Platform Adapter Libraries.

平台适配器库。

构造函数

属性

browser: BrowserAdapter

The Browser Adapter.

浏览器适配器。

device: WebDeviceAdapter

The Device Adapter.

设备适配器。

font: FontAdapter

The Font Adapter.

字体适配器。

fs: FileSystemAdapter

The FileSystem Adapter.

文件系统适配器。

The global object built into the platform. For example, wx in WeChat.

平台内置的全局对象。例如微信中的wx。

media: MediaAdapter

The Media Adapter.

媒体适配器。

storage: StorageAdapter

The LocalStorage Adapter.

本地存储适配器。

textInput: TextInputAdapter

The TextInput Adapter.

文本输入适配器。

方法

  • 参数

    • name: string

      The name of the API to check.

    返回 boolean

    true if the API is available, otherwise false.

    Check if the specified API is available in the global object.

    检查指定的API是否在全局对象中可用。

  • 参数

    • obj: any

      The object to check against, defaults to the global object.

    • name: string

      The name of the API to check.

    返回 boolean

    true if the API is available, otherwise false.

    Check if the specified API is available in the global object.

    检查指定的API是否在全局对象中可用。

  • 参数

    • name:
          | "storage"
          | "browser"
          | "fs"
          | "font"
          | "textInput"
          | "media"
          | "device"

      The name of the adapter.

    • cls: any

      The class of the adapter.

    返回 void

    Register a platform adapter.

    注册一个平台适配器。

  • 参数

    • name: string

      The name of the feature.

    返回 void

    Print a warning message if the specified feature is not supported on the current platform.

    打印一条警告消息,说明当前平台不支持指定的功能。