## 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'; // @public export interface Atom extends Signal { set(value: Value, diff?: Diff): Value; update(updater: (value: Value) => Value): Value; } // @public export const /** * Creates a new [[Atom]]. * * An Atom is a signal that can be updated directly by calling [[Atom.set]] or [[Atom.update]]. * * @example * ```ts * const name = atom('name', 'John') * * name.get() // 'John' * * name.set('Jane') * * name.get() // 'Jane' * ``` * * @public */ atom: typeof atom_2; // @public export interface AtomOptions { computeDiff?: ComputeDiff; historyLength?: number; isEqual?: (a: any, b: any) => boolean; } // @public export interface Computed extends Signal { readonly isActivelyListening: boolean; // @internal (undocumented) readonly parentEpochs: number[]; // @internal (undocumented) readonly parents: Signal[]; } // @public export const /** * Creates a new [[Atom]]. * * An Atom is a signal that can be updated directly by calling [[Atom.set]] or [[Atom.update]]. * * @example * ```ts * const name = atom('name', 'John') * * name.get() // 'John' * * name.set('Jane') * * name.get() // 'Jane' * ``` * * @public */ computed: typeof computed_2; // @public export interface ComputedOptions { computeDiff?: ComputeDiff; historyLength?: number; isEqual?: (a: any, b: any) => boolean; } // @public export const /** * Creates a new [[Atom]]. * * An Atom is a signal that can be updated directly by calling [[Atom.set]] or [[Atom.update]]. * * @example * ```ts * const name = atom('name', 'John') * * name.get() // 'John' * * name.set('Jane') * * name.get() // 'Jane' * ``` * * @public */ EffectScheduler: typeof EffectScheduler_2; // @public (undocumented) export const /** * Creates a new [[Atom]]. * * An Atom is a signal that can be updated directly by calling [[Atom.set]] or [[Atom.update]]. * * @example * ```ts * const name = atom('name', 'John') * * name.get() // 'John' * * name.set('Jane') * * name.get() // 'Jane' * ``` * * @public */ EMPTY_ARRAY: []; // @public export function getComputedInstance(obj: Obj, propertyName: Prop): Computed; // @public export const /** * Creates a new [[Atom]]. * * An Atom is a signal that can be updated directly by calling [[Atom.set]] or [[Atom.update]]. * * @example * ```ts * const name = atom('name', 'John') * * name.get() // 'John' * * name.set('Jane') * * name.get() // 'Jane' * ``` * * @public */ isAtom: typeof isAtom_2; // @public export const /** * Creates a new [[Atom]]. * * An Atom is a signal that can be updated directly by calling [[Atom.set]] or [[Atom.update]]. * * @example * ```ts * const name = atom('name', 'John') * * name.get() // 'John' * * name.set('Jane') * * name.get() // 'Jane' * ``` * * @public */ isSignal: typeof isSignal_2; // @public export const isUninitialized: (value: any) => value is typeof UNINITIALIZED; // @public export const /** * Creates a new [[Atom]]. * * An Atom is a signal that can be updated directly by calling [[Atom.set]] or [[Atom.update]]. * * @example * ```ts * const name = atom('name', 'John') * * name.get() // 'John' * * name.set('Jane') * * name.get() // 'Jane' * ``` * * @public */ react: typeof react_2; // @public export interface Reactor { scheduler: EffectScheduler_2; start(options?: { force?: boolean; }): void; stop(): void; } // @public export const /** * Creates a new [[Atom]]. * * An Atom is a signal that can be updated directly by calling [[Atom.set]] or [[Atom.update]]. * * @example * ```ts * const name = atom('name', 'John') * * name.get() // 'John' * * name.set('Jane') * * name.get() // 'Jane' * ``` * * @public */ reactor: typeof reactor_2; // @public (undocumented) export const RESET_VALUE: unique symbol; // @public (undocumented) export type RESET_VALUE = typeof RESET_VALUE; // @public export interface Signal { __unsafe__getWithoutCapture(): Value; // @internal (undocumented) children: ArraySet; get(): Value; getDiffSince(epoch: number): Diff[] | RESET_VALUE; lastChangedEpoch: number; name: string; // @deprecated (undocumented) value: Value; } // @public export function track>(baseComponent: T): T extends React_2.MemoExoticComponent ? T : React_2.MemoExoticComponent; // @public export const /** * Creates a new [[Atom]]. * * An Atom is a signal that can be updated directly by calling [[Atom.set]] or [[Atom.update]]. * * @example * ```ts * const name = atom('name', 'John') * * name.get() // 'John' * * name.set('Jane') * * name.get() // 'Jane' * ``` * * @public */ transact: typeof transact_2; // @public export const /** * Creates a new [[Atom]]. * * An Atom is a signal that can be updated directly by calling [[Atom.set]] or [[Atom.update]]. * * @example * ```ts * const name = atom('name', 'John') * * name.get() // 'John' * * name.set('Jane') * * name.get() // 'Jane' * ``` * * @public */ transaction: typeof transaction_2; // @public export const /** * Creates a new [[Atom]]. * * An Atom is a signal that can be updated directly by calling [[Atom.set]] or [[Atom.update]]. * * @example * ```ts * const name = atom('name', 'John') * * name.get() // 'John' * * name.set('Jane') * * name.get() // 'Jane' * ``` * * @public */ unsafe__withoutCapture: typeof unsafe__withoutCapture_2; // @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 const /** * Creates a new [[Atom]]. * * An Atom is a signal that can be updated directly by calling [[Atom.set]] or [[Atom.update]]. * * @example * ```ts * const name = atom('name', 'John') * * name.get() // 'John' * * name.set('Jane') * * name.get() // 'Jane' * ``` * * @public */ whyAmIRunning: typeof whyAmIRunning_2; // @public export const /** * Creates a new [[Atom]]. * * An Atom is a signal that can be updated directly by calling [[Atom.set]] or [[Atom.update]]. * * @example * ```ts * const name = atom('name', 'John') * * name.get() // 'John' * * name.set('Jane') * * name.get() // 'Jane' * ``` * * @public */ withDiff: typeof withDiff_2; // (No @packageDocumentation comment for this package) ```