Options
All
  • Public
  • Public/Protected
  • All
Menu

插件的全局上下文 声明文件

Index

Type aliases

ExternalExtensionGlobalVariable

ExternalExtensionGlobalVariable: { ArgumentType: ArgumentTypeDef; BlockType: BlockTypeDef; Constant: { ConnectStatus: DeviceConnectStatusType }; Env: { HostType: HostType; Locale: string; PlatformType: PlatformType }; extensions: { getDevice: any; register: any }; formatMessage: any }

硬件插件全局上下文

通过 self.UCode 访问

例如:

self.UCode.ArgumentType.ANGLE

Type declaration

  • ArgumentType: ArgumentTypeDef

    积木块可用的参数类型 常量

  • BlockType: BlockTypeDef

    可用的积木块类型 常量

  • Constant: { ConnectStatus: DeviceConnectStatusType }

    常量上下文

  • Env: { HostType: HostType; Locale: string; PlatformType: PlatformType }

    环境变量

  • extensions: { getDevice: any; register: any }

    插件上下文

    • getDevice:function
      • getDevice<T>(targetId: string): undefined | T
      • 获取硬件协议的函数,需要通过 TargetId 角色的ID (角色ID每次加载都会重新生成,需要实时运行)

        Type parameters

        Parameters

        • targetId: string

        Returns undefined | T

    • register:function
      • 注册入口,可以通过这个函数注入整个插件

        Parameters

        Returns void

  • formatMessage:function
    • 翻译文件格式化

      Parameters

      Returns string

Generated using TypeDoc