{ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "7.41.0", "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", "noStandardTags": true, "tagDefinitions": [ { "tagName": "@alpha", "syntaxKind": "modifier" }, { "tagName": "@beta", "syntaxKind": "modifier" }, { "tagName": "@defaultValue", "syntaxKind": "block" }, { "tagName": "@decorator", "syntaxKind": "block", "allowMultiple": true }, { "tagName": "@deprecated", "syntaxKind": "block" }, { "tagName": "@eventProperty", "syntaxKind": "modifier" }, { "tagName": "@example", "syntaxKind": "block", "allowMultiple": true }, { "tagName": "@experimental", "syntaxKind": "modifier" }, { "tagName": "@inheritDoc", "syntaxKind": "inline" }, { "tagName": "@internal", "syntaxKind": "modifier" }, { "tagName": "@label", "syntaxKind": "inline" }, { "tagName": "@link", "syntaxKind": "inline", "allowMultiple": true }, { "tagName": "@override", "syntaxKind": "modifier" }, { "tagName": "@packageDocumentation", "syntaxKind": "modifier" }, { "tagName": "@param", "syntaxKind": "block", "allowMultiple": true }, { "tagName": "@privateRemarks", "syntaxKind": "block" }, { "tagName": "@public", "syntaxKind": "modifier" }, { "tagName": "@readonly", "syntaxKind": "modifier" }, { "tagName": "@remarks", "syntaxKind": "block" }, { "tagName": "@returns", "syntaxKind": "block" }, { "tagName": "@sealed", "syntaxKind": "modifier" }, { "tagName": "@see", "syntaxKind": "block" }, { "tagName": "@throws", "syntaxKind": "block", "allowMultiple": true }, { "tagName": "@typeParam", "syntaxKind": "block", "allowMultiple": true }, { "tagName": "@virtual", "syntaxKind": "modifier" }, { "tagName": "@betaDocumentation", "syntaxKind": "modifier" }, { "tagName": "@internalRemarks", "syntaxKind": "block" }, { "tagName": "@preapproved", "syntaxKind": "modifier" } ], "supportForTags": { "@alpha": true, "@beta": true, "@defaultValue": true, "@decorator": true, "@deprecated": true, "@eventProperty": true, "@example": true, "@experimental": true, "@inheritDoc": true, "@internal": true, "@label": true, "@link": true, "@override": true, "@packageDocumentation": true, "@param": true, "@privateRemarks": true, "@public": true, "@readonly": true, "@remarks": true, "@returns": true, "@sealed": true, "@see": true, "@throws": true, "@typeParam": true, "@virtual": true, "@betaDocumentation": true, "@internalRemarks": true, "@preapproved": true }, "reportUnsupportedHtmlElements": false } }, "kind": "Package", "canonicalReference": "@tldraw/store!", "docComment": "", "name": "@tldraw/store", "preserveMemberOrder": false, "members": [ { "kind": "EntryPoint", "canonicalReference": "@tldraw/store!", "name": "", "preserveMemberOrder": false, "members": [ { "kind": "TypeAlias", "canonicalReference": "@tldraw/store!AllRecords:type", "docComment": "/**\n * Get the type of all records in a record store.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type AllRecords" }, { "kind": "Content", "text": "> = " }, { "kind": "Reference", "text": "ExtractR", "canonicalReference": "@tldraw/store!~ExtractR:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "ExtractRecordType", "canonicalReference": "@tldraw/store!~ExtractRecordType:type" }, { "kind": "Content", "text": ">" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/type-utils.ts", "releaseTag": "Public", "name": "AllRecords", "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 1, "endIndex": 3 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "typeTokenRange": { "startIndex": 4, "endIndex": 8 } }, { "kind": "Function", "canonicalReference": "@tldraw/store!assertIdType:function(1)", "docComment": "/**\n * Assert whether an id correspond to a record type.\n *\n * @param id - The id to check.\n *\n * @param type - The type of the record.\n *\n * @example\n * ```ts\n * assertIdType(myId, \"shape\")\n * ```\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function assertIdType(id: " }, { "kind": "Content", "text": "string | undefined" }, { "kind": "Content", "text": ", type: " }, { "kind": "Reference", "text": "RecordType", "canonicalReference": "@tldraw/store!RecordType:class" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "asserts " }, { "kind": "Reference", "text": "id", "canonicalReference": "@tldraw/store!~id" }, { "kind": "Content", "text": " is " }, { "kind": "Reference", "text": "IdOf", "canonicalReference": "@tldraw/store!IdOf:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/RecordType.ts", "returnTypeTokenRange": { "startIndex": 8, "endIndex": 13 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "id", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "type", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 7 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "R", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "assertIdType" }, { "kind": "Interface", "canonicalReference": "@tldraw/store!BaseRecord:interface", "docComment": "/**\n * The base record that all records must extend.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface BaseRecord" }, { "kind": "Content", "text": "> " } ], "fileUrlPath": "packages/store/src/lib/BaseRecord.ts", "releaseTag": "Public", "typeParameters": [ { "typeParameterName": "TypeName", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "Id", "constraintTokenRange": { "startIndex": 3, "endIndex": 7 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "BaseRecord", "preserveMemberOrder": false, "members": [ { "kind": "PropertySignature", "canonicalReference": "@tldraw/store!BaseRecord#id:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "readonly id: " }, { "kind": "Content", "text": "Id" }, { "kind": "Content", "text": ";" } ], "isReadonly": true, "isOptional": false, "releaseTag": "Public", "name": "id", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@tldraw/store!BaseRecord#typeName:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "readonly typeName: " }, { "kind": "Content", "text": "TypeName" }, { "kind": "Content", "text": ";" } ], "isReadonly": true, "isOptional": false, "releaseTag": "Public", "name": "typeName", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/store!CollectionDiff:type", "docComment": "/**\n * A diff describing the changes to a collection.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type CollectionDiff = " }, { "kind": "Content", "text": "{\n added?: " }, { "kind": "Reference", "text": "Set", "canonicalReference": "!Set:interface" }, { "kind": "Content", "text": ";\n removed?: " }, { "kind": "Reference", "text": "Set", "canonicalReference": "!Set:interface" }, { "kind": "Content", "text": ";\n}" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/Store.ts", "releaseTag": "Public", "name": "CollectionDiff", "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "typeTokenRange": { "startIndex": 1, "endIndex": 6 } }, { "kind": "Function", "canonicalReference": "@tldraw/store!compareSchemas:function(1)", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "compareSchemas: (_a: " }, { "kind": "Reference", "text": "SerializedSchema", "canonicalReference": "@tldraw/store!SerializedSchema:type" }, { "kind": "Content", "text": ", _b: " }, { "kind": "Reference", "text": "SerializedSchema", "canonicalReference": "@tldraw/store!SerializedSchema:type" }, { "kind": "Content", "text": ") => " }, { "kind": "Content", "text": "-1 | 0 | 1" } ], "fileUrlPath": "packages/store/src/lib/compareSchemas.ts", "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "_a", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "_b", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "name": "compareSchemas" }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/store!ComputedCache:type", "docComment": "/**\n * A record store is a collection of records of different types.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type ComputedCache = " }, { "kind": "Content", "text": "{\n get(id: " }, { "kind": "Reference", "text": "IdOf", "canonicalReference": "@tldraw/store!IdOf:type" }, { "kind": "Content", "text": "): Data | undefined;\n}" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/Store.ts", "releaseTag": "Public", "name": "ComputedCache", "typeParameters": [ { "typeParameterName": "Data", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "R", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "typeTokenRange": { "startIndex": 3, "endIndex": 6 } }, { "kind": "Function", "canonicalReference": "@tldraw/store!createMigrationIds:function(1)", "docComment": "/**\n * Creates a named set of migration ids given a named set of version numbers and a sequence id.\n *\n * See the [migration guide](https://tldraw.dev/docs/persistence#Migrations) for more info on how to use this API.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function createMigrationIds" }, { "kind": "Content", "text": ">(sequenceId: " }, { "kind": "Content", "text": "ID" }, { "kind": "Content", "text": ", versions: " }, { "kind": "Content", "text": "Versions" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "{\n [K in keyof Versions]: `${ID}/${Versions[K]}`;\n}" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/migrate.ts", "returnTypeTokenRange": { "startIndex": 10, "endIndex": 11 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "sequenceId", "parameterTypeTokenRange": { "startIndex": 6, "endIndex": 7 }, "isOptional": false }, { "parameterName": "versions", "parameterTypeTokenRange": { "startIndex": 8, "endIndex": 9 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "ID", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "Versions", "constraintTokenRange": { "startIndex": 3, "endIndex": 5 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "createMigrationIds" }, { "kind": "Function", "canonicalReference": "@tldraw/store!createMigrationSequence:function(1)", "docComment": "/**\n * Creates a migration sequence. See the [migration guide](https://tldraw.dev/docs/persistence#Migrations) for more info on how to use this API.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function createMigrationSequence({ sequence, sequenceId, retroactive, }: " }, { "kind": "Content", "text": "{\n sequenceId: string;\n retroactive?: boolean;\n sequence: " }, { "kind": "Reference", "text": "Array", "canonicalReference": "!Array:interface" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "Migration", "canonicalReference": "@tldraw/store!Migration:type" }, { "kind": "Content", "text": " | " }, { "kind": "Reference", "text": "StandaloneDependsOn", "canonicalReference": "@tldraw/store!~StandaloneDependsOn:type" }, { "kind": "Content", "text": ">;\n}" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "MigrationSequence", "canonicalReference": "@tldraw/store!MigrationSequence:interface" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/migrate.ts", "returnTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "{ sequence, sequenceId, retroactive, }", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 8 }, "isOptional": false } ], "name": "createMigrationSequence" }, { "kind": "Function", "canonicalReference": "@tldraw/store!createRecordType:function(1)", "docComment": "/**\n * Create a record type.\n *\n * @param typeName - The name of the type to create.\n *\n * @example\n * ```ts\n * const Book = createRecordType('book')\n * ```\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function createRecordType(typeName: " }, { "kind": "Content", "text": "R['typeName']" }, { "kind": "Content", "text": ", config: " }, { "kind": "Content", "text": "{\n validator?: " }, { "kind": "Reference", "text": "StoreValidator", "canonicalReference": "@tldraw/store!StoreValidator:type" }, { "kind": "Content", "text": ";\n scope: " }, { "kind": "Reference", "text": "RecordScope", "canonicalReference": "@tldraw/store!~RecordScope:type" }, { "kind": "Content", "text": ";\n}" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "RecordType", "canonicalReference": "@tldraw/store!RecordType:class" }, { "kind": "Content", "text": ">" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/RecordType.ts", "returnTypeTokenRange": { "startIndex": 11, "endIndex": 15 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "typeName", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "config", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 10 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "R", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "createRecordType" }, { "kind": "Function", "canonicalReference": "@tldraw/store!defineMigrations:function(1)", "docComment": "/**\n * @deprecated\n *\n * use `createShapePropsMigrationSequence` instead. See [the docs](https://tldraw.dev/docs/persistence#Updating-legacy-shape-migrations-defineMigrations) for how to migrate.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function defineMigrations(opts: " }, { "kind": "Content", "text": "{\n firstVersion?: number;\n currentVersion?: number;\n migrators?: " }, { "kind": "Reference", "text": "Record", "canonicalReference": "!Record:type" }, { "kind": "Content", "text": ";\n subTypeKey?: string;\n subTypeMigrations?: " }, { "kind": "Reference", "text": "Record", "canonicalReference": "!Record:type" }, { "kind": "Content", "text": ";\n}" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "LegacyMigrations", "canonicalReference": "@tldraw/store!LegacyMigrations:interface" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/migrate.ts", "returnTypeTokenRange": { "startIndex": 11, "endIndex": 12 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "opts", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 10 }, "isOptional": false } ], "name": "defineMigrations" }, { "kind": "Function", "canonicalReference": "@tldraw/store!devFreeze:function(1)", "docComment": "/**\n * Freeze an object when in development mode. Copied from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze\n *\n * @param object - The object to freeze.\n *\n * @returns The frozen object when in development mode, or else the object when in other modes.\n *\n * @example\n * ```ts\n * const frozen = devFreeze({ a: 1 })\n * ```\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function devFreeze(object: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/devFreeze.ts", "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "object", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "devFreeze" }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/store!HistoryEntry:type", "docComment": "/**\n * An entry containing changes that originated either by user actions or remote changes.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type HistoryEntry = " }, { "kind": "Content", "text": "{\n changes: " }, { "kind": "Reference", "text": "RecordsDiff", "canonicalReference": "@tldraw/store!RecordsDiff:type" }, { "kind": "Content", "text": ";\n source: " }, { "kind": "Reference", "text": "ChangeSource", "canonicalReference": "@tldraw/store!~ChangeSource:type" }, { "kind": "Content", "text": ";\n}" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/Store.ts", "releaseTag": "Public", "name": "HistoryEntry", "typeParameters": [ { "typeParameterName": "R", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 3, "endIndex": 4 } } ], "typeTokenRange": { "startIndex": 5, "endIndex": 10 } }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/store!IdOf:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type IdOf = " }, { "kind": "Content", "text": "R['id']" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/BaseRecord.ts", "releaseTag": "Public", "name": "IdOf", "typeParameters": [ { "typeParameterName": "R", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "typeTokenRange": { "startIndex": 3, "endIndex": 4 } }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/store!LegacyMigration:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type LegacyMigration = " }, { "kind": "Content", "text": "{\n up: (oldState: Before) => After;\n down: (newState: After) => Before;\n}" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/migrate.ts", "releaseTag": "Public", "name": "LegacyMigration", "typeParameters": [ { "typeParameterName": "Before", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "typeParameterName": "After", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 3, "endIndex": 4 } } ], "typeTokenRange": { "startIndex": 5, "endIndex": 6 } }, { "kind": "Interface", "canonicalReference": "@tldraw/store!LegacyMigrations:interface", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface LegacyMigrations extends " }, { "kind": "Reference", "text": "LegacyBaseMigrationsInfo", "canonicalReference": "@tldraw/store!~LegacyBaseMigrationsInfo:interface" }, { "kind": "Content", "text": " " } ], "fileUrlPath": "packages/store/src/lib/migrate.ts", "releaseTag": "Public", "name": "LegacyMigrations", "preserveMemberOrder": false, "members": [ { "kind": "PropertySignature", "canonicalReference": "@tldraw/store!LegacyMigrations#subTypeKey:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "subTypeKey?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": true, "releaseTag": "Public", "name": "subTypeKey", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@tldraw/store!LegacyMigrations#subTypeMigrations:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "subTypeMigrations?: " }, { "kind": "Reference", "text": "Record", "canonicalReference": "!Record:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": true, "releaseTag": "Public", "name": "subTypeMigrations", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 5 } } ], "extendsTokenRanges": [ { "startIndex": 1, "endIndex": 2 } ] }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/store!Migration:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type Migration = " }, { "kind": "Content", "text": "{\n readonly id: " }, { "kind": "Reference", "text": "MigrationId", "canonicalReference": "@tldraw/store!MigrationId:type" }, { "kind": "Content", "text": ";\n readonly dependsOn?: readonly " }, { "kind": "Reference", "text": "MigrationId", "canonicalReference": "@tldraw/store!MigrationId:type" }, { "kind": "Content", "text": "[] | undefined;\n} & ({\n readonly scope: 'record';\n readonly filter?: (record: " }, { "kind": "Reference", "text": "UnknownRecord", "canonicalReference": "@tldraw/store!UnknownRecord:type" }, { "kind": "Content", "text": ") => boolean;\n readonly up: (oldState: " }, { "kind": "Reference", "text": "UnknownRecord", "canonicalReference": "@tldraw/store!UnknownRecord:type" }, { "kind": "Content", "text": ") => " }, { "kind": "Reference", "text": "UnknownRecord", "canonicalReference": "@tldraw/store!UnknownRecord:type" }, { "kind": "Content", "text": " | void;\n readonly down?: (newState: " }, { "kind": "Reference", "text": "UnknownRecord", "canonicalReference": "@tldraw/store!UnknownRecord:type" }, { "kind": "Content", "text": ") => " }, { "kind": "Reference", "text": "UnknownRecord", "canonicalReference": "@tldraw/store!UnknownRecord:type" }, { "kind": "Content", "text": " | void;\n} | {\n readonly scope: 'store';\n readonly up: (oldState: " }, { "kind": "Reference", "text": "SerializedStore", "canonicalReference": "@tldraw/store!SerializedStore:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "UnknownRecord", "canonicalReference": "@tldraw/store!UnknownRecord:type" }, { "kind": "Content", "text": ">) => " }, { "kind": "Reference", "text": "SerializedStore", "canonicalReference": "@tldraw/store!SerializedStore:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "UnknownRecord", "canonicalReference": "@tldraw/store!UnknownRecord:type" }, { "kind": "Content", "text": "> | void;\n readonly down?: (newState: " }, { "kind": "Reference", "text": "SerializedStore", "canonicalReference": "@tldraw/store!SerializedStore:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "UnknownRecord", "canonicalReference": "@tldraw/store!UnknownRecord:type" }, { "kind": "Content", "text": ">) => " }, { "kind": "Reference", "text": "SerializedStore", "canonicalReference": "@tldraw/store!SerializedStore:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "UnknownRecord", "canonicalReference": "@tldraw/store!UnknownRecord:type" }, { "kind": "Content", "text": "> | void;\n})" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/migrate.ts", "releaseTag": "Public", "name": "Migration", "typeTokenRange": { "startIndex": 1, "endIndex": 32 } }, { "kind": "Enum", "canonicalReference": "@tldraw/store!MigrationFailureReason:enum", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare enum MigrationFailureReason " } ], "fileUrlPath": "packages/store/src/lib/migrate.ts", "releaseTag": "Public", "name": "MigrationFailureReason", "preserveMemberOrder": false, "members": [ { "kind": "EnumMember", "canonicalReference": "@tldraw/store!MigrationFailureReason.IncompatibleSubtype:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "IncompatibleSubtype = " }, { "kind": "Content", "text": "\"incompatible-subtype\"" } ], "initializerTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "name": "IncompatibleSubtype" }, { "kind": "EnumMember", "canonicalReference": "@tldraw/store!MigrationFailureReason.MigrationError:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "MigrationError = " }, { "kind": "Content", "text": "\"migration-error\"" } ], "initializerTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "name": "MigrationError" }, { "kind": "EnumMember", "canonicalReference": "@tldraw/store!MigrationFailureReason.TargetVersionTooNew:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "TargetVersionTooNew = " }, { "kind": "Content", "text": "\"target-version-too-new\"" } ], "initializerTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "name": "TargetVersionTooNew" }, { "kind": "EnumMember", "canonicalReference": "@tldraw/store!MigrationFailureReason.TargetVersionTooOld:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "TargetVersionTooOld = " }, { "kind": "Content", "text": "\"target-version-too-old\"" } ], "initializerTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "name": "TargetVersionTooOld" }, { "kind": "EnumMember", "canonicalReference": "@tldraw/store!MigrationFailureReason.UnknownType:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "UnknownType = " }, { "kind": "Content", "text": "\"unknown-type\"" } ], "initializerTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "name": "UnknownType" }, { "kind": "EnumMember", "canonicalReference": "@tldraw/store!MigrationFailureReason.UnrecognizedSubtype:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "UnrecognizedSubtype = " }, { "kind": "Content", "text": "\"unrecognized-subtype\"" } ], "initializerTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "name": "UnrecognizedSubtype" } ] }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/store!MigrationId:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type MigrationId = " }, { "kind": "Content", "text": "`${string}/${number}`" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/migrate.ts", "releaseTag": "Public", "name": "MigrationId", "typeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/store!MigrationResult:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type MigrationResult = " }, { "kind": "Content", "text": "{\n type: 'error';\n reason: " }, { "kind": "Reference", "text": "MigrationFailureReason", "canonicalReference": "@tldraw/store!MigrationFailureReason:enum" }, { "kind": "Content", "text": ";\n} | {\n type: 'success';\n value: T;\n}" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/migrate.ts", "releaseTag": "Public", "name": "MigrationResult", "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "typeTokenRange": { "startIndex": 1, "endIndex": 4 } }, { "kind": "Interface", "canonicalReference": "@tldraw/store!MigrationSequence:interface", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface MigrationSequence " } ], "fileUrlPath": "packages/store/src/lib/migrate.ts", "releaseTag": "Public", "name": "MigrationSequence", "preserveMemberOrder": false, "members": [ { "kind": "PropertySignature", "canonicalReference": "@tldraw/store!MigrationSequence#retroactive:member", "docComment": "/**\n * retroactive should be true if the migrations should be applied to snapshots that were created before this migration sequence was added to the schema.\n *\n * In general:\n *\n * - retroactive should be true when app developers create their own new migration sequences. - retroactive should be false when library developers ship a migration sequence. When you install a library for the first time, any migrations that were added in the library before that point should generally _not_ be applied to your existing data.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "retroactive: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "retroactive", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@tldraw/store!MigrationSequence#sequence:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "sequence: " }, { "kind": "Reference", "text": "Migration", "canonicalReference": "@tldraw/store!Migration:type" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "sequence", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 } }, { "kind": "PropertySignature", "canonicalReference": "@tldraw/store!MigrationSequence#sequenceId:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "sequenceId: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "sequenceId", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/store!RecordId:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type RecordId = " }, { "kind": "Content", "text": "string & {\n __type__: R;\n}" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/BaseRecord.ts", "releaseTag": "Public", "name": "RecordId", "typeParameters": [ { "typeParameterName": "R", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "typeTokenRange": { "startIndex": 3, "endIndex": 4 } }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/store!RecordsDiff:type", "docComment": "/**\n * A diff describing the changes to a record.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type RecordsDiff = " }, { "kind": "Content", "text": "{\n added: " }, { "kind": "Reference", "text": "Record", "canonicalReference": "!Record:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "IdOf", "canonicalReference": "@tldraw/store!IdOf:type" }, { "kind": "Content", "text": ", R>;\n updated: " }, { "kind": "Reference", "text": "Record", "canonicalReference": "!Record:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "IdOf", "canonicalReference": "@tldraw/store!IdOf:type" }, { "kind": "Content", "text": ", [from: R, to: R]>;\n removed: " }, { "kind": "Reference", "text": "Record", "canonicalReference": "!Record:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "IdOf", "canonicalReference": "@tldraw/store!IdOf:type" }, { "kind": "Content", "text": ", R>;\n}" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/Store.ts", "releaseTag": "Public", "name": "RecordsDiff", "typeParameters": [ { "typeParameterName": "R", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "typeTokenRange": { "startIndex": 3, "endIndex": 16 } }, { "kind": "Class", "canonicalReference": "@tldraw/store!RecordType:class", "docComment": "/**\n * A record type is a type that can be stored in a record store. It is created with `createRecordType`.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare class RecordType" }, { "kind": "Content", "text": "> " } ], "fileUrlPath": "packages/store/src/lib/RecordType.ts", "releaseTag": "Public", "typeParameters": [ { "typeParameterName": "R", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "RequiredProperties", "constraintTokenRange": { "startIndex": 3, "endIndex": 6 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "isAbstract": false, "name": "RecordType", "preserveMemberOrder": false, "members": [ { "kind": "Constructor", "canonicalReference": "@tldraw/store!RecordType:constructor(1)", "docComment": "/**\n * Constructs a new instance of the `RecordType` class\n */\n", "excerptTokens": [ { "kind": "Content", "text": "constructor(\n typeName: " }, { "kind": "Content", "text": "R['typeName']" }, { "kind": "Content", "text": ", config: " }, { "kind": "Content", "text": "{\n readonly createDefaultProperties: () => " }, { "kind": "Reference", "text": "Exclude", "canonicalReference": "!Exclude:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "OmitMeta", "canonicalReference": "@tldraw/store!~OmitMeta:type" }, { "kind": "Content", "text": ", RequiredProperties>;\n readonly validator?: " }, { "kind": "Reference", "text": "StoreValidator", "canonicalReference": "@tldraw/store!StoreValidator:type" }, { "kind": "Content", "text": ";\n readonly scope?: " }, { "kind": "Reference", "text": "RecordScope", "canonicalReference": "@tldraw/store!~RecordScope:type" }, { "kind": "Content", "text": ";\n }" }, { "kind": "Content", "text": ");" } ], "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "typeName", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "config", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 12 }, "isOptional": false } ] }, { "kind": "Method", "canonicalReference": "@tldraw/store!RecordType#clone:member(1)", "docComment": "/**\n * Clone a record of this type.\n *\n * @param record - The record to clone.\n *\n * @returns The cloned record.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "clone(record: " }, { "kind": "Content", "text": "R" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "R" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "record", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "isOptional": false, "isAbstract": false, "name": "clone" }, { "kind": "Method", "canonicalReference": "@tldraw/store!RecordType#create:member(1)", "docComment": "/**\n * Create a new record of this type.\n *\n * @param properties - The properties of the record.\n *\n * @returns The new record.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "create(properties: " }, { "kind": "Reference", "text": "Pick", "canonicalReference": "!Pick:type" }, { "kind": "Content", "text": " & " }, { "kind": "Reference", "text": "Omit", "canonicalReference": "!Omit:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "Partial", "canonicalReference": "!Partial:type" }, { "kind": "Content", "text": ", RequiredProperties>" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "R" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 8, "endIndex": 9 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "properties", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 7 }, "isOptional": false } ], "isOptional": false, "isAbstract": false, "name": "create" }, { "kind": "Method", "canonicalReference": "@tldraw/store!RecordType#createCustomId:member(1)", "docComment": "/**\n * Create a new ID for this record type based on the given ID.\n *\n * @deprecated\n *\n * - Use `createId` instead.\n *\n * @param id - The ID to base the new ID on.\n *\n * @returns The new ID.\n *\n * @example\n * ```ts\n * const id = recordType.createCustomId('myId')\n * ```\n *\n */\n", "excerptTokens": [ { "kind": "Content", "text": "createCustomId(id: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "IdOf", "canonicalReference": "@tldraw/store!IdOf:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "id", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "isOptional": false, "isAbstract": false, "name": "createCustomId" }, { "kind": "Property", "canonicalReference": "@tldraw/store!RecordType#createDefaultProperties:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "readonly createDefaultProperties: " }, { "kind": "Content", "text": "() => " }, { "kind": "Reference", "text": "Exclude", "canonicalReference": "!Exclude:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "OmitMeta", "canonicalReference": "@tldraw/store!~OmitMeta:type" }, { "kind": "Content", "text": ", RequiredProperties>" }, { "kind": "Content", "text": ";" } ], "isReadonly": true, "isOptional": false, "releaseTag": "Public", "name": "createDefaultProperties", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 6 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Method", "canonicalReference": "@tldraw/store!RecordType#createId:member(1)", "docComment": "/**\n * Create a new ID for this record type.\n *\n * @returns The new ID.\n *\n * @example\n * ```ts\n * const id = recordType.createId()\n * ```\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "createId(customUniquePart?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "IdOf", "canonicalReference": "@tldraw/store!IdOf:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "customUniquePart", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true } ], "isOptional": false, "isAbstract": false, "name": "createId" }, { "kind": "Method", "canonicalReference": "@tldraw/store!RecordType#isId:member(1)", "docComment": "/**\n * Check whether an id is an id of this type.\n *\n * @param id - The id to check.\n *\n * @returns Whether the id is an id of this type.\n *\n * @example\n * ```ts\n * const result = recordType.isIn('someId')\n * ```\n *\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isId(id?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "id", "canonicalReference": "@tldraw/store!~id" }, { "kind": "Content", "text": " is " }, { "kind": "Reference", "text": "IdOf", "canonicalReference": "@tldraw/store!IdOf:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 7 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "id", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true } ], "isOptional": false, "isAbstract": false, "name": "isId" }, { "kind": "Property", "canonicalReference": "@tldraw/store!RecordType#isInstance:member", "docComment": "/**\n * Check whether a record is an instance of this record type.\n *\n * @param record - The record to check.\n *\n * @returns Whether the record is an instance of this record type.\n *\n * @example\n * ```ts\n * const result = recordType.isInstance(someRecord)\n * ```\n *\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isInstance: " }, { "kind": "Content", "text": "(record?: " }, { "kind": "Reference", "text": "UnknownRecord", "canonicalReference": "@tldraw/store!UnknownRecord:type" }, { "kind": "Content", "text": ") => " }, { "kind": "Reference", "text": "record", "canonicalReference": "@tldraw/store!~record" }, { "kind": "Content", "text": " is R" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "isInstance", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 6 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Method", "canonicalReference": "@tldraw/store!RecordType#parseId:member(1)", "docComment": "/**\n * Takes an id like `user:123` and returns the part after the colon `123`\n *\n * @param id - The id\n *\n * @returns \n */\n", "excerptTokens": [ { "kind": "Content", "text": "parseId(id: " }, { "kind": "Reference", "text": "IdOf", "canonicalReference": "@tldraw/store!IdOf:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 4, "endIndex": 5 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "id", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isOptional": false } ], "isOptional": false, "isAbstract": false, "name": "parseId" }, { "kind": "Property", "canonicalReference": "@tldraw/store!RecordType#scope:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "readonly scope: " }, { "kind": "Reference", "text": "RecordScope", "canonicalReference": "@tldraw/store!~RecordScope:type" }, { "kind": "Content", "text": ";" } ], "isReadonly": true, "isOptional": false, "releaseTag": "Public", "name": "scope", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!RecordType#typeName:member", "docComment": "/**\n * The unique type associated with this record.\n *\n * @public @readonly\n */\n", "excerptTokens": [ { "kind": "Content", "text": "readonly typeName: " }, { "kind": "Content", "text": "R['typeName']" }, { "kind": "Content", "text": ";" } ], "isReadonly": true, "isOptional": false, "releaseTag": "Public", "name": "typeName", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Method", "canonicalReference": "@tldraw/store!RecordType#validate:member(1)", "docComment": "/**\n * Check that the passed in record passes the validations for this type. Returns its input correctly typed if it does, but throws an error otherwise.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "validate(record: " }, { "kind": "Content", "text": "unknown" }, { "kind": "Content", "text": ", recordBefore?: " }, { "kind": "Content", "text": "R" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "R" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "record", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "recordBefore", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true } ], "isOptional": false, "isAbstract": false, "name": "validate" }, { "kind": "Property", "canonicalReference": "@tldraw/store!RecordType#validator:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "readonly validator: " }, { "kind": "Reference", "text": "StoreValidator", "canonicalReference": "@tldraw/store!StoreValidator:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "isReadonly": true, "isOptional": false, "releaseTag": "Public", "name": "validator", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Method", "canonicalReference": "@tldraw/store!RecordType#withDefaultProperties:member(1)", "docComment": "/**\n * Create a new RecordType that has the same type name as this RecordType and includes the given default properties.\n *\n * @param fn - A function that returns the default properties of the new RecordType.\n *\n * @returns The new RecordType.\n *\n * @example\n * ```ts\n * const authorType = createRecordType('author', () => ({ living: true }))\n * const deadAuthorType = authorType.withDefaultProperties({ living: false })\n * ```\n *\n */\n", "excerptTokens": [ { "kind": "Content", "text": "withDefaultProperties, 'id' | 'typeName'>" }, { "kind": "Content", "text": ">(createDefaultProperties: " }, { "kind": "Content", "text": "() => DefaultProps" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "RecordType", "canonicalReference": "@tldraw/store!RecordType:class" }, { "kind": "Content", "text": ">" }, { "kind": "Content", "text": ";" } ], "typeParameters": [ { "typeParameterName": "DefaultProps", "constraintTokenRange": { "startIndex": 1, "endIndex": 5 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 8, "endIndex": 12 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "createDefaultProperties", "parameterTypeTokenRange": { "startIndex": 6, "endIndex": 7 }, "isOptional": false } ], "isOptional": false, "isAbstract": false, "name": "withDefaultProperties" } ], "implementsTokenRanges": [] }, { "kind": "Function", "canonicalReference": "@tldraw/store!reverseRecordsDiff:function(1)", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function reverseRecordsDiff(diff: " }, { "kind": "Reference", "text": "RecordsDiff", "canonicalReference": "@tldraw/store!RecordsDiff:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "RecordsDiff", "canonicalReference": "@tldraw/store!RecordsDiff:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/Store.ts", "returnTypeTokenRange": { "startIndex": 4, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "diff", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isOptional": false } ], "name": "reverseRecordsDiff" }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/store!SerializedSchema:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type SerializedSchema = " }, { "kind": "Reference", "text": "SerializedSchemaV1", "canonicalReference": "@tldraw/store!SerializedSchemaV1:interface" }, { "kind": "Content", "text": " | " }, { "kind": "Reference", "text": "SerializedSchemaV2", "canonicalReference": "@tldraw/store!SerializedSchemaV2:interface" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/StoreSchema.ts", "releaseTag": "Public", "name": "SerializedSchema", "typeTokenRange": { "startIndex": 1, "endIndex": 4 } }, { "kind": "Interface", "canonicalReference": "@tldraw/store!SerializedSchemaV1:interface", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface SerializedSchemaV1 " } ], "fileUrlPath": "packages/store/src/lib/StoreSchema.ts", "releaseTag": "Public", "name": "SerializedSchemaV1", "preserveMemberOrder": false, "members": [ { "kind": "PropertySignature", "canonicalReference": "@tldraw/store!SerializedSchemaV1#recordVersions:member", "docComment": "/**\n * Record versions are the versions for each record type. e.g. adding a new field to a record\n */\n", "excerptTokens": [ { "kind": "Content", "text": "recordVersions: " }, { "kind": "Reference", "text": "Record", "canonicalReference": "!Record:type" }, { "kind": "Content", "text": ";\n subTypeKey: string;\n } | {\n version: number;\n }>" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "recordVersions", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 5 } }, { "kind": "PropertySignature", "canonicalReference": "@tldraw/store!SerializedSchemaV1#schemaVersion:member", "docComment": "/**\n * Schema version is the version for this type you're looking at right now\n */\n", "excerptTokens": [ { "kind": "Content", "text": "schemaVersion: " }, { "kind": "Content", "text": "1" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "schemaVersion", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@tldraw/store!SerializedSchemaV1#storeVersion:member", "docComment": "/**\n * Store version is the version for the structure of the store. e.g. higher level structure like removing or renaming a record type.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "storeVersion: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "storeVersion", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@tldraw/store!SerializedSchemaV2:interface", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface SerializedSchemaV2 " } ], "fileUrlPath": "packages/store/src/lib/StoreSchema.ts", "releaseTag": "Public", "name": "SerializedSchemaV2", "preserveMemberOrder": false, "members": [ { "kind": "PropertySignature", "canonicalReference": "@tldraw/store!SerializedSchemaV2#schemaVersion:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "schemaVersion: " }, { "kind": "Content", "text": "2" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "schemaVersion", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@tldraw/store!SerializedSchemaV2#sequences:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "sequences: " }, { "kind": "Content", "text": "{\n [sequenceId: string]: {\n version: number;\n retroactive: boolean;\n };\n }" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "sequences", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/store!SerializedStore:type", "docComment": "/**\n * A serialized snapshot of the record store's values.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type SerializedStore = " }, { "kind": "Reference", "text": "Record", "canonicalReference": "!Record:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "IdOf", "canonicalReference": "@tldraw/store!IdOf:type" }, { "kind": "Content", "text": ", R>" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/Store.ts", "releaseTag": "Public", "name": "SerializedStore", "typeParameters": [ { "typeParameterName": "R", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "typeTokenRange": { "startIndex": 3, "endIndex": 7 } }, { "kind": "Function", "canonicalReference": "@tldraw/store!squashRecordDiffs:function(1)", "docComment": "/**\n * Squash a collection of diffs into a single diff.\n *\n * @param diffs - An array of diffs to squash.\n *\n * @returns A single diff that represents the squashed diffs.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function squashRecordDiffs(diffs: " }, { "kind": "Reference", "text": "RecordsDiff", "canonicalReference": "@tldraw/store!RecordsDiff:type" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "RecordsDiff", "canonicalReference": "@tldraw/store!RecordsDiff:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/Store.ts", "returnTypeTokenRange": { "startIndex": 6, "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "diffs", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "squashRecordDiffs" }, { "kind": "Class", "canonicalReference": "@tldraw/store!Store:class", "docComment": "/**\n * A store of records.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare class Store " } ], "fileUrlPath": "packages/store/src/lib/Store.ts", "releaseTag": "Public", "typeParameters": [ { "typeParameterName": "R", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 3, "endIndex": 4 } }, { "typeParameterName": "Props", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 5, "endIndex": 6 } } ], "isAbstract": false, "name": "Store", "preserveMemberOrder": false, "members": [ { "kind": "Method", "canonicalReference": "@tldraw/store!Store#_flushHistory:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "_flushHistory(): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [], "isOptional": false, "isAbstract": false, "name": "_flushHistory" }, { "kind": "Constructor", "canonicalReference": "@tldraw/store!Store:constructor(1)", "docComment": "/**\n * Constructs a new instance of the `Store` class\n */\n", "excerptTokens": [ { "kind": "Content", "text": "constructor(config: " }, { "kind": "Content", "text": "{\n initialData?: " }, { "kind": "Reference", "text": "SerializedStore", "canonicalReference": "@tldraw/store!SerializedStore:type" }, { "kind": "Content", "text": ";\n schema: " }, { "kind": "Reference", "text": "StoreSchema", "canonicalReference": "@tldraw/store!StoreSchema:class" }, { "kind": "Content", "text": ";\n props: Props;\n }" }, { "kind": "Content", "text": ");" } ], "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "config", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 6 }, "isOptional": false } ] }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#allRecords:member", "docComment": "/**\n * Get an array of all values in the store.\n *\n * @returns An array of all values in the store.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "allRecords: " }, { "kind": "Content", "text": "() => R[]" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "allRecords", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Method", "canonicalReference": "@tldraw/store!Store#applyDiff:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "applyDiff(diff: " }, { "kind": "Reference", "text": "RecordsDiff", "canonicalReference": "@tldraw/store!RecordsDiff:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ", runCallbacks?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 6, "endIndex": 7 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "diff", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isOptional": false }, { "parameterName": "runCallbacks", "parameterTypeTokenRange": { "startIndex": 4, "endIndex": 5 }, "isOptional": true } ], "isOptional": false, "isAbstract": false, "name": "applyDiff" }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#clear:member", "docComment": "/**\n * Removes all records from the store.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "clear: " }, { "kind": "Content", "text": "() => void" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "clear", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#createComputedCache:member", "docComment": "/**\n * Create a computed cache.\n *\n * @param name - The name of the derivation cache.\n *\n * @param derive - A function used to derive the value of the cache.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "createComputedCache: " }, { "kind": "Content", "text": "(name: string, derive: (record: V) => T | undefined, isEqual?: ((a: V, b: V) => boolean) | undefined) => " }, { "kind": "Reference", "text": "ComputedCache", "canonicalReference": "@tldraw/store!ComputedCache:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "createComputedCache", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#createSelectedComputedCache:member", "docComment": "/**\n * Create a computed cache from a selector\n *\n * @param name - The name of the derivation cache.\n *\n * @param selector - A function that returns a subset of the original shape\n *\n * @param derive - A function used to derive the value of the cache.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "createSelectedComputedCache: " }, { "kind": "Content", "text": "(name: string, selector: (record: V) => T | undefined, derive: (input: T) => J | undefined) => " }, { "kind": "Reference", "text": "ComputedCache", "canonicalReference": "@tldraw/store!ComputedCache:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "createSelectedComputedCache", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Method", "canonicalReference": "@tldraw/store!Store#extractingChanges:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "extractingChanges(fn: " }, { "kind": "Content", "text": "() => void" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "RecordsDiff", "canonicalReference": "@tldraw/store!RecordsDiff:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "fn", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "isOptional": false, "isAbstract": false, "name": "extractingChanges" }, { "kind": "Method", "canonicalReference": "@tldraw/store!Store#filterChangesByScope:member(1)", "docComment": "/**\n * Filters out non-document changes from a diff. Returns null if there are no changes left.\n *\n * @param change - the records diff\n *\n * @returns \n */\n", "excerptTokens": [ { "kind": "Content", "text": "filterChangesByScope(change: " }, { "kind": "Reference", "text": "RecordsDiff", "canonicalReference": "@tldraw/store!RecordsDiff:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ", scope: " }, { "kind": "Reference", "text": "RecordScope", "canonicalReference": "@tldraw/store!~RecordScope:type" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "{\n added: { [K in " }, { "kind": "Reference", "text": "IdOf", "canonicalReference": "@tldraw/store!IdOf:type" }, { "kind": "Content", "text": "]: R; };\n updated: { [K_1 in " }, { "kind": "Reference", "text": "IdOf", "canonicalReference": "@tldraw/store!IdOf:type" }, { "kind": "Content", "text": "]: [from: R, to: R]; };\n removed: { [K in " }, { "kind": "Reference", "text": "IdOf", "canonicalReference": "@tldraw/store!IdOf:type" }, { "kind": "Content", "text": "]: R; };\n } | null" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 6, "endIndex": 13 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "change", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isOptional": false }, { "parameterName": "scope", "parameterTypeTokenRange": { "startIndex": 4, "endIndex": 5 }, "isOptional": false } ], "isOptional": false, "isAbstract": false, "name": "filterChangesByScope" }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#get:member", "docComment": "/**\n * Get the value of a store record by its id.\n *\n * @param id - The id of the record to get.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "get: " }, { "kind": "Content", "text": ">(id: K) => " }, { "kind": "Reference", "text": "RecFromId", "canonicalReference": "@tldraw/store!~RecFromId:type" }, { "kind": "Content", "text": " | undefined" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "get", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 6 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#getRecordType:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "getRecordType: " }, { "kind": "Content", "text": "(record: R) => T" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "getRecordType", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Method", "canonicalReference": "@tldraw/store!Store#getSnapshot:member(1)", "docComment": "/**\n * Get a serialized snapshot of the store and its schema.\n * ```ts\n * const snapshot = store.getSnapshot()\n * store.loadSnapshot(snapshot)\n * ```\n *\n * @param scope - The scope of records to serialize. Defaults to 'document'.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "getSnapshot(scope?: " }, { "kind": "Content", "text": "'all' | " }, { "kind": "Reference", "text": "RecordScope", "canonicalReference": "@tldraw/store!~RecordScope:type" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "StoreSnapshot", "canonicalReference": "@tldraw/store!StoreSnapshot:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 4, "endIndex": 6 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "scope", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isOptional": true } ], "isOptional": false, "isAbstract": false, "name": "getSnapshot" }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#has:member", "docComment": "/**\n * Get whether the record store has a id.\n *\n * @param id - The id of the record to check.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "has: " }, { "kind": "Content", "text": ">(id: K) => boolean" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "has", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#history:member", "docComment": "/**\n * An atom containing the store's history.\n *\n * @public @readonly\n */\n", "excerptTokens": [ { "kind": "Content", "text": "readonly history: " }, { "kind": "Reference", "text": "Atom", "canonicalReference": "@tldraw/state!Atom:interface" }, { "kind": "Content", "text": ">" }, { "kind": "Content", "text": ";" } ], "isReadonly": true, "isOptional": false, "releaseTag": "Public", "name": "history", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 5 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#id:member", "docComment": "/**\n * The random id of the store.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "readonly id: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isReadonly": true, "isOptional": false, "releaseTag": "Public", "name": "id", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#listen:member", "docComment": "/**\n * Add a new listener to the store.\n *\n * @param onHistory - The listener to call when the store updates.\n *\n * @param filters - Filters to apply to the listener.\n *\n * @returns A function to remove the listener.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "listen: " }, { "kind": "Content", "text": "(onHistory: " }, { "kind": "Reference", "text": "StoreListener", "canonicalReference": "@tldraw/store!StoreListener:type" }, { "kind": "Content", "text": ", filters?: " }, { "kind": "Reference", "text": "Partial", "canonicalReference": "!Partial:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "StoreListenerFilters", "canonicalReference": "@tldraw/store!~StoreListenerFilters:type" }, { "kind": "Content", "text": ">) => () => void" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "listen", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 8 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Method", "canonicalReference": "@tldraw/store!Store#loadSnapshot:member(1)", "docComment": "/**\n * Load a serialized snapshot.\n * ```ts\n * const snapshot = store.getSnapshot()\n * store.loadSnapshot(snapshot)\n * ```\n *\n * @param snapshot - The snapshot to load.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "loadSnapshot(snapshot: " }, { "kind": "Reference", "text": "StoreSnapshot", "canonicalReference": "@tldraw/store!StoreSnapshot:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 4, "endIndex": 5 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "snapshot", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isOptional": false } ], "isOptional": false, "isAbstract": false, "name": "loadSnapshot" }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#mergeRemoteChanges:member", "docComment": "/**\n * Merge changes from a remote source without triggering listeners.\n *\n * @param fn - A function that merges the external changes.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "mergeRemoteChanges: " }, { "kind": "Content", "text": "(fn: () => void) => void" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "mergeRemoteChanges", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Method", "canonicalReference": "@tldraw/store!Store#migrateSnapshot:member(1)", "docComment": "/**\n * Migrate a serialized snapshot of the store and its schema.\n * ```ts\n * const snapshot = store.getSnapshot()\n * store.migrateSnapshot(snapshot)\n * ```\n *\n * @param snapshot - The snapshot to load.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "migrateSnapshot(snapshot: " }, { "kind": "Reference", "text": "StoreSnapshot", "canonicalReference": "@tldraw/store!StoreSnapshot:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "StoreSnapshot", "canonicalReference": "@tldraw/store!StoreSnapshot:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 4, "endIndex": 6 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "snapshot", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isOptional": false } ], "isOptional": false, "isAbstract": false, "name": "migrateSnapshot" }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#onAfterChange:member", "docComment": "/**\n * A callback fired after each record's change.\n *\n * @param prev - The previous value, if any.\n *\n * @param next - The next value.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "onAfterChange?: " }, { "kind": "Content", "text": "(prev: R, next: R, source: 'remote' | 'user') => void" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": true, "releaseTag": "Public", "name": "onAfterChange", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#onAfterCreate:member", "docComment": "/**\n * A callback fired after a record is created. Use this to perform related updates to other records in the store.\n *\n * @param record - The record to be created\n */\n", "excerptTokens": [ { "kind": "Content", "text": "onAfterCreate?: " }, { "kind": "Content", "text": "(record: R, source: 'remote' | 'user') => void" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": true, "releaseTag": "Public", "name": "onAfterCreate", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#onAfterDelete:member", "docComment": "/**\n * A callback fired after a record is deleted.\n *\n * @param prev - The record that will be deleted.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "onAfterDelete?: " }, { "kind": "Content", "text": "(prev: R, source: 'remote' | 'user') => void" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": true, "releaseTag": "Public", "name": "onAfterDelete", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#onBeforeChange:member", "docComment": "/**\n * A callback fired before each record's change.\n *\n * @param prev - The previous value, if any.\n *\n * @param next - The next value.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "onBeforeChange?: " }, { "kind": "Content", "text": "(prev: R, next: R, source: 'remote' | 'user') => R" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": true, "releaseTag": "Public", "name": "onBeforeChange", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#onBeforeCreate:member", "docComment": "/**\n * A callback fired after each record's change.\n *\n * @param prev - The previous value, if any.\n *\n * @param next - The next value.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "onBeforeCreate?: " }, { "kind": "Content", "text": "(next: R, source: 'remote' | 'user') => R" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": true, "releaseTag": "Public", "name": "onBeforeCreate", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#onBeforeDelete:member", "docComment": "/**\n * A callback fired before a record is deleted.\n *\n * @param prev - The record that will be deleted.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "onBeforeDelete?: " }, { "kind": "Content", "text": "(prev: R, source: 'remote' | 'user') => false | void" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": true, "releaseTag": "Public", "name": "onBeforeDelete", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#props:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "readonly props: " }, { "kind": "Content", "text": "Props" }, { "kind": "Content", "text": ";" } ], "isReadonly": true, "isOptional": false, "releaseTag": "Public", "name": "props", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#put:member", "docComment": "/**\n * Add some records to the store. It's an error if they already exist.\n *\n * @param records - The records to add.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "put: " }, { "kind": "Content", "text": "(records: R[], phaseOverride?: 'initialize') => void" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "put", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#query:member", "docComment": "/**\n * A StoreQueries instance for this store.\n *\n * @public @readonly\n */\n", "excerptTokens": [ { "kind": "Content", "text": "readonly query: " }, { "kind": "Reference", "text": "StoreQueries", "canonicalReference": "@tldraw/store!~StoreQueries:class" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "isReadonly": true, "isOptional": false, "releaseTag": "Public", "name": "query", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#remove:member", "docComment": "/**\n * Remove some records from the store via their ids.\n *\n * @param ids - The ids of the records to remove.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "remove: " }, { "kind": "Content", "text": "(ids: " }, { "kind": "Reference", "text": "IdOf", "canonicalReference": "@tldraw/store!IdOf:type" }, { "kind": "Content", "text": "[]) => void" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "remove", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#schema:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "readonly schema: " }, { "kind": "Reference", "text": "StoreSchema", "canonicalReference": "@tldraw/store!StoreSchema:class" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "isReadonly": true, "isOptional": false, "releaseTag": "Public", "name": "schema", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#scopedTypes:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "readonly scopedTypes: " }, { "kind": "Content", "text": "{\n readonly [K in " }, { "kind": "Reference", "text": "RecordScope", "canonicalReference": "@tldraw/store!~RecordScope:type" }, { "kind": "Content", "text": "]: " }, { "kind": "Reference", "text": "ReadonlySet", "canonicalReference": "!ReadonlySet:interface" }, { "kind": "Content", "text": ";\n }" }, { "kind": "Content", "text": ";" } ], "isReadonly": true, "isOptional": false, "releaseTag": "Public", "name": "scopedTypes", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 6 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#serialize:member", "docComment": "/**\n * Creates a JSON payload from the record store.\n *\n * @param scope - The scope of records to serialize. Defaults to 'document'.\n *\n * @returns The record store snapshot as a JSON payload.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "serialize: " }, { "kind": "Content", "text": "(scope?: 'all' | " }, { "kind": "Reference", "text": "RecordScope", "canonicalReference": "@tldraw/store!~RecordScope:type" }, { "kind": "Content", "text": ") => " }, { "kind": "Reference", "text": "SerializedStore", "canonicalReference": "@tldraw/store!SerializedStore:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "serialize", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 6 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#unsafeGetWithoutCapture:member", "docComment": "/**\n * Get the value of a store record by its id without updating its epoch.\n *\n * @param id - The id of the record to get.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "unsafeGetWithoutCapture: " }, { "kind": "Content", "text": ">(id: K) => " }, { "kind": "Reference", "text": "RecFromId", "canonicalReference": "@tldraw/store!~RecFromId:type" }, { "kind": "Content", "text": " | undefined" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "unsafeGetWithoutCapture", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 6 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!Store#update:member", "docComment": "/**\n * Update a record. To update multiple records at once, use the `update` method of the `TypedStore` class.\n *\n * @param id - The id of the record to update.\n *\n * @param updater - A function that updates the record.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "update: " }, { "kind": "Content", "text": ">(id: K, updater: (record: " }, { "kind": "Reference", "text": "RecFromId", "canonicalReference": "@tldraw/store!~RecFromId:type" }, { "kind": "Content", "text": ") => " }, { "kind": "Reference", "text": "RecFromId", "canonicalReference": "@tldraw/store!~RecFromId:type" }, { "kind": "Content", "text": ") => void" }, { "kind": "Content", "text": ";" } ], "isReadonly": false, "isOptional": false, "releaseTag": "Public", "name": "update", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 8 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Method", "canonicalReference": "@tldraw/store!Store#validate:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "validate(phase: " }, { "kind": "Content", "text": "'createRecord' | 'initialize' | 'tests' | 'updateRecord'" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "phase", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "isOptional": false, "isAbstract": false, "name": "validate" } ], "implementsTokenRanges": [] }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/store!StoreError:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type StoreError = " }, { "kind": "Content", "text": "{\n error: " }, { "kind": "Reference", "text": "Error", "canonicalReference": "!Error:interface" }, { "kind": "Content", "text": ";\n phase: 'createRecord' | 'initialize' | 'tests' | 'updateRecord';\n recordBefore?: unknown;\n recordAfter: unknown;\n isExistingValidationIssue: boolean;\n}" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/Store.ts", "releaseTag": "Public", "name": "StoreError", "typeTokenRange": { "startIndex": 1, "endIndex": 4 } }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/store!StoreListener:type", "docComment": "/**\n * A function that will be called when the history changes.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type StoreListener = " }, { "kind": "Content", "text": "(entry: " }, { "kind": "Reference", "text": "HistoryEntry", "canonicalReference": "@tldraw/store!HistoryEntry:type" }, { "kind": "Content", "text": ") => void" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/Store.ts", "releaseTag": "Public", "name": "StoreListener", "typeParameters": [ { "typeParameterName": "R", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "typeTokenRange": { "startIndex": 3, "endIndex": 6 } }, { "kind": "Class", "canonicalReference": "@tldraw/store!StoreSchema:class", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare class StoreSchema " } ], "fileUrlPath": "packages/store/src/lib/StoreSchema.ts", "releaseTag": "Public", "typeParameters": [ { "typeParameterName": "R", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "P", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 3, "endIndex": 4 } } ], "isAbstract": false, "name": "StoreSchema", "preserveMemberOrder": false, "members": [ { "kind": "Method", "canonicalReference": "@tldraw/store!StoreSchema.create:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "static create(types: " }, { "kind": "Content", "text": "{\n [TypeName in R['typeName']]: {\n createId: any;\n };\n }" }, { "kind": "Content", "text": ", options?: " }, { "kind": "Reference", "text": "StoreSchemaOptions", "canonicalReference": "@tldraw/store!StoreSchemaOptions:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "StoreSchema", "canonicalReference": "@tldraw/store!StoreSchema:class" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "typeParameters": [ { "typeParameterName": "R", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "P", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 3, "endIndex": 4 } } ], "isStatic": true, "returnTypeTokenRange": { "startIndex": 10, "endIndex": 12 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "types", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false }, { "parameterName": "options", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 9 }, "isOptional": true } ], "isOptional": false, "isAbstract": false, "name": "create" }, { "kind": "Method", "canonicalReference": "@tldraw/store!StoreSchema#getMigrationsSince:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "getMigrationsSince(persistedSchema: " }, { "kind": "Reference", "text": "SerializedSchema", "canonicalReference": "@tldraw/store!SerializedSchema:type" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "Result", "canonicalReference": "@tldraw/utils!Result:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "Migration", "canonicalReference": "@tldraw/store!Migration:type" }, { "kind": "Content", "text": "[], string>" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 7 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "persistedSchema", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "isOptional": false, "isAbstract": false, "name": "getMigrationsSince" }, { "kind": "Method", "canonicalReference": "@tldraw/store!StoreSchema#migratePersistedRecord:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "migratePersistedRecord(record: " }, { "kind": "Content", "text": "R" }, { "kind": "Content", "text": ", persistedSchema: " }, { "kind": "Reference", "text": "SerializedSchema", "canonicalReference": "@tldraw/store!SerializedSchema:type" }, { "kind": "Content", "text": ", direction?: " }, { "kind": "Content", "text": "'down' | 'up'" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "MigrationResult", "canonicalReference": "@tldraw/store!MigrationResult:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 7, "endIndex": 9 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "record", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "persistedSchema", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "direction", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true } ], "isOptional": false, "isAbstract": false, "name": "migratePersistedRecord" }, { "kind": "Method", "canonicalReference": "@tldraw/store!StoreSchema#migrateStoreSnapshot:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "migrateStoreSnapshot(snapshot: " }, { "kind": "Reference", "text": "StoreSnapshot", "canonicalReference": "@tldraw/store!StoreSnapshot:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "MigrationResult", "canonicalReference": "@tldraw/store!MigrationResult:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "SerializedStore", "canonicalReference": "@tldraw/store!SerializedStore:type" }, { "kind": "Content", "text": ">" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 4, "endIndex": 8 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "snapshot", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isOptional": false } ], "isOptional": false, "isAbstract": false, "name": "migrateStoreSnapshot" }, { "kind": "Property", "canonicalReference": "@tldraw/store!StoreSchema#migrations:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "readonly migrations: " }, { "kind": "Reference", "text": "Record", "canonicalReference": "!Record:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "isReadonly": true, "isOptional": false, "releaseTag": "Public", "name": "migrations", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 5 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Method", "canonicalReference": "@tldraw/store!StoreSchema#serialize:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "serialize(): " }, { "kind": "Reference", "text": "SerializedSchemaV2", "canonicalReference": "@tldraw/store!SerializedSchemaV2:interface" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [], "isOptional": false, "isAbstract": false, "name": "serialize" }, { "kind": "Method", "canonicalReference": "@tldraw/store!StoreSchema#serializeEarliestVersion:member(1)", "docComment": "/**\n * @deprecated\n *\n * This is only here for legacy reasons, don't use it unless you have david's blessing!\n */\n", "excerptTokens": [ { "kind": "Content", "text": "serializeEarliestVersion(): " }, { "kind": "Reference", "text": "SerializedSchema", "canonicalReference": "@tldraw/store!SerializedSchema:type" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [], "isOptional": false, "isAbstract": false, "name": "serializeEarliestVersion" }, { "kind": "Property", "canonicalReference": "@tldraw/store!StoreSchema#sortedMigrations:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "readonly sortedMigrations: " }, { "kind": "Content", "text": "readonly " }, { "kind": "Reference", "text": "Migration", "canonicalReference": "@tldraw/store!Migration:type" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ";" } ], "isReadonly": true, "isOptional": false, "releaseTag": "Public", "name": "sortedMigrations", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Property", "canonicalReference": "@tldraw/store!StoreSchema#types:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "readonly types: " }, { "kind": "Content", "text": "{\n [Record in R as Record['typeName']]: " }, { "kind": "Reference", "text": "RecordType", "canonicalReference": "@tldraw/store!RecordType:class" }, { "kind": "Content", "text": ";\n }" }, { "kind": "Content", "text": ";" } ], "isReadonly": true, "isOptional": false, "releaseTag": "Public", "name": "types", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 }, "isStatic": false, "isProtected": false, "isAbstract": false }, { "kind": "Method", "canonicalReference": "@tldraw/store!StoreSchema#validateRecord:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "validateRecord(store: " }, { "kind": "Reference", "text": "Store", "canonicalReference": "@tldraw/store!Store:class" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ", record: " }, { "kind": "Content", "text": "R" }, { "kind": "Content", "text": ", phase: " }, { "kind": "Content", "text": "'createRecord' | 'initialize' | 'tests' | 'updateRecord'" }, { "kind": "Content", "text": ", recordBefore: " }, { "kind": "Content", "text": "null | R" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "R" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 10, "endIndex": 11 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "store", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isOptional": false }, { "parameterName": "record", "parameterTypeTokenRange": { "startIndex": 4, "endIndex": 5 }, "isOptional": false }, { "parameterName": "phase", "parameterTypeTokenRange": { "startIndex": 6, "endIndex": 7 }, "isOptional": false }, { "parameterName": "recordBefore", "parameterTypeTokenRange": { "startIndex": 8, "endIndex": 9 }, "isOptional": false } ], "isOptional": false, "isAbstract": false, "name": "validateRecord" } ], "implementsTokenRanges": [] }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/store!StoreSchemaOptions:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type StoreSchemaOptions = " }, { "kind": "Content", "text": "{\n migrations?: " }, { "kind": "Reference", "text": "MigrationSequence", "canonicalReference": "@tldraw/store!MigrationSequence:interface" }, { "kind": "Content", "text": "[];\n onValidationFailure?: (data: {\n error: unknown;\n store: " }, { "kind": "Reference", "text": "Store", "canonicalReference": "@tldraw/store!Store:class" }, { "kind": "Content", "text": ";\n record: R;\n phase: 'createRecord' | 'initialize' | 'tests' | 'updateRecord';\n recordBefore: null | R;\n }) => R;\n createIntegrityChecker?: (store: " }, { "kind": "Reference", "text": "Store", "canonicalReference": "@tldraw/store!Store:class" }, { "kind": "Content", "text": ") => void;\n}" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/StoreSchema.ts", "releaseTag": "Public", "name": "StoreSchemaOptions", "typeParameters": [ { "typeParameterName": "R", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "P", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "typeTokenRange": { "startIndex": 3, "endIndex": 10 } }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/store!StoreSnapshot:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type StoreSnapshot = " }, { "kind": "Content", "text": "{\n store: " }, { "kind": "Reference", "text": "SerializedStore", "canonicalReference": "@tldraw/store!SerializedStore:type" }, { "kind": "Content", "text": ";\n schema: " }, { "kind": "Reference", "text": "SerializedSchema", "canonicalReference": "@tldraw/store!SerializedSchema:type" }, { "kind": "Content", "text": ";\n}" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/Store.ts", "releaseTag": "Public", "name": "StoreSnapshot", "typeParameters": [ { "typeParameterName": "R", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "typeTokenRange": { "startIndex": 3, "endIndex": 8 } }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/store!StoreValidator:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type StoreValidator = " }, { "kind": "Content", "text": "{\n validate: (record: unknown) => R;\n validateUsingKnownGoodVersion?: (knownGoodVersion: R, record: unknown) => R;\n}" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/Store.ts", "releaseTag": "Public", "name": "StoreValidator", "typeParameters": [ { "typeParameterName": "R", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "typeTokenRange": { "startIndex": 3, "endIndex": 4 } }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/store!StoreValidators:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type StoreValidators = " }, { "kind": "Content", "text": "{\n [K in R['typeName']]: " }, { "kind": "Reference", "text": "StoreValidator", "canonicalReference": "@tldraw/store!StoreValidator:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "Extract", "canonicalReference": "!Extract:type" }, { "kind": "Content", "text": ">;\n}" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/Store.ts", "releaseTag": "Public", "name": "StoreValidators", "typeParameters": [ { "typeParameterName": "R", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "typeTokenRange": { "startIndex": 3, "endIndex": 8 } }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/store!UnknownRecord:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type UnknownRecord = " }, { "kind": "Reference", "text": "BaseRecord", "canonicalReference": "@tldraw/store!BaseRecord:interface" }, { "kind": "Content", "text": ">" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/store/src/lib/BaseRecord.ts", "releaseTag": "Public", "name": "UnknownRecord", "typeTokenRange": { "startIndex": 1, "endIndex": 7 } } ] } ] }