tldraw/packages/tlsync-client/api-report.md
Steve Ruiz eb26964130
[refactor] restore createTLSchema (#1444)
This PR restores `createTLSchema`. 

It also:
- removes `TldrawEditorConfig.default`
- makes `config` a required property of `<TldrawEditor>`, though it's
created automatically in `<Tldraw>`.
- makes `config` a required property of `App`
- removes `TLShapeType` and replaces the rare usage with
`TLShape["type"]`
- adds `TLDefaultShape` for a union of our default shapes
- makes `TLShape` a union of `TLDefaultShape` and `TLUnknownShape`

### Change Type

- [x] `major` — Breaking Change

### Release Notes

- [editor] Simplifies custom shape definition
- [tldraw] Updates props for <TldrawEditor> component to require a
`TldrawEditorConfig`.
2023-05-24 10:48:31 +00:00

3.3 KiB

API Report File for "@tldraw/tlsync-client"

Do not edit this file. It is a report generated by API Extractor.


import { RecordsDiff } from '@tldraw/tlstore';
import { SerializedSchema } from '@tldraw/tlstore';
import { Store } from '@tldraw/tlstore';
import { StoreSnapshot } from '@tldraw/tlstore';
import { SyncedStore } from '@tldraw/editor';
import { TldrawEditorConfig } from '@tldraw/editor';
import { TLInstanceId } from '@tldraw/editor';
import { TLRecord } from '@tldraw/editor';
import { TLStore } from '@tldraw/editor';
import { TLStoreSchema } from '@tldraw/editor';
import { TLUser } from '@tldraw/editor';
import { TLUserId } from '@tldraw/editor';

// @public (undocumented)
export function addDbName(name: string): void;

// @public (undocumented)
export class BroadcastChannelMock {
    constructor(_name: string);
    // (undocumented)
    close(): void;
    // (undocumented)
    onmessage?: (e: MessageEvent) => void;
    // (undocumented)
    postMessage(_msg: Message): void;
}

// @public (undocumented)
export function clearDb(universalPersistenceKey: string): void;

// @public (undocumented)
export const DEFAULT_DOCUMENT_NAME: any;

// @public (undocumented)
export function getAllIndexDbNames(): string[];

// @public (undocumented)
export function getUserData(): TLUser;

// @public (undocumented)
export function hardReset({ shouldReload }?: {
    shouldReload?: boolean | undefined;
}): Promise<void>;

// @public (undocumented)
export function loadDataFromStore(universalPersistenceKey: string, opts?: {
    didCancel?: () => boolean;
}): Promise<{
    records: TLRecord[];
    schema?: SerializedSchema;
} | undefined>;

// @public (undocumented)
export const STORE_PREFIX = "TLDRAW_DOCUMENT_v2";

// @public (undocumented)
export function storeChangesInIndexedDb(universalPersistenceKey: string, schema: TLStoreSchema, changes: RecordsDiff<any>, opts?: {
    didCancel?: () => boolean;
}): Promise<void>;

// @public (undocumented)
export function storeSnapshotInIndexedDb(universalPersistenceKey: string, schema: TLStoreSchema, snapshot: StoreSnapshot<any>, opts?: {
    didCancel?: () => boolean;
}): Promise<void>;

// @public (undocumented)
export function subscribeToUserData(store: Store<any>): () => void;

// @public (undocumented)
export const TAB_ID: TLInstanceId;

// @public (undocumented)
export class TLLocalSyncClient {
    constructor(store: TLStore, { universalPersistenceKey, onLoad, onLoadError, }: {
        universalPersistenceKey: string;
        onLoad: (self: TLLocalSyncClient) => void;
        onLoadError: (error: Error) => void;
    }, channel?: BroadcastChannel | BroadcastChannelMock);
    // (undocumented)
    readonly channel: BroadcastChannel | BroadcastChannelMock;
    // (undocumented)
    close(): void;
    // (undocumented)
    initTime: number;
    // (undocumented)
    readonly serializedSchema: SerializedSchema;
    // (undocumented)
    readonly store: TLStore;
    // (undocumented)
    readonly universalPersistenceKey: string;
}

// @public
export function useLocalSyncClient({ universalPersistenceKey, instanceId, userId, config, }: {
    universalPersistenceKey: string;
    instanceId: TLInstanceId;
    userId: TLUserId;
    config: TldrawEditorConfig;
}): SyncedStore;

// (No @packageDocumentation comment for this package)