For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/react/接口/MainThreadObjectTypeDefinition.md.
  • 简体中文
    • English
  • 接口: MainThreadObjectTypeDefinition<I, O extends object>

    描述可序列化的初始化数据如何在主线程运行时中变成一个稳定的对象。

    类型参数

    类型参数
    I
    O extends object

    属性

    create

    readonly create: (initialValue: I) => O

    创建实际的主线程对象。

    它必须是不捕获任何外部变量的主线程函数。函数用到的导入必须来自共享运行时模块。

    参数

    参数类型
    initialValueI

    返回

    O


    type

    readonly type: string

    全局唯一且稳定的类型键。

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。