## API Report File for "@tldraw/state" > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts import { FunctionComponent } from 'react'; import { default as React_2 } from 'react'; // @internal export class ArraySet { add(elem: T): boolean; // (undocumented) clear(): void; // (undocumented) has(elem: T): boolean; get isEmpty(): boolean; remove(elem: T): boolean; // (undocumented) size(): number; visit(visitor: (item: T) => void): void; } // @public export interface Atom extends Signal { set(value: Value, diff?: Diff): Value; update(updater: (value: Value) => Value): Value; } // @public export function atom( name: string, initialValue: Value, options?: AtomOptions): Atom; // @public export interface AtomOptions { computeDiff?: ComputeDiff; historyLength?: number; isEqual?: (a: any, b: any) => boolean; } // @internal (undocumented) export interface Child { // (undocumented) isActivelyListening: boolean; // (undocumented) lastTraversedEpoch: number; // (undocumented) readonly parentEpochs: number[]; // (undocumented) readonly parents: Signal[]; // (undocumented) readonly parentSet: ArraySet>; } // @public export interface Computed extends Signal { readonly isActivelyListening: boolean; // @internal (undocumented) readonly parentEpochs: number[]; // @internal (undocumented) readonly parents: Signal[]; // @internal (undocumented) readonly parentSet: ArraySet>; } // @public export function computed(name: string, compute: (previousValue: typeof UNINITIALIZED | Value, lastComputedEpoch: number) => Value | WithDiff, options?: ComputedOptions): Computed; // @public (undocumented) export function computed(target: any, key: string, descriptor: PropertyDescriptor): PropertyDescriptor; // @public (undocumented) export function computed(options?: ComputedOptions): (target: any, key: string, descriptor: PropertyDescriptor) => PropertyDescriptor; // @public export type ComputeDiff = (previousValue: Value, currentValue: Value, lastComputedEpoch: number, currentEpoch: number) => Diff | RESET_VALUE; // @public export interface ComputedOptions { computeDiff?: ComputeDiff; historyLength?: number; isEqual?: (a: any, b: any) => boolean; } // @public export const EffectScheduler: new (name: string, runEffect: (lastReactedEpoch: number) => Result, options?: EffectSchedulerOptions) => EffectScheduler; // @public (undocumented) export interface EffectScheduler { attach(): void; detach(): void; execute(): Result; readonly isActivelyListening: boolean; // @internal (undocumented) readonly lastTraversedEpoch: number; // @internal (undocumented) maybeExecute(): void; // @internal (undocumented) maybeScheduleEffect(): void; // @internal (undocumented) readonly parentEpochs: number[]; // @internal (undocumented) readonly parents: Signal[]; // @internal (undocumented) readonly parentSet: ArraySet>; readonly scheduleCount: number; // @internal (undocumented) scheduleEffect(): void; } // @public (undocumented) export interface EffectSchedulerOptions { scheduleEffect?: (execute: () => void) => void; } // @public (undocumented) export const EMPTY_ARRAY: []; // @public export function getComputedInstance(obj: Obj, propertyName: Prop): Computed; // @public export function isAtom(value: unknown): value is Atom; // @public (undocumented) export function isSignal(value: any): value is Signal; // @public export const isUninitialized: (value: any) => value is typeof UNINITIALIZED; // @public export function react(name: string, fn: (lastReactedEpoch: number) => any, options?: EffectSchedulerOptions): () => void; // @public export interface Reactor { scheduler: EffectScheduler; start(options?: { force?: boolean; }): void; stop(): void; } // @public export function reactor(name: string, fn: (lastReactedEpoch: number) => Result, options?: EffectSchedulerOptions): Reactor; // @public (undocumented) export const RESET_VALUE: unique symbol; // @public (undocumented) export type RESET_VALUE = typeof RESET_VALUE; // @public export interface Signal { __unsafe__getWithoutCapture(ignoreErrors?: boolean): Value; // @internal (undocumented) children: ArraySet; get(): Value; getDiffSince(epoch: number): Diff[] | RESET_VALUE; lastChangedEpoch: number; name: string; } // @public export function track>(baseComponent: T): React_2.NamedExoticComponent>; // @public export function transact(fn: () => T): T; // @public export function transaction(fn: (rollback: () => void) => T): T; // @public (undocumented) export const UNINITIALIZED: unique symbol; // @public export type UNINITIALIZED = typeof UNINITIALIZED; // @public export function unsafe__withoutCapture(fn: () => T): T; // @public export function useAtom( name: string, valueOrInitialiser: (() => Value) | Value, options?: AtomOptions): Atom; // @public export function useComputed(name: string, compute: () => Value, deps: any[]): Computed; // @public (undocumented) export function useComputed(name: string, compute: () => Value, opts: ComputedOptions, deps: any[]): Computed; // @public (undocumented) export function useQuickReactor(name: string, reactFn: () => void, deps?: any[]): void; // @public (undocumented) export function useReactor(name: string, reactFn: () => void, deps?: any[] | undefined): void; // @internal (undocumented) export function useStateTracking(name: string, render: () => T): T; // @public export function useValue(value: Signal): Value; // @public (undocumented) export function useValue(name: string, fn: () => Value, deps: unknown[]): Value; // @public export function whyAmIRunning(): void; // @public (undocumented) export const WithDiff: { new (value: Value, diff: Diff): { diff: Diff; value: Value; }; }; // @public (undocumented) export interface WithDiff { // (undocumented) diff: Diff; // (undocumented) value: Value; } // @public export function withDiff(value: Value, diff: Diff): WithDiff; // (No @packageDocumentation comment for this package) ```