356a0d1e73
- Remove TLUser, TLUserPresence - Add first-class support for user preferences that persists across rooms and tabs ### Change Type <!-- 💡 Indicate the type of change your pull request is. --> <!-- 🤷♀️ If you're not sure, don't select anything --> <!-- ✂️ Feel free to delete unselected options --> <!-- To select one, put an x in the box: [x] --> - [ ] `patch` — Bug Fix - [ ] `minor` — New Feature - [x] `major` — Breaking Change - [ ] `dependencies` — Dependency Update (publishes a `patch` release, for devDependencies use `internal`) - [ ] `documentation` — Changes to the documentation only (will not publish a new version) - [ ] `tests` — Changes to any testing-related code only (will not publish a new version) - [ ] `internal` — Any other changes that don't affect the published package (will not publish a new version) ### Test Plan 1. Add a step-by-step description of how to test your PR here. 2. - [ ] Unit Tests - [ ] Webdriver tests ### Release Notes - Add a brief release note for your PR here.
73 lines
2.1 KiB
Markdown
73 lines
2.1 KiB
Markdown
## API Report File for "@tldraw/file-format"
|
|
|
|
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
|
|
```ts
|
|
|
|
import { App } from '@tldraw/editor';
|
|
import { MigrationFailureReason } from '@tldraw/tlstore';
|
|
import { Result } from '@tldraw/utils';
|
|
import { SerializedSchema } from '@tldraw/tlstore';
|
|
import { TldrawEditorConfig } from '@tldraw/editor';
|
|
import { TLInstanceId } from '@tldraw/editor';
|
|
import { TLStore } from '@tldraw/editor';
|
|
import { TLTranslationKey } from '@tldraw/ui';
|
|
import { ToastsContextType } from '@tldraw/ui';
|
|
import { UnknownRecord } from '@tldraw/tlstore';
|
|
|
|
// @public (undocumented)
|
|
export function isV1File(data: any): boolean;
|
|
|
|
// @internal (undocumented)
|
|
export function parseAndLoadDocument(app: App, document: string, msg: (id: TLTranslationKey) => string, addToast: ToastsContextType['addToast'], onV1FileLoad?: () => void, forceDarkMode?: boolean): Promise<void>;
|
|
|
|
// @public (undocumented)
|
|
export function parseTldrawJsonFile({ config, json, instanceId, }: {
|
|
config: TldrawEditorConfig;
|
|
json: string;
|
|
instanceId: TLInstanceId;
|
|
}): Result<TLStore, TldrawFileParseError>;
|
|
|
|
// @public (undocumented)
|
|
export function serializeTldrawJson(store: TLStore): Promise<string>;
|
|
|
|
// @public (undocumented)
|
|
export function serializeTldrawJsonBlob(store: TLStore): Promise<Blob>;
|
|
|
|
// @public (undocumented)
|
|
export const TLDRAW_FILE_EXTENSION: ".tldr";
|
|
|
|
// @public (undocumented)
|
|
export const TLDRAW_FILE_MIMETYPE: "application/vnd.tldraw+json";
|
|
|
|
// @public (undocumented)
|
|
export interface TldrawFile {
|
|
// (undocumented)
|
|
records: UnknownRecord[];
|
|
// (undocumented)
|
|
schema: SerializedSchema;
|
|
// (undocumented)
|
|
tldrawFileFormatVersion: number;
|
|
}
|
|
|
|
// @public (undocumented)
|
|
export type TldrawFileParseError = {
|
|
type: 'fileFormatVersionTooNew';
|
|
version: number;
|
|
} | {
|
|
type: 'invalidRecords';
|
|
cause: unknown;
|
|
} | {
|
|
type: 'migrationFailed';
|
|
reason: MigrationFailureReason;
|
|
} | {
|
|
type: 'notATldrawFile';
|
|
cause: unknown;
|
|
} | {
|
|
type: 'v1File';
|
|
data: any;
|
|
};
|
|
|
|
// (No @packageDocumentation comment for this package)
|
|
|
|
```
|