export declare const COMPONENT_CHANGE_HANDLE: unique symbol; export type BaseShape = Record; export type ComponentHandle = any> = { id: number; name: string; defaults: () => Shape; reset: (instance: Shape) => void; initialize: (pooled: ComponentInstanceInternal, initial: Partial, id: number) => void; serialize?: Serializer; deserialize?: Deserializer; extensions?: Ext; create: () => ComponentInstance; isInstance: (instance: any) => instance is ComponentInstance; }; type Serializer = (shape: Shape) => string; type Deserializer = (str: string, additionalProperties: PropertyDescriptorMap) => Shape; type Extensions = Record) => any> | undefined; type AppliedExtensions> = Ex extends undefined ? {} : { [K in keyof Ex]: Ex[K] extends (...args: any[]) => any ? ReturnType : never; }; export type ComponentInstance$ = Extensions> = { /** A unique ID for this component instance */ id: number; /** A reference to the component definition */ type: ComponentHandle; /** INTERNAL USE ONLY */ [COMPONENT_CHANGE_HANDLE]?: (instance: ComponentInstance) => void; /** Set changed = true to trigger changed() filters for this component */ changed: boolean; /** * Call $() with a callback to automatically update the changed state for any * alterations made within the callback. */ (callback: () => void): void; }; export type ComponentInstance = Extensions> = { $: ComponentInstance$; } & Shape & AppliedExtensions; export type ComponentInstanceInternal = { $: ComponentInstance$; }; export type InstanceFor = Handle extends ComponentHandle ? ComponentInstance : never; export type AnyComponent = ComponentInstanceInternal; export type ComponentOptions> = { serialize?: Serializer; deserialize?: Deserializer; extensions?: Ext; }; export declare const componentTypeMap: Map>; export declare function component>(name: string, init: () => Shape, options?: ComponentOptions): ComponentHandle; export declare function state>(name: string, init: () => Shape, options?: Omit, 'serialize' | 'deserialize'>): ComponentHandle; export declare function namespace(ns: string): { component: >(name: string, init: () => Shape, options?: ComponentOptions) => ComponentHandle; state: >(name: string, init: () => Shape_1, options?: Omit, "serialize" | "deserialize"> | undefined) => ComponentHandle; }; export {};