/** * Return type for useTamboComponentState hook. * Similar to useState but with additional metadata. */ export type UseTamboComponentStateReturn = [ currentState: S, setState: (newState: S | ((prev: S) => S)) => void, meta: { isPending: boolean; error: Error | null; flush: () => void; } ]; /** * Hook for managing component state with bidirectional server sync. * * This hook acts like useState but automatically syncs state changes * to the Tambo backend. Server-side state updates are also reflected * in the component. * * Can be used within rendered components, interactable components, or * components awaiting provider context (acts as plain useState until context is available). * @param keyName - The unique key to identify this state value within the component's state * @param initialValue - Initial value for the state (used if no server state exists) * @param debounceTime - Debounce time in milliseconds (default: 500ms) * @returns Tuple of [currentState, setState, meta] * @example * ```tsx * function Counter() { * const [count, setCount, { isPending }] = useTamboComponentState('count', 0); * * return ( *
* {count} * *
* ); * } * ``` */ export declare function useTamboComponentState(keyName: string, initialValue?: S, debounceTime?: number): UseTamboComponentStateReturn; export declare function useTamboComponentState(keyName: string, initialValue: S, debounceTime?: number): UseTamboComponentStateReturn; //# sourceMappingURL=use-tambo-v1-component-state.d.ts.map