Skip to main content

Module object_shape

Module object_shape 

Source
Expand description

Object shapes and function signatures, ported from ObjectShape.ts.

Defines the shape registry used by Environment to resolve property types and function call signatures for built-in objects, hooks, and user-defined types.

Structs§

FunctionSignature
Call signature of a function, used for type and effect inference. Ported from TS FunctionSignature.
FunctionSignatureBuilder
Builder for non-hook function signatures.
HookSignatureBuilder
Builder for hook signatures.
ObjectShape
Shape of an object or function type. Ported from TS ObjectShape.
ShapeRegistry
Registry mapping shape IDs to their ObjectShape definitions.

Enums§

HookKind

Constants§

BUILT_IN_ARRAY_ID
BUILT_IN_DISPATCH_ID
BUILT_IN_EFFECT_EVENT_ID
BUILT_IN_FUNCTION_ID
BUILT_IN_JSX_ID
BUILT_IN_MAP_ID
BUILT_IN_MIXED_READONLY_ID
BUILT_IN_OBJECT_ID
BUILT_IN_PROPS_ID
BUILT_IN_REF_VALUE_ID
BUILT_IN_SET_ACTION_STATE_ID
BUILT_IN_SET_ID
BUILT_IN_SET_OPTIMISTIC_ID
BUILT_IN_SET_STATE_ID
BUILT_IN_START_TRANSITION_ID
BUILT_IN_USE_ACTION_STATE_ID
BUILT_IN_USE_CONTEXT_HOOK_ID
BUILT_IN_USE_EFFECT_EVENT_ID
BUILT_IN_USE_EFFECT_HOOK_ID
BUILT_IN_USE_INSERTION_EFFECT_HOOK_ID
BUILT_IN_USE_LAYOUT_EFFECT_HOOK_ID
BUILT_IN_USE_OPERATOR_ID
BUILT_IN_USE_OPTIMISTIC_ID
BUILT_IN_USE_REDUCER_ID
BUILT_IN_USE_REF_ID
BUILT_IN_USE_STATE_ID
BUILT_IN_USE_TRANSITION_ID
BUILT_IN_WEAK_MAP_ID
BUILT_IN_WEAK_SET_ID
REANIMATED_SHARED_VALUE_ID

Functions§

add_function
Add a non-hook function to a ShapeRegistry. Returns a Type::Function representing the added function.
add_hook
Add a hook to a ShapeRegistry. Returns a Type::Function representing the added hook.
add_object
Add an object to a ShapeRegistry. Returns a Type::Object representing the added object.
default_mutating_hook
Default type for hooks when enableAssumeHooksFollowRulesOfReact is false. Matches TS DefaultMutatingHook.
default_nonmutating_hook
Default type for hooks when enableAssumeHooksFollowRulesOfReact is true. Matches TS DefaultNonmutatingHook.