Pixso 开放文档
插件 API
官方工具集
  • 中文
  • English
插件 API
官方工具集
  • 中文
  • English
  • 插件 API

    • 简介
    • 预备知识
    • manifest
    • 开发指南
    • 更新日志
    • Plugin API 文档

      • 概述
      • 全局对象

        • pixso
        • pixso.ui
        • pixso.host
        • pixso.mouse
        • pixso.editor
        • pixso.keyboard
        • pixso.fieldset
        • pixso.viewport
        • pixso.vectorEditor
        • pixso.stickyToolbar
        • pixso.clientStorage
        • pixso.serverStorage
      • 节点类型

        • BooleanOperationNode
        • ComponentNode
        • ComponentSetNode
        • DocumentNode
        • EllipseNode
        • FrameNode
        • GroupNode
        • InstanceNode
        • LineNode
        • PageNode
        • PolygonNode
        • RectangleNode
        • SectionNode
        • SliceNode
        • StarNode
        • TextNode
        • VectorNode
      • 样式类型

        • PaintStyle
        • TextStyle
        • EffectStyle
        • GridStyle
      • 数据类型

        • Action
        • ArcData
        • BlendMode
        • CommandItem
        • ComponentProperties-Related
        • Constraints
        • DialogType
        • DocumentationLink
        • Effect
        • EmbedData
        • ExportSettings
        • FontName
        • Guide
        • HandleMirroring
        • HyperlinkTarget
        • Image
        • LayoutGrid
        • LetterSpacing
        • Library
        • LineHeight
        • NodeChangeProperty
        • OverflowDirection
        • Overlay
        • Paint
        • PublishStatus
        • Reaction
        • Rect-related
        • RGB & RGBA
        • StickyToolbar
        • StrokeCap
        • StrokeJoin
        • StyleChangeProperty
        • TextCase
        • TextDecoration
        • TextListOptions
        • ThemeType
        • ToolType
        • Transition
        • Trigger
        • Vector
    • Host API 文档

      • 概述
      • Host API
  • 服务端 API

    • OpenAPI 文档
    • OpenAPI 文档
    • 事件订阅
    • 事件订阅
  • 客户端 API

    • 简介
    • 唤醒客户端
    • Web API
    • 更新日志

pixso.host

pixso.host 对象提供了插件宿主相关属性的 API。

clientWidth

  • Readonly:true
  • Type: number

获取宿主可视窗口的宽度。

clientHeight

  • Readonly:true
  • Type: number

获取宿主可视窗口的高度。

platform

  • Readonly: true
  • Type: PlatformType
type PlatformType = "MAC" | "WINDOWS" | "UNKNOWN";

返回宿主所属的操作系统类型。

HWDC

postMessage

  • type: postMessage: (message: any) => void

由 sandbox.js 向 host.js 发送消息。


onmessage

  • type: Function | undefined

监听 host.js 向 sandbox.js 发送的消息。


on

  • type: on: (event: 'message', cb: (event: any) => void) => void

监听 host.js 向 sandbox.js 发送的消息。


once

  • type: once: (event: 'message', cb: (event: any) => void) => void

监听 host.js 向 sandbox.js 发送的消息,回调函数运行一次后便移除监听。


off

  • type: off: (event: 'message', cb: (event: any) => void) => void

移除通过 pixso.host.on 或 pixso.host.once 绑定的事件处理函数。

Prev
pixso.ui
Next
pixso.mouse