For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /api/react.definemainthreadobjecttype.md.
This is the dev preview website. Check out the document at lynx-stack.dev

Home > @lynx-js/react > defineMainThreadObjectType

defineMainThreadObjectType() function

Define a main-thread object type for use by a library-provided hook.

Signature:

export declare function defineMainThreadObjectType<I, O extends object>(definition: MainThreadObjectTypeDefinition<I, O>): MainThreadObjectType<I, O>;

Parameters

Parameter

Type

Description

definition

MainThreadObjectTypeDefinition<I, O>

Stable type key and target-object factory function.

Returns:

MainThreadObjectType<I, O>

An immutable object type definition.