snapshot of https://github.com/tldraw/tldraw.git (main, 2026-09-23; blobs > 131072B omitted)
Some checks failed
Deploy analytics worker / Deploy analytics worker to ${{ (github.ref == 'refs/heads/production' && 'production') || (github.ref == 'refs/heads/main' && 'staging') || 'preview' }} (push) Failing after 1s
i18n upload strings / Upload latest strings (push) Failing after 1s
Deploy bemo / Deploy bemo to ${{ (github.ref == 'refs/heads/bemo-production' && 'production') || (github.ref == 'refs/heads/main' && 'staging') || 'preview' }} (push) Failing after 1s
Deploy grafana resources / ${{ github.event_name == 'push' && 'Deploy grafana resources' || 'Validate grafana resources (dry run)' }} (push) Failing after 0s
End to end tests (dotcom) / Check for relevant changes (push) Failing after 0s
End to end tests (examples) / Check for relevant changes (push) Failing after 0s
End to end tests (mermaid readability) / Check for relevant changes (push) Failing after 1s
End to end tests (perf) / Check for relevant changes (push) Failing after 0s
Publish editor extensions / Publish editor extensions (push) Failing after 1s
Publish SDK packages / Remove the publish-packages label (push) Has been skipped
Checks / Tests & checks (push) Has been cancelled
Checks / Build all projects (push) Has been cancelled
Deploy templates / Deploy templates (push) Has been cancelled
End to end tests (dotcom) / End to end tests (dotcom) (push) Has been cancelled
End to end tests (mermaid readability) / End to end tests (mermaid readability) (push) Has been cancelled
End to end tests (perf) / End to end tests (perf) (push) Has been cancelled
Deploy .com / Deploy dotcom to ${{ (github.ref == 'refs/heads/production' && 'production') || (github.ref == 'refs/heads/main' && 'staging') || 'preview' }} (push) Has been cancelled
End to end tests (examples) / End to end tests (examples) (push) Has been cancelled
Publish SDK packages / Publish SDK packages (push) Has been cancelled
Publish SDK packages / Tell user released version (push) Has been cancelled
Publish SDK packages / Publishes code templates to separate repositories (push) Has been cancelled
Publish SDK packages / Deploys the template demos with the new SDK version (push) Has been cancelled
Some checks failed
Deploy analytics worker / Deploy analytics worker to ${{ (github.ref == 'refs/heads/production' && 'production') || (github.ref == 'refs/heads/main' && 'staging') || 'preview' }} (push) Failing after 1s
i18n upload strings / Upload latest strings (push) Failing after 1s
Deploy bemo / Deploy bemo to ${{ (github.ref == 'refs/heads/bemo-production' && 'production') || (github.ref == 'refs/heads/main' && 'staging') || 'preview' }} (push) Failing after 1s
Deploy grafana resources / ${{ github.event_name == 'push' && 'Deploy grafana resources' || 'Validate grafana resources (dry run)' }} (push) Failing after 0s
End to end tests (dotcom) / Check for relevant changes (push) Failing after 0s
End to end tests (examples) / Check for relevant changes (push) Failing after 0s
End to end tests (mermaid readability) / Check for relevant changes (push) Failing after 1s
End to end tests (perf) / Check for relevant changes (push) Failing after 0s
Publish editor extensions / Publish editor extensions (push) Failing after 1s
Publish SDK packages / Remove the publish-packages label (push) Has been skipped
Checks / Tests & checks (push) Has been cancelled
Checks / Build all projects (push) Has been cancelled
Deploy templates / Deploy templates (push) Has been cancelled
End to end tests (dotcom) / End to end tests (dotcom) (push) Has been cancelled
End to end tests (mermaid readability) / End to end tests (mermaid readability) (push) Has been cancelled
End to end tests (perf) / End to end tests (perf) (push) Has been cancelled
Deploy .com / Deploy dotcom to ${{ (github.ref == 'refs/heads/production' && 'production') || (github.ref == 'refs/heads/main' && 'staging') || 'preview' }} (push) Has been cancelled
End to end tests (examples) / End to end tests (examples) (push) Has been cancelled
Publish SDK packages / Publish SDK packages (push) Has been cancelled
Publish SDK packages / Tell user released version (push) Has been cancelled
Publish SDK packages / Publishes code templates to separate repositories (push) Has been cancelled
Publish SDK packages / Deploys the template demos with the new SDK version (push) Has been cancelled
This commit is contained in:
207
packages/state/api-report.api.md
Normal file
207
packages/state/api-report.api.md
Normal file
@@ -0,0 +1,207 @@
|
||||
## API Report File for "@tldraw/state"
|
||||
|
||||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
||||
|
||||
```ts
|
||||
|
||||
// @internal
|
||||
export class ArraySet<T> {
|
||||
[Symbol.iterator](): Generator<T, void, unknown>;
|
||||
add(elem: T): boolean;
|
||||
clear(): void;
|
||||
has(elem: T): boolean;
|
||||
get isEmpty(): boolean;
|
||||
remove(elem: T): boolean;
|
||||
size(): number;
|
||||
visit(visitor: (item: T) => void): void;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface Atom<Value, Diff = unknown> extends Signal<Value, Diff> {
|
||||
set(value: Value, diff?: Diff): Value;
|
||||
update(updater: (value: Value) => Value): Value;
|
||||
}
|
||||
|
||||
// @public
|
||||
export function atom<Value, Diff = unknown>(
|
||||
name: string,
|
||||
initialValue: Value,
|
||||
options?: AtomOptions<Value, Diff>): Atom<Value, Diff>;
|
||||
|
||||
// @public
|
||||
export interface AtomOptions<Value, Diff> {
|
||||
computeDiff?: ComputeDiff<Value, Diff>;
|
||||
historyLength?: number;
|
||||
isEqual?(a: any, b: any): boolean;
|
||||
}
|
||||
|
||||
// @internal
|
||||
export interface Child {
|
||||
__debug_ancestor_epochs__: Map<Signal<any, any>, number> | null;
|
||||
isActivelyListening: boolean;
|
||||
lastTraversedEpoch: number;
|
||||
readonly name: string;
|
||||
readonly parentEpochs: number[];
|
||||
readonly parents: Signal<any, any>[];
|
||||
readonly parentSet: ArraySet<Signal<any, any>>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface Computed<Value, Diff = unknown> extends Signal<Value, Diff> {
|
||||
readonly isActivelyListening: boolean;
|
||||
// @internal (undocumented)
|
||||
readonly parentEpochs: number[];
|
||||
// @internal (undocumented)
|
||||
readonly parents: Signal<any, any>[];
|
||||
// @internal (undocumented)
|
||||
readonly parentSet: ArraySet<Signal<any, any>>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export function computed<Value, Diff = unknown>(name: string, compute: (previousValue: typeof UNINITIALIZED | Value, lastComputedEpoch: number) => Value | WithDiff<Value, Diff>, options?: ComputedOptions<Value, Diff>): Computed<Value, Diff>;
|
||||
|
||||
// @public
|
||||
export function computed<This extends object, Value>(compute: () => Value, context: ClassMethodDecoratorContext<This, () => Value>): () => Value;
|
||||
|
||||
// @public
|
||||
export function computed(target: any, key: string, descriptor: PropertyDescriptor): PropertyDescriptor;
|
||||
|
||||
// @public
|
||||
export function computed<Value, Diff = unknown>(options?: ComputedOptions<Value, Diff>): ((target: any, key: string, descriptor: PropertyDescriptor) => PropertyDescriptor) & (<This>(compute: () => Value, context: ClassMethodDecoratorContext<This, () => Value>) => () => Value);
|
||||
|
||||
// @public
|
||||
export type ComputeDiff<Value, Diff> = (previousValue: Value, currentValue: Value, lastComputedEpoch: number, currentEpoch: number) => Diff | RESET_VALUE;
|
||||
|
||||
// @public
|
||||
export interface ComputedOptions<Value, Diff> {
|
||||
computeDiff?: ComputeDiff<Value, Diff>;
|
||||
historyLength?: number;
|
||||
isEqual?(a: any, b: any): boolean;
|
||||
}
|
||||
|
||||
// @internal
|
||||
export function deferAsyncEffects<T>(fn: () => Promise<T>): Promise<T | undefined>;
|
||||
|
||||
// @public
|
||||
export const EffectScheduler: new <Result>(name: string, runEffect: (lastReactedEpoch: number) => Result, options?: EffectSchedulerOptions) => EffectScheduler<Result>;
|
||||
|
||||
// @public (undocumented)
|
||||
export interface EffectScheduler<Result> {
|
||||
// @internal (undocumented)
|
||||
__debug_ancestor_epochs__: Map<Signal<any, any>, number> | null;
|
||||
attach(): void;
|
||||
detach(): void;
|
||||
execute(): Result;
|
||||
readonly isActivelyListening: boolean;
|
||||
// @internal (undocumented)
|
||||
readonly lastTraversedEpoch: number;
|
||||
// @internal (undocumented)
|
||||
maybeExecute(): void;
|
||||
// @internal (undocumented)
|
||||
maybeScheduleEffect(): void;
|
||||
// (undocumented)
|
||||
readonly name: string;
|
||||
// @internal (undocumented)
|
||||
readonly parentEpochs: number[];
|
||||
// @internal (undocumented)
|
||||
readonly parents: Signal<any, any>[];
|
||||
// @internal (undocumented)
|
||||
readonly parentSet: ArraySet<Signal<any, any>>;
|
||||
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 extends object, Prop extends keyof Obj>(obj: Obj, propertyName: Prop): Computed<Obj[Prop] extends () => infer Value ? Value : Obj[Prop]>;
|
||||
|
||||
// @public
|
||||
export function isAtom(value: unknown): value is Atom<unknown>;
|
||||
|
||||
// @public
|
||||
export function isSignal(value: any): value is Signal<any>;
|
||||
|
||||
// @public
|
||||
export function isUninitialized(value: any): value is UNINITIALIZED;
|
||||
|
||||
// @public
|
||||
export function localStorageAtom<Value, Diff = unknown>(name: string, initialValue: Value, options?: AtomOptions<Value, Diff>): [Atom<Value, Diff>, () => void];
|
||||
|
||||
// @public
|
||||
export function react(name: string, fn: (lastReactedEpoch: number) => any, options?: EffectSchedulerOptions): () => void;
|
||||
|
||||
// @public
|
||||
export interface Reactor<T = unknown> {
|
||||
scheduler: EffectScheduler<T>;
|
||||
start(options?: {
|
||||
force?: boolean;
|
||||
}): void;
|
||||
stop(): void;
|
||||
}
|
||||
|
||||
// @public
|
||||
export function reactor<Result>(name: string, fn: (lastReactedEpoch: number) => Result, options?: EffectSchedulerOptions): Reactor<Result>;
|
||||
|
||||
// @public
|
||||
export const RESET_VALUE: unique symbol;
|
||||
|
||||
// @public
|
||||
export type RESET_VALUE = typeof RESET_VALUE;
|
||||
|
||||
// @public
|
||||
export interface Signal<Value, Diff = unknown> {
|
||||
__unsafe__getWithoutCapture(ignoreErrors?: boolean): Value;
|
||||
// @internal (undocumented)
|
||||
children: ArraySet<Child>;
|
||||
get(): Value;
|
||||
getDiffSince(epoch: number): Diff[] | RESET_VALUE;
|
||||
lastChangedEpoch: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export function transact<T>(fn: () => T): T;
|
||||
|
||||
// @public
|
||||
export function transaction<T>(fn: (rollback: () => void) => T): T;
|
||||
|
||||
// @public
|
||||
export const UNINITIALIZED: unique symbol;
|
||||
|
||||
// @public
|
||||
export type UNINITIALIZED = typeof UNINITIALIZED;
|
||||
|
||||
// @public
|
||||
export function unsafe__withoutCapture<T>(fn: () => T): T;
|
||||
|
||||
// @public
|
||||
export function whyAmIRunning(): void;
|
||||
|
||||
// @public
|
||||
export const WithDiff: {
|
||||
new <Value, Diff>(value: Value, diff: Diff): {
|
||||
diff: Diff;
|
||||
value: Value;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface WithDiff<Value, Diff> {
|
||||
diff: Diff;
|
||||
value: Value;
|
||||
}
|
||||
|
||||
// @public
|
||||
export function withDiff<Value, Diff>(value: Value, diff: Diff): WithDiff<Value, Diff>;
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user