From 157d24db7348151fafc168467cbaa5fcf876131e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mime=20=C4=8Cuvalo?= Date: Mon, 5 Feb 2024 14:32:50 +0000 Subject: [PATCH] docs: rework search UI (#2723) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reworks search to not be a page and instead to be inline dropdown. Screenshot 2024-02-05 at 13 22 58 - rework search completely - rm Search Results css - uses Ariakit and add appropriate hooks / styling - I couldn't use Radix unfortunately since they're still working on adding a Combox: https://github.com/radix-ui/primitives/issues/1342 - I'm open to other suggestions but Ariakit plays nicely with Radix and keeps things open to migrate to Radix in the future - fixes bug with not scrolling to right place when having a direct link - adds categories in the search results - examples / reference / learn - and adds category icons. Let me know if there's a better policy for adding new SVG icons cc @steveruizok ### Change Type - [x] `minor` — New feature ### Test Plan 1. Test searches using normal method for each type (examples, docs, refs) 2. Test searches using AI for each type (ditto) ### Release Notes - Docs: rework the search to be an inline dropdown. --- apps/docs/api/store.api.json | 11364 ++++++++-------- apps/docs/api/validate.api.json | 9228 ++++++------- apps/docs/app/api/ai/route.ts | 64 +- apps/docs/app/api/search/route.ts | 34 +- apps/docs/app/search-results/page.tsx | 97 - apps/docs/components/Autocomplete.css | 193 + apps/docs/components/Autocomplete.tsx | 123 + apps/docs/components/Header.tsx | 12 +- apps/docs/components/Search.tsx | 201 +- apps/docs/components/Sidebar.tsx | 16 +- apps/docs/components/Spinner.tsx | 20 + .../docs/content/releases/v2.0.0-alpha.12.mdx | 1 - .../docs/content/releases/v2.0.0-alpha.13.mdx | 1976 ++- .../docs/content/releases/v2.0.0-alpha.14.mdx | 3 +- .../docs/content/releases/v2.0.0-alpha.15.mdx | 43 +- .../docs/content/releases/v2.0.0-alpha.16.mdx | 13 +- .../docs/content/releases/v2.0.0-alpha.17.mdx | 7 +- .../docs/content/releases/v2.0.0-alpha.18.mdx | 3 +- .../docs/content/releases/v2.0.0-alpha.19.mdx | 3 +- apps/docs/content/releases/v2.0.0-beta.1.mdx | 3 +- apps/docs/content/releases/v2.0.0-beta.2.mdx | 3 +- apps/docs/next.config.js | 8 +- apps/docs/package.json | 1 + apps/docs/styles/globals.css | 161 +- apps/docs/types/content-types.ts | 2 - apps/docs/types/search-types.ts | 6 + apps/docs/utils/search-api.ts | 9 + yarn.lock | 67 +- 28 files changed, 11965 insertions(+), 11696 deletions(-) delete mode 100644 apps/docs/app/search-results/page.tsx create mode 100644 apps/docs/components/Autocomplete.css create mode 100644 apps/docs/components/Autocomplete.tsx create mode 100644 apps/docs/components/Spinner.tsx create mode 100644 apps/docs/utils/search-api.ts diff --git a/apps/docs/api/store.api.json b/apps/docs/api/store.api.json index 9b1afaf38..b04b5014a 100644 --- a/apps/docs/api/store.api.json +++ b/apps/docs/api/store.api.json @@ -1,5684 +1,5684 @@ { - "metadata": { - "toolPackage": "@microsoft/api-extractor", - "toolVersion": "7.35.4", - "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!compareRecordVersions:function(1)", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare function compareRecordVersions(a: " - }, - { - "kind": "Reference", - "text": "RecordVersion", - "canonicalReference": "@tldraw/store!RecordVersion:type" - }, - { - "kind": "Content", - "text": ", b: " - }, - { - "kind": "Reference", - "text": "RecordVersion", - "canonicalReference": "@tldraw/store!RecordVersion:type" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Content", - "text": "-1 | 0 | 1" - }, - { - "kind": "Content", - "text": ";" - } - ], - "fileUrlPath": "packages/store/src/lib/migrate.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": "compareRecordVersions" - }, - { - "kind": "Variable", - "canonicalReference": "@tldraw/store!compareSchemas:var", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "compareSchemas: " - }, - { - "kind": "Content", - "text": "(a: " - }, - { - "kind": "Reference", - "text": "SerializedSchema", - "canonicalReference": "@tldraw/store!SerializedSchema:interface" - }, - { - "kind": "Content", - "text": ", b: " - }, - { - "kind": "Reference", - "text": "SerializedSchema", - "canonicalReference": "@tldraw/store!SerializedSchema:interface" - }, - { - "kind": "Content", - "text": ") => -1 | 0 | 1" - } - ], - "fileUrlPath": "packages/store/src/lib/compareSchemas.ts", - "isReadonly": true, - "releaseTag": "Public", - "name": "compareSchemas", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 6 - } - }, - { - "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!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 migrations?: " - }, - { - "kind": "Reference", - "text": "Migrations", - "canonicalReference": "@tldraw/store!Migrations:interface" - }, - { - "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": 13, - "endIndex": 17 - }, - "releaseTag": "Public", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "typeName", - "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 - }, - "isOptional": false - }, - { - "parameterName": "config", - "parameterTypeTokenRange": { - "startIndex": 5, - "endIndex": 12 - }, - "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 * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare function defineMigrations" - }, - { - "kind": "Content", - "text": " = " - }, - { - "kind": "Reference", - "text": "EMPTY_SYMBOL", - "canonicalReference": "@tldraw/store!~EMPTY_SYMBOL:type" - }, - { - "kind": "Content", - "text": ">(opts: " - }, - { - "kind": "Content", - "text": "{\n firstVersion?: CurrentVersion extends number ? FirstVersion : never;\n currentVersion?: CurrentVersion;\n migrators?: CurrentVersion extends number ? FirstVersion extends number ? CurrentVersion extends FirstVersion ? {\n [version in " - }, - { - "kind": "Reference", - "text": "Exclude", - "canonicalReference": "!Exclude:type" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "Range", - "canonicalReference": "@tldraw/store!~Range_2:type" - }, - { - "kind": "Content", - "text": "<1, CurrentVersion>, 0>]: " - }, - { - "kind": "Reference", - "text": "Migration", - "canonicalReference": "@tldraw/store!Migration:type" - }, - { - "kind": "Content", - "text": ";\n } : {\n [version in " - }, - { - "kind": "Reference", - "text": "Exclude", - "canonicalReference": "!Exclude:type" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "Range", - "canonicalReference": "@tldraw/store!~Range_2:type" - }, - { - "kind": "Content", - "text": ", FirstVersion>]: " - }, - { - "kind": "Reference", - "text": "Migration", - "canonicalReference": "@tldraw/store!Migration:type" - }, - { - "kind": "Content", - "text": ";\n } : {\n [version in " - }, - { - "kind": "Reference", - "text": "Exclude", - "canonicalReference": "!Exclude:type" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "Range", - "canonicalReference": "@tldraw/store!~Range_2:type" - }, - { - "kind": "Content", - "text": "<1, CurrentVersion>, 0>]: " - }, - { - "kind": "Reference", - "text": "Migration", - "canonicalReference": "@tldraw/store!Migration:type" - }, - { - "kind": "Content", - "text": ";\n } : never;\n subTypeKey?: string;\n subTypeMigrations?: " - }, - { - "kind": "Reference", - "text": "Record", - "canonicalReference": "!Record:type" - }, - { - "kind": "Content", - "text": ";\n}" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "Migrations", - "canonicalReference": "@tldraw/store!Migrations:interface" - }, - { - "kind": "Content", - "text": ";" - } - ], - "fileUrlPath": "packages/store/src/lib/migrate.ts", - "returnTypeTokenRange": { - "startIndex": 37, - "endIndex": 38 - }, - "releaseTag": "Public", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "opts", - "parameterTypeTokenRange": { - "startIndex": 13, - "endIndex": 36 - }, - "isOptional": false - } - ], - "typeParameters": [ - { - "typeParameterName": "FirstVersion", - "constraintTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "defaultTypeTokenRange": { - "startIndex": 4, - "endIndex": 5 - } - }, - { - "typeParameterName": "CurrentVersion", - "constraintTokenRange": { - "startIndex": 6, - "endIndex": 10 - }, - "defaultTypeTokenRange": { - "startIndex": 11, - "endIndex": 12 - } - } - ], - "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": "Function", - "canonicalReference": "@tldraw/store!getRecordVersion:function(1)", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare function getRecordVersion(record: " - }, - { - "kind": "Reference", - "text": "UnknownRecord", - "canonicalReference": "@tldraw/store!UnknownRecord:type" - }, - { - "kind": "Content", - "text": ", serializedSchema: " - }, - { - "kind": "Reference", - "text": "SerializedSchema", - "canonicalReference": "@tldraw/store!SerializedSchema:interface" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "RecordVersion", - "canonicalReference": "@tldraw/store!RecordVersion:type" - }, - { - "kind": "Content", - "text": ";" - } - ], - "fileUrlPath": "packages/store/src/lib/migrate.ts", - "returnTypeTokenRange": { - "startIndex": 5, - "endIndex": 6 - }, - "releaseTag": "Public", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "record", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isOptional": false - }, - { - "parameterName": "serializedSchema", - "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 - }, - "isOptional": false - } - ], - "name": "getRecordVersion" - }, - { - "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": "Function", - "canonicalReference": "@tldraw/store!migrate:function(1)", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare function migrate({ value, migrations, fromVersion, toVersion, }: " - }, - { - "kind": "Content", - "text": "{\n value: unknown;\n migrations: " - }, - { - "kind": "Reference", - "text": "Migrations", - "canonicalReference": "@tldraw/store!Migrations:interface" - }, - { - "kind": "Content", - "text": ";\n fromVersion: number;\n toVersion: number;\n}" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "MigrationResult", - "canonicalReference": "@tldraw/store!MigrationResult:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "fileUrlPath": "packages/store/src/lib/migrate.ts", - "returnTypeTokenRange": { - "startIndex": 5, - "endIndex": 7 - }, - "releaseTag": "Public", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "{ value, migrations, fromVersion, toVersion, }", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 4 - }, - "isOptional": false - } - ], - "typeParameters": [ - { - "typeParameterName": "T", - "constraintTokenRange": { - "startIndex": 0, - "endIndex": 0 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "name": "migrate" - }, - { - "kind": "Function", - "canonicalReference": "@tldraw/store!migrateRecord:function(1)", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare function migrateRecord({ record, migrations, fromVersion, toVersion, }: " - }, - { - "kind": "Content", - "text": "{\n record: unknown;\n migrations: " - }, - { - "kind": "Reference", - "text": "Migrations", - "canonicalReference": "@tldraw/store!Migrations:interface" - }, - { - "kind": "Content", - "text": ";\n fromVersion: number;\n toVersion: number;\n}" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "MigrationResult", - "canonicalReference": "@tldraw/store!MigrationResult:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "fileUrlPath": "packages/store/src/lib/migrate.ts", - "returnTypeTokenRange": { - "startIndex": 7, - "endIndex": 9 - }, - "releaseTag": "Public", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "{ record, migrations, fromVersion, toVersion, }", - "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 6 - }, - "isOptional": false - } - ], - "typeParameters": [ - { - "typeParameterName": "R", - "constraintTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "name": "migrateRecord" - }, - { - "kind": "TypeAlias", - "canonicalReference": "@tldraw/store!Migration:type", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export type Migration = " - }, - { - "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": "Migration", - "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": "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!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!Migrations:interface", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export interface Migrations extends " - }, - { - "kind": "Reference", - "text": "BaseMigrationsInfo", - "canonicalReference": "@tldraw/store!~BaseMigrationsInfo:interface" - }, - { - "kind": "Content", - "text": " " - } - ], - "fileUrlPath": "packages/store/src/lib/migrate.ts", - "releaseTag": "Public", - "name": "Migrations", - "preserveMemberOrder": false, - "members": [ - { - "kind": "PropertySignature", - "canonicalReference": "@tldraw/store!Migrations#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!Migrations#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!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 migrations: " - }, - { - "kind": "Reference", - "text": "Migrations", - "canonicalReference": "@tldraw/store!Migrations:interface" - }, - { - "kind": "Content", - "text": ";\n readonly validator?: {\n validate: (r: unknown) => R;\n } | " - }, - { - "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": 14 - }, - "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": "Property", - "canonicalReference": "@tldraw/store!RecordType#migrations:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "readonly migrations: " - }, - { - "kind": "Reference", - "text": "Migrations", - "canonicalReference": "@tldraw/store!Migrations:interface" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isReadonly": true, - "isOptional": false, - "releaseTag": "Public", - "name": "migrations", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "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": "): " - }, - { - "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": "validate" - }, - { - "kind": "Property", - "canonicalReference": "@tldraw/store!RecordType#validator:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "readonly validator: " - }, - { - "kind": "Content", - "text": "{\n validate: (r: unknown) => R;\n } | " - }, - { - "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": 4 - }, - "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": "TypeAlias", - "canonicalReference": "@tldraw/store!RecordVersion:type", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export type RecordVersion = " - }, - { - "kind": "Content", - "text": "{\n rootVersion: number;\n subTypeVersion?: number;\n}" - }, - { - "kind": "Content", - "text": ";" - } - ], - "fileUrlPath": "packages/store/src/lib/migrate.ts", - "releaseTag": "Public", - "name": "RecordVersion", - "typeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "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": "Interface", - "canonicalReference": "@tldraw/store!SerializedSchema:interface", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export interface SerializedSchema " - } - ], - "fileUrlPath": "packages/store/src/lib/StoreSchema.ts", - "releaseTag": "Public", - "name": "SerializedSchema", - "preserveMemberOrder": false, - "members": [ - { - "kind": "PropertySignature", - "canonicalReference": "@tldraw/store!SerializedSchema#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!SerializedSchema#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": "number" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isReadonly": false, - "isOptional": false, - "releaseTag": "Public", - "name": "schemaVersion", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "kind": "PropertySignature", - "canonicalReference": "@tldraw/store!SerializedSchema#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": "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 before 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": "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": "Property", - "canonicalReference": "@tldraw/store!StoreSchema#currentStoreVersion:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "get currentStoreVersion(): " - }, - { - "kind": "Content", - "text": "number" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isReadonly": true, - "isOptional": false, - "releaseTag": "Public", - "name": "currentStoreVersion", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isStatic": false, - "isProtected": false, - "isAbstract": false - }, - { - "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:interface" - }, - { - "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": "Method", - "canonicalReference": "@tldraw/store!StoreSchema#serialize:member(1)", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "serialize(): " - }, - { - "kind": "Reference", - "text": "SerializedSchema", - "canonicalReference": "@tldraw/store!SerializedSchema: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": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "serializeEarliestVersion(): " - }, - { - "kind": "Reference", - "text": "SerializedSchema", - "canonicalReference": "@tldraw/store!SerializedSchema:interface" - }, - { - "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#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 snapshotMigrations?: " - }, - { - "kind": "Reference", - "text": "Migrations", - "canonicalReference": "@tldraw/store!Migrations: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:interface" - }, - { - "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}" - }, - { - "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 - } - } - ] - } - ] + "metadata": { + "toolPackage": "@microsoft/api-extractor", + "toolVersion": "7.35.4", + "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!compareRecordVersions:function(1)", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function compareRecordVersions(a: " + }, + { + "kind": "Reference", + "text": "RecordVersion", + "canonicalReference": "@tldraw/store!RecordVersion:type" + }, + { + "kind": "Content", + "text": ", b: " + }, + { + "kind": "Reference", + "text": "RecordVersion", + "canonicalReference": "@tldraw/store!RecordVersion:type" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Content", + "text": "-1 | 0 | 1" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "packages/store/src/lib/migrate.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": "compareRecordVersions" + }, + { + "kind": "Variable", + "canonicalReference": "@tldraw/store!compareSchemas:var", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "compareSchemas: " + }, + { + "kind": "Content", + "text": "(a: " + }, + { + "kind": "Reference", + "text": "SerializedSchema", + "canonicalReference": "@tldraw/store!SerializedSchema:interface" + }, + { + "kind": "Content", + "text": ", b: " + }, + { + "kind": "Reference", + "text": "SerializedSchema", + "canonicalReference": "@tldraw/store!SerializedSchema:interface" + }, + { + "kind": "Content", + "text": ") => -1 | 0 | 1" + } + ], + "fileUrlPath": "packages/store/src/lib/compareSchemas.ts", + "isReadonly": true, + "releaseTag": "Public", + "name": "compareSchemas", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 6 + } + }, + { + "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!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 migrations?: " + }, + { + "kind": "Reference", + "text": "Migrations", + "canonicalReference": "@tldraw/store!Migrations:interface" + }, + { + "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": 13, + "endIndex": 17 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "typeName", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "isOptional": false + }, + { + "parameterName": "config", + "parameterTypeTokenRange": { + "startIndex": 5, + "endIndex": 12 + }, + "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 * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function defineMigrations" + }, + { + "kind": "Content", + "text": " = " + }, + { + "kind": "Reference", + "text": "EMPTY_SYMBOL", + "canonicalReference": "@tldraw/store!~EMPTY_SYMBOL:type" + }, + { + "kind": "Content", + "text": ">(opts: " + }, + { + "kind": "Content", + "text": "{\n firstVersion?: CurrentVersion extends number ? FirstVersion : never;\n currentVersion?: CurrentVersion;\n migrators?: CurrentVersion extends number ? FirstVersion extends number ? CurrentVersion extends FirstVersion ? {\n [version in " + }, + { + "kind": "Reference", + "text": "Exclude", + "canonicalReference": "!Exclude:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "Range", + "canonicalReference": "@tldraw/store!~Range_2:type" + }, + { + "kind": "Content", + "text": "<1, CurrentVersion>, 0>]: " + }, + { + "kind": "Reference", + "text": "Migration", + "canonicalReference": "@tldraw/store!Migration:type" + }, + { + "kind": "Content", + "text": ";\n } : {\n [version in " + }, + { + "kind": "Reference", + "text": "Exclude", + "canonicalReference": "!Exclude:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "Range", + "canonicalReference": "@tldraw/store!~Range_2:type" + }, + { + "kind": "Content", + "text": ", FirstVersion>]: " + }, + { + "kind": "Reference", + "text": "Migration", + "canonicalReference": "@tldraw/store!Migration:type" + }, + { + "kind": "Content", + "text": ";\n } : {\n [version in " + }, + { + "kind": "Reference", + "text": "Exclude", + "canonicalReference": "!Exclude:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "Range", + "canonicalReference": "@tldraw/store!~Range_2:type" + }, + { + "kind": "Content", + "text": "<1, CurrentVersion>, 0>]: " + }, + { + "kind": "Reference", + "text": "Migration", + "canonicalReference": "@tldraw/store!Migration:type" + }, + { + "kind": "Content", + "text": ";\n } : never;\n subTypeKey?: string;\n subTypeMigrations?: " + }, + { + "kind": "Reference", + "text": "Record", + "canonicalReference": "!Record:type" + }, + { + "kind": "Content", + "text": ";\n}" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Migrations", + "canonicalReference": "@tldraw/store!Migrations:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "packages/store/src/lib/migrate.ts", + "returnTypeTokenRange": { + "startIndex": 37, + "endIndex": 38 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "opts", + "parameterTypeTokenRange": { + "startIndex": 13, + "endIndex": 36 + }, + "isOptional": false + } + ], + "typeParameters": [ + { + "typeParameterName": "FirstVersion", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "defaultTypeTokenRange": { + "startIndex": 4, + "endIndex": 5 + } + }, + { + "typeParameterName": "CurrentVersion", + "constraintTokenRange": { + "startIndex": 6, + "endIndex": 10 + }, + "defaultTypeTokenRange": { + "startIndex": 11, + "endIndex": 12 + } + } + ], + "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": "Function", + "canonicalReference": "@tldraw/store!getRecordVersion:function(1)", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function getRecordVersion(record: " + }, + { + "kind": "Reference", + "text": "UnknownRecord", + "canonicalReference": "@tldraw/store!UnknownRecord:type" + }, + { + "kind": "Content", + "text": ", serializedSchema: " + }, + { + "kind": "Reference", + "text": "SerializedSchema", + "canonicalReference": "@tldraw/store!SerializedSchema:interface" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "RecordVersion", + "canonicalReference": "@tldraw/store!RecordVersion:type" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "packages/store/src/lib/migrate.ts", + "returnTypeTokenRange": { + "startIndex": 5, + "endIndex": 6 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "record", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + }, + { + "parameterName": "serializedSchema", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "isOptional": false + } + ], + "name": "getRecordVersion" + }, + { + "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": "Function", + "canonicalReference": "@tldraw/store!migrate:function(1)", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function migrate({ value, migrations, fromVersion, toVersion, }: " + }, + { + "kind": "Content", + "text": "{\n value: unknown;\n migrations: " + }, + { + "kind": "Reference", + "text": "Migrations", + "canonicalReference": "@tldraw/store!Migrations:interface" + }, + { + "kind": "Content", + "text": ";\n fromVersion: number;\n toVersion: number;\n}" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "MigrationResult", + "canonicalReference": "@tldraw/store!MigrationResult:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "packages/store/src/lib/migrate.ts", + "returnTypeTokenRange": { + "startIndex": 5, + "endIndex": 7 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ value, migrations, fromVersion, toVersion, }", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 4 + }, + "isOptional": false + } + ], + "typeParameters": [ + { + "typeParameterName": "T", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "name": "migrate" + }, + { + "kind": "Function", + "canonicalReference": "@tldraw/store!migrateRecord:function(1)", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function migrateRecord({ record, migrations, fromVersion, toVersion, }: " + }, + { + "kind": "Content", + "text": "{\n record: unknown;\n migrations: " + }, + { + "kind": "Reference", + "text": "Migrations", + "canonicalReference": "@tldraw/store!Migrations:interface" + }, + { + "kind": "Content", + "text": ";\n fromVersion: number;\n toVersion: number;\n}" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "MigrationResult", + "canonicalReference": "@tldraw/store!MigrationResult:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "packages/store/src/lib/migrate.ts", + "returnTypeTokenRange": { + "startIndex": 7, + "endIndex": 9 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ record, migrations, fromVersion, toVersion, }", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 6 + }, + "isOptional": false + } + ], + "typeParameters": [ + { + "typeParameterName": "R", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "name": "migrateRecord" + }, + { + "kind": "TypeAlias", + "canonicalReference": "@tldraw/store!Migration:type", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export type Migration = " + }, + { + "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": "Migration", + "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": "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!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!Migrations:interface", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export interface Migrations extends " + }, + { + "kind": "Reference", + "text": "BaseMigrationsInfo", + "canonicalReference": "@tldraw/store!~BaseMigrationsInfo:interface" + }, + { + "kind": "Content", + "text": " " + } + ], + "fileUrlPath": "packages/store/src/lib/migrate.ts", + "releaseTag": "Public", + "name": "Migrations", + "preserveMemberOrder": false, + "members": [ + { + "kind": "PropertySignature", + "canonicalReference": "@tldraw/store!Migrations#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!Migrations#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!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 migrations: " + }, + { + "kind": "Reference", + "text": "Migrations", + "canonicalReference": "@tldraw/store!Migrations:interface" + }, + { + "kind": "Content", + "text": ";\n readonly validator?: {\n validate: (r: unknown) => R;\n } | " + }, + { + "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": 14 + }, + "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": "Property", + "canonicalReference": "@tldraw/store!RecordType#migrations:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "readonly migrations: " + }, + { + "kind": "Reference", + "text": "Migrations", + "canonicalReference": "@tldraw/store!Migrations:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isReadonly": true, + "isOptional": false, + "releaseTag": "Public", + "name": "migrations", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "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": "): " + }, + { + "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": "validate" + }, + { + "kind": "Property", + "canonicalReference": "@tldraw/store!RecordType#validator:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "readonly validator: " + }, + { + "kind": "Content", + "text": "{\n validate: (r: unknown) => R;\n } | " + }, + { + "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": 4 + }, + "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": "TypeAlias", + "canonicalReference": "@tldraw/store!RecordVersion:type", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export type RecordVersion = " + }, + { + "kind": "Content", + "text": "{\n rootVersion: number;\n subTypeVersion?: number;\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "packages/store/src/lib/migrate.ts", + "releaseTag": "Public", + "name": "RecordVersion", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "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": "Interface", + "canonicalReference": "@tldraw/store!SerializedSchema:interface", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export interface SerializedSchema " + } + ], + "fileUrlPath": "packages/store/src/lib/StoreSchema.ts", + "releaseTag": "Public", + "name": "SerializedSchema", + "preserveMemberOrder": false, + "members": [ + { + "kind": "PropertySignature", + "canonicalReference": "@tldraw/store!SerializedSchema#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!SerializedSchema#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": "number" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isReadonly": false, + "isOptional": false, + "releaseTag": "Public", + "name": "schemaVersion", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "@tldraw/store!SerializedSchema#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": "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 before 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": "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": "Property", + "canonicalReference": "@tldraw/store!StoreSchema#currentStoreVersion:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "get currentStoreVersion(): " + }, + { + "kind": "Content", + "text": "number" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isReadonly": true, + "isOptional": false, + "releaseTag": "Public", + "name": "currentStoreVersion", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isStatic": false, + "isProtected": false, + "isAbstract": false + }, + { + "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:interface" + }, + { + "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": "Method", + "canonicalReference": "@tldraw/store!StoreSchema#serialize:member(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "serialize(): " + }, + { + "kind": "Reference", + "text": "SerializedSchema", + "canonicalReference": "@tldraw/store!SerializedSchema: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": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "serializeEarliestVersion(): " + }, + { + "kind": "Reference", + "text": "SerializedSchema", + "canonicalReference": "@tldraw/store!SerializedSchema:interface" + }, + { + "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#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 snapshotMigrations?: " + }, + { + "kind": "Reference", + "text": "Migrations", + "canonicalReference": "@tldraw/store!Migrations: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:interface" + }, + { + "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}" + }, + { + "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 + } + } + ] + } + ] } diff --git a/apps/docs/api/validate.api.json b/apps/docs/api/validate.api.json index 37b598734..a6d334e45 100644 --- a/apps/docs/api/validate.api.json +++ b/apps/docs/api/validate.api.json @@ -1,4616 +1,4616 @@ { - "metadata": { - "toolPackage": "@microsoft/api-extractor", - "toolVersion": "7.35.4", - "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/validate!", - "docComment": "", - "name": "@tldraw/validate", - "preserveMemberOrder": false, - "members": [ - { - "kind": "EntryPoint", - "canonicalReference": "@tldraw/validate!", - "name": "", - "preserveMemberOrder": false, - "members": [ - { - "kind": "Class", - "canonicalReference": "@tldraw/validate!ArrayOfValidator:class", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare class ArrayOfValidator extends " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": " " - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "releaseTag": "Public", - "typeParameters": [ - { - "typeParameterName": "T", - "constraintTokenRange": { - "startIndex": 0, - "endIndex": 0 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "isAbstract": false, - "name": "ArrayOfValidator", - "preserveMemberOrder": false, - "members": [ - { - "kind": "Constructor", - "canonicalReference": "@tldraw/validate!ArrayOfValidator:constructor(1)", - "docComment": "/**\n * Constructs a new instance of the `ArrayOfValidator` class\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "constructor(itemValidator: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ");" - } - ], - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "itemValidator", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "isOptional": false - } - ] - }, - { - "kind": "Property", - "canonicalReference": "@tldraw/validate!ArrayOfValidator#itemValidator:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "readonly itemValidator: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isReadonly": true, - "isOptional": false, - "releaseTag": "Public", - "name": "itemValidator", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "isStatic": false, - "isProtected": false, - "isAbstract": false - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!ArrayOfValidator#lengthGreaterThan1:member(1)", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "lengthGreaterThan1(): " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [], - "isOptional": false, - "isAbstract": false, - "name": "lengthGreaterThan1" - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!ArrayOfValidator#nonEmpty:member(1)", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "nonEmpty(): " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [], - "isOptional": false, - "isAbstract": false, - "name": "nonEmpty" - } - ], - "extendsTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "implementsTokenRanges": [] - }, - { - "kind": "Class", - "canonicalReference": "@tldraw/validate!DictValidator:class", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare class DictValidator extends " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "Record", - "canonicalReference": "!Record:type" - }, - { - "kind": "Content", - "text": ">" - }, - { - "kind": "Content", - "text": " " - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "releaseTag": "Public", - "typeParameters": [ - { - "typeParameterName": "Key", - "constraintTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - }, - { - "typeParameterName": "Value", - "constraintTokenRange": { - "startIndex": 0, - "endIndex": 0 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "isAbstract": false, - "name": "DictValidator", - "preserveMemberOrder": false, - "members": [ - { - "kind": "Constructor", - "canonicalReference": "@tldraw/validate!DictValidator:constructor(1)", - "docComment": "/**\n * Constructs a new instance of the `DictValidator` class\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "constructor(keyValidator: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ", valueValidator: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ");" - } - ], - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "keyValidator", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "isOptional": false - }, - { - "parameterName": "valueValidator", - "parameterTypeTokenRange": { - "startIndex": 4, - "endIndex": 6 - }, - "isOptional": false - } - ] - }, - { - "kind": "Property", - "canonicalReference": "@tldraw/validate!DictValidator#keyValidator:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "readonly keyValidator: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isReadonly": true, - "isOptional": false, - "releaseTag": "Public", - "name": "keyValidator", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "isStatic": false, - "isProtected": false, - "isAbstract": false - }, - { - "kind": "Property", - "canonicalReference": "@tldraw/validate!DictValidator#valueValidator:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "readonly valueValidator: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isReadonly": true, - "isOptional": false, - "releaseTag": "Public", - "name": "valueValidator", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "isStatic": false, - "isProtected": false, - "isAbstract": false - } - ], - "extendsTokenRange": { - "startIndex": 3, - "endIndex": 7 - }, - "implementsTokenRanges": [] - }, - { - "kind": "Class", - "canonicalReference": "@tldraw/validate!ObjectValidator:class", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare class ObjectValidator extends " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": " " - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "releaseTag": "Public", - "typeParameters": [ - { - "typeParameterName": "Shape", - "constraintTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "isAbstract": false, - "name": "ObjectValidator", - "preserveMemberOrder": false, - "members": [ - { - "kind": "Constructor", - "canonicalReference": "@tldraw/validate!ObjectValidator:constructor(1)", - "docComment": "/**\n * Constructs a new instance of the `ObjectValidator` class\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "constructor(config: " - }, - { - "kind": "Content", - "text": "{\n readonly [K in keyof Shape]: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": ";\n }" - }, - { - "kind": "Content", - "text": ", shouldAllowUnknownProperties?: " - }, - { - "kind": "Content", - "text": "boolean" - }, - { - "kind": "Content", - "text": ");" - } - ], - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "config", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 4 - }, - "isOptional": false - }, - { - "parameterName": "shouldAllowUnknownProperties", - "parameterTypeTokenRange": { - "startIndex": 5, - "endIndex": 6 - }, - "isOptional": true - } - ] - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!ObjectValidator#allowUnknownProperties:member(1)", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "allowUnknownProperties(): " - }, - { - "kind": "Reference", - "text": "ObjectValidator", - "canonicalReference": "@tldraw/validate!ObjectValidator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [], - "isOptional": false, - "isAbstract": false, - "name": "allowUnknownProperties" - }, - { - "kind": "Property", - "canonicalReference": "@tldraw/validate!ObjectValidator#config:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "readonly config: " - }, - { - "kind": "Content", - "text": "{\n readonly [K in keyof Shape]: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": ";\n }" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isReadonly": true, - "isOptional": false, - "releaseTag": "Public", - "name": "config", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 4 - }, - "isStatic": false, - "isProtected": false, - "isAbstract": false - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!ObjectValidator#extend:member(1)", - "docComment": "/**\n * Extend an object validator by adding additional properties.\n *\n * @example\n * ```ts\n * const animalValidator = T.object({\n * \tname: T.string,\n * })\n * const catValidator = animalValidator.extend({\n * \tmeowVolume: T.number,\n * })\n * ```\n *\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "extend" - }, - { - "kind": "Content", - "text": ">(extension: " - }, - { - "kind": "Content", - "text": "{\n readonly [K in keyof Extension]: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": ";\n }" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "ObjectValidator", - "canonicalReference": "@tldraw/validate!ObjectValidator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "typeParameters": [ - { - "typeParameterName": "Extension", - "constraintTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 8, - "endIndex": 10 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "extension", - "parameterTypeTokenRange": { - "startIndex": 4, - "endIndex": 7 - }, - "isOptional": false - } - ], - "isOptional": false, - "isAbstract": false, - "name": "extend" - } - ], - "extendsTokenRange": { - "startIndex": 3, - "endIndex": 5 - }, - "implementsTokenRanges": [] - }, - { - "kind": "Namespace", - "canonicalReference": "@tldraw/validate!T:namespace", - "docComment": "", - "excerptTokens": [], - "fileUrlPath": "packages/validate/src/index.ts", - "releaseTag": "None", - "name": "T", - "preserveMemberOrder": false, - "members": [ - { - "kind": "Variable", - "canonicalReference": "@tldraw/validate!T.any:var", - "docComment": "/**\n * Validation that accepts any value. Generally this should be avoided, but you can use it as an escape hatch if you want to work without validations for e.g. a prototype.\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "any: " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "isReadonly": true, - "releaseTag": "Public", - "name": "any", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - } - }, - { - "kind": "Variable", - "canonicalReference": "@tldraw/validate!T.array:var", - "docComment": "/**\n * Validates that a value is an array. To check the contents of the array, use T.arrayOf.\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "array: " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "isReadonly": true, - "releaseTag": "Public", - "name": "array", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - } - }, - { - "kind": "Function", - "canonicalReference": "@tldraw/validate!T.arrayOf:function(1)", - "docComment": "/**\n * Validates that a value is an array whose contents matches the passed-in validator.\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare function arrayOf(itemValidator: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "ArrayOfValidator", - "canonicalReference": "@tldraw/validate!ArrayOfValidator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "returnTypeTokenRange": { - "startIndex": 4, - "endIndex": 6 - }, - "releaseTag": "Public", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "itemValidator", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "isOptional": false - } - ], - "typeParameters": [ - { - "typeParameterName": "T", - "constraintTokenRange": { - "startIndex": 0, - "endIndex": 0 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "name": "arrayOf" - }, - { - "kind": "Class", - "canonicalReference": "@tldraw/validate!T.ArrayOfValidator:class", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare class ArrayOfValidator extends " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": " " - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "releaseTag": "Public", - "typeParameters": [ - { - "typeParameterName": "T", - "constraintTokenRange": { - "startIndex": 0, - "endIndex": 0 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "isAbstract": false, - "name": "ArrayOfValidator", - "preserveMemberOrder": false, - "members": [ - { - "kind": "Constructor", - "canonicalReference": "@tldraw/validate!T.ArrayOfValidator:constructor(1)", - "docComment": "/**\n * Constructs a new instance of the `ArrayOfValidator` class\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "constructor(itemValidator: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ");" - } - ], - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "itemValidator", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "isOptional": false - } - ] - }, - { - "kind": "Property", - "canonicalReference": "@tldraw/validate!T.ArrayOfValidator#itemValidator:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "readonly itemValidator: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isReadonly": true, - "isOptional": false, - "releaseTag": "Public", - "name": "itemValidator", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "isStatic": false, - "isProtected": false, - "isAbstract": false - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!T.ArrayOfValidator#lengthGreaterThan1:member(1)", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "lengthGreaterThan1(): " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [], - "isOptional": false, - "isAbstract": false, - "name": "lengthGreaterThan1" - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!T.ArrayOfValidator#nonEmpty:member(1)", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "nonEmpty(): " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [], - "isOptional": false, - "isAbstract": false, - "name": "nonEmpty" - } - ], - "extendsTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "implementsTokenRanges": [] - }, - { - "kind": "Variable", - "canonicalReference": "@tldraw/validate!T.bigint:var", - "docComment": "/**\n * Validates that a value is a bigint.\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "bigint: " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "isReadonly": true, - "releaseTag": "Public", - "name": "bigint", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - } - }, - { - "kind": "Variable", - "canonicalReference": "@tldraw/validate!T.boolean:var", - "docComment": "/**\n * Validates that a value is boolean.\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "boolean: " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "isReadonly": true, - "releaseTag": "Public", - "name": "boolean", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - } - }, - { - "kind": "Function", - "canonicalReference": "@tldraw/validate!T.dict:function(1)", - "docComment": "/**\n * Validation that an option is a dict with particular keys and values.\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare function dict(keyValidator: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ", valueValidator: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "DictValidator", - "canonicalReference": "@tldraw/validate!DictValidator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "returnTypeTokenRange": { - "startIndex": 9, - "endIndex": 11 - }, - "releaseTag": "Public", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "keyValidator", - "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 5 - }, - "isOptional": false - }, - { - "parameterName": "valueValidator", - "parameterTypeTokenRange": { - "startIndex": 6, - "endIndex": 8 - }, - "isOptional": false - } - ], - "typeParameters": [ - { - "typeParameterName": "Key", - "constraintTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - }, - { - "typeParameterName": "Value", - "constraintTokenRange": { - "startIndex": 0, - "endIndex": 0 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "name": "dict" - }, - { - "kind": "Class", - "canonicalReference": "@tldraw/validate!T.DictValidator:class", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare class DictValidator extends " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "Record", - "canonicalReference": "!Record:type" - }, - { - "kind": "Content", - "text": ">" - }, - { - "kind": "Content", - "text": " " - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "releaseTag": "Public", - "typeParameters": [ - { - "typeParameterName": "Key", - "constraintTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - }, - { - "typeParameterName": "Value", - "constraintTokenRange": { - "startIndex": 0, - "endIndex": 0 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "isAbstract": false, - "name": "DictValidator", - "preserveMemberOrder": false, - "members": [ - { - "kind": "Constructor", - "canonicalReference": "@tldraw/validate!T.DictValidator:constructor(1)", - "docComment": "/**\n * Constructs a new instance of the `DictValidator` class\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "constructor(keyValidator: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ", valueValidator: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ");" - } - ], - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "keyValidator", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "isOptional": false - }, - { - "parameterName": "valueValidator", - "parameterTypeTokenRange": { - "startIndex": 4, - "endIndex": 6 - }, - "isOptional": false - } - ] - }, - { - "kind": "Property", - "canonicalReference": "@tldraw/validate!T.DictValidator#keyValidator:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "readonly keyValidator: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isReadonly": true, - "isOptional": false, - "releaseTag": "Public", - "name": "keyValidator", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "isStatic": false, - "isProtected": false, - "isAbstract": false - }, - { - "kind": "Property", - "canonicalReference": "@tldraw/validate!T.DictValidator#valueValidator:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "readonly valueValidator: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isReadonly": true, - "isOptional": false, - "releaseTag": "Public", - "name": "valueValidator", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "isStatic": false, - "isProtected": false, - "isAbstract": false - } - ], - "extendsTokenRange": { - "startIndex": 3, - "endIndex": 7 - }, - "implementsTokenRanges": [] - }, - { - "kind": "Variable", - "canonicalReference": "@tldraw/validate!T.integer:var", - "docComment": "/**\n * Fails if number is not an integer\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "integer: " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "isReadonly": true, - "releaseTag": "Public", - "name": "integer", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - } - }, - { - "kind": "Function", - "canonicalReference": "@tldraw/validate!T.jsonDict:function(1)", - "docComment": "/**\n * Validate an object has a particular shape.\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare function jsonDict(): " - }, - { - "kind": "Reference", - "text": "DictValidator", - "canonicalReference": "@tldraw/validate!DictValidator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "returnTypeTokenRange": { - "startIndex": 1, - "endIndex": 5 - }, - "releaseTag": "Public", - "overloadIndex": 1, - "parameters": [], - "name": "jsonDict" - }, - { - "kind": "Variable", - "canonicalReference": "@tldraw/validate!T.jsonValue:var", - "docComment": "/**\n * Validate that a value is valid JSON.\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "jsonValue: " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "JsonValue", - "canonicalReference": "@tldraw/utils!JsonValue:type" - }, - { - "kind": "Content", - "text": ">" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "isReadonly": true, - "releaseTag": "Public", - "name": "jsonValue", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 5 - } - }, - { - "kind": "Variable", - "canonicalReference": "@tldraw/validate!T.linkUrl:var", - "docComment": "/**\n * Validates that a value is a url safe to use as a link.\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "linkUrl: " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "isReadonly": true, - "releaseTag": "Public", - "name": "linkUrl", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - } - }, - { - "kind": "Function", - "canonicalReference": "@tldraw/validate!T.literal:function(1)", - "docComment": "/**\n * Validates that a value matches another that was passed in.\n *\n * @example\n * ```ts\n * const trueValidator = T.literal(true)\n * ```\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare function literal(expectedValue: " - }, - { - "kind": "Content", - "text": "T" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "returnTypeTokenRange": { - "startIndex": 5, - "endIndex": 7 - }, - "releaseTag": "Public", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "expectedValue", - "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 - }, - "isOptional": false - } - ], - "typeParameters": [ - { - "typeParameterName": "T", - "constraintTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "name": "literal" - }, - { - "kind": "Function", - "canonicalReference": "@tldraw/validate!T.literalEnum:function(1)", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare function literalEnum(...values: " - }, - { - "kind": "Content", - "text": "Values" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "returnTypeTokenRange": { - "startIndex": 5, - "endIndex": 7 - }, - "releaseTag": "Public", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "values", - "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 - }, - "isOptional": false - } - ], - "typeParameters": [ - { - "typeParameterName": "Values", - "constraintTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "name": "literalEnum" - }, - { - "kind": "Function", - "canonicalReference": "@tldraw/validate!T.model:function(1)", - "docComment": "/**\n * A named object with an ID. Errors will be reported as being part of the object with the given name.\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare function model(name: " - }, - { - "kind": "Content", - "text": "string" - }, - { - "kind": "Content", - "text": ", validator: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "returnTypeTokenRange": { - "startIndex": 8, - "endIndex": 10 - }, - "releaseTag": "Public", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "name", - "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 - }, - "isOptional": false - }, - { - "parameterName": "validator", - "parameterTypeTokenRange": { - "startIndex": 5, - "endIndex": 7 - }, - "isOptional": false - } - ], - "typeParameters": [ - { - "typeParameterName": "T", - "constraintTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "name": "model" - }, - { - "kind": "Variable", - "canonicalReference": "@tldraw/validate!T.nonZeroInteger:var", - "docComment": "/**\n * Fails if value \\<= 0 and is not an integer\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "nonZeroInteger: " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "isReadonly": true, - "releaseTag": "Public", - "name": "nonZeroInteger", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - } - }, - { - "kind": "Variable", - "canonicalReference": "@tldraw/validate!T.nonZeroNumber:var", - "docComment": "/**\n * Fails if value \\<= 0\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "nonZeroNumber: " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "isReadonly": true, - "releaseTag": "Public", - "name": "nonZeroNumber", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - } - }, - { - "kind": "Function", - "canonicalReference": "@tldraw/validate!T.nullable:function(1)", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare function nullable(validator: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "returnTypeTokenRange": { - "startIndex": 4, - "endIndex": 6 - }, - "releaseTag": "Public", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "validator", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "isOptional": false - } - ], - "typeParameters": [ - { - "typeParameterName": "T", - "constraintTokenRange": { - "startIndex": 0, - "endIndex": 0 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "name": "nullable" - }, - { - "kind": "Variable", - "canonicalReference": "@tldraw/validate!T.number:var", - "docComment": "/**\n * Validates that a value is a finite non-NaN number.\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "number: " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "isReadonly": true, - "releaseTag": "Public", - "name": "number", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - } - }, - { - "kind": "Function", - "canonicalReference": "@tldraw/validate!T.object:function(1)", - "docComment": "/**\n * Validate an object has a particular shape.\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare function object(config: " - }, - { - "kind": "Content", - "text": "{\n readonly [K in keyof Shape]: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": ";\n}" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "ObjectValidator", - "canonicalReference": "@tldraw/validate!ObjectValidator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "returnTypeTokenRange": { - "startIndex": 7, - "endIndex": 9 - }, - "releaseTag": "Public", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "config", - "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 6 - }, - "isOptional": false - } - ], - "typeParameters": [ - { - "typeParameterName": "Shape", - "constraintTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "name": "object" - }, - { - "kind": "Class", - "canonicalReference": "@tldraw/validate!T.ObjectValidator:class", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare class ObjectValidator extends " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": " " - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "releaseTag": "Public", - "typeParameters": [ - { - "typeParameterName": "Shape", - "constraintTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "isAbstract": false, - "name": "ObjectValidator", - "preserveMemberOrder": false, - "members": [ - { - "kind": "Constructor", - "canonicalReference": "@tldraw/validate!T.ObjectValidator:constructor(1)", - "docComment": "/**\n * Constructs a new instance of the `ObjectValidator` class\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "constructor(config: " - }, - { - "kind": "Content", - "text": "{\n readonly [K in keyof Shape]: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": ";\n }" - }, - { - "kind": "Content", - "text": ", shouldAllowUnknownProperties?: " - }, - { - "kind": "Content", - "text": "boolean" - }, - { - "kind": "Content", - "text": ");" - } - ], - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "config", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 4 - }, - "isOptional": false - }, - { - "parameterName": "shouldAllowUnknownProperties", - "parameterTypeTokenRange": { - "startIndex": 5, - "endIndex": 6 - }, - "isOptional": true - } - ] - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!T.ObjectValidator#allowUnknownProperties:member(1)", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "allowUnknownProperties(): " - }, - { - "kind": "Reference", - "text": "ObjectValidator", - "canonicalReference": "@tldraw/validate!ObjectValidator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [], - "isOptional": false, - "isAbstract": false, - "name": "allowUnknownProperties" - }, - { - "kind": "Property", - "canonicalReference": "@tldraw/validate!T.ObjectValidator#config:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "readonly config: " - }, - { - "kind": "Content", - "text": "{\n readonly [K in keyof Shape]: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": ";\n }" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isReadonly": true, - "isOptional": false, - "releaseTag": "Public", - "name": "config", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 4 - }, - "isStatic": false, - "isProtected": false, - "isAbstract": false - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!T.ObjectValidator#extend:member(1)", - "docComment": "/**\n * Extend an object validator by adding additional properties.\n *\n * @example\n * ```ts\n * const animalValidator = T.object({\n * \tname: T.string,\n * })\n * const catValidator = animalValidator.extend({\n * \tmeowVolume: T.number,\n * })\n * ```\n *\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "extend" - }, - { - "kind": "Content", - "text": ">(extension: " - }, - { - "kind": "Content", - "text": "{\n readonly [K in keyof Extension]: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": ";\n }" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "ObjectValidator", - "canonicalReference": "@tldraw/validate!ObjectValidator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "typeParameters": [ - { - "typeParameterName": "Extension", - "constraintTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 8, - "endIndex": 10 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "extension", - "parameterTypeTokenRange": { - "startIndex": 4, - "endIndex": 7 - }, - "isOptional": false - } - ], - "isOptional": false, - "isAbstract": false, - "name": "extend" - } - ], - "extendsTokenRange": { - "startIndex": 3, - "endIndex": 5 - }, - "implementsTokenRanges": [] - }, - { - "kind": "Function", - "canonicalReference": "@tldraw/validate!T.optional:function(1)", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare function optional(validator: " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "returnTypeTokenRange": { - "startIndex": 4, - "endIndex": 6 - }, - "releaseTag": "Public", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "validator", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "isOptional": false - } - ], - "typeParameters": [ - { - "typeParameterName": "T", - "constraintTokenRange": { - "startIndex": 0, - "endIndex": 0 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "name": "optional" - }, - { - "kind": "Variable", - "canonicalReference": "@tldraw/validate!T.positiveInteger:var", - "docComment": "/**\n * Fails if value \\< 0 and is not an integer\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "positiveInteger: " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "isReadonly": true, - "releaseTag": "Public", - "name": "positiveInteger", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - } - }, - { - "kind": "Variable", - "canonicalReference": "@tldraw/validate!T.positiveNumber:var", - "docComment": "/**\n * Fails if value \\< 0\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "positiveNumber: " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "isReadonly": true, - "releaseTag": "Public", - "name": "positiveNumber", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - } - }, - { - "kind": "Function", - "canonicalReference": "@tldraw/validate!T.setEnum:function(1)", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare function setEnum(values: " - }, - { - "kind": "Reference", - "text": "ReadonlySet", - "canonicalReference": "!ReadonlySet:interface" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "returnTypeTokenRange": { - "startIndex": 4, - "endIndex": 6 - }, - "releaseTag": "Public", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "values", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "isOptional": false - } - ], - "typeParameters": [ - { - "typeParameterName": "T", - "constraintTokenRange": { - "startIndex": 0, - "endIndex": 0 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "name": "setEnum" - }, - { - "kind": "Variable", - "canonicalReference": "@tldraw/validate!T.srcUrl:var", - "docComment": "/**\n * Validates that a valid is a url safe to load as an asset.\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "srcUrl: " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "isReadonly": true, - "releaseTag": "Public", - "name": "srcUrl", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - } - }, - { - "kind": "Variable", - "canonicalReference": "@tldraw/validate!T.string:var", - "docComment": "/**\n * Validates that a value is a string.\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "string: " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "isReadonly": true, - "releaseTag": "Public", - "name": "string", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - } - }, - { - "kind": "TypeAlias", - "canonicalReference": "@tldraw/validate!T.TypeOf:type", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export type TypeOf" - }, - { - "kind": "Content", - "text": "> = " - }, - { - "kind": "Content", - "text": "V extends " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": " ? T : never" - }, - { - "kind": "Content", - "text": ";" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "releaseTag": "Public", - "name": "TypeOf", - "typeParameters": [ - { - "typeParameterName": "V", - "constraintTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "typeTokenRange": { - "startIndex": 4, - "endIndex": 7 - } - }, - { - "kind": "Function", - "canonicalReference": "@tldraw/validate!T.union:function(1)", - "docComment": "/**\n * Validate a union of several object types. Each object must have a property matching `key` which should be a unique string.\n *\n * @example\n * ```ts\n * const catValidator = T.object({ kind: T.value('cat'), meow: T.boolean })\n * const dogValidator = T.object({ kind: T.value('dog'), bark: T.boolean })\n * const animalValidator = T.union('kind', { cat: catValidator, dog: dogValidator })\n * ```\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare function union" - }, - { - "kind": "Content", - "text": ">(key: " - }, - { - "kind": "Content", - "text": "Key" - }, - { - "kind": "Content", - "text": ", config: " - }, - { - "kind": "Content", - "text": "Config" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "UnionValidator", - "canonicalReference": "@tldraw/validate!UnionValidator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "returnTypeTokenRange": { - "startIndex": 10, - "endIndex": 12 - }, - "releaseTag": "Public", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "key", - "parameterTypeTokenRange": { - "startIndex": 6, - "endIndex": 7 - }, - "isOptional": false - }, - { - "parameterName": "config", - "parameterTypeTokenRange": { - "startIndex": 8, - "endIndex": 9 - }, - "isOptional": false - } - ], - "typeParameters": [ - { - "typeParameterName": "Key", - "constraintTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - }, - { - "typeParameterName": "Config", - "constraintTokenRange": { - "startIndex": 3, - "endIndex": 5 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "name": "union" - }, - { - "kind": "Class", - "canonicalReference": "@tldraw/validate!T.UnionValidator:class", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare class UnionValidator" - }, - { - "kind": "Content", - "text": ", UnknownValue = " - }, - { - "kind": "Content", - "text": "never" - }, - { - "kind": "Content", - "text": "> extends " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "TypeOf", - "canonicalReference": "@tldraw/validate!T.TypeOf:type" - }, - { - "kind": "Content", - "text": " | UnknownValue>" - }, - { - "kind": "Content", - "text": " " - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "releaseTag": "Public", - "typeParameters": [ - { - "typeParameterName": "Key", - "constraintTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - }, - { - "typeParameterName": "Config", - "constraintTokenRange": { - "startIndex": 3, - "endIndex": 5 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - }, - { - "typeParameterName": "UnknownValue", - "constraintTokenRange": { - "startIndex": 0, - "endIndex": 0 - }, - "defaultTypeTokenRange": { - "startIndex": 6, - "endIndex": 7 - } - } - ], - "isAbstract": false, - "name": "UnionValidator", - "preserveMemberOrder": false, - "members": [ - { - "kind": "Constructor", - "canonicalReference": "@tldraw/validate!T.UnionValidator:constructor(1)", - "docComment": "/**\n * Constructs a new instance of the `UnionValidator` class\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "constructor(key: " - }, - { - "kind": "Content", - "text": "Key" - }, - { - "kind": "Content", - "text": ", config: " - }, - { - "kind": "Content", - "text": "Config" - }, - { - "kind": "Content", - "text": ", unknownValueValidation: " - }, - { - "kind": "Content", - "text": "(value: object, variant: string) => UnknownValue" - }, - { - "kind": "Content", - "text": ");" - } - ], - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "key", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isOptional": false - }, - { - "parameterName": "config", - "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 - }, - "isOptional": false - }, - { - "parameterName": "unknownValueValidation", - "parameterTypeTokenRange": { - "startIndex": 5, - "endIndex": 6 - }, - "isOptional": false - } - ] - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!T.UnionValidator#validateUnknownVariants:member(1)", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "validateUnknownVariants(unknownValueValidation: " - }, - { - "kind": "Content", - "text": "(value: object, variant: string) => Unknown" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "UnionValidator", - "canonicalReference": "@tldraw/validate!UnionValidator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "typeParameters": [ - { - "typeParameterName": "Unknown", - "constraintTokenRange": { - "startIndex": 0, - "endIndex": 0 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 5 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "unknownValueValidation", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isOptional": false - } - ], - "isOptional": false, - "isAbstract": false, - "name": "validateUnknownVariants" - } - ], - "extendsTokenRange": { - "startIndex": 8, - "endIndex": 12 - }, - "implementsTokenRanges": [] - }, - { - "kind": "Variable", - "canonicalReference": "@tldraw/validate!T.unknown:var", - "docComment": "/**\n * Validation that accepts any value. Useful as a starting point for building your own custom validations.\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "unknown: " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "isReadonly": true, - "releaseTag": "Public", - "name": "unknown", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - } - }, - { - "kind": "Variable", - "canonicalReference": "@tldraw/validate!T.unknownObject:var", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "unknownObject: " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "Record", - "canonicalReference": "!Record:type" - }, - { - "kind": "Content", - "text": ">" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "isReadonly": true, - "releaseTag": "Public", - "name": "unknownObject", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 5 - } - }, - { - "kind": "TypeAlias", - "canonicalReference": "@tldraw/validate!T.Validatable:type", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export type Validatable = " - }, - { - "kind": "Content", - "text": "{\n validate: (value: unknown) => T;\n}" - }, - { - "kind": "Content", - "text": ";" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "releaseTag": "Public", - "name": "Validatable", - "typeParameters": [ - { - "typeParameterName": "T", - "constraintTokenRange": { - "startIndex": 0, - "endIndex": 0 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "typeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "kind": "Class", - "canonicalReference": "@tldraw/validate!T.ValidationError:class", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare class ValidationError extends " - }, - { - "kind": "Reference", - "text": "Error", - "canonicalReference": "!Error:interface" - }, - { - "kind": "Content", - "text": " " - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "releaseTag": "Public", - "isAbstract": false, - "name": "ValidationError", - "preserveMemberOrder": false, - "members": [ - { - "kind": "Constructor", - "canonicalReference": "@tldraw/validate!T.ValidationError:constructor(1)", - "docComment": "/**\n * Constructs a new instance of the `ValidationError` class\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "constructor(rawMessage: " - }, - { - "kind": "Content", - "text": "string" - }, - { - "kind": "Content", - "text": ", path?: " - }, - { - "kind": "Reference", - "text": "ReadonlyArray", - "canonicalReference": "!ReadonlyArray:interface" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ");" - } - ], - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "rawMessage", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isOptional": false - }, - { - "parameterName": "path", - "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 5 - }, - "isOptional": true - } - ] - }, - { - "kind": "Property", - "canonicalReference": "@tldraw/validate!T.ValidationError#name:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "name: " - }, - { - "kind": "Content", - "text": "string" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isReadonly": false, - "isOptional": false, - "releaseTag": "Public", - "name": "name", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isStatic": false, - "isProtected": false, - "isAbstract": false - }, - { - "kind": "Property", - "canonicalReference": "@tldraw/validate!T.ValidationError#path:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "readonly path: " - }, - { - "kind": "Reference", - "text": "ReadonlyArray", - "canonicalReference": "!ReadonlyArray:interface" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isReadonly": true, - "isOptional": false, - "releaseTag": "Public", - "name": "path", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "isStatic": false, - "isProtected": false, - "isAbstract": false - }, - { - "kind": "Property", - "canonicalReference": "@tldraw/validate!T.ValidationError#rawMessage:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "readonly rawMessage: " - }, - { - "kind": "Content", - "text": "string" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isReadonly": true, - "isOptional": false, - "releaseTag": "Public", - "name": "rawMessage", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isStatic": false, - "isProtected": false, - "isAbstract": false - } - ], - "extendsTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "implementsTokenRanges": [] - }, - { - "kind": "Class", - "canonicalReference": "@tldraw/validate!T.Validator:class", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare class Validator implements " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": " " - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "releaseTag": "Public", - "typeParameters": [ - { - "typeParameterName": "T", - "constraintTokenRange": { - "startIndex": 0, - "endIndex": 0 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "isAbstract": false, - "name": "Validator", - "preserveMemberOrder": false, - "members": [ - { - "kind": "Constructor", - "canonicalReference": "@tldraw/validate!T.Validator:constructor(1)", - "docComment": "/**\n * Constructs a new instance of the `Validator` class\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "constructor(validationFn: " - }, - { - "kind": "Reference", - "text": "ValidatorFn", - "canonicalReference": "@tldraw/validate!T.ValidatorFn:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ");" - } - ], - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "validationFn", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "isOptional": false - } - ] - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!T.Validator#check:member(1)", - "docComment": "/**\n * Refine this validation with an additional check that doesn't change the resulting value.\n *\n * @example\n * ```ts\n * const numberLessThan10Validator = T.number.check((value) => {\n * \tif (value >= 10) {\n * \t\tthrow new ValidationError(`Expected number less than 10, got ${value}`)\n * \t}\n * })\n * ```\n *\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "check(name: " - }, - { - "kind": "Content", - "text": "string" - }, - { - "kind": "Content", - "text": ", checkFn: " - }, - { - "kind": "Content", - "text": "(value: T) => void" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 5, - "endIndex": 7 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "name", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isOptional": false - }, - { - "parameterName": "checkFn", - "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 - }, - "isOptional": false - } - ], - "isOptional": false, - "isAbstract": false, - "name": "check" - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!T.Validator#check:member(2)", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "check(checkFn: " - }, - { - "kind": "Content", - "text": "(value: T) => void" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 5 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 2, - "parameters": [ - { - "parameterName": "checkFn", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isOptional": false - } - ], - "isOptional": false, - "isAbstract": false, - "name": "check" - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!T.Validator#isValid:member(1)", - "docComment": "/**\n * Checks that the passed value is of the correct type.\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "isValid(value: " - }, - { - "kind": "Content", - "text": "unknown" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "value", - "canonicalReference": "@tldraw/validate!~value" - }, - { - "kind": "Content", - "text": " is T" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 5 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "value", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isOptional": false - } - ], - "isOptional": false, - "isAbstract": false, - "name": "isValid" - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!T.Validator#nullable:member(1)", - "docComment": "/**\n * Returns a new validator that also accepts null or undefined. The resulting value will always be null.\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "nullable(): " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [], - "isOptional": false, - "isAbstract": false, - "name": "nullable" - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!T.Validator#optional:member(1)", - "docComment": "/**\n * Returns a new validator that also accepts null or undefined. The resulting value will always be null.\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "optional(): " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [], - "isOptional": false, - "isAbstract": false, - "name": "optional" - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!T.Validator#refine:member(1)", - "docComment": "/**\n * Refine this validation to a new type. The passed-in validation function should throw an error if the value can't be converted to the new type, or return the new type otherwise.\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "refine(otherValidationFn: " - }, - { - "kind": "Content", - "text": "(value: T) => U" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "typeParameters": [ - { - "typeParameterName": "U", - "constraintTokenRange": { - "startIndex": 0, - "endIndex": 0 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 5 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "otherValidationFn", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isOptional": false - } - ], - "isOptional": false, - "isAbstract": false, - "name": "refine" - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!T.Validator#validate:member(1)", - "docComment": "/**\n * Asserts that the passed value is of the correct type and returns it. The returned value is guaranteed to be referentially equal to the passed value.\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "validate(value: " - }, - { - "kind": "Content", - "text": "unknown" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Content", - "text": "T" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "value", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isOptional": false - } - ], - "isOptional": false, - "isAbstract": false, - "name": "validate" - }, - { - "kind": "Property", - "canonicalReference": "@tldraw/validate!T.Validator#validationFn:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "readonly validationFn: " - }, - { - "kind": "Reference", - "text": "ValidatorFn", - "canonicalReference": "@tldraw/validate!T.ValidatorFn:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isReadonly": true, - "isOptional": false, - "releaseTag": "Public", - "name": "validationFn", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "isStatic": false, - "isProtected": false, - "isAbstract": false - } - ], - "implementsTokenRanges": [ - { - "startIndex": 1, - "endIndex": 3 - } - ] - }, - { - "kind": "TypeAlias", - "canonicalReference": "@tldraw/validate!T.ValidatorFn:type", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export type ValidatorFn = " - }, - { - "kind": "Content", - "text": "(value: unknown) => T" - }, - { - "kind": "Content", - "text": ";" - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "releaseTag": "Public", - "name": "ValidatorFn", - "typeParameters": [ - { - "typeParameterName": "T", - "constraintTokenRange": { - "startIndex": 0, - "endIndex": 0 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "typeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - } - ] - }, - { - "kind": "Class", - "canonicalReference": "@tldraw/validate!UnionValidator:class", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare class UnionValidator" - }, - { - "kind": "Content", - "text": ", UnknownValue = " - }, - { - "kind": "Content", - "text": "never" - }, - { - "kind": "Content", - "text": "> extends " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "TypeOf", - "canonicalReference": "@tldraw/validate!T.TypeOf:type" - }, - { - "kind": "Content", - "text": " | UnknownValue>" - }, - { - "kind": "Content", - "text": " " - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "releaseTag": "Public", - "typeParameters": [ - { - "typeParameterName": "Key", - "constraintTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - }, - { - "typeParameterName": "Config", - "constraintTokenRange": { - "startIndex": 3, - "endIndex": 5 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - }, - { - "typeParameterName": "UnknownValue", - "constraintTokenRange": { - "startIndex": 0, - "endIndex": 0 - }, - "defaultTypeTokenRange": { - "startIndex": 6, - "endIndex": 7 - } - } - ], - "isAbstract": false, - "name": "UnionValidator", - "preserveMemberOrder": false, - "members": [ - { - "kind": "Constructor", - "canonicalReference": "@tldraw/validate!UnionValidator:constructor(1)", - "docComment": "/**\n * Constructs a new instance of the `UnionValidator` class\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "constructor(key: " - }, - { - "kind": "Content", - "text": "Key" - }, - { - "kind": "Content", - "text": ", config: " - }, - { - "kind": "Content", - "text": "Config" - }, - { - "kind": "Content", - "text": ", unknownValueValidation: " - }, - { - "kind": "Content", - "text": "(value: object, variant: string) => UnknownValue" - }, - { - "kind": "Content", - "text": ");" - } - ], - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "key", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isOptional": false - }, - { - "parameterName": "config", - "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 - }, - "isOptional": false - }, - { - "parameterName": "unknownValueValidation", - "parameterTypeTokenRange": { - "startIndex": 5, - "endIndex": 6 - }, - "isOptional": false - } - ] - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!UnionValidator#validateUnknownVariants:member(1)", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "validateUnknownVariants(unknownValueValidation: " - }, - { - "kind": "Content", - "text": "(value: object, variant: string) => Unknown" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "UnionValidator", - "canonicalReference": "@tldraw/validate!UnionValidator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "typeParameters": [ - { - "typeParameterName": "Unknown", - "constraintTokenRange": { - "startIndex": 0, - "endIndex": 0 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 5 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "unknownValueValidation", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isOptional": false - } - ], - "isOptional": false, - "isAbstract": false, - "name": "validateUnknownVariants" - } - ], - "extendsTokenRange": { - "startIndex": 8, - "endIndex": 12 - }, - "implementsTokenRanges": [] - }, - { - "kind": "Class", - "canonicalReference": "@tldraw/validate!Validator:class", - "docComment": "/**\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare class Validator implements " - }, - { - "kind": "Reference", - "text": "Validatable", - "canonicalReference": "@tldraw/validate!T.Validatable:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": " " - } - ], - "fileUrlPath": "packages/validate/src/lib/validation.ts", - "releaseTag": "Public", - "typeParameters": [ - { - "typeParameterName": "T", - "constraintTokenRange": { - "startIndex": 0, - "endIndex": 0 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "isAbstract": false, - "name": "Validator", - "preserveMemberOrder": false, - "members": [ - { - "kind": "Constructor", - "canonicalReference": "@tldraw/validate!Validator:constructor(1)", - "docComment": "/**\n * Constructs a new instance of the `Validator` class\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "constructor(validationFn: " - }, - { - "kind": "Reference", - "text": "ValidatorFn", - "canonicalReference": "@tldraw/validate!T.ValidatorFn:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ");" - } - ], - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "validationFn", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "isOptional": false - } - ] - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!Validator#check:member(1)", - "docComment": "/**\n * Refine this validation with an additional check that doesn't change the resulting value.\n *\n * @example\n * ```ts\n * const numberLessThan10Validator = T.number.check((value) => {\n * \tif (value >= 10) {\n * \t\tthrow new ValidationError(`Expected number less than 10, got ${value}`)\n * \t}\n * })\n * ```\n *\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "check(name: " - }, - { - "kind": "Content", - "text": "string" - }, - { - "kind": "Content", - "text": ", checkFn: " - }, - { - "kind": "Content", - "text": "(value: T) => void" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 5, - "endIndex": 7 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "name", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isOptional": false - }, - { - "parameterName": "checkFn", - "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 - }, - "isOptional": false - } - ], - "isOptional": false, - "isAbstract": false, - "name": "check" - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!Validator#check:member(2)", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "check(checkFn: " - }, - { - "kind": "Content", - "text": "(value: T) => void" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 5 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 2, - "parameters": [ - { - "parameterName": "checkFn", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isOptional": false - } - ], - "isOptional": false, - "isAbstract": false, - "name": "check" - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!Validator#isValid:member(1)", - "docComment": "/**\n * Checks that the passed value is of the correct type.\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "isValid(value: " - }, - { - "kind": "Content", - "text": "unknown" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "value", - "canonicalReference": "@tldraw/validate!~value" - }, - { - "kind": "Content", - "text": " is T" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 5 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "value", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isOptional": false - } - ], - "isOptional": false, - "isAbstract": false, - "name": "isValid" - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!Validator#nullable:member(1)", - "docComment": "/**\n * Returns a new validator that also accepts null or undefined. The resulting value will always be null.\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "nullable(): " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [], - "isOptional": false, - "isAbstract": false, - "name": "nullable" - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!Validator#optional:member(1)", - "docComment": "/**\n * Returns a new validator that also accepts null or undefined. The resulting value will always be null.\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "optional(): " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [], - "isOptional": false, - "isAbstract": false, - "name": "optional" - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!Validator#refine:member(1)", - "docComment": "/**\n * Refine this validation to a new type. The passed-in validation function should throw an error if the value can't be converted to the new type, or return the new type otherwise.\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "refine(otherValidationFn: " - }, - { - "kind": "Content", - "text": "(value: T) => U" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "Validator", - "canonicalReference": "@tldraw/validate!Validator:class" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "typeParameters": [ - { - "typeParameterName": "U", - "constraintTokenRange": { - "startIndex": 0, - "endIndex": 0 - }, - "defaultTypeTokenRange": { - "startIndex": 0, - "endIndex": 0 - } - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 5 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "otherValidationFn", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isOptional": false - } - ], - "isOptional": false, - "isAbstract": false, - "name": "refine" - }, - { - "kind": "Method", - "canonicalReference": "@tldraw/validate!Validator#validate:member(1)", - "docComment": "/**\n * Asserts that the passed value is of the correct type and returns it. The returned value is guaranteed to be referentially equal to the passed value.\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "validate(value: " - }, - { - "kind": "Content", - "text": "unknown" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Content", - "text": "T" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 - }, - "releaseTag": "Public", - "isProtected": false, - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "value", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isOptional": false - } - ], - "isOptional": false, - "isAbstract": false, - "name": "validate" - }, - { - "kind": "Property", - "canonicalReference": "@tldraw/validate!Validator#validationFn:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "readonly validationFn: " - }, - { - "kind": "Reference", - "text": "ValidatorFn", - "canonicalReference": "@tldraw/validate!T.ValidatorFn:type" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isReadonly": true, - "isOptional": false, - "releaseTag": "Public", - "name": "validationFn", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "isStatic": false, - "isProtected": false, - "isAbstract": false - } - ], - "implementsTokenRanges": [ - { - "startIndex": 1, - "endIndex": 3 - } - ] - } - ] - } - ] + "metadata": { + "toolPackage": "@microsoft/api-extractor", + "toolVersion": "7.35.4", + "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/validate!", + "docComment": "", + "name": "@tldraw/validate", + "preserveMemberOrder": false, + "members": [ + { + "kind": "EntryPoint", + "canonicalReference": "@tldraw/validate!", + "name": "", + "preserveMemberOrder": false, + "members": [ + { + "kind": "Class", + "canonicalReference": "@tldraw/validate!ArrayOfValidator:class", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare class ArrayOfValidator extends " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": " " + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "releaseTag": "Public", + "typeParameters": [ + { + "typeParameterName": "T", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "isAbstract": false, + "name": "ArrayOfValidator", + "preserveMemberOrder": false, + "members": [ + { + "kind": "Constructor", + "canonicalReference": "@tldraw/validate!ArrayOfValidator:constructor(1)", + "docComment": "/**\n * Constructs a new instance of the `ArrayOfValidator` class\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "constructor(itemValidator: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ");" + } + ], + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "itemValidator", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "isOptional": false + } + ] + }, + { + "kind": "Property", + "canonicalReference": "@tldraw/validate!ArrayOfValidator#itemValidator:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "readonly itemValidator: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isReadonly": true, + "isOptional": false, + "releaseTag": "Public", + "name": "itemValidator", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "isStatic": false, + "isProtected": false, + "isAbstract": false + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!ArrayOfValidator#lengthGreaterThan1:member(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "lengthGreaterThan1(): " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [], + "isOptional": false, + "isAbstract": false, + "name": "lengthGreaterThan1" + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!ArrayOfValidator#nonEmpty:member(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "nonEmpty(): " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [], + "isOptional": false, + "isAbstract": false, + "name": "nonEmpty" + } + ], + "extendsTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "implementsTokenRanges": [] + }, + { + "kind": "Class", + "canonicalReference": "@tldraw/validate!DictValidator:class", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare class DictValidator extends " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "Record", + "canonicalReference": "!Record:type" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": " " + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "releaseTag": "Public", + "typeParameters": [ + { + "typeParameterName": "Key", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + }, + { + "typeParameterName": "Value", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "isAbstract": false, + "name": "DictValidator", + "preserveMemberOrder": false, + "members": [ + { + "kind": "Constructor", + "canonicalReference": "@tldraw/validate!DictValidator:constructor(1)", + "docComment": "/**\n * Constructs a new instance of the `DictValidator` class\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "constructor(keyValidator: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ", valueValidator: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ");" + } + ], + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "keyValidator", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "isOptional": false + }, + { + "parameterName": "valueValidator", + "parameterTypeTokenRange": { + "startIndex": 4, + "endIndex": 6 + }, + "isOptional": false + } + ] + }, + { + "kind": "Property", + "canonicalReference": "@tldraw/validate!DictValidator#keyValidator:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "readonly keyValidator: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isReadonly": true, + "isOptional": false, + "releaseTag": "Public", + "name": "keyValidator", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "isStatic": false, + "isProtected": false, + "isAbstract": false + }, + { + "kind": "Property", + "canonicalReference": "@tldraw/validate!DictValidator#valueValidator:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "readonly valueValidator: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isReadonly": true, + "isOptional": false, + "releaseTag": "Public", + "name": "valueValidator", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "isStatic": false, + "isProtected": false, + "isAbstract": false + } + ], + "extendsTokenRange": { + "startIndex": 3, + "endIndex": 7 + }, + "implementsTokenRanges": [] + }, + { + "kind": "Class", + "canonicalReference": "@tldraw/validate!ObjectValidator:class", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare class ObjectValidator extends " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": " " + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "releaseTag": "Public", + "typeParameters": [ + { + "typeParameterName": "Shape", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "isAbstract": false, + "name": "ObjectValidator", + "preserveMemberOrder": false, + "members": [ + { + "kind": "Constructor", + "canonicalReference": "@tldraw/validate!ObjectValidator:constructor(1)", + "docComment": "/**\n * Constructs a new instance of the `ObjectValidator` class\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "constructor(config: " + }, + { + "kind": "Content", + "text": "{\n readonly [K in keyof Shape]: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": ";\n }" + }, + { + "kind": "Content", + "text": ", shouldAllowUnknownProperties?: " + }, + { + "kind": "Content", + "text": "boolean" + }, + { + "kind": "Content", + "text": ");" + } + ], + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "config", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 4 + }, + "isOptional": false + }, + { + "parameterName": "shouldAllowUnknownProperties", + "parameterTypeTokenRange": { + "startIndex": 5, + "endIndex": 6 + }, + "isOptional": true + } + ] + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!ObjectValidator#allowUnknownProperties:member(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "allowUnknownProperties(): " + }, + { + "kind": "Reference", + "text": "ObjectValidator", + "canonicalReference": "@tldraw/validate!ObjectValidator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [], + "isOptional": false, + "isAbstract": false, + "name": "allowUnknownProperties" + }, + { + "kind": "Property", + "canonicalReference": "@tldraw/validate!ObjectValidator#config:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "readonly config: " + }, + { + "kind": "Content", + "text": "{\n readonly [K in keyof Shape]: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": ";\n }" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isReadonly": true, + "isOptional": false, + "releaseTag": "Public", + "name": "config", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 4 + }, + "isStatic": false, + "isProtected": false, + "isAbstract": false + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!ObjectValidator#extend:member(1)", + "docComment": "/**\n * Extend an object validator by adding additional properties.\n *\n * @example\n * ```ts\n * const animalValidator = T.object({\n * \tname: T.string,\n * })\n * const catValidator = animalValidator.extend({\n * \tmeowVolume: T.number,\n * })\n * ```\n *\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "extend" + }, + { + "kind": "Content", + "text": ">(extension: " + }, + { + "kind": "Content", + "text": "{\n readonly [K in keyof Extension]: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": ";\n }" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "ObjectValidator", + "canonicalReference": "@tldraw/validate!ObjectValidator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "typeParameters": [ + { + "typeParameterName": "Extension", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 8, + "endIndex": 10 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "extension", + "parameterTypeTokenRange": { + "startIndex": 4, + "endIndex": 7 + }, + "isOptional": false + } + ], + "isOptional": false, + "isAbstract": false, + "name": "extend" + } + ], + "extendsTokenRange": { + "startIndex": 3, + "endIndex": 5 + }, + "implementsTokenRanges": [] + }, + { + "kind": "Namespace", + "canonicalReference": "@tldraw/validate!T:namespace", + "docComment": "", + "excerptTokens": [], + "fileUrlPath": "packages/validate/src/index.ts", + "releaseTag": "None", + "name": "T", + "preserveMemberOrder": false, + "members": [ + { + "kind": "Variable", + "canonicalReference": "@tldraw/validate!T.any:var", + "docComment": "/**\n * Validation that accepts any value. Generally this should be avoided, but you can use it as an escape hatch if you want to work without validations for e.g. a prototype.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "any: " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "isReadonly": true, + "releaseTag": "Public", + "name": "any", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "Variable", + "canonicalReference": "@tldraw/validate!T.array:var", + "docComment": "/**\n * Validates that a value is an array. To check the contents of the array, use T.arrayOf.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "array: " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "isReadonly": true, + "releaseTag": "Public", + "name": "array", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "Function", + "canonicalReference": "@tldraw/validate!T.arrayOf:function(1)", + "docComment": "/**\n * Validates that a value is an array whose contents matches the passed-in validator.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function arrayOf(itemValidator: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "ArrayOfValidator", + "canonicalReference": "@tldraw/validate!ArrayOfValidator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "returnTypeTokenRange": { + "startIndex": 4, + "endIndex": 6 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "itemValidator", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "isOptional": false + } + ], + "typeParameters": [ + { + "typeParameterName": "T", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "name": "arrayOf" + }, + { + "kind": "Class", + "canonicalReference": "@tldraw/validate!T.ArrayOfValidator:class", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare class ArrayOfValidator extends " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": " " + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "releaseTag": "Public", + "typeParameters": [ + { + "typeParameterName": "T", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "isAbstract": false, + "name": "ArrayOfValidator", + "preserveMemberOrder": false, + "members": [ + { + "kind": "Constructor", + "canonicalReference": "@tldraw/validate!T.ArrayOfValidator:constructor(1)", + "docComment": "/**\n * Constructs a new instance of the `ArrayOfValidator` class\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "constructor(itemValidator: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ");" + } + ], + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "itemValidator", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "isOptional": false + } + ] + }, + { + "kind": "Property", + "canonicalReference": "@tldraw/validate!T.ArrayOfValidator#itemValidator:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "readonly itemValidator: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isReadonly": true, + "isOptional": false, + "releaseTag": "Public", + "name": "itemValidator", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "isStatic": false, + "isProtected": false, + "isAbstract": false + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!T.ArrayOfValidator#lengthGreaterThan1:member(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "lengthGreaterThan1(): " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [], + "isOptional": false, + "isAbstract": false, + "name": "lengthGreaterThan1" + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!T.ArrayOfValidator#nonEmpty:member(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "nonEmpty(): " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [], + "isOptional": false, + "isAbstract": false, + "name": "nonEmpty" + } + ], + "extendsTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "implementsTokenRanges": [] + }, + { + "kind": "Variable", + "canonicalReference": "@tldraw/validate!T.bigint:var", + "docComment": "/**\n * Validates that a value is a bigint.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "bigint: " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "isReadonly": true, + "releaseTag": "Public", + "name": "bigint", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "Variable", + "canonicalReference": "@tldraw/validate!T.boolean:var", + "docComment": "/**\n * Validates that a value is boolean.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "boolean: " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "isReadonly": true, + "releaseTag": "Public", + "name": "boolean", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "Function", + "canonicalReference": "@tldraw/validate!T.dict:function(1)", + "docComment": "/**\n * Validation that an option is a dict with particular keys and values.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function dict(keyValidator: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ", valueValidator: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "DictValidator", + "canonicalReference": "@tldraw/validate!DictValidator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "returnTypeTokenRange": { + "startIndex": 9, + "endIndex": 11 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "keyValidator", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 5 + }, + "isOptional": false + }, + { + "parameterName": "valueValidator", + "parameterTypeTokenRange": { + "startIndex": 6, + "endIndex": 8 + }, + "isOptional": false + } + ], + "typeParameters": [ + { + "typeParameterName": "Key", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + }, + { + "typeParameterName": "Value", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "name": "dict" + }, + { + "kind": "Class", + "canonicalReference": "@tldraw/validate!T.DictValidator:class", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare class DictValidator extends " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "Record", + "canonicalReference": "!Record:type" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": " " + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "releaseTag": "Public", + "typeParameters": [ + { + "typeParameterName": "Key", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + }, + { + "typeParameterName": "Value", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "isAbstract": false, + "name": "DictValidator", + "preserveMemberOrder": false, + "members": [ + { + "kind": "Constructor", + "canonicalReference": "@tldraw/validate!T.DictValidator:constructor(1)", + "docComment": "/**\n * Constructs a new instance of the `DictValidator` class\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "constructor(keyValidator: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ", valueValidator: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ");" + } + ], + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "keyValidator", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "isOptional": false + }, + { + "parameterName": "valueValidator", + "parameterTypeTokenRange": { + "startIndex": 4, + "endIndex": 6 + }, + "isOptional": false + } + ] + }, + { + "kind": "Property", + "canonicalReference": "@tldraw/validate!T.DictValidator#keyValidator:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "readonly keyValidator: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isReadonly": true, + "isOptional": false, + "releaseTag": "Public", + "name": "keyValidator", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "isStatic": false, + "isProtected": false, + "isAbstract": false + }, + { + "kind": "Property", + "canonicalReference": "@tldraw/validate!T.DictValidator#valueValidator:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "readonly valueValidator: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isReadonly": true, + "isOptional": false, + "releaseTag": "Public", + "name": "valueValidator", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "isStatic": false, + "isProtected": false, + "isAbstract": false + } + ], + "extendsTokenRange": { + "startIndex": 3, + "endIndex": 7 + }, + "implementsTokenRanges": [] + }, + { + "kind": "Variable", + "canonicalReference": "@tldraw/validate!T.integer:var", + "docComment": "/**\n * Fails if number is not an integer\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "integer: " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "isReadonly": true, + "releaseTag": "Public", + "name": "integer", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "Function", + "canonicalReference": "@tldraw/validate!T.jsonDict:function(1)", + "docComment": "/**\n * Validate an object has a particular shape.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function jsonDict(): " + }, + { + "kind": "Reference", + "text": "DictValidator", + "canonicalReference": "@tldraw/validate!DictValidator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 5 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [], + "name": "jsonDict" + }, + { + "kind": "Variable", + "canonicalReference": "@tldraw/validate!T.jsonValue:var", + "docComment": "/**\n * Validate that a value is valid JSON.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "jsonValue: " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "JsonValue", + "canonicalReference": "@tldraw/utils!JsonValue:type" + }, + { + "kind": "Content", + "text": ">" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "isReadonly": true, + "releaseTag": "Public", + "name": "jsonValue", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 5 + } + }, + { + "kind": "Variable", + "canonicalReference": "@tldraw/validate!T.linkUrl:var", + "docComment": "/**\n * Validates that a value is a url safe to use as a link.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "linkUrl: " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "isReadonly": true, + "releaseTag": "Public", + "name": "linkUrl", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "Function", + "canonicalReference": "@tldraw/validate!T.literal:function(1)", + "docComment": "/**\n * Validates that a value matches another that was passed in.\n *\n * @example\n * ```ts\n * const trueValidator = T.literal(true)\n * ```\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function literal(expectedValue: " + }, + { + "kind": "Content", + "text": "T" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "returnTypeTokenRange": { + "startIndex": 5, + "endIndex": 7 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "expectedValue", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "isOptional": false + } + ], + "typeParameters": [ + { + "typeParameterName": "T", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "name": "literal" + }, + { + "kind": "Function", + "canonicalReference": "@tldraw/validate!T.literalEnum:function(1)", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function literalEnum(...values: " + }, + { + "kind": "Content", + "text": "Values" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "returnTypeTokenRange": { + "startIndex": 5, + "endIndex": 7 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "values", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "isOptional": false + } + ], + "typeParameters": [ + { + "typeParameterName": "Values", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "name": "literalEnum" + }, + { + "kind": "Function", + "canonicalReference": "@tldraw/validate!T.model:function(1)", + "docComment": "/**\n * A named object with an ID. Errors will be reported as being part of the object with the given name.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function model(name: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ", validator: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "returnTypeTokenRange": { + "startIndex": 8, + "endIndex": 10 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "name", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "isOptional": false + }, + { + "parameterName": "validator", + "parameterTypeTokenRange": { + "startIndex": 5, + "endIndex": 7 + }, + "isOptional": false + } + ], + "typeParameters": [ + { + "typeParameterName": "T", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "name": "model" + }, + { + "kind": "Variable", + "canonicalReference": "@tldraw/validate!T.nonZeroInteger:var", + "docComment": "/**\n * Fails if value \\<= 0 and is not an integer\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "nonZeroInteger: " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "isReadonly": true, + "releaseTag": "Public", + "name": "nonZeroInteger", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "Variable", + "canonicalReference": "@tldraw/validate!T.nonZeroNumber:var", + "docComment": "/**\n * Fails if value \\<= 0\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "nonZeroNumber: " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "isReadonly": true, + "releaseTag": "Public", + "name": "nonZeroNumber", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "Function", + "canonicalReference": "@tldraw/validate!T.nullable:function(1)", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function nullable(validator: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "returnTypeTokenRange": { + "startIndex": 4, + "endIndex": 6 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "validator", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "isOptional": false + } + ], + "typeParameters": [ + { + "typeParameterName": "T", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "name": "nullable" + }, + { + "kind": "Variable", + "canonicalReference": "@tldraw/validate!T.number:var", + "docComment": "/**\n * Validates that a value is a finite non-NaN number.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "number: " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "isReadonly": true, + "releaseTag": "Public", + "name": "number", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "Function", + "canonicalReference": "@tldraw/validate!T.object:function(1)", + "docComment": "/**\n * Validate an object has a particular shape.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function object(config: " + }, + { + "kind": "Content", + "text": "{\n readonly [K in keyof Shape]: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": ";\n}" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "ObjectValidator", + "canonicalReference": "@tldraw/validate!ObjectValidator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "returnTypeTokenRange": { + "startIndex": 7, + "endIndex": 9 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "config", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 6 + }, + "isOptional": false + } + ], + "typeParameters": [ + { + "typeParameterName": "Shape", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "name": "object" + }, + { + "kind": "Class", + "canonicalReference": "@tldraw/validate!T.ObjectValidator:class", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare class ObjectValidator extends " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": " " + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "releaseTag": "Public", + "typeParameters": [ + { + "typeParameterName": "Shape", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "isAbstract": false, + "name": "ObjectValidator", + "preserveMemberOrder": false, + "members": [ + { + "kind": "Constructor", + "canonicalReference": "@tldraw/validate!T.ObjectValidator:constructor(1)", + "docComment": "/**\n * Constructs a new instance of the `ObjectValidator` class\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "constructor(config: " + }, + { + "kind": "Content", + "text": "{\n readonly [K in keyof Shape]: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": ";\n }" + }, + { + "kind": "Content", + "text": ", shouldAllowUnknownProperties?: " + }, + { + "kind": "Content", + "text": "boolean" + }, + { + "kind": "Content", + "text": ");" + } + ], + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "config", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 4 + }, + "isOptional": false + }, + { + "parameterName": "shouldAllowUnknownProperties", + "parameterTypeTokenRange": { + "startIndex": 5, + "endIndex": 6 + }, + "isOptional": true + } + ] + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!T.ObjectValidator#allowUnknownProperties:member(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "allowUnknownProperties(): " + }, + { + "kind": "Reference", + "text": "ObjectValidator", + "canonicalReference": "@tldraw/validate!ObjectValidator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [], + "isOptional": false, + "isAbstract": false, + "name": "allowUnknownProperties" + }, + { + "kind": "Property", + "canonicalReference": "@tldraw/validate!T.ObjectValidator#config:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "readonly config: " + }, + { + "kind": "Content", + "text": "{\n readonly [K in keyof Shape]: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": ";\n }" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isReadonly": true, + "isOptional": false, + "releaseTag": "Public", + "name": "config", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 4 + }, + "isStatic": false, + "isProtected": false, + "isAbstract": false + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!T.ObjectValidator#extend:member(1)", + "docComment": "/**\n * Extend an object validator by adding additional properties.\n *\n * @example\n * ```ts\n * const animalValidator = T.object({\n * \tname: T.string,\n * })\n * const catValidator = animalValidator.extend({\n * \tmeowVolume: T.number,\n * })\n * ```\n *\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "extend" + }, + { + "kind": "Content", + "text": ">(extension: " + }, + { + "kind": "Content", + "text": "{\n readonly [K in keyof Extension]: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": ";\n }" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "ObjectValidator", + "canonicalReference": "@tldraw/validate!ObjectValidator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "typeParameters": [ + { + "typeParameterName": "Extension", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 8, + "endIndex": 10 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "extension", + "parameterTypeTokenRange": { + "startIndex": 4, + "endIndex": 7 + }, + "isOptional": false + } + ], + "isOptional": false, + "isAbstract": false, + "name": "extend" + } + ], + "extendsTokenRange": { + "startIndex": 3, + "endIndex": 5 + }, + "implementsTokenRanges": [] + }, + { + "kind": "Function", + "canonicalReference": "@tldraw/validate!T.optional:function(1)", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function optional(validator: " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "returnTypeTokenRange": { + "startIndex": 4, + "endIndex": 6 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "validator", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "isOptional": false + } + ], + "typeParameters": [ + { + "typeParameterName": "T", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "name": "optional" + }, + { + "kind": "Variable", + "canonicalReference": "@tldraw/validate!T.positiveInteger:var", + "docComment": "/**\n * Fails if value \\< 0 and is not an integer\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "positiveInteger: " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "isReadonly": true, + "releaseTag": "Public", + "name": "positiveInteger", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "Variable", + "canonicalReference": "@tldraw/validate!T.positiveNumber:var", + "docComment": "/**\n * Fails if value \\< 0\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "positiveNumber: " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "isReadonly": true, + "releaseTag": "Public", + "name": "positiveNumber", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "Function", + "canonicalReference": "@tldraw/validate!T.setEnum:function(1)", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function setEnum(values: " + }, + { + "kind": "Reference", + "text": "ReadonlySet", + "canonicalReference": "!ReadonlySet:interface" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "returnTypeTokenRange": { + "startIndex": 4, + "endIndex": 6 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "values", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "isOptional": false + } + ], + "typeParameters": [ + { + "typeParameterName": "T", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "name": "setEnum" + }, + { + "kind": "Variable", + "canonicalReference": "@tldraw/validate!T.srcUrl:var", + "docComment": "/**\n * Validates that a valid is a url safe to load as an asset.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "srcUrl: " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "isReadonly": true, + "releaseTag": "Public", + "name": "srcUrl", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "Variable", + "canonicalReference": "@tldraw/validate!T.string:var", + "docComment": "/**\n * Validates that a value is a string.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "string: " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "isReadonly": true, + "releaseTag": "Public", + "name": "string", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@tldraw/validate!T.TypeOf:type", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export type TypeOf" + }, + { + "kind": "Content", + "text": "> = " + }, + { + "kind": "Content", + "text": "V extends " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": " ? T : never" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "releaseTag": "Public", + "name": "TypeOf", + "typeParameters": [ + { + "typeParameterName": "V", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "typeTokenRange": { + "startIndex": 4, + "endIndex": 7 + } + }, + { + "kind": "Function", + "canonicalReference": "@tldraw/validate!T.union:function(1)", + "docComment": "/**\n * Validate a union of several object types. Each object must have a property matching `key` which should be a unique string.\n *\n * @example\n * ```ts\n * const catValidator = T.object({ kind: T.value('cat'), meow: T.boolean })\n * const dogValidator = T.object({ kind: T.value('dog'), bark: T.boolean })\n * const animalValidator = T.union('kind', { cat: catValidator, dog: dogValidator })\n * ```\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function union" + }, + { + "kind": "Content", + "text": ">(key: " + }, + { + "kind": "Content", + "text": "Key" + }, + { + "kind": "Content", + "text": ", config: " + }, + { + "kind": "Content", + "text": "Config" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "UnionValidator", + "canonicalReference": "@tldraw/validate!UnionValidator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "returnTypeTokenRange": { + "startIndex": 10, + "endIndex": 12 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "key", + "parameterTypeTokenRange": { + "startIndex": 6, + "endIndex": 7 + }, + "isOptional": false + }, + { + "parameterName": "config", + "parameterTypeTokenRange": { + "startIndex": 8, + "endIndex": 9 + }, + "isOptional": false + } + ], + "typeParameters": [ + { + "typeParameterName": "Key", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + }, + { + "typeParameterName": "Config", + "constraintTokenRange": { + "startIndex": 3, + "endIndex": 5 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "name": "union" + }, + { + "kind": "Class", + "canonicalReference": "@tldraw/validate!T.UnionValidator:class", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare class UnionValidator" + }, + { + "kind": "Content", + "text": ", UnknownValue = " + }, + { + "kind": "Content", + "text": "never" + }, + { + "kind": "Content", + "text": "> extends " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "TypeOf", + "canonicalReference": "@tldraw/validate!T.TypeOf:type" + }, + { + "kind": "Content", + "text": " | UnknownValue>" + }, + { + "kind": "Content", + "text": " " + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "releaseTag": "Public", + "typeParameters": [ + { + "typeParameterName": "Key", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + }, + { + "typeParameterName": "Config", + "constraintTokenRange": { + "startIndex": 3, + "endIndex": 5 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + }, + { + "typeParameterName": "UnknownValue", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 6, + "endIndex": 7 + } + } + ], + "isAbstract": false, + "name": "UnionValidator", + "preserveMemberOrder": false, + "members": [ + { + "kind": "Constructor", + "canonicalReference": "@tldraw/validate!T.UnionValidator:constructor(1)", + "docComment": "/**\n * Constructs a new instance of the `UnionValidator` class\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "constructor(key: " + }, + { + "kind": "Content", + "text": "Key" + }, + { + "kind": "Content", + "text": ", config: " + }, + { + "kind": "Content", + "text": "Config" + }, + { + "kind": "Content", + "text": ", unknownValueValidation: " + }, + { + "kind": "Content", + "text": "(value: object, variant: string) => UnknownValue" + }, + { + "kind": "Content", + "text": ");" + } + ], + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "key", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + }, + { + "parameterName": "config", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "isOptional": false + }, + { + "parameterName": "unknownValueValidation", + "parameterTypeTokenRange": { + "startIndex": 5, + "endIndex": 6 + }, + "isOptional": false + } + ] + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!T.UnionValidator#validateUnknownVariants:member(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "validateUnknownVariants(unknownValueValidation: " + }, + { + "kind": "Content", + "text": "(value: object, variant: string) => Unknown" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "UnionValidator", + "canonicalReference": "@tldraw/validate!UnionValidator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "typeParameters": [ + { + "typeParameterName": "Unknown", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 5 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "unknownValueValidation", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "isOptional": false, + "isAbstract": false, + "name": "validateUnknownVariants" + } + ], + "extendsTokenRange": { + "startIndex": 8, + "endIndex": 12 + }, + "implementsTokenRanges": [] + }, + { + "kind": "Variable", + "canonicalReference": "@tldraw/validate!T.unknown:var", + "docComment": "/**\n * Validation that accepts any value. Useful as a starting point for building your own custom validations.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "unknown: " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "isReadonly": true, + "releaseTag": "Public", + "name": "unknown", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "Variable", + "canonicalReference": "@tldraw/validate!T.unknownObject:var", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "unknownObject: " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "Record", + "canonicalReference": "!Record:type" + }, + { + "kind": "Content", + "text": ">" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "isReadonly": true, + "releaseTag": "Public", + "name": "unknownObject", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 5 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@tldraw/validate!T.Validatable:type", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export type Validatable = " + }, + { + "kind": "Content", + "text": "{\n validate: (value: unknown) => T;\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "releaseTag": "Public", + "name": "Validatable", + "typeParameters": [ + { + "typeParameterName": "T", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "typeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "Class", + "canonicalReference": "@tldraw/validate!T.ValidationError:class", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare class ValidationError extends " + }, + { + "kind": "Reference", + "text": "Error", + "canonicalReference": "!Error:interface" + }, + { + "kind": "Content", + "text": " " + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "releaseTag": "Public", + "isAbstract": false, + "name": "ValidationError", + "preserveMemberOrder": false, + "members": [ + { + "kind": "Constructor", + "canonicalReference": "@tldraw/validate!T.ValidationError:constructor(1)", + "docComment": "/**\n * Constructs a new instance of the `ValidationError` class\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "constructor(rawMessage: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ", path?: " + }, + { + "kind": "Reference", + "text": "ReadonlyArray", + "canonicalReference": "!ReadonlyArray:interface" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ");" + } + ], + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "rawMessage", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + }, + { + "parameterName": "path", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 5 + }, + "isOptional": true + } + ] + }, + { + "kind": "Property", + "canonicalReference": "@tldraw/validate!T.ValidationError#name:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "name: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isReadonly": false, + "isOptional": false, + "releaseTag": "Public", + "name": "name", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isStatic": false, + "isProtected": false, + "isAbstract": false + }, + { + "kind": "Property", + "canonicalReference": "@tldraw/validate!T.ValidationError#path:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "readonly path: " + }, + { + "kind": "Reference", + "text": "ReadonlyArray", + "canonicalReference": "!ReadonlyArray:interface" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isReadonly": true, + "isOptional": false, + "releaseTag": "Public", + "name": "path", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "isStatic": false, + "isProtected": false, + "isAbstract": false + }, + { + "kind": "Property", + "canonicalReference": "@tldraw/validate!T.ValidationError#rawMessage:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "readonly rawMessage: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isReadonly": true, + "isOptional": false, + "releaseTag": "Public", + "name": "rawMessage", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isStatic": false, + "isProtected": false, + "isAbstract": false + } + ], + "extendsTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "implementsTokenRanges": [] + }, + { + "kind": "Class", + "canonicalReference": "@tldraw/validate!T.Validator:class", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare class Validator implements " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": " " + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "releaseTag": "Public", + "typeParameters": [ + { + "typeParameterName": "T", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "isAbstract": false, + "name": "Validator", + "preserveMemberOrder": false, + "members": [ + { + "kind": "Constructor", + "canonicalReference": "@tldraw/validate!T.Validator:constructor(1)", + "docComment": "/**\n * Constructs a new instance of the `Validator` class\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "constructor(validationFn: " + }, + { + "kind": "Reference", + "text": "ValidatorFn", + "canonicalReference": "@tldraw/validate!T.ValidatorFn:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ");" + } + ], + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "validationFn", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "isOptional": false + } + ] + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!T.Validator#check:member(1)", + "docComment": "/**\n * Refine this validation with an additional check that doesn't change the resulting value.\n *\n * @example\n * ```ts\n * const numberLessThan10Validator = T.number.check((value) => {\n * \tif (value >= 10) {\n * \t\tthrow new ValidationError(`Expected number less than 10, got ${value}`)\n * \t}\n * })\n * ```\n *\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "check(name: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ", checkFn: " + }, + { + "kind": "Content", + "text": "(value: T) => void" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 5, + "endIndex": 7 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "name", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + }, + { + "parameterName": "checkFn", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "isOptional": false + } + ], + "isOptional": false, + "isAbstract": false, + "name": "check" + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!T.Validator#check:member(2)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "check(checkFn: " + }, + { + "kind": "Content", + "text": "(value: T) => void" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 5 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 2, + "parameters": [ + { + "parameterName": "checkFn", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "isOptional": false, + "isAbstract": false, + "name": "check" + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!T.Validator#isValid:member(1)", + "docComment": "/**\n * Checks that the passed value is of the correct type.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "isValid(value: " + }, + { + "kind": "Content", + "text": "unknown" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "value", + "canonicalReference": "@tldraw/validate!~value" + }, + { + "kind": "Content", + "text": " is T" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 5 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "value", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "isOptional": false, + "isAbstract": false, + "name": "isValid" + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!T.Validator#nullable:member(1)", + "docComment": "/**\n * Returns a new validator that also accepts null or undefined. The resulting value will always be null.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "nullable(): " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [], + "isOptional": false, + "isAbstract": false, + "name": "nullable" + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!T.Validator#optional:member(1)", + "docComment": "/**\n * Returns a new validator that also accepts null or undefined. The resulting value will always be null.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "optional(): " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [], + "isOptional": false, + "isAbstract": false, + "name": "optional" + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!T.Validator#refine:member(1)", + "docComment": "/**\n * Refine this validation to a new type. The passed-in validation function should throw an error if the value can't be converted to the new type, or return the new type otherwise.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "refine(otherValidationFn: " + }, + { + "kind": "Content", + "text": "(value: T) => U" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "typeParameters": [ + { + "typeParameterName": "U", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 5 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "otherValidationFn", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "isOptional": false, + "isAbstract": false, + "name": "refine" + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!T.Validator#validate:member(1)", + "docComment": "/**\n * Asserts that the passed value is of the correct type and returns it. The returned value is guaranteed to be referentially equal to the passed value.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "validate(value: " + }, + { + "kind": "Content", + "text": "unknown" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Content", + "text": "T" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "value", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "isOptional": false, + "isAbstract": false, + "name": "validate" + }, + { + "kind": "Property", + "canonicalReference": "@tldraw/validate!T.Validator#validationFn:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "readonly validationFn: " + }, + { + "kind": "Reference", + "text": "ValidatorFn", + "canonicalReference": "@tldraw/validate!T.ValidatorFn:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isReadonly": true, + "isOptional": false, + "releaseTag": "Public", + "name": "validationFn", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "isStatic": false, + "isProtected": false, + "isAbstract": false + } + ], + "implementsTokenRanges": [ + { + "startIndex": 1, + "endIndex": 3 + } + ] + }, + { + "kind": "TypeAlias", + "canonicalReference": "@tldraw/validate!T.ValidatorFn:type", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export type ValidatorFn = " + }, + { + "kind": "Content", + "text": "(value: unknown) => T" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "releaseTag": "Public", + "name": "ValidatorFn", + "typeParameters": [ + { + "typeParameterName": "T", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "typeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + } + ] + }, + { + "kind": "Class", + "canonicalReference": "@tldraw/validate!UnionValidator:class", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare class UnionValidator" + }, + { + "kind": "Content", + "text": ", UnknownValue = " + }, + { + "kind": "Content", + "text": "never" + }, + { + "kind": "Content", + "text": "> extends " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "TypeOf", + "canonicalReference": "@tldraw/validate!T.TypeOf:type" + }, + { + "kind": "Content", + "text": " | UnknownValue>" + }, + { + "kind": "Content", + "text": " " + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "releaseTag": "Public", + "typeParameters": [ + { + "typeParameterName": "Key", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + }, + { + "typeParameterName": "Config", + "constraintTokenRange": { + "startIndex": 3, + "endIndex": 5 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + }, + { + "typeParameterName": "UnknownValue", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 6, + "endIndex": 7 + } + } + ], + "isAbstract": false, + "name": "UnionValidator", + "preserveMemberOrder": false, + "members": [ + { + "kind": "Constructor", + "canonicalReference": "@tldraw/validate!UnionValidator:constructor(1)", + "docComment": "/**\n * Constructs a new instance of the `UnionValidator` class\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "constructor(key: " + }, + { + "kind": "Content", + "text": "Key" + }, + { + "kind": "Content", + "text": ", config: " + }, + { + "kind": "Content", + "text": "Config" + }, + { + "kind": "Content", + "text": ", unknownValueValidation: " + }, + { + "kind": "Content", + "text": "(value: object, variant: string) => UnknownValue" + }, + { + "kind": "Content", + "text": ");" + } + ], + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "key", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + }, + { + "parameterName": "config", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "isOptional": false + }, + { + "parameterName": "unknownValueValidation", + "parameterTypeTokenRange": { + "startIndex": 5, + "endIndex": 6 + }, + "isOptional": false + } + ] + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!UnionValidator#validateUnknownVariants:member(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "validateUnknownVariants(unknownValueValidation: " + }, + { + "kind": "Content", + "text": "(value: object, variant: string) => Unknown" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "UnionValidator", + "canonicalReference": "@tldraw/validate!UnionValidator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "typeParameters": [ + { + "typeParameterName": "Unknown", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 5 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "unknownValueValidation", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "isOptional": false, + "isAbstract": false, + "name": "validateUnknownVariants" + } + ], + "extendsTokenRange": { + "startIndex": 8, + "endIndex": 12 + }, + "implementsTokenRanges": [] + }, + { + "kind": "Class", + "canonicalReference": "@tldraw/validate!Validator:class", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare class Validator implements " + }, + { + "kind": "Reference", + "text": "Validatable", + "canonicalReference": "@tldraw/validate!T.Validatable:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": " " + } + ], + "fileUrlPath": "packages/validate/src/lib/validation.ts", + "releaseTag": "Public", + "typeParameters": [ + { + "typeParameterName": "T", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "isAbstract": false, + "name": "Validator", + "preserveMemberOrder": false, + "members": [ + { + "kind": "Constructor", + "canonicalReference": "@tldraw/validate!Validator:constructor(1)", + "docComment": "/**\n * Constructs a new instance of the `Validator` class\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "constructor(validationFn: " + }, + { + "kind": "Reference", + "text": "ValidatorFn", + "canonicalReference": "@tldraw/validate!T.ValidatorFn:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ");" + } + ], + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "validationFn", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "isOptional": false + } + ] + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!Validator#check:member(1)", + "docComment": "/**\n * Refine this validation with an additional check that doesn't change the resulting value.\n *\n * @example\n * ```ts\n * const numberLessThan10Validator = T.number.check((value) => {\n * \tif (value >= 10) {\n * \t\tthrow new ValidationError(`Expected number less than 10, got ${value}`)\n * \t}\n * })\n * ```\n *\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "check(name: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ", checkFn: " + }, + { + "kind": "Content", + "text": "(value: T) => void" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 5, + "endIndex": 7 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "name", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + }, + { + "parameterName": "checkFn", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "isOptional": false + } + ], + "isOptional": false, + "isAbstract": false, + "name": "check" + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!Validator#check:member(2)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "check(checkFn: " + }, + { + "kind": "Content", + "text": "(value: T) => void" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 5 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 2, + "parameters": [ + { + "parameterName": "checkFn", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "isOptional": false, + "isAbstract": false, + "name": "check" + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!Validator#isValid:member(1)", + "docComment": "/**\n * Checks that the passed value is of the correct type.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "isValid(value: " + }, + { + "kind": "Content", + "text": "unknown" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "value", + "canonicalReference": "@tldraw/validate!~value" + }, + { + "kind": "Content", + "text": " is T" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 5 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "value", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "isOptional": false, + "isAbstract": false, + "name": "isValid" + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!Validator#nullable:member(1)", + "docComment": "/**\n * Returns a new validator that also accepts null or undefined. The resulting value will always be null.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "nullable(): " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [], + "isOptional": false, + "isAbstract": false, + "name": "nullable" + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!Validator#optional:member(1)", + "docComment": "/**\n * Returns a new validator that also accepts null or undefined. The resulting value will always be null.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "optional(): " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [], + "isOptional": false, + "isAbstract": false, + "name": "optional" + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!Validator#refine:member(1)", + "docComment": "/**\n * Refine this validation to a new type. The passed-in validation function should throw an error if the value can't be converted to the new type, or return the new type otherwise.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "refine(otherValidationFn: " + }, + { + "kind": "Content", + "text": "(value: T) => U" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Validator", + "canonicalReference": "@tldraw/validate!Validator:class" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "typeParameters": [ + { + "typeParameterName": "U", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 5 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "otherValidationFn", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "isOptional": false, + "isAbstract": false, + "name": "refine" + }, + { + "kind": "Method", + "canonicalReference": "@tldraw/validate!Validator#validate:member(1)", + "docComment": "/**\n * Asserts that the passed value is of the correct type and returns it. The returned value is guaranteed to be referentially equal to the passed value.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "validate(value: " + }, + { + "kind": "Content", + "text": "unknown" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Content", + "text": "T" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "value", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "isOptional": false, + "isAbstract": false, + "name": "validate" + }, + { + "kind": "Property", + "canonicalReference": "@tldraw/validate!Validator#validationFn:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "readonly validationFn: " + }, + { + "kind": "Reference", + "text": "ValidatorFn", + "canonicalReference": "@tldraw/validate!T.ValidatorFn:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isReadonly": true, + "isOptional": false, + "releaseTag": "Public", + "name": "validationFn", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "isStatic": false, + "isProtected": false, + "isAbstract": false + } + ], + "implementsTokenRanges": [ + { + "startIndex": 1, + "endIndex": 3 + } + ] + } + ] + } + ] } diff --git a/apps/docs/app/api/ai/route.ts b/apps/docs/app/api/ai/route.ts index 6a957720d..38c1c596d 100644 --- a/apps/docs/app/api/ai/route.ts +++ b/apps/docs/app/api/ai/route.ts @@ -2,11 +2,13 @@ import { SearchResult } from '@/types/search-types' import { getDb } from '@/utils/ContentDatabase' import assert from 'assert' import { NextRequest } from 'next/server' +import { SEARCH_RESULTS, searchBucket, sectionTypeBucket } from '@/utils/search-api' type Data = { results: { articles: SearchResult[] apiDocs: SearchResult[] + examples: SearchResult[] } status: 'success' | 'error' | 'no-query' } @@ -16,13 +18,11 @@ const BANNED_HEADINGS = ['new', 'constructor', 'properties', 'example', 'methods export async function GET(req: NextRequest) { const { searchParams } = new URL(req.url) const query = searchParams.get('q')?.toLowerCase() + if (!query) { return new Response( JSON.stringify({ - results: { - articles: [], - apiDocs: [], - }, + results: structuredClone(SEARCH_RESULTS), status: 'error', error: 'No query', }), @@ -33,10 +33,7 @@ export async function GET(req: NextRequest) { } try { - const results: Data['results'] = { - articles: [], - apiDocs: [], - } + const results: Data['results'] = structuredClone(SEARCH_RESULTS) const db = await getDb() const getVectorDb = (await import('@/utils/ContentVectorDatabase')).getVectorDb @@ -44,9 +41,11 @@ export async function GET(req: NextRequest) { const vdb = await getVectorDb() const queryResults = await vdb.query(query, 25) queryResults.sort((a, b) => b.score - a.score) + const headings = await Promise.all( queryResults.map(async (result) => { if (result.type !== 'heading') return // bleg + const article = await db.db.get( `SELECT id, title, description, categoryId, sectionId, keywords FROM articles WHERE id = ?`, result.id @@ -62,6 +61,7 @@ export async function GET(req: NextRequest) { ) const heading = await db.db.get(`SELECT * FROM headings WHERE slug = ?`, result.slug) assert(heading, `No heading found for ${result.id} ${result.slug}`) + return { id: result.id, article, @@ -72,18 +72,23 @@ export async function GET(req: NextRequest) { } }) ) + const visited = new Set() for (const result of headings) { if (!result) continue if (visited.has(result.id)) continue + visited.add(result.id) const { category, section, article, heading, score } = result const isUncategorized = category.id === section.id + '_ucg' + if (BANNED_HEADINGS.some((h) => heading.slug.endsWith(h))) continue - results[section.id === 'reference' ? 'apiDocs' : 'articles'].push({ + + results[searchBucket(section.id)].push({ id: result.id, type: 'heading', subtitle: isUncategorized ? section.title : `${section.title} / ${category.title}`, + sectionType: sectionTypeBucket(section.id), title: section.id === 'reference' ? article.title + '.' + heading.title @@ -94,6 +99,7 @@ export async function GET(req: NextRequest) { score, }) } + const articles = await Promise.all( queryResults.map(async (result) => ({ score: result.score, @@ -103,8 +109,10 @@ export async function GET(req: NextRequest) { ), })) ) + for (const { score, article } of articles.filter(Boolean)) { if (visited.has(article.id)) continue + visited.add(article.id) const category = await db.db.get( `SELECT id, title FROM categories WHERE categories.id = ?`, @@ -115,10 +123,12 @@ export async function GET(req: NextRequest) { article.sectionId ) const isUncategorized = category.id === section.id + '_ucg' - results[section.id === 'reference' ? 'apiDocs' : 'articles'].push({ + + results[searchBucket(section.id)].push({ id: article.id, type: 'article', subtitle: isUncategorized ? section.title : `${section.title} / ${category.title}`, + sectionType: sectionTypeBucket(section.id), title: article.title, url: isUncategorized ? `${section.id}/${article.id}` @@ -126,23 +136,18 @@ export async function GET(req: NextRequest) { score, }) } - const apiDocsScores = results.apiDocs.map((a) => a.score) - const maxScoreApiDocs = Math.max(...apiDocsScores) - const minScoreApiDocs = Math.min(...apiDocsScores) - const apiDocsBottom = minScoreApiDocs + (maxScoreApiDocs - minScoreApiDocs) * 0.75 - results.apiDocs - .filter((a) => a.score > apiDocsBottom) - .sort((a, b) => b.score - a.score) - .sort((a, b) => (b.type === 'heading' ? -1 : 1) - (a.type === 'heading' ? -1 : 1)) - .slice(0, 10) - const articleScores = results.articles.map((a) => a.score) - const maxScoreArticles = Math.max(...articleScores) - const minScoreArticles = Math.min(...articleScores) - const articlesBottom = minScoreArticles + (maxScoreArticles - minScoreArticles) * 0.5 - results.articles - .filter((a) => a.score > articlesBottom) - .sort((a, b) => b.score - a.score) - .sort((a, b) => (b.type === 'heading' ? -1 : 1) - (a.type === 'heading' ? -1 : 1)) + + Object.keys(results).forEach((section: string) => { + const scores = results[section as keyof Data['results']].map((a) => a.score) + const maxScore = Math.max(...scores) + const minScore = Math.min(...scores) + const bottomScore = minScore + (maxScore - minScore) * (section === 'apiDocs' ? 0.75 : 0.5) + results[section as keyof Data['results']] + .filter((a) => a.score > bottomScore) + .sort((a, b) => b.score - a.score) + .sort((a, b) => (b.type === 'heading' ? -1 : 1) - (a.type === 'heading' ? -1 : 1)) + }) + return new Response( JSON.stringify({ results, @@ -155,10 +160,7 @@ export async function GET(req: NextRequest) { } catch (e: any) { return new Response( JSON.stringify({ - results: { - articles: [], - apiDocs: [], - }, + results: structuredClone(SEARCH_RESULTS), status: 'error', error: e.message, }), diff --git a/apps/docs/app/api/search/route.ts b/apps/docs/app/api/search/route.ts index 64f210d0d..a9a51deeb 100644 --- a/apps/docs/app/api/search/route.ts +++ b/apps/docs/app/api/search/route.ts @@ -1,11 +1,13 @@ import { SearchResult } from '@/types/search-types' import { getDb } from '@/utils/ContentDatabase' import { NextRequest } from 'next/server' +import { SEARCH_RESULTS, searchBucket, sectionTypeBucket } from '@/utils/search-api' type Data = { results: { articles: SearchResult[] apiDocs: SearchResult[] + examples: SearchResult[] } status: 'success' | 'error' | 'no-query' } @@ -23,10 +25,7 @@ export async function GET(req: NextRequest) { if (!query) { return new Response( JSON.stringify({ - results: { - articles: [], - apiDocs: [], - }, + results: structuredClone(SEARCH_RESULTS), status: 'no-query', }), { @@ -36,15 +35,9 @@ export async function GET(req: NextRequest) { } try { - const results: Data['results'] = { - articles: [], - apiDocs: [], - } - + const results: Data['results'] = structuredClone(SEARCH_RESULTS) const db = await getDb() - const queryWithoutSpaces = query.replace(/\s/g, '') - const searchForArticle = await db.db.prepare( ` SELECT id, title, sectionId, categoryId, content @@ -61,16 +54,16 @@ export async function GET(req: NextRequest) { await searchForArticle.all(query).then(async (queryResults) => { for (const article of queryResults) { - const isApiDoc = article.sectionId === 'reference' const section = await db.getSection(article.sectionId) const category = await db.getCategory(article.categoryId) const isUncategorized = category.id === section.id + '_ucg' - results[isApiDoc ? 'apiDocs' : 'articles'].push({ + results[searchBucket(article.sectionId)].push({ id: article.id, type: 'article', subtitle: isUncategorized ? section.title : `${section.title} / ${category.title}`, title: article.title, + sectionType: sectionTypeBucket(section.id), url: isUncategorized ? `${section.id}/${article.id}` : `${section.id}/${category.id}/${article.id}`, @@ -93,17 +86,17 @@ export async function GET(req: NextRequest) { await searchForArticleHeadings.all(queryWithoutSpaces).then(async (queryResults) => { for (const heading of queryResults) { if (BANNED_HEADINGS.some((h) => heading.slug.endsWith(h))) continue - const article = await db.getArticle(heading.articleId) - const isApiDoc = article.sectionId === 'reference' + const article = await db.getArticle(heading.articleId) const section = await db.getSection(article.sectionId) const category = await db.getCategory(article.categoryId) const isUncategorized = category.id === section.id + '_ucg' - results[isApiDoc ? 'apiDocs' : 'articles'].push({ + results[searchBucket(article.sectionId)].push({ id: article.id + '#' + heading.slug, type: 'heading', subtitle: isUncategorized ? section.title : `${section.title} / ${category.title}`, + sectionType: sectionTypeBucket(section.id), title: section.id === 'reference' ? article.title + '.' + heading.title @@ -116,8 +109,8 @@ export async function GET(req: NextRequest) { } }) - results.apiDocs.sort((a, b) => b.score - a.score) - results.articles.sort((a, b) => b.score - a.score) + Object.keys(results).forEach((section: string) => results[section as keyof Data['results']].sort((a, b) => b.score - a.score)) + results.articles.sort( (a, b) => (b.type === 'heading' ? -1 : 1) - (a.type === 'heading' ? -1 : 1) ) @@ -128,10 +121,7 @@ export async function GET(req: NextRequest) { } catch (e: any) { return new Response( JSON.stringify({ - results: { - articles: [], - apiDocs: [], - }, + results: structuredClone(SEARCH_RESULTS), status: 'error', error: e.message, }), diff --git a/apps/docs/app/search-results/page.tsx b/apps/docs/app/search-results/page.tsx deleted file mode 100644 index df5bb35ae..000000000 --- a/apps/docs/app/search-results/page.tsx +++ /dev/null @@ -1,97 +0,0 @@ -import { Header } from '@/components/Header' -import { Sidebar } from '@/components/Sidebar' -import { SearchResult } from '@/types/search-types' -import { getDb } from '@/utils/ContentDatabase' -import Link from 'next/link' -import process from 'process' - -const HOST_URL = - process.env.NODE_ENV === 'development' - ? 'http://localhost:3001' - : process.env.NEXT_PUBLIC_SITE_URL ?? 'https://www.tldraw.dev' - -export default async function SearchResultsPage({ - searchParams, -}: { - searchParams: { q: string; t: string } -}) { - const query = searchParams.q?.toString() as string - const type = searchParams.t?.toString() as string - - const db = await getDb() - const sidebar = await db.getSidebarContentList({}) - - let results: { - articles: SearchResult[] - apiDocs: SearchResult[] - error: null | string - } = { - articles: [], - apiDocs: [], - error: null, - } - - if (query) { - const endPoint = - type === 'ai' ? `${HOST_URL}/api/ai?q=${query}` : `${HOST_URL}/api/search?q=${query}` - const res = await fetch(endPoint) - if (!res.ok) { - results.error = await res.text() - } else { - const json = await res.json() - results = json.results - } - } - - return ( - <> -
- -
-
-

{`Found ${ - results.articles.length + results.apiDocs.length - } results for "${query}"`}

-
- {type === 'ai' ? ( - Search again using exact match... - ) : ( - // TODO: replace emoji with icon - ✨ Search again using AI... - )} -
-
- - {results.articles.length > 0 && results.apiDocs.length > 0 && ( - <> -
-

API Docs

- - )} - {results.apiDocs.length > 0 && } -
- - ) -} - -function ResultsList({ results, type }: { results: SearchResult[]; type?: string }) { - return ( -
    - {results.map((result) => ( - -
  • -
    -

    {result.subtitle}

    - {type === 'ai' && ( - - {(result.score * 100).toFixed()}% - - )} -
    -

    {result.title}

    -
  • - - ))} -
- ) -} diff --git a/apps/docs/components/Autocomplete.css b/apps/docs/components/Autocomplete.css new file mode 100644 index 000000000..d64c32c95 --- /dev/null +++ b/apps/docs/components/Autocomplete.css @@ -0,0 +1,193 @@ +.autocomplete__wrapper { + position: relative; + display: flex; + height: 40px; + flex-direction: row; + border-radius: 24px; + padding: 0 16px; + background-color: var(--color-tint-1); +} + +.autocomplete__input { + position: relative; + padding-left: 20px; + height: 100%; + width: 100%; + border-radius: 4px; + border: none; + background-color: var(--color-background); + font-family: var(--font-body); + font-size: 14px; + background-color: none; + background: none; +} + +.autocomplete__input:disabled { + /* background-color: var(--color-tint-1); */ + color: var(--color-tint-5); +} + +.autocomplete__input::placeholder { + color: var(--color-tint-5); +} + +.autocomplete__input:focus { + outline: none; +} + +.autocomplete__icon { + position: absolute; + top: 50%; + transform: translateY(-50%); + color: var(--color-tint-5); + left: 12px; + z-index: 2; + pointer-events: none; + transition: color 0.12s; +} + +.autocomplete__cancel { + display: none; +} + +.autocomplete__wrapper:focus-within .autocomplete__cancel { + display: flex; +} + +.autocomplete__cancel { + justify-content: center; + align-items: center; + position: absolute; + top: 50%; + right: 12px; + transform: translateY(-50%); + z-index: 2; + border: 0; + cursor: pointer; + height: 24px; + min-width: 24px; + line-height: 26px; + color: var(--color-tint-6); + background-color: var(--color-tint-2); + border-radius: 2px; +} + +.autocomplete__item__icon { + width: 24px; + height: 24px; + flex: 0 0 24px; +} + +.autocomplete__group { + font-size: 14px; + font-weight: normal; + color: var(--color-text-secondary); + text-transform: uppercase; + white-space: nowrap; +} + +.autocomplete__wrapper:focus-within .autocomplete__icon { + color: var(--color-text); +} + +.autocomplete__item { + position: relative; + display: flex; + height: 2.5rem; + cursor: default; + scroll-margin-top: 0.25rem; + scroll-margin-bottom: 0.25rem; + align-items: center; + border-radius: 0.25rem; + padding-left: 1.75rem; + padding-right: 1.75rem; + color: hsl(204 10% 10%); + outline: 2px solid transparent; + outline-offset: 2px; +} + +.autocomplete__item [data-user-value] { + font-weight: bold; +} + +@media (min-width: 640px) { + .autocomplete__item { + height: 2.25rem; + font-size: 15px; + } +} + +.autocomplete__popover { + position: relative; + z-index: 50; + display: flex; + max-height: min(var(--popover-available-height, 300px), 300px); + flex-direction: column; + overflow: auto; + overscroll-behavior: contain; + border-radius: 0.5rem; + border-width: 1px; + border-style: solid; + border-color: hsl(204 20% 88%); + background-color: hsl(204 20% 100%); + padding: 0.5rem; + color: hsl(204 10% 10%); + outline: 2px solid transparent; + outline-offset: 2px; + box-shadow: + 0 10px 15px -3px rgb(0 0 0 / 0.1), + 0 4px 6px -4px rgb(0 0 0 / 0.1); +} + +:is([data-theme="dark"] .autocomplete__popover) { + border-color: hsl(204 3% 26%); + background-color: hsl(204 3% 18%); + color: hsl(204 20% 100%); + box-shadow: + 0 10px 15px -3px rgb(0 0 0 / 0.25), + 0 4px 6px -4px rgb(0 0 0 / 0.1); +} + +.autocomplete__item { + display: flex; + cursor: pointer; + scroll-margin: 0.5rem; + align-items: center; + gap: 0.5rem; + border-radius: 0.25rem; + padding: 0.5rem; + outline: none !important; + white-space: nowrap; + overflow: hidden; +} + +.autocomplete__item:hover { + background-color: hsl(204 100% 80% / 0.4); +} + +.autocomplete__item[data-active-item] { + background-color: hsl(204 100% 40%); + color: hsl(204 20% 100%); +} + +.autocomplete__item:active, +.autocomplete__item[data-active] { + padding-top: 9px; + padding-bottom: 7px; +} + +:is([data-theme="dark"] .autocomplete__item) { + color: hsl(204 20% 100%); +} + +:is([data-theme="dark"] .autocomplete__item__icon path) { + fill: hsl(204 20% 100%); +} + +:is([data-theme="dark"] .autocomplete__item:hover) { + background-color: hsl(204 100% 40% / 0.25); +} + +:is([data-theme="dark"] .autocomplete__item)[data-active-item] { + background-color: hsl(204 100% 40%); +} diff --git a/apps/docs/components/Autocomplete.tsx b/apps/docs/components/Autocomplete.tsx new file mode 100644 index 000000000..2ca058b72 --- /dev/null +++ b/apps/docs/components/Autocomplete.tsx @@ -0,0 +1,123 @@ +import { + Combobox, + ComboboxCancel, + ComboboxGroup, + ComboboxGroupLabel, + ComboboxItem, + ComboboxItemValue, + ComboboxPopover, + ComboboxProvider, +} from '@ariakit/react' +import { ComponentType, ForwardedRef, forwardRef, startTransition, useState } from 'react' +import './Autocomplete.css' +import { Icon } from './Icon' +import Spinner from './Spinner' + +export type DropdownOption = { + label: string + value: string + group?: string +} + +type AutocompleteProps = { + customUI?: React.ReactNode + groups?: string[] + groupsToIcon?: { + [key: string]: ComponentType<{ + className?: string + }> + } + groupsToLabel?: { [key: string]: string } + isLoading: boolean + options: DropdownOption[] + onChange: (value: string) => void + onInputChange: (value: string) => void +} + +const DEFAULT_GROUP = 'autocomplete-default' + +const Autocomplete = forwardRef(function Autocomplete( + { + customUI, + groups = [DEFAULT_GROUP], + groupsToIcon, + groupsToLabel, + isLoading, + options, + onInputChange, + onChange, + }: AutocompleteProps, + ref: ForwardedRef +) { + const [open, setOpen] = useState(false) + const [value, setValue] = useState('') + + const renderedGroups = groups.map((group) => { + const filteredOptions = options.filter( + ({ group: optionGroup }) => optionGroup === group || group === DEFAULT_GROUP + ) + if (filteredOptions.length === 0) return null + + return ( + + {groupsToLabel?.[group] && ( + + {groupsToLabel?.[group]} + + )} + {filteredOptions.map(({ label, value }) => { + const Icon = groupsToIcon?.[group] + return ( + + {Icon && } + + + ) + })} + + ) + }) + + return ( + + defaultSelectedValue="" + open={open} + setOpen={setOpen} + resetValueOnHide + includesBaseElement={false} + setValue={(newValue) => { + startTransition(() => setValue(newValue)) + onInputChange(newValue) + }} + setSelectedValue={(newValue) => onChange(newValue)} + > +
+ {isLoading ? ( + + ) : ( + + )} + + + + {value && } + + {value && ( + + {customUI} + {options.length === 0 && No results found.} + {options.length !== 0 && renderedGroups} + + )} +
+ + ) +}) + +export default Autocomplete diff --git a/apps/docs/components/Header.tsx b/apps/docs/components/Header.tsx index eeaf14d98..7fb2a0833 100644 --- a/apps/docs/components/Header.tsx +++ b/apps/docs/components/Header.tsx @@ -7,15 +7,7 @@ import { Chevron } from './Icons' import { Search } from './Search' import { ThemeSwitcher } from './ThemeSwitcher' -export function Header({ - searchQuery, - searchType, - sectionId, -}: { - searchQuery?: string - searchType?: string - sectionId?: string -}) { +export function Header({ sectionId }: { sectionId?: string }) { return (
@@ -27,7 +19,7 @@ export function Header({ }} /> - +
diff --git a/apps/docs/components/Search.tsx b/apps/docs/components/Search.tsx index e7205269c..3a526007b 100644 --- a/apps/docs/components/Search.tsx +++ b/apps/docs/components/Search.tsx @@ -1,77 +1,162 @@ 'use client' -import { usePathname, useRouter } from 'next/navigation' -import { useCallback, useEffect, useRef, useState } from 'react' +import { SEARCH_TYPE, SearchResult } from '@/types/search-types' +import { debounce } from '@/utils/debounce' +import { useRouter } from 'next/navigation' +import { useEffect, useRef, useState } from 'react' import { useHotkeys } from 'react-hotkeys-hook' -import { Icon } from './Icon' +import Autocomplete, { DropdownOption } from './Autocomplete' -export function Search({ - prevType = 'n', - prevQuery = '', -}: { - prevType?: string - prevQuery?: string -}) { - const [query, setQuery] = useState(prevQuery) - const [isDisabled, setIsDisabled] = useState(false) - - const handleChange = useCallback((e: React.ChangeEvent) => { - setQuery(e.target.value) - }, []) +const HOST_URL = + process.env.NODE_ENV === 'development' + ? 'http://localhost:3001' + : process.env.NEXT_PUBLIC_SITE_URL ?? 'https://www.tldraw.dev' +export function Search() { + const [searchType, setSearchType] = useState(SEARCH_TYPE.NORMAL) + const [isLoading, setIsLoading] = useState(false) + const [searchResults, setSearchResults] = useState([]) + const [query, setQuery] = useState('') + const [platform, setPlatform] = useState<'mac' | 'nonMac' | null>() const rInput = useRef(null) - - const pathName = usePathname() const router = useRouter() + const handleInputChange = debounce((query: string) => setQuery(query), 200) + + useEffect(() => { + async function handleFetchResults() { + if (!query) { + return + } + + setIsLoading(true) + + try { + const endPoint = + searchType === SEARCH_TYPE.AI + ? `${HOST_URL}/api/ai?q=${query}` + : `${HOST_URL}/api/search?q=${query}` + const res = await fetch(endPoint) + if (res.ok) { + const json = await res.json() + const topArticles = json.results.articles.slice(0, 10) + const topAPI = json.results.apiDocs.slice(0, 10) + const topExamples = json.results.examples.slice(0, 10) + const allResults = topExamples.concat(topArticles).concat(topAPI) + setSearchResults( + allResults.map((result: SearchResult) => ({ + label: result.title, + value: result.url, + group: result.sectionType, + })) + ) + } + } catch (err) { + console.error(err) + } + + setIsLoading(false) + } + + handleFetchResults() + }, [query, searchType]) + + const handleChange = (url: string) => { + router.push(url.startsWith('/') ? url : `/${url}`) + } + + const handleSearchTypeChange = () => { + setSearchType(searchType === SEARCH_TYPE.AI ? SEARCH_TYPE.NORMAL : SEARCH_TYPE.AI) + } + + useEffect(() => { + setPlatform( + // TODO(mime): we should have a standard hook for this. + // And also, we should navigator.userAgentData.platform where available. + // eslint-disable-next-line deprecation/deprecation + typeof window !== 'undefined' && /mac/i.test(window.navigator.platform) ? 'mac' : 'nonMac' + ) + }, []) + useHotkeys('meta+k,ctrl+k', (e) => { e.preventDefault() rInput.current?.focus() rInput.current?.select() }) - useEffect(() => { - setIsDisabled(false) - }, [pathName]) - - const handleFocus = useCallback(() => { - // focus input and select all - rInput.current!.focus() - rInput.current!.select() - }, []) - - const handleKeyDown = useCallback( - (e: React.KeyboardEvent) => { - const currentQuery = rInput.current!.value - if (e.key === 'Enter' && currentQuery !== prevQuery) { - setIsDisabled(true) - router.push(`/search-results?q=${currentQuery}&t=${prevType}`) - } else if (e.key === 'Escape') { - rInput.current!.blur() - } - }, - [router, prevQuery, prevType] - ) - return (
-
- - -
+ + {searchType === SEARCH_TYPE.NORMAL ? '✨ Search using AI' : '⭐ Search without AI'} + + } + groups={['examples', 'docs', 'reference']} + groupsToLabel={{ examples: 'Examples', docs: 'Articles', reference: 'Reference' }} + groupsToIcon={{ examples: CodeIcon, docs: DocIcon, reference: ReferenceIcon }} + options={searchResults} + isLoading={isLoading} + onInputChange={handleInputChange} + onChange={handleChange} + /> + {platform && ( + + {platform === 'mac' && } + {platform === 'nonMac' && Ctrl} + K + + )}
) } + +/*! + * Author: Dazzle UI + * License: https://www.svgrepo.com/page/licensing/#CC%20Attribution + */ +const CodeIcon = ({ className }: { className?: string }) => ( + + + + +) + +/*! + * Author: Solar Icons + * License: https://www.svgrepo.com/page/licensing/#CC%20Attribution + */ +const DocIcon = ({ className }: { className?: string }) => ( + + + + + + +) + +/*! + * Author: Konstantin Filatov + * License: https://www.svgrepo.com/page/licensing/#CC%20Attribution + */ +const ReferenceIcon = ({ className }: { className?: string }) => ( + + + +) diff --git a/apps/docs/components/Sidebar.tsx b/apps/docs/components/Sidebar.tsx index 6895fcb2e..dfecfcb04 100644 --- a/apps/docs/components/Sidebar.tsx +++ b/apps/docs/components/Sidebar.tsx @@ -28,15 +28,7 @@ const linkContext = createContext<{ sectionId: string | null } | null>(null) -export function Sidebar({ - headings, - links, - sectionId, - categoryId, - articleId, - searchQuery, - searchType, -}: SidebarProps) { +export function Sidebar({ headings, links, sectionId, categoryId, articleId }: SidebarProps) { const activeId = articleId ?? categoryId ?? sectionId const pathName = usePathname() @@ -45,17 +37,13 @@ export function Sidebar({ document.body.classList.remove('sidebar-open') document.querySelector('.sidebar__nav [data-active=true]')?.scrollIntoView({ block: 'center' }) - - // XXX(mime): scrolling the sidebar into position also scrolls the page to the wrong - // spot. this compensates for that but, ugh. - document.documentElement.scrollTop = 0 }, [pathName]) return ( <>
e.stopPropagation()}> - +
diff --git a/apps/docs/components/Spinner.tsx b/apps/docs/components/Spinner.tsx new file mode 100644 index 000000000..46e35fba1 --- /dev/null +++ b/apps/docs/components/Spinner.tsx @@ -0,0 +1,20 @@ +// TODO(mime): copied from tldraw package, needs to be in another shared location. +export default function Spinner(props: React.SVGProps) { + return ( + + + + + + + + + ) +} diff --git a/apps/docs/content/releases/v2.0.0-alpha.12.mdx b/apps/docs/content/releases/v2.0.0-alpha.12.mdx index 14fa6f327..e01ec0fbe 100644 --- a/apps/docs/content/releases/v2.0.0-alpha.12.mdx +++ b/apps/docs/content/releases/v2.0.0-alpha.12.mdx @@ -8,4 +8,3 @@ status: published --- [View on GitHub](https://github.com/tldraw/tldraw/releases/tag/v2.0.0-alpha.12) - diff --git a/apps/docs/content/releases/v2.0.0-alpha.13.mdx b/apps/docs/content/releases/v2.0.0-alpha.13.mdx index 33ad1d285..64dc6e2d7 100644 --- a/apps/docs/content/releases/v2.0.0-alpha.13.mdx +++ b/apps/docs/content/releases/v2.0.0-alpha.13.mdx @@ -9,992 +9,990 @@ status: published [View on GitHub](https://github.com/tldraw/tldraw/releases/tag/v2.0.0-alpha.13) -This is a big one! Our last release (alpha.12) was a few months ago, after which we decided to push forward with some big breaking changes that we had been putting off. This will likely remain our most breaking release, so the notes below may not be as helpful for gathering what's changed. Check the updated docs at [tldraw.dev](https://tldraw.dev). - -Some highlights: - -- The `editor.css` and `ui.css` are now combined as `tldraw.css`, so please update your imports from `@tldraw/tldraw` -- Assets are now provided by a CDN by default, so no need to copy those into your project -- We've removed `signia` and `signia-react` from dependencies: they're folded in as `@tldraw/state` -- We've added a new `ExternalContentManager` for customizing how files/ images / text and other content are handled on paste or drop -- `@tldraw/tlstore` is now `@tldraw/store` -- `@tldraw/tlvalidate` is now `@tldraw/validate` -- `@tldraw/indices` is added for our fractional indexing -- The `ShapeUtil` API requires fewer overrides and has fewer properties: caching is now handled on the Editor class methods -- We've introduced a new Styles API for hooking into our existing styles or defining your own shared properties that should move together. - -Here's the big list! - ---- - -### Release Notes - -#### Fix crash when rotating a deleted shape ([#1658](https://github.com/tldraw/tldraw/pull/1658)) - -- Fixed a crash when trying to rotate a deleted shape. - -#### [improvement] store snapshot types ([#1657](https://github.com/tldraw/tldraw/pull/1657)) - -- [dev] Rename `StoreSnapshot` to `SerializedStore` -- [dev] Create new `StoreSnapshot` as type related to `getSnapshot`/`loadSnapshot` - -#### [fix] pen mode touches ([#1655](https://github.com/tldraw/tldraw/pull/1655)) - -- Removes three touches to cancel pen mode feature. - -#### (2/2) [docs] Fix links to API. ([#1654](https://github.com/tldraw/tldraw/pull/1654)) - -- Documentation: Simplified links to the API reference. - -#### (1/2) [docs] Restore some missing changes ([#1652](https://github.com/tldraw/tldraw/pull/1652)) - -- None (Docs internals) - -#### [docs] Remove embeds page ([#1653](https://github.com/tldraw/tldraw/pull/1653)) - -- Documentation: Removed unused Embeds page. - -#### Fix text shapes not having colour ([#1649](https://github.com/tldraw/tldraw/pull/1649)) - -- None: Fixes an unreleased bug. - -#### Styles API docs ([#1641](https://github.com/tldraw/tldraw/pull/1641)) - --- - -#### Styles API follow-ups ([#1636](https://github.com/tldraw/tldraw/pull/1636)) - --- - -#### docs: remove not accepting contributions notice ([#1647](https://github.com/tldraw/tldraw/pull/1647)) - -- Remove not accepting contributions notice from README - -#### Fix SVG cursors not being used ([#1639](https://github.com/tldraw/tldraw/pull/1639)) - -- None: Fixing an unreleased bug. - -#### [docs] Add table of contents to Editor page ([#1642](https://github.com/tldraw/tldraw/pull/1642)) - -- Documentation: Added a table of contents to the Editor page. - -#### speed up playwright and add visual regression tests ([#1638](https://github.com/tldraw/tldraw/pull/1638)) - --- - -#### [docs] Allow sidebar to be scrolled on short screens ([#1632](https://github.com/tldraw/tldraw/pull/1632)) - -- Documentation: Fixed the sidebar being unscrollable on some short screens. - -#### [docs] Add feedback when you search ([#1633](https://github.com/tldraw/tldraw/pull/1633)) - -- Documentation: Added some immediate feedback when you search. - -#### [docs] Separate some pages out of the Docs section ([#1626](https://github.com/tldraw/tldraw/pull/1626)) - -- Documentation: Restructured the sidebar for clarity. - -#### [docs] Fix wrong cursor when hovering buttons ([#1630](https://github.com/tldraw/tldraw/pull/1630)) - -- Documentation: Fixed the wrong cursor showing when hovering some buttons. - -#### [docs] Tighten up wording & structure of Usage page ([#1624](https://github.com/tldraw/tldraw/pull/1624)) - -- Documentation: Impoved clarity of wording and structure of the Usage page. - -#### [docs] Tighten up Editor page introduction ([#1622](https://github.com/tldraw/tldraw/pull/1622)) - -- Documentation: Simplified the Editor page. - -#### [docs] Tighten up Introduction page ([#1621](https://github.com/tldraw/tldraw/pull/1621)) - -- Documentation: Simplified the Introduction page. - -#### Lokalise: Translations update ([#1618](https://github.com/tldraw/tldraw/pull/1618)) - -- Added more translations for Simplified Chinese. - -#### [docs] Simplify paths for uncategorised pages ([#1619](https://github.com/tldraw/tldraw/pull/1619)) - -- Documentation: Cleaned up some paths. - -#### `ShapeUtil` refactor, `Editor` cleanup ([#1611](https://github.com/tldraw/tldraw/pull/1611)) - -- [editor] renames `defaultProps` to `getDefaultProps` -- [editor] removes `outline`, `outlineSegments`, `handles`, `bounds` -- [editor] renames `renderBackground` to `backgroundComponent` - -#### Revert "Update dependencies (#1613)" ([#1617](https://github.com/tldraw/tldraw/pull/1617)) - -- - -#### Remove on drop override ([#1612](https://github.com/tldraw/tldraw/pull/1612)) - -- [editor] Remove `onDropOverride` - -#### Make resizeBox a regular function ([#1610](https://github.com/tldraw/tldraw/pull/1610)) - -- [editor] Change `resizeBox` to be a regular function. - -#### Rename `ShapeUtil.render` -> `ShapeUtil.component` ([#1609](https://github.com/tldraw/tldraw/pull/1609)) - -- [editor] rename `ShapeUtil.render` to `ShapeUtil.component` - -#### tldraw.css ([#1607](https://github.com/tldraw/tldraw/pull/1607)) - -- [tldraw] Removes `editor.css` and `ui.css` exports, replaces with `tldraw.css` - -#### [fix] camera culling ([#1602](https://github.com/tldraw/tldraw/pull/1602)) - -- [editor] Adds `Editor.cameraState` -- Adds smart culling to make panning and zooming more smooth - -#### Styles API ([#1580](https://github.com/tldraw/tldraw/pull/1580)) - -- - -#### (1/2) Timeout collaborator cursors ([#1525](https://github.com/tldraw/tldraw/pull/1525)) - -- Brought back cursor timeouts. Collaborator cursors now disappear after 3 seconds of inactivity. - -#### Remove `@tldraw/utils` from the docs site ([#1596](https://github.com/tldraw/tldraw/pull/1596)) - -- [docs] Removed an internal utilities package. - -#### (1/2) Cursor Chat - Presence ([#1487](https://github.com/tldraw/tldraw/pull/1487)) - -- [dev] Added support for cursor chat presence. - -#### [docs] Add barebones note about translations ([#1593](https://github.com/tldraw/tldraw/pull/1593)) - -- [docs] Added brief info on how to join as a translations contributor. - -#### [refactor] snapping ([#1589](https://github.com/tldraw/tldraw/pull/1589)) - -- [editor] fix bug in snapping - -#### remove `ShapeUtil.transform` ([#1590](https://github.com/tldraw/tldraw/pull/1590)) - -- [editor] Remove `ShapeUtil.transform` - -#### Change app to editor in docs ([#1592](https://github.com/tldraw/tldraw/pull/1592)) - -- [docs] Updated 'App' to 'Editor'. - -#### Make sure loading screens use dark mode user preference. ([#1552](https://github.com/tldraw/tldraw/pull/1552)) - -- Make sure our loading and error screens take dark mode setting into account. - -#### remove `ShapeUtil.point` ([#1591](https://github.com/tldraw/tldraw/pull/1591)) - -- [editor] Remove `ShapeUtil.point` - -#### [fix] Remove group shape export backgrounds ([#1587](https://github.com/tldraw/tldraw/pull/1587)) - -- Fix image exports for groups - -#### Add tsdocs to Editor methods ([#1581](https://github.com/tldraw/tldraw/pull/1581)) - -- [dev] Added initial documentation for the Editor class. - -#### add presence to yjs example ([#1582](https://github.com/tldraw/tldraw/pull/1582)) - -- [editor] Add presence to yjs example. - -#### Add optional generic to `updateShapes` / `createShapes` ([#1579](https://github.com/tldraw/tldraw/pull/1579)) - -- [editor] adds an optional shape generic to `updateShapes` and `createShapes` - -#### fix: properly remove awareness from store ([#1565](https://github.com/tldraw/tldraw/pull/1565)) - -- Add a brief release note for your PR here. - -#### [improvement] Embed shape cleanup ([#1569](https://github.com/tldraw/tldraw/pull/1569)) - -- [editor] Remove unused props for `TLEditorShape` -- [editor] Adds `canUnmount` property to embed definitions - -#### Move the loading of assets to the TldrawEditorWithReadyStore so that all code paths load the assets. ([#1561](https://github.com/tldraw/tldraw/pull/1561)) - -- Fix a problem where assets were not loading in some cases (snapshots). - -#### Add anchor targets to our headings. ([#1571](https://github.com/tldraw/tldraw/pull/1571)) - -- Improve documentation to include anchor targets. - -#### shapes folder, move tools into shape defs ([#1574](https://github.com/tldraw/tldraw/pull/1574)) - -n/a - -#### mini `defineShape` API ([#1563](https://github.com/tldraw/tldraw/pull/1563)) - -[dev-facing, notes to come] - -#### Lokalise: Translations update ([#1572](https://github.com/tldraw/tldraw/pull/1572)) - -- Added and updates translations for Italian, Russian, and Ukrainian. - -#### Fix README typo ([#1451](https://github.com/tldraw/tldraw/pull/1451)) - -- None - -#### yjs example ([#1560](https://github.com/tldraw/tldraw/pull/1560)) - -- [editor] Adds yjs example project - -#### `ExternalContentManager` for handling external content (files, images, etc) ([#1550](https://github.com/tldraw/tldraw/pull/1550)) - -- [editor] add `ExternalContentManager` for plopping content onto the canvas -- [editor] remove `onCreateAssetFromFile` prop -- [editor] remove `onCreateBookmarkFromUrl` prop -- [editor] introduce `ExternalContentManager` -- [editor] add cleanup function to `onMount` - -#### Misc sync fixes ([#1555](https://github.com/tldraw/tldraw/pull/1555)) - -- Fixes a handful of state management bugs that manifest in multiplayer rooms - -#### [Docs] Change some editor properties to methods ([#1553](https://github.com/tldraw/tldraw/pull/1553)) - -- [docs] Fixed some methods that were incorrectly marked as properties. - -#### [Docs] Change some internal methods to public ([#1554](https://github.com/tldraw/tldraw/pull/1554)) - -- [docs] Changed some Editor methods from internal to public. - -#### Use unpkg as a default for serving assets. ([#1548](https://github.com/tldraw/tldraw/pull/1548)) - -- Use unpkg asset hosting as a default. - -#### hoist opacity out of props ([#1526](https://github.com/tldraw/tldraw/pull/1526)) - -[internal only for now] - -#### Fix arrows with weird bends crashing ([#1540](https://github.com/tldraw/tldraw/pull/1540)) - -- Fixed a rare crash that could happen when you try to curve an arrow with zero distance. - -#### [feature] add vertical align to note shape ([#1539](https://github.com/tldraw/tldraw/pull/1539)) - -- Adds vertical align prop to note shapes - -#### [fix] Shift key code / nudge ([#1537](https://github.com/tldraw/tldraw/pull/1537)) - -- Fix shift key nudging - -#### scale exported canvases when they reach the browsers max size ([#1536](https://github.com/tldraw/tldraw/pull/1536)) - -- Fix a bug where sometimes exports would fail when they were too big for your browser. Now, they're scaled down to the max supported size. - -#### [fix] control click on mac ([#1535](https://github.com/tldraw/tldraw/pull/1535)) - -- Fix control click to open menu on Mac - -#### Fix being able to undo following ([#1531](https://github.com/tldraw/tldraw/pull/1531)) - -- Fixed a bug where you could undo viewport-following and viewport-unfollowing. - -#### Select locked shapes on long press ([#1529](https://github.com/tldraw/tldraw/pull/1529)) - - - -#### highlighter fixes ([#1530](https://github.com/tldraw/tldraw/pull/1530)) - -[aq bug fixes] - -#### Lokalise: Translations update ([#1515](https://github.com/tldraw/tldraw/pull/1515)) - -- Added and updated community translations for Galician, Italian, Romanian, Russian, Ukrainian, and Traditional Chinese. - -#### Simplify static cursors ([#1520](https://github.com/tldraw/tldraw/pull/1520)) - -- (editor) Simplifies the cursors in our CSS. - -#### Renaming types, shape utils, tools ([#1513](https://github.com/tldraw/tldraw/pull/1513)) - -- Renaming of types, shape utils, tools - -#### tlschema cleanup ([#1509](https://github.com/tldraw/tldraw/pull/1509)) - -- [editor] Remove `app.createShapeId` -- [tlschema] Cleans up exports - -#### Rename tlstore to store ([#1507](https://github.com/tldraw/tldraw/pull/1507)) - -- Replace @tldraw/tlstore with @tldraw/store - -#### Rename tlvalidate to validate ([#1508](https://github.com/tldraw/tldraw/pull/1508)) - -- Rename tlvalidate to validate - -#### Filter out unused assets. ([#1502](https://github.com/tldraw/tldraw/pull/1502)) - -- Optimize file size of exported files. - -#### Cleanup @tldraw/ui types / exports ([#1504](https://github.com/tldraw/tldraw/pull/1504)) - -- [editor] clean up / unify types - -#### rename app to editor ([#1503](https://github.com/tldraw/tldraw/pull/1503)) - -- Rename `App` to `Editor` and many other things that reference `app` to `editor`. - -#### Revert 09c36781 & tweak linting ([#1501](https://github.com/tldraw/tldraw/pull/1501)) - -[internal-only] - -#### Add support for locking shapes ([#1447](https://github.com/tldraw/tldraw/pull/1447)) - -- Add support for locking shapes. - -#### [3/3] Highlighter styling ([#1490](https://github.com/tldraw/tldraw/pull/1490)) - -Highlighter pen is here! 🎉🎉🎉 - -#### [2/3] renderer changes to support "sandwich mode" highlighting ([#1418](https://github.com/tldraw/tldraw/pull/1418)) - -[not yet!] - -#### [1/3] initial highlighter shape/tool ([#1401](https://github.com/tldraw/tldraw/pull/1401)) - -[internal only change layout ground work for highlighter] - -#### [feature] reduce motion ([#1485](https://github.com/tldraw/tldraw/pull/1485)) - -- [editor] Add `reduceMotion` user preference -- Add reduce motion option to preferences - -#### [feature] Easier store persistence API + persistence example ([#1480](https://github.com/tldraw/tldraw/pull/1480)) - -- [tlstore] adds `getSnapshot` and `loadSnapshot` - -#### Add DSL to make writing shape-layout test cases much easier ([#1413](https://github.com/tldraw/tldraw/pull/1413)) - -[internal only change] - -#### Feature flags rework ([#1474](https://github.com/tldraw/tldraw/pull/1474)) - -[internal only change] - -#### [tiny] add isPageId ([#1482](https://github.com/tldraw/tldraw/pull/1482)) - -- [tlschema] Add `isPageId` - -#### [minor] Mark tlsync-client internal APIs ([#1481](https://github.com/tldraw/tldraw/pull/1481)) - -- Removes internal APIs from `@tldraw/tlsync-client` - -#### [refactor] update record names ([#1473](https://github.com/tldraw/tldraw/pull/1473)) - -- [editor] rename record types - -#### remove safari special-casing for paste ([#1470](https://github.com/tldraw/tldraw/pull/1470)) - -[fixes a regression introduced during this release] - -#### Don't allow `g` keyboard shortcut in readonly mode, show laser tool in the toolbar ([#1459](https://github.com/tldraw/tldraw/pull/1459)) - -- Disable geo tool shortcut in readonly mode. Show laser on the toolbar. - -#### [mini-feature] Following indicator ([#1468](https://github.com/tldraw/tldraw/pull/1468)) - -- Adds viewport following indicator - -#### [chore] refactor user preferences ([#1435](https://github.com/tldraw/tldraw/pull/1435)) - -- Add a brief release note for your PR here. - -#### Add translations for "Leave shared project" action ([#1394](https://github.com/tldraw/tldraw/pull/1394)) - -- None - -#### update use-gesture ([#1453](https://github.com/tldraw/tldraw/pull/1453)) - -- Updates use-gesture to fix pinch gesture bug on iPad. - -#### Add migration for horizontal alignment ([#1443](https://github.com/tldraw/tldraw/pull/1443)) - -- Add support for legacy alignment options. - -#### Stricter ID types ([#1439](https://github.com/tldraw/tldraw/pull/1439)) - -[internal only, covered by #1432 changelog] - -#### [refactor] restore createTLSchema ([#1444](https://github.com/tldraw/tldraw/pull/1444)) - -- [editor] Simplifies custom shape definition -- [tldraw] Updates props for `` component to require a `TldrawEditorConfig`. - -#### Fix cursor shadow getting clipped ([#1441](https://github.com/tldraw/tldraw/pull/1441)) - -- Fixed a bug where custom cursors could have their shadow clipped. - -#### Add SVG cursors for all cursor types ([#1416](https://github.com/tldraw/tldraw/pull/1416)) - -- Added consistent custom cursors. - -#### [refactor] remove `createTLSchema` ([#1440](https://github.com/tldraw/tldraw/pull/1440)) - -- [tlschema] Removes `createTLSchema` in favor of `TldrawEditorConfig` - -#### [refactor] Remove `TLShapeDef`, `getShapeUtilByType`. ([#1432](https://github.com/tldraw/tldraw/pull/1432)) - -- [tlschema] Update props of `createTLSchema` -- [editor] Update props of `TldrawEditorConfig` -- [editor] Remove `App.getShapeUtilByType` -- [editor] Update `App.getShapeUtil` to take a type rather than a shape - -#### [refactor] record migrations ([#1430](https://github.com/tldraw/tldraw/pull/1430)) - -- [tlschema] Improve `defineMigrations` -- [editor] Simplify migration definitions - -#### Measure individual words instead of just line breaks for text exports ([#1397](https://github.com/tldraw/tldraw/pull/1397)) - -- Add a brief release note for your PR here. - -#### Update docs links + guides + build ([#1422](https://github.com/tldraw/tldraw/pull/1422)) - -* [docs] Updated guides to get assets from the new `tldraw/tldraw` repo instead of the old `tldraw/tldraw-examples`. -* [docs] Updated an old CodeSandbox link to the new StackBlitz. - -#### Create @tldraw/indices package ([#1426](https://github.com/tldraw/tldraw/pull/1426)) - -- [@tldraw/editor] Remove fractional indices code into `@tldraw/indices` -- [@tldraw/indices] Create library for fractional indices code - -#### [feature] Add checkbox to toolbar ([#1423](https://github.com/tldraw/tldraw/pull/1423)) - -- Adds missing checkbox to toolbar. - -#### [improvement] set horizontal position using text alignment ([#1419](https://github.com/tldraw/tldraw/pull/1419)) - -- Geo shapes and sticky notes now position their labels based on their alignment. - -#### [fix] reorder handles in front of selection ([#1420](https://github.com/tldraw/tldraw/pull/1420)) - -- Fix a bug where handles would appear behind selection indicators. - -#### [feature] add laser pointer ([#1412](https://github.com/tldraw/tldraw/pull/1412)) - -- Adds the laser pointer tool. - -#### [firefox] Fix the pointer getting stuck down when you press the control key ([#1390](https://github.com/tldraw/tldraw/pull/1390)) - -- [Firefox] Fixed a bug where the pointer could get stuck down when the control key is held down. - -#### Vertical text alignment for geo shapes ([#1414](https://github.com/tldraw/tldraw/pull/1414)) - -- This adds vertical text alignment property to geo shapes. - -#### [fix] page menu, drag handle css ([#1406](https://github.com/tldraw/tldraw/pull/1406)) - -- Fix styling in the page menu - -#### Switch to new collaborators component ([#1405](https://github.com/tldraw/tldraw/pull/1405)) - -- [Breaking] Removes the old version of LiveCollaborators, replacing it with the new one based on `TLInstancePresence` - -#### [improvement] refactor paste to support multi-line text ([#1398](https://github.com/tldraw/tldraw/pull/1398)) - -- Improves clipboard logic when pasting text -- Adds support for pasting multi-line text -- Adds maximum widths when pasting single-line text -- Adds support for RTL languages when pasting multi-line or wrapped text -- Strips leading indentation when pasting text - -#### remove url state, to private ([#1402](https://github.com/tldraw/tldraw/pull/1402)) - -- [editor] remove `useUrlState` - -#### Don't allow the users to use keyboard shortcuts to select tools in readonly mode. ([#1382](https://github.com/tldraw/tldraw/pull/1382)) - -- Disable keyboard shortcut events for tools in readonly mode. We only allow the select, hand tools, and zoom tool. - -#### [fix] Don't synchronize isReadOnly ([#1396](https://github.com/tldraw/tldraw/pull/1396)) - -- Removes the isReadOnly value from the `user_document_settings` record type. - -#### fix pasted tabs not getting converted to space ([#1388](https://github.com/tldraw/tldraw/pull/1388)) - -- Fixed a bug where pasted tabs wouldn't get converted into spaces. - -#### Delete an empty text shape when clicking on another text shape. ([#1384](https://github.com/tldraw/tldraw/pull/1384)) - -- Fix a problem with empty text shapes not getting deleted if you clicked on another text shape. - -#### Fix setting the grid mode. ([#1386](https://github.com/tldraw/tldraw/pull/1386)) - -- Fix grid mode toggle. - -#### Update codesandbox + example link ([#1368](https://github.com/tldraw/tldraw/pull/1368)) - -- [docs] Fixed some links to examples. - -#### Fix selection foreground being misaligned ([#1380](https://github.com/tldraw/tldraw/pull/1380)) - -- None (fix for a bug that hasn't released) - -#### Expand selection outline for single-selected draw shape ([#1379](https://github.com/tldraw/tldraw/pull/1379)) - -- Improve selection outlines around horizontal or vertical draw shapes - -#### Add localizations for snapshots links ([#1347](https://github.com/tldraw/tldraw/pull/1347)) - -- Add localization for creating snapshot links. - -#### [fix] pointer location not updating when moving over editing shape ([#1378](https://github.com/tldraw/tldraw/pull/1378)) - -- Fix a bug where the pointer location would not update when moving the pointer over an editing shape. - -#### [perf] deleteShapes ([#1373](https://github.com/tldraw/tldraw/pull/1373)) - -- Perf improvement for deleting shapes in a document with lots of pages. - -#### Neaten up pr template ([#1369](https://github.com/tldraw/tldraw/pull/1369)) - -- None: internal - -#### fix a couple of consistency assumptions ([#1365](https://github.com/tldraw/tldraw/pull/1365)) - -- Fixes a couple of minor consistency bugs affecting shape updating and page deletion in multiplayer contexts. - -#### Disable nightly/on-demand webdriver scripts ([#1366](https://github.com/tldraw/tldraw/pull/1366)) - -None - -#### avoid lazy race conditions ([#1364](https://github.com/tldraw/tldraw/pull/1364)) - -[internal only] - -#### Adds CI for webdriver tests ([#1343](https://github.com/tldraw/tldraw/pull/1343)) - -- Github action CI workflows added for webdriver tests -- Refactored e2e test runner - -#### enable eslint for test files ([#1363](https://github.com/tldraw/tldraw/pull/1363)) - -internal-only change - -#### [perf] make ensureStoreIsUsable scale better ([#1362](https://github.com/tldraw/tldraw/pull/1362)) - -- Add a brief release note for your PR here. - -#### Export Events stuff ([#1360](https://github.com/tldraw/tldraw/pull/1360)) - -- [ui] export the `TLUiEventSource` type -- [ui] export the `EventsProviderProps ` type -- [ui] export the `useEvents ` hook - -#### presence-related fixes ([#1361](https://github.com/tldraw/tldraw/pull/1361)) - -- Fix a bug where creating a page could throw an error in some multiplayer contexts. - -#### [improvement] rename onEvent to onUiEvent ([#1358](https://github.com/tldraw/tldraw/pull/1358)) - -- [docs] Adds docs for ui events -- [tldraw] Renames `onEvent` to `onUiEvent` - -#### [docs] Update links in docs ([#1357](https://github.com/tldraw/tldraw/pull/1357)) - -- [docs] Update links in docs to point to the tldraw repository rather than tldraw-examples. - -#### [improvement] Ui events followup ([#1354](https://github.com/tldraw/tldraw/pull/1354)) - -- [ui] Adds source to ui events data object -- [ui] Corrects source for toolbar events -- [ui] Corrects source for clipboard events -- [examples] Updates events example - -#### [fix] various text ([#1350](https://github.com/tldraw/tldraw/pull/1350)) - -- Allow leading whitespace - -#### [chore] Bump nanoid ([#1349](https://github.com/tldraw/tldraw/pull/1349)) - -- Remove unused userId and instanceId props from AppOptions - -#### Fix "copy as png" in firefox when `dom.events.asyncClipboard.clipboardItem` is enabled ([#1342](https://github.com/tldraw/tldraw/pull/1342)) - -- Fix "copy as png" in firefox when `dom.events.asyncClipboard.clipboardItem` is enabled - -#### Rework the assets package for strategy-specific imports ([#1341](https://github.com/tldraw/tldraw/pull/1341)) - -- [dev] If you're using the `@tldraw/assets` package, you need to update your code to `import { getAssetUrlsByImport } from '@tldraw/assets/imports'` instead of `import { getBundlerAssetUrls } from '@tldraw/assets` - ---- - -#### 💥 Breaking Change - -- [minor] Mark tlsync-client internal APIs [#1481](https://github.com/tldraw/tldraw/pull/1481) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/store` - - [tweak] migrate store snapshot arguments [#1659](https://github.com/tldraw/tldraw/pull/1659) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/store`, `@tldraw/tlschema` - - [improvement] store snapshot types [#1657](https://github.com/tldraw/tldraw/pull/1657) ([@steveruizok](https://github.com/steveruizok)) - - Rename tlstore to store [#1507](https://github.com/tldraw/tldraw/pull/1507) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/ui` - - [fix] react component runaways, error boundaries [#1625](https://github.com/tldraw/tldraw/pull/1625) ([@steveruizok](https://github.com/steveruizok)) - - Tidy up [#1600](https://github.com/tldraw/tldraw/pull/1600) ([@steveruizok](https://github.com/steveruizok)) - - Use unpkg as a default for serving assets. [#1548](https://github.com/tldraw/tldraw/pull/1548) ([@MitjaBezensek](https://github.com/MitjaBezensek)) - - Switch to new collaborators component [#1405](https://github.com/tldraw/tldraw/pull/1405) ([@ds300](https://github.com/ds300)) - - [improvement] Ui events followup [#1354](https://github.com/tldraw/tldraw/pull/1354) ([@steveruizok](https://github.com/steveruizok)) - - [feature] ui events [#1326](https://github.com/tldraw/tldraw/pull/1326) ([@orangemug](https://github.com/orangemug) [@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/tldraw`, `@tldraw/tlschema` - - `ShapeUtil` refactor, `Editor` cleanup [#1611](https://github.com/tldraw/tldraw/pull/1611) ([@steveruizok](https://github.com/steveruizok)) - - [refactor] restore createTLSchema [#1444](https://github.com/tldraw/tldraw/pull/1444) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor` - - Remove on drop override [#1612](https://github.com/tldraw/tldraw/pull/1612) ([@steveruizok](https://github.com/steveruizok)) - - Rename `ShapeUtil.render` -> `ShapeUtil.component` [#1609](https://github.com/tldraw/tldraw/pull/1609) ([@steveruizok](https://github.com/steveruizok)) - - [fix] camera culling [#1602](https://github.com/tldraw/tldraw/pull/1602) ([@steveruizok](https://github.com/steveruizok)) - - remove `ShapeUtil.transform` [#1590](https://github.com/tldraw/tldraw/pull/1590) ([@steveruizok](https://github.com/steveruizok)) - - remove `ShapeUtil.point` [#1591](https://github.com/tldraw/tldraw/pull/1591) ([@steveruizok](https://github.com/steveruizok)) - - remove url state, to private [#1402](https://github.com/tldraw/tldraw/pull/1402) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/tldraw`, `@tldraw/ui` - - tldraw.css [#1607](https://github.com/tldraw/tldraw/pull/1607) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/tlschema`, `@tldraw/ui`, `@tldraw/utils`, `@tldraw/validate` - - Styles API [#1580](https://github.com/tldraw/tldraw/pull/1580) ([@SomeHats](https://github.com/SomeHats) [@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/tldraw`, `@tldraw/tlschema`, `@tldraw/utils`, `@tldraw/validate` - - mini `defineShape` API [#1563](https://github.com/tldraw/tldraw/pull/1563) ([@SomeHats](https://github.com/SomeHats)) -- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/tldraw`, `@tldraw/ui` - - `ExternalContentManager` for handling external content (files, images, etc) [#1550](https://github.com/tldraw/tldraw/pull/1550) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/tlschema`, `@tldraw/ui` - - hoist opacity out of props [#1526](https://github.com/tldraw/tldraw/pull/1526) ([@SomeHats](https://github.com/SomeHats)) - - Add support for project names [#1340](https://github.com/tldraw/tldraw/pull/1340) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) - - [refactor] Remove `TLShapeDef`, `getShapeUtilByType`. [#1432](https://github.com/tldraw/tldraw/pull/1432) ([@steveruizok](https://github.com/steveruizok) [@SomeHats](https://github.com/SomeHats)) - - [fix] Don't synchronize isReadOnly [#1396](https://github.com/tldraw/tldraw/pull/1396) ([@ds300](https://github.com/ds300)) -- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/store`, `@tldraw/tlschema`, `@tldraw/ui` - - Independent instance state persistence [#1493](https://github.com/tldraw/tldraw/pull/1493) ([@ds300](https://github.com/ds300)) - - tlschema cleanup [#1509](https://github.com/tldraw/tldraw/pull/1509) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/ui` - - Renaming types, shape utils, tools [#1513](https://github.com/tldraw/tldraw/pull/1513) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/tlschema`, `@tldraw/validate` - - Rename tlvalidate to validate [#1508](https://github.com/tldraw/tldraw/pull/1508) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/file-format`, `@tldraw/tlschema`, `@tldraw/ui` - - Cleanup @tldraw/ui types / exports [#1504](https://github.com/tldraw/tldraw/pull/1504) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/indices`, `@tldraw/tldraw`, `@tldraw/ui` - - rename app to editor [#1503](https://github.com/tldraw/tldraw/pull/1503) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/tldraw`, `@tldraw/tlschema`, `@tldraw/ui` - - [refactor] User-facing APIs [#1478](https://github.com/tldraw/tldraw/pull/1478) ([@steveruizok](https://github.com/steveruizok)) - - [chore] refactor user preferences [#1435](https://github.com/tldraw/tldraw/pull/1435) ([@ds300](https://github.com/ds300)) -- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/tlschema`, `@tldraw/ui` - - [refactor] update record names [#1473](https://github.com/tldraw/tldraw/pull/1473) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/tlschema` - - [refactor] remove `createTLSchema` [#1440](https://github.com/tldraw/tldraw/pull/1440) ([@steveruizok](https://github.com/steveruizok)) - - [refactor] record migrations [#1430](https://github.com/tldraw/tldraw/pull/1430) ([@steveruizok](https://github.com/steveruizok)) - - [chore] Bump nanoid [#1349](https://github.com/tldraw/tldraw/pull/1349) ([@ds300](https://github.com/ds300)) -- `@tldraw/editor`, `@tldraw/indices`, `@tldraw/utils` - - Create @tldraw/indices package [#1426](https://github.com/tldraw/tldraw/pull/1426) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/ui` - - [improvement] rename onEvent to onUiEvent [#1358](https://github.com/tldraw/tldraw/pull/1358) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/assets`, `@tldraw/tlschema` - - Rework the assets package for strategy-specific imports [#1341](https://github.com/tldraw/tldraw/pull/1341) ([@SomeHats](https://github.com/SomeHats)) - -#### 🚀 Enhancement - -- [feature] Easier store persistence API + persistence example [#1480](https://github.com/tldraw/tldraw/pull/1480) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/tlschema`, `@tldraw/ui` - - Styles API follow-ups [#1636](https://github.com/tldraw/tldraw/pull/1636) ([@SomeHats](https://github.com/SomeHats) [@steveruizok](https://github.com/steveruizok)) - - (1/2) Cursor Chat - Presence [#1487](https://github.com/tldraw/tldraw/pull/1487) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor` - - Make resizeBox a regular function [#1610](https://github.com/tldraw/tldraw/pull/1610) ([@steveruizok](https://github.com/steveruizok)) - - [improvement] set horizontal position using text alignment [#1419](https://github.com/tldraw/tldraw/pull/1419) ([@steveruizok](https://github.com/steveruizok)) - - [fix] pointer location not updating when moving over editing shape [#1378](https://github.com/tldraw/tldraw/pull/1378) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/tlschema` - - [fix] yjs presence [#1603](https://github.com/tldraw/tldraw/pull/1603) ([@steveruizok](https://github.com/steveruizok)) - - (1/2) Timeout collaborator cursors [#1525](https://github.com/tldraw/tldraw/pull/1525) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) - - [feature] add vertical align to note shape [#1539](https://github.com/tldraw/tldraw/pull/1539) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/file-format` - - Add optional generic to `updateShapes` / `createShapes` [#1579](https://github.com/tldraw/tldraw/pull/1579) ([@steveruizok](https://github.com/steveruizok)) - - move v1 migration code into file-format [#1499](https://github.com/tldraw/tldraw/pull/1499) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/ui` - - Add support for locking shapes [#1447](https://github.com/tldraw/tldraw/pull/1447) ([@MitjaBezensek](https://github.com/MitjaBezensek) [@steveruizok](https://github.com/steveruizok)) - - [feature] reduce motion [#1485](https://github.com/tldraw/tldraw/pull/1485) ([@steveruizok](https://github.com/steveruizok)) - - [mini-feature] Following indicator [#1468](https://github.com/tldraw/tldraw/pull/1468) ([@steveruizok](https://github.com/steveruizok)) - - Add SVG cursors for all cursor types [#1416](https://github.com/tldraw/tldraw/pull/1416) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) - - [improvement] refactor paste to support multi-line text [#1398](https://github.com/tldraw/tldraw/pull/1398) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/assets`, `@tldraw/editor`, `@tldraw/ui` - - [3/3] Highlighter styling [#1490](https://github.com/tldraw/tldraw/pull/1490) ([@SomeHats](https://github.com/SomeHats) [@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/primitives` - - [2/3] renderer changes to support "sandwich mode" highlighting [#1418](https://github.com/tldraw/tldraw/pull/1418) ([@SomeHats](https://github.com/SomeHats)) -- `@tldraw/assets`, `@tldraw/editor`, `@tldraw/tlschema`, `@tldraw/ui` - - [1/3] initial highlighter shape/tool [#1401](https://github.com/tldraw/tldraw/pull/1401) ([@SomeHats](https://github.com/SomeHats)) - - [feature] add laser pointer [#1412](https://github.com/tldraw/tldraw/pull/1412) ([@steveruizok](https://github.com/steveruizok)) - - Vertical text alignment for geo shapes [#1414](https://github.com/tldraw/tldraw/pull/1414) ([@MitjaBezensek](https://github.com/MitjaBezensek) [@steveruizok](https://github.com/steveruizok)) -- `@tldraw/ui` - - [feature] Add checkbox to toolbar [#1423](https://github.com/tldraw/tldraw/pull/1423) ([@steveruizok](https://github.com/steveruizok)) - - Add stuff for new 'share project' flow [#1403](https://github.com/tldraw/tldraw/pull/1403) ([@ds300](https://github.com/ds300)) - - Snapshot link menu translations [#1399](https://github.com/tldraw/tldraw/pull/1399) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/assets`, `@tldraw/ui` - - open menus refactor [#1400](https://github.com/tldraw/tldraw/pull/1400) ([@steveruizok](https://github.com/steveruizok)) - -#### 🐛 Bug Fix - -- Lokalise: Translations update [#1618](https://github.com/tldraw/tldraw/pull/1618) ([@TodePond](https://github.com/TodePond)) -- Fa translation [#1500](https://github.com/tldraw/tldraw/pull/1500) ([@mokazemi](https://github.com/mokazemi) [@steveruizok](https://github.com/steveruizok)) -- Lokalise: Translations update [#1572](https://github.com/tldraw/tldraw/pull/1572) ([@TodePond](https://github.com/TodePond)) -- Update changelog. Bump version. [#1546](https://github.com/tldraw/tldraw/pull/1546) ([@MitjaBezensek](https://github.com/MitjaBezensek)) -- Lokalise: Translations update [#1515](https://github.com/tldraw/tldraw/pull/1515) ([@TodePond](https://github.com/TodePond)) -- VS Code version bump, changelog. [#1497](https://github.com/tldraw/tldraw/pull/1497) ([@MitjaBezensek](https://github.com/MitjaBezensek)) -- Fix issue template label not getting applied [#1428](https://github.com/tldraw/tldraw/pull/1428) ([@TodePond](https://github.com/TodePond)) -- Bump version. [#1421](https://github.com/tldraw/tldraw/pull/1421) ([@MitjaBezensek](https://github.com/MitjaBezensek)) -- Update community translations + remove unused translations [#1356](https://github.com/tldraw/tldraw/pull/1356) ([@TodePond](https://github.com/TodePond)) -- [docs] Update links in docs [#1357](https://github.com/tldraw/tldraw/pull/1357) ([@steveruizok](https://github.com/steveruizok)) -- [chore] Add label options to PR template [#1339](https://github.com/tldraw/tldraw/pull/1339) ([@ds300](https://github.com/ds300)) -- Fix publishing [#1338](https://github.com/tldraw/tldraw/pull/1338) ([@SomeHats](https://github.com/SomeHats)) -- Update README.md [#1331](https://github.com/tldraw/tldraw/pull/1331) ([@steveruizok](https://github.com/steveruizok)) -- [docs] editor API [#1328](https://github.com/tldraw/tldraw/pull/1328) ([@steveruizok](https://github.com/steveruizok)) -- [docs] Add missing params docs [#1223](https://github.com/tldraw/tldraw/pull/1223) ([@TodePond](https://github.com/TodePond)) -- Add link to original tldraw within issue template [#1225](https://github.com/tldraw/tldraw/pull/1225) ([@TodePond](https://github.com/TodePond)) -- Fix issue templates not appearing [#1228](https://github.com/tldraw/tldraw/pull/1228) ([@TodePond](https://github.com/TodePond)) -- [improvement] readme / contributing [#1199](https://github.com/tldraw/tldraw/pull/1199) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) -- [improvement] add bug report / feature request [#1218](https://github.com/tldraw/tldraw/pull/1218) ([@steveruizok](https://github.com/steveruizok)) -- add `env` and prefix output options to exec [#1217](https://github.com/tldraw/tldraw/pull/1217) ([@SomeHats](https://github.com/SomeHats)) -- lite: run prettier on js + json files [#1195](https://github.com/tldraw/tldraw/pull/1195) ([@SomeHats](https://github.com/SomeHats)) -- [chore] use explicit yarn in clean script [#1216](https://github.com/tldraw/tldraw/pull/1216) ([@ds300](https://github.com/ds300)) -- fix husky install [#1212](https://github.com/tldraw/tldraw/pull/1212) ([@SomeHats](https://github.com/SomeHats)) -- Alex/test [#1202](https://github.com/tldraw/tldraw/pull/1202) ([@SomeHats](https://github.com/SomeHats)) -- lite: tweak lockfile name [#1195](https://github.com/tldraw/tldraw/pull/1195) ([@SomeHats](https://github.com/SomeHats)) -- lite: common logfile name [#1195](https://github.com/tldraw/tldraw/pull/1195) ([@SomeHats](https://github.com/SomeHats)) -- lite: open runners [#1195](https://github.com/tldraw/tldraw/pull/1195) ([@SomeHats](https://github.com/SomeHats)) -- poke [#1195](https://github.com/tldraw/tldraw/pull/1195) ([@SomeHats](https://github.com/SomeHats)) -- lite: standalone? [#1195](https://github.com/tldraw/tldraw/pull/1195) ([@SomeHats](https://github.com/SomeHats)) -- `@tldraw/editor` - - Fix crash when rotating a deleted shape [#1658](https://github.com/tldraw/tldraw/pull/1658) ([@TodePond](https://github.com/TodePond)) - - [fix] pen mode touches [#1655](https://github.com/tldraw/tldraw/pull/1655) ([@steveruizok](https://github.com/steveruizok)) - - Fix text shapes not having colour [#1649](https://github.com/tldraw/tldraw/pull/1649) ([@TodePond](https://github.com/TodePond)) - - Fix SVG cursors not being used [#1639](https://github.com/tldraw/tldraw/pull/1639) ([@TodePond](https://github.com/TodePond)) - - [fix] tldraw file drop [#1616](https://github.com/tldraw/tldraw/pull/1616) ([@steveruizok](https://github.com/steveruizok)) - - Make sure loading screens use dark mode user preference. [#1552](https://github.com/tldraw/tldraw/pull/1552) ([@MitjaBezensek](https://github.com/MitjaBezensek) [@steveruizok](https://github.com/steveruizok)) - - [fix] Remove group shape export backgrounds [#1587](https://github.com/tldraw/tldraw/pull/1587) ([@steveruizok](https://github.com/steveruizok)) - - Move the loading of assets to the TldrawEditorWithReadyStore so that all code paths load the assets. [#1561](https://github.com/tldraw/tldraw/pull/1561) ([@MitjaBezensek](https://github.com/MitjaBezensek)) - - shapes folder, move tools into shape defs [#1574](https://github.com/tldraw/tldraw/pull/1574) ([@SomeHats](https://github.com/SomeHats)) - - offset drop point by editor client rect [#1564](https://github.com/tldraw/tldraw/pull/1564) ([@BrianHung](https://github.com/BrianHung)) - - More misc sync fixes [#1559](https://github.com/tldraw/tldraw/pull/1559) ([@ds300](https://github.com/ds300)) - - Misc sync fixes [#1555](https://github.com/tldraw/tldraw/pull/1555) ([@ds300](https://github.com/ds300)) - - [fix] Shift key code / nudge [#1537](https://github.com/tldraw/tldraw/pull/1537) ([@steveruizok](https://github.com/steveruizok)) - - scale exported canvases when they reach the browsers max size [#1536](https://github.com/tldraw/tldraw/pull/1536) ([@SomeHats](https://github.com/SomeHats)) - - [fix] control click on mac [#1535](https://github.com/tldraw/tldraw/pull/1535) ([@steveruizok](https://github.com/steveruizok)) - - Fix being able to undo following [#1531](https://github.com/tldraw/tldraw/pull/1531) ([@TodePond](https://github.com/TodePond)) - - send user prefs data in broadcast msg [#1466](https://github.com/tldraw/tldraw/pull/1466) ([@ds300](https://github.com/ds300)) - - Fix positioning of default cursor [#1458](https://github.com/tldraw/tldraw/pull/1458) ([@TodePond](https://github.com/TodePond)) - - change pointer cursor to white [#1454](https://github.com/tldraw/tldraw/pull/1454) ([@TodePond](https://github.com/TodePond)) - - Fix cursor shadow getting clipped [#1441](https://github.com/tldraw/tldraw/pull/1441) ([@TodePond](https://github.com/TodePond)) - - Fix new wobble [#1431](https://github.com/tldraw/tldraw/pull/1431) ([@TodePond](https://github.com/TodePond)) - - [fix] laser pointer [#1429](https://github.com/tldraw/tldraw/pull/1429) ([@steveruizok](https://github.com/steveruizok)) - - [fix] reorder handles in front of selection [#1420](https://github.com/tldraw/tldraw/pull/1420) ([@steveruizok](https://github.com/steveruizok)) - - [firefox] Fix the pointer getting stuck down when you press the control key [#1390](https://github.com/tldraw/tldraw/pull/1390) ([@TodePond](https://github.com/TodePond)) - - fix viewport following [#1411](https://github.com/tldraw/tldraw/pull/1411) ([@ds300](https://github.com/ds300)) - - fix pasted tabs not getting converted to space [#1388](https://github.com/tldraw/tldraw/pull/1388) ([@TodePond](https://github.com/TodePond)) - - Delete an empty text shape when clicking on another text shape. [#1384](https://github.com/tldraw/tldraw/pull/1384) ([@MitjaBezensek](https://github.com/MitjaBezensek)) - - Fix setting the grid mode. [#1386](https://github.com/tldraw/tldraw/pull/1386) ([@MitjaBezensek](https://github.com/MitjaBezensek)) - - Fix selection foreground being misaligned [#1380](https://github.com/tldraw/tldraw/pull/1380) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) - - Expand selection outline for single-selected draw shape [#1379](https://github.com/tldraw/tldraw/pull/1379) ([@SomeHats](https://github.com/SomeHats)) - - [fix] Allow interactions with embeds in readonly mode [#1333](https://github.com/tldraw/tldraw/pull/1333) ([@MitjaBezensek](https://github.com/MitjaBezensek)) - - [perf] deleteShapes [#1373](https://github.com/tldraw/tldraw/pull/1373) ([@ds300](https://github.com/ds300)) - - fix a couple of consistency assumptions [#1365](https://github.com/tldraw/tldraw/pull/1365) ([@ds300](https://github.com/ds300)) - - [fix] various text [#1350](https://github.com/tldraw/tldraw/pull/1350) ([@steveruizok](https://github.com/steveruizok)) - - [fix] tabs in text exports [#1323](https://github.com/tldraw/tldraw/pull/1323) ([@steveruizok](https://github.com/steveruizok)) - - [fix] update useTransform.ts [#1327](https://github.com/tldraw/tldraw/pull/1327) ([@steveruizok](https://github.com/steveruizok)) - - [improvement] dragging start distance on coarse pointer [#1220](https://github.com/tldraw/tldraw/pull/1220) ([@steveruizok](https://github.com/steveruizok)) - - [fix] SVG export for arrows with labels but no arrowheads [#1229](https://github.com/tldraw/tldraw/pull/1229) ([@steveruizok](https://github.com/steveruizok)) - - add docs for TLShapeUtil [#1215](https://github.com/tldraw/tldraw/pull/1215) ([@TodePond](https://github.com/TodePond)) - - [fix] publish [#1222](https://github.com/tldraw/tldraw/pull/1222) ([@ds300](https://github.com/ds300)) - - [fix] typo in isFocusingInput [#1221](https://github.com/tldraw/tldraw/pull/1221) ([@ds300](https://github.com/ds300)) - - [feat] new LiveCollaborators behind feature flag [#1219](https://github.com/tldraw/tldraw/pull/1219) ([@ds300](https://github.com/ds300)) - - [fix] collaborator render order [#1213](https://github.com/tldraw/tldraw/pull/1213) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/ui` - - 3/2 Cursor chat [#1623](https://github.com/tldraw/tldraw/pull/1623) ([@steveruizok](https://github.com/steveruizok)) - - [fix] embeds [#1578](https://github.com/tldraw/tldraw/pull/1578) ([@steveruizok](https://github.com/steveruizok)) - - highlighter fixes [#1530](https://github.com/tldraw/tldraw/pull/1530) ([@SomeHats](https://github.com/SomeHats)) - - Feature flags rework [#1474](https://github.com/tldraw/tldraw/pull/1474) ([@SomeHats](https://github.com/SomeHats)) - - remove svg layer, html all the things, rs to tl [#1227](https://github.com/tldraw/tldraw/pull/1227) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) - - Added `pHYs` to import/export of png images [#1200](https://github.com/tldraw/tldraw/pull/1200) ([@orangemug](https://github.com/orangemug) [@steveruizok](https://github.com/steveruizok)) -- `@tldraw/tldraw` - - [fix] tldraw api report [#1615](https://github.com/tldraw/tldraw/pull/1615) ([@steveruizok](https://github.com/steveruizok)) - - Fix to not ignore the `userId` option for `` component in `@tldraw/tldraw` [#1205](https://github.com/tldraw/tldraw/pull/1205) ([@orangemug](https://github.com/orangemug)) -- `@tldraw/editor`, `@tldraw/primitives` - - [refactor] snapping [#1589](https://github.com/tldraw/tldraw/pull/1589) ([@steveruizok](https://github.com/steveruizok)) - - Fix arrows with weird bends crashing [#1540](https://github.com/tldraw/tldraw/pull/1540) ([@TodePond](https://github.com/TodePond)) - - ensure that fixed points stay fixed [#1523](https://github.com/tldraw/tldraw/pull/1523) ([@steveruizok](https://github.com/steveruizok)) - - Use `strokePathData` for `` path to avoid bugs in the inner path algo [#1207](https://github.com/tldraw/tldraw/pull/1207) ([@orangemug](https://github.com/orangemug) [@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/tlschema` - - update exports for user presence [#1583](https://github.com/tldraw/tldraw/pull/1583) ([@steveruizok](https://github.com/steveruizok)) - - [improvement] Embed shape cleanup [#1569](https://github.com/tldraw/tldraw/pull/1569) ([@steveruizok](https://github.com/steveruizok)) - - Add migration for horizontal alignment [#1443](https://github.com/tldraw/tldraw/pull/1443) ([@MitjaBezensek](https://github.com/MitjaBezensek) [@steveruizok](https://github.com/steveruizok)) - - [chore] move schema construction to tlschema package [#1334](https://github.com/tldraw/tldraw/pull/1334) ([@ds300](https://github.com/ds300)) -- `@tldraw/assets`, `@tldraw/editor`, `@tldraw/ui`, `@tldraw/utils` - - Asset improvements [#1557](https://github.com/tldraw/tldraw/pull/1557) ([@MitjaBezensek](https://github.com/MitjaBezensek)) -- `@tldraw/ui` - - Use `"Toggle locked"` [#1538](https://github.com/tldraw/tldraw/pull/1538) ([@steveruizok](https://github.com/steveruizok)) - - Select locked shapes on long press [#1529](https://github.com/tldraw/tldraw/pull/1529) ([@steveruizok](https://github.com/steveruizok)) - - remove safari special-casing for paste [#1470](https://github.com/tldraw/tldraw/pull/1470) ([@SomeHats](https://github.com/SomeHats)) - - Don't allow `g` keyboard shortcut in readonly mode, show laser tool in the toolbar [#1459](https://github.com/tldraw/tldraw/pull/1459) ([@MitjaBezensek](https://github.com/MitjaBezensek) [@steveruizok](https://github.com/steveruizok)) - - Fix people menu button border on android [#1471](https://github.com/tldraw/tldraw/pull/1471) ([@TodePond](https://github.com/TodePond)) - - [fix] lock option for laser tool [#1460](https://github.com/tldraw/tldraw/pull/1460) ([@steveruizok](https://github.com/steveruizok)) - - Add laser keyboard shortcut. [#1467](https://github.com/tldraw/tldraw/pull/1467) ([@MitjaBezensek](https://github.com/MitjaBezensek)) - - [fix] make follow icon visible on iPad [#1462](https://github.com/tldraw/tldraw/pull/1462) ([@steveruizok](https://github.com/steveruizok)) - - [fix] page item submenu [#1461](https://github.com/tldraw/tldraw/pull/1461) ([@steveruizok](https://github.com/steveruizok)) - - Add translations for "Leave shared project" action [#1394](https://github.com/tldraw/tldraw/pull/1394) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) - - [fix] page menu, drag handle css [#1406](https://github.com/tldraw/tldraw/pull/1406) ([@steveruizok](https://github.com/steveruizok)) - - Don't allow the users to use keyboard shortcuts to select tools in readonly mode. [#1382](https://github.com/tldraw/tldraw/pull/1382) ([@MitjaBezensek](https://github.com/MitjaBezensek)) - - Disabling middle click paste in favour of panning [#1335](https://github.com/tldraw/tldraw/pull/1335) ([@orangemug](https://github.com/orangemug) [@steveruizok](https://github.com/steveruizok)) - - Export Events stuff [#1360](https://github.com/tldraw/tldraw/pull/1360) ([@steveruizok](https://github.com/steveruizok)) - - Fix "copy as png" in firefox when `dom.events.asyncClipboard.clipboardItem` is enabled [#1342](https://github.com/tldraw/tldraw/pull/1342) ([@orangemug](https://github.com/orangemug)) - - [tiny] rename show menu paste [#1332](https://github.com/tldraw/tldraw/pull/1332) ([@steveruizok](https://github.com/steveruizok)) - - update @radix-ui/react-popover to 1.0.6-rc.5 [#1206](https://github.com/tldraw/tldraw/pull/1206) ([@SomeHats](https://github.com/SomeHats)) -- `@tldraw/file-format` - - Filter out unused assets. [#1502](https://github.com/tldraw/tldraw/pull/1502) ([@MitjaBezensek](https://github.com/MitjaBezensek)) -- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/tlschema`, `@tldraw/ui`, `@tldraw/utils` - - Stricter ID types [#1439](https://github.com/tldraw/tldraw/pull/1439) ([@SomeHats](https://github.com/SomeHats) [@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/primitives`, `@tldraw/ui` - - Measure individual words instead of just line breaks for text exports [#1397](https://github.com/tldraw/tldraw/pull/1397) ([@SomeHats](https://github.com/SomeHats)) -- `@tldraw/tlschema` - - [perf] make ensureStoreIsUsable scale better [#1362](https://github.com/tldraw/tldraw/pull/1362) ([@ds300](https://github.com/ds300)) -- `@tldraw/editor`, `@tldraw/utils` - - presence-related fixes [#1361](https://github.com/tldraw/tldraw/pull/1361) ([@ds300](https://github.com/ds300)) -- `@tldraw/assets`, `@tldraw/editor`, `@tldraw/tlschema`, `@tldraw/ui` - - [feature] `check-box` geo shape [#1330](https://github.com/tldraw/tldraw/pull/1330) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/assets`, `@tldraw/editor`, `@tldraw/tldraw`, `@tldraw/ui` - - New vite-based examples app [#1226](https://github.com/tldraw/tldraw/pull/1226) ([@SomeHats](https://github.com/SomeHats)) -- `@tldraw/assets`, `@tldraw/file-format`, `@tldraw/polyfills`, `@tldraw/primitives`, `@tldraw/tldraw`, `@tldraw/tlschema`, `@tldraw/ui`, `@tldraw/utils` - - readmes [#1195](https://github.com/tldraw/tldraw/pull/1195) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/assets`, `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/polyfills`, `@tldraw/primitives`, `@tldraw/tldraw`, `@tldraw/tlschema`, `@tldraw/ui`, `@tldraw/utils` - - [chore] update lazyrepo [#1211](https://github.com/tldraw/tldraw/pull/1211) ([@ds300](https://github.com/ds300)) - - [lite] upgrade lazyrepo [#1198](https://github.com/tldraw/tldraw/pull/1198) ([@ds300](https://github.com/ds300)) - - transfer-out: transfer out [#1195](https://github.com/tldraw/tldraw/pull/1195) ([@SomeHats](https://github.com/SomeHats)) -- `@tldraw/tlschema`, `@tldraw/ui` - - [fix] pick a better default language [#1201](https://github.com/tldraw/tldraw/pull/1201) ([@steveruizok](https://github.com/steveruizok) [@TodePond](https://github.com/TodePond)) -- `@tldraw/assets`, `@tldraw/editor`, `@tldraw/tldraw`, `@tldraw/tlschema`, `@tldraw/ui`, `@tldraw/utils` - - derived presence state [#1204](https://github.com/tldraw/tldraw/pull/1204) ([@ds300](https://github.com/ds300)) - -#### ⚠️ Pushed to `main` - -- Update publish-new.yml ([@steveruizok](https://github.com/steveruizok)) -- Update lerna.json ([@steveruizok](https://github.com/steveruizok)) -- Update publish-new.ts ([@steveruizok](https://github.com/steveruizok)) -- change App to Editor in docs ([@TodePond](https://github.com/TodePond)) -- rename api.mdx to editor.mdx ([@TodePond](https://github.com/TodePond)) -- remove e2e files ([@steveruizok](https://github.com/steveruizok)) -- main: notify huppy after release ([@SomeHats](https://github.com/SomeHats)) -- main: exclude @tldraw/assets from vite dep optimization to fix examples links ([@SomeHats](https://github.com/SomeHats)) -- `@tldraw/assets`, `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/indices`, `@tldraw/polyfills`, `@tldraw/primitives`, `@tldraw/store`, `@tldraw/tldraw`, `@tldraw/tlschema`, `@tldraw/ui`, `@tldraw/utils`, `@tldraw/validate` - - update lazyrepo ([@ds300](https://github.com/ds300)) - -#### 🏠 Internal - -- [chore] bump vscode extension to 2.0.9 [#1662](https://github.com/tldraw/tldraw/pull/1662) ([@steveruizok](https://github.com/steveruizok)) -- untrack generated files [#1646](https://github.com/tldraw/tldraw/pull/1646) ([@steveruizok](https://github.com/steveruizok)) -- Update pr template [#1570](https://github.com/tldraw/tldraw/pull/1570) ([@steveruizok](https://github.com/steveruizok)) -- Add contributor license agreement. [#1556](https://github.com/tldraw/tldraw/pull/1556) ([@steveruizok](https://github.com/steveruizok)) -- Reinstate auto [#1524](https://github.com/tldraw/tldraw/pull/1524) ([@ds300](https://github.com/ds300)) -- [infra] use npx to run auto [#1521](https://github.com/tldraw/tldraw/pull/1521) ([@ds300](https://github.com/ds300)) -- Revert 09c36781 & tweak linting [#1501](https://github.com/tldraw/tldraw/pull/1501) ([@SomeHats](https://github.com/SomeHats)) -- [fix] eslint from brivate [#1498](https://github.com/tldraw/tldraw/pull/1498) ([@steveruizok](https://github.com/steveruizok)) -- [chore] remove webdriver dependencies / scripts [#1488](https://github.com/tldraw/tldraw/pull/1488) ([@steveruizok](https://github.com/steveruizok)) -- [fix] local e2e script [#1442](https://github.com/tldraw/tldraw/pull/1442) ([@steveruizok](https://github.com/steveruizok)) -- [chore] remove yarnrc-private.yml [#1427](https://github.com/tldraw/tldraw/pull/1427) ([@steveruizok](https://github.com/steveruizok)) -- [fix] example routes on vercel [#1391](https://github.com/tldraw/tldraw/pull/1391) ([@steveruizok](https://github.com/steveruizok)) -- Neaten up pr template [#1369](https://github.com/tldraw/tldraw/pull/1369) ([@TodePond](https://github.com/TodePond)) -- remove references to tldraw-lite [#1367](https://github.com/tldraw/tldraw/pull/1367) ([@SomeHats](https://github.com/SomeHats)) -- `@tldraw/editor`, `@tldraw/ui` - - Explicit shape type checks [#1594](https://github.com/tldraw/tldraw/pull/1594) ([@steveruizok](https://github.com/steveruizok)) - - [improvement] bookmark shape logic [#1568](https://github.com/tldraw/tldraw/pull/1568) ([@steveruizok](https://github.com/steveruizok)) - - Simplify static cursors [#1520](https://github.com/tldraw/tldraw/pull/1520) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/ui` - - move some kbds into actions and tools [#1585](https://github.com/tldraw/tldraw/pull/1585) ([@BrianHung](https://github.com/BrianHung) [@steveruizok](https://github.com/steveruizok)) - - Add localizations for snapshots links [#1347](https://github.com/tldraw/tldraw/pull/1347) ([@MitjaBezensek](https://github.com/MitjaBezensek)) -- `@tldraw/editor` - - use the right TLEventHandlers [#1486](https://github.com/tldraw/tldraw/pull/1486) ([@judicaelandria](https://github.com/judicaelandria) [@steveruizok](https://github.com/steveruizok)) - - yjs example [#1560](https://github.com/tldraw/tldraw/pull/1560) ([@steveruizok](https://github.com/steveruizok)) - - rename app folder to editor [#1528](https://github.com/tldraw/tldraw/pull/1528) ([@steveruizok](https://github.com/steveruizok)) - - [fix] overlay rendering issues [#1389](https://github.com/tldraw/tldraw/pull/1389) ([@steveruizok](https://github.com/steveruizok)) - - Remove commented code in App [#1377](https://github.com/tldraw/tldraw/pull/1377) ([@steveruizok](https://github.com/steveruizok)) - - enable eslint for test files [#1363](https://github.com/tldraw/tldraw/pull/1363) ([@SomeHats](https://github.com/SomeHats)) -- `@tldraw/tlschema` - - restore styles sets exports [#1512](https://github.com/tldraw/tldraw/pull/1512) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/primitives` - - replace console.log with nicelog [#1496](https://github.com/tldraw/tldraw/pull/1496) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/indices`, `@tldraw/primitives`, `@tldraw/tldraw`, `@tldraw/ui` - - [chore] remove benchmark [#1489](https://github.com/tldraw/tldraw/pull/1489) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/tlschema` - - [tiny] add isPageId [#1482](https://github.com/tldraw/tldraw/pull/1482) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/polyfills`, `@tldraw/primitives`, `@tldraw/tldraw`, `@tldraw/tlschema`, `@tldraw/ui`, `@tldraw/utils` - - avoid lazy race conditions [#1364](https://github.com/tldraw/tldraw/pull/1364) ([@SomeHats](https://github.com/SomeHats)) - -#### 📝 Documentation - -- [fix] remove docs scripts [#1651](https://github.com/tldraw/tldraw/pull/1651) ([@steveruizok](https://github.com/steveruizok)) -- (2/2) [docs] Fix links to API. [#1654](https://github.com/tldraw/tldraw/pull/1654) ([@TodePond](https://github.com/TodePond)) -- (1/2) [docs] Restore some missing changes [#1652](https://github.com/tldraw/tldraw/pull/1652) ([@TodePond](https://github.com/TodePond)) -- [docs] Remove embeds page [#1653](https://github.com/tldraw/tldraw/pull/1653) ([@TodePond](https://github.com/TodePond)) -- docs: remove not accepting contributions notice [#1647](https://github.com/tldraw/tldraw/pull/1647) ([@gabrielchl](https://github.com/gabrielchl)) -- [docs] Add table of contents to Editor page [#1642](https://github.com/tldraw/tldraw/pull/1642) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) -- remove docs (again) [#1643](https://github.com/tldraw/tldraw/pull/1643) ([@steveruizok](https://github.com/steveruizok)) -- [1/2] Move docs to brivate [#1640](https://github.com/tldraw/tldraw/pull/1640) ([@steveruizok](https://github.com/steveruizok)) -- [docs] Allow sidebar to be scrolled on short screens [#1632](https://github.com/tldraw/tldraw/pull/1632) ([@TodePond](https://github.com/TodePond)) -- [docs] Add feedback when you search [#1633](https://github.com/tldraw/tldraw/pull/1633) ([@TodePond](https://github.com/TodePond)) -- [docs] Separate some pages out of the Docs section [#1626](https://github.com/tldraw/tldraw/pull/1626) ([@TodePond](https://github.com/TodePond)) -- [docs] Fix wrong cursor when hovering buttons [#1630](https://github.com/tldraw/tldraw/pull/1630) ([@TodePond](https://github.com/TodePond)) -- [docs] Tighten up wording & structure of Usage page [#1624](https://github.com/tldraw/tldraw/pull/1624) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) -- [docs] Tighten up Editor page introduction [#1622](https://github.com/tldraw/tldraw/pull/1622) ([@TodePond](https://github.com/TodePond)) -- [docs] Tighten up Introduction page [#1621](https://github.com/tldraw/tldraw/pull/1621) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) -- [docs] Simplify paths for uncategorised pages [#1619](https://github.com/tldraw/tldraw/pull/1619) ([@TodePond](https://github.com/TodePond)) -- Auto content refresh for docs site [#1606](https://github.com/tldraw/tldraw/pull/1606) ([@steveruizok](https://github.com/steveruizok)) -- Remove `@tldraw/utils` from the docs site [#1596](https://github.com/tldraw/tldraw/pull/1596) ([@TodePond](https://github.com/TodePond)) -- [docs] Add barebones note about translations [#1593](https://github.com/tldraw/tldraw/pull/1593) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) -- Change app to editor in docs [#1592](https://github.com/tldraw/tldraw/pull/1592) ([@TodePond](https://github.com/TodePond)) -- add presence to yjs example [#1582](https://github.com/tldraw/tldraw/pull/1582) ([@steveruizok](https://github.com/steveruizok)) -- fix: properly remove awareness from store [#1565](https://github.com/tldraw/tldraw/pull/1565) ([@shahriar-shojib](https://github.com/shahriar-shojib) [@steveruizok](https://github.com/steveruizok)) -- Add anchor targets to our headings. [#1571](https://github.com/tldraw/tldraw/pull/1571) ([@MitjaBezensek](https://github.com/MitjaBezensek)) -- Fix README typo [#1451](https://github.com/tldraw/tldraw/pull/1451) ([@fossinating](https://github.com/fossinating) [@steveruizok](https://github.com/steveruizok)) -- Update examples links to point to examples folder. [#1522](https://github.com/tldraw/tldraw/pull/1522) ([@steveruizok](https://github.com/steveruizok)) -- Update docs links + guides + build [#1422](https://github.com/tldraw/tldraw/pull/1422) ([@TodePond](https://github.com/TodePond)) -- Update codesandbox + example link [#1368](https://github.com/tldraw/tldraw/pull/1368) ([@TodePond](https://github.com/TodePond)) -- `@tldraw/editor` - - [improvement] custom shapes example [#1660](https://github.com/tldraw/tldraw/pull/1660) ([@steveruizok](https://github.com/steveruizok)) - - Add tsdocs to Editor methods [#1581](https://github.com/tldraw/tldraw/pull/1581) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) - - [Docs] Change some editor properties to methods [#1553](https://github.com/tldraw/tldraw/pull/1553) ([@TodePond](https://github.com/TodePond)) - - [Docs] Change some internal methods to public [#1554](https://github.com/tldraw/tldraw/pull/1554) ([@TodePond](https://github.com/TodePond)) -- `@tldraw/editor`, `@tldraw/tlschema` - - Styles API docs [#1641](https://github.com/tldraw/tldraw/pull/1641) ([@SomeHats](https://github.com/SomeHats) [@steveruizok](https://github.com/steveruizok)) -- `@tldraw/tlschema` - - TLSchema readme [#1506](https://github.com/tldraw/tldraw/pull/1506) ([@steveruizok](https://github.com/steveruizok)) - -#### 🧪 Tests - -- speed up playwright and add visual regression tests [#1638](https://github.com/tldraw/tldraw/pull/1638) ([@SomeHats](https://github.com/SomeHats) [@huppy-bot[bot]](https://github.com/huppy-bot[bot])) -- Disable nightly/on-demand webdriver scripts [#1366](https://github.com/tldraw/tldraw/pull/1366) ([@orangemug](https://github.com/orangemug)) -- Adds CI for webdriver tests [#1343](https://github.com/tldraw/tldraw/pull/1343) ([@orangemug](https://github.com/orangemug)) -- Added initial webdriver tests [#1337](https://github.com/tldraw/tldraw/pull/1337) ([@orangemug](https://github.com/orangemug)) -- `@tldraw/editor` - - update editor tests [#1547](https://github.com/tldraw/tldraw/pull/1547) ([@steveruizok](https://github.com/steveruizok)) - - Add DSL to make writing shape-layout test cases much easier [#1413](https://github.com/tldraw/tldraw/pull/1413) ([@SomeHats](https://github.com/SomeHats)) -- `@tldraw/editor`, `@tldraw/ui` - - Add playwright tests [#1484](https://github.com/tldraw/tldraw/pull/1484) ([@steveruizok](https://github.com/steveruizok)) - -#### 🔩 Dependency Updates - -- [chore] update wdio-vscode-service [#1346](https://github.com/tldraw/tldraw/pull/1346) ([@ds300](https://github.com/ds300)) -- `@tldraw/editor`, `@tldraw/state`, `@tldraw/store`, `@tldraw/tlschema`, `@tldraw/ui` - - Incorporate signia as @tldraw/state [#1620](https://github.com/tldraw/tldraw/pull/1620) ([@steveruizok](https://github.com/steveruizok) [@ds300](https://github.com/ds300)) -- `@tldraw/assets`, `@tldraw/editor`, `@tldraw/polyfills`, `@tldraw/tldraw`, `@tldraw/ui` - - Revert "Update dependencies (#1613)" [#1617](https://github.com/tldraw/tldraw/pull/1617) ([@SomeHats](https://github.com/SomeHats)) - - Update dependencies [#1613](https://github.com/tldraw/tldraw/pull/1613) ([@steveruizok](https://github.com/steveruizok)) -- `@tldraw/editor` - - update use-gesture [#1453](https://github.com/tldraw/tldraw/pull/1453) ([@ds300](https://github.com/ds300)) - -#### Authors: 13 - -- [@huppy-bot[bot]](https://github.com/huppy-bot[bot]) -- alex ([@SomeHats](https://github.com/SomeHats)) -- Brian Hung ([@BrianHung](https://github.com/BrianHung)) -- David ([@fossinating](https://github.com/fossinating)) -- David Sheldrick ([@ds300](https://github.com/ds300)) -- Gabriel Lee ([@gabrielchl](https://github.com/gabrielchl)) -- Judicael ([@judicaelandria](https://github.com/judicaelandria)) -- Lu Wilson ([@TodePond](https://github.com/TodePond)) -- Mitja Bezenšek ([@MitjaBezensek](https://github.com/MitjaBezensek)) -- Mohammad Kazemi ([@mokazemi](https://github.com/mokazemi)) -- Orange Mug ([@orangemug](https://github.com/orangemug)) -- Shahriar Shojib ([@shahriar-shojib](https://github.com/shahriar-shojib)) -- Steve Ruiz ([@steveruizok](https://github.com/steveruizok)) \ No newline at end of file +This is a big one! Our last release (alpha.12) was a few months ago, after which we decided to push forward with some big breaking changes that we had been putting off. This will likely remain our most breaking release, so the notes below may not be as helpful for gathering what's changed. Check the updated docs at [tldraw.dev](https://tldraw.dev). + +Some highlights: + +- The `editor.css` and `ui.css` are now combined as `tldraw.css`, so please update your imports from `@tldraw/tldraw` +- Assets are now provided by a CDN by default, so no need to copy those into your project +- We've removed `signia` and `signia-react` from dependencies: they're folded in as `@tldraw/state` +- We've added a new `ExternalContentManager` for customizing how files/ images / text and other content are handled on paste or drop +- `@tldraw/tlstore` is now `@tldraw/store` +- `@tldraw/tlvalidate` is now `@tldraw/validate` +- `@tldraw/indices` is added for our fractional indexing +- The `ShapeUtil` API requires fewer overrides and has fewer properties: caching is now handled on the Editor class methods +- We've introduced a new Styles API for hooking into our existing styles or defining your own shared properties that should move together. + +Here's the big list! + +--- + +### Release Notes + +#### Fix crash when rotating a deleted shape ([#1658](https://github.com/tldraw/tldraw/pull/1658)) + +- Fixed a crash when trying to rotate a deleted shape. + +#### [improvement] store snapshot types ([#1657](https://github.com/tldraw/tldraw/pull/1657)) + +- [dev] Rename `StoreSnapshot` to `SerializedStore` +- [dev] Create new `StoreSnapshot` as type related to `getSnapshot`/`loadSnapshot` + +#### [fix] pen mode touches ([#1655](https://github.com/tldraw/tldraw/pull/1655)) + +- Removes three touches to cancel pen mode feature. + +#### (2/2) [docs] Fix links to API. ([#1654](https://github.com/tldraw/tldraw/pull/1654)) + +- Documentation: Simplified links to the API reference. + +#### (1/2) [docs] Restore some missing changes ([#1652](https://github.com/tldraw/tldraw/pull/1652)) + +- None (Docs internals) + +#### [docs] Remove embeds page ([#1653](https://github.com/tldraw/tldraw/pull/1653)) + +- Documentation: Removed unused Embeds page. + +#### Fix text shapes not having colour ([#1649](https://github.com/tldraw/tldraw/pull/1649)) + +- None: Fixes an unreleased bug. + +#### Styles API docs ([#1641](https://github.com/tldraw/tldraw/pull/1641)) + +-- + +#### Styles API follow-ups ([#1636](https://github.com/tldraw/tldraw/pull/1636)) + +-- + +#### docs: remove not accepting contributions notice ([#1647](https://github.com/tldraw/tldraw/pull/1647)) + +- Remove not accepting contributions notice from README + +#### Fix SVG cursors not being used ([#1639](https://github.com/tldraw/tldraw/pull/1639)) + +- None: Fixing an unreleased bug. + +#### [docs] Add table of contents to Editor page ([#1642](https://github.com/tldraw/tldraw/pull/1642)) + +- Documentation: Added a table of contents to the Editor page. + +#### speed up playwright and add visual regression tests ([#1638](https://github.com/tldraw/tldraw/pull/1638)) + +-- + +#### [docs] Allow sidebar to be scrolled on short screens ([#1632](https://github.com/tldraw/tldraw/pull/1632)) + +- Documentation: Fixed the sidebar being unscrollable on some short screens. + +#### [docs] Add feedback when you search ([#1633](https://github.com/tldraw/tldraw/pull/1633)) + +- Documentation: Added some immediate feedback when you search. + +#### [docs] Separate some pages out of the Docs section ([#1626](https://github.com/tldraw/tldraw/pull/1626)) + +- Documentation: Restructured the sidebar for clarity. + +#### [docs] Fix wrong cursor when hovering buttons ([#1630](https://github.com/tldraw/tldraw/pull/1630)) + +- Documentation: Fixed the wrong cursor showing when hovering some buttons. + +#### [docs] Tighten up wording & structure of Usage page ([#1624](https://github.com/tldraw/tldraw/pull/1624)) + +- Documentation: Impoved clarity of wording and structure of the Usage page. + +#### [docs] Tighten up Editor page introduction ([#1622](https://github.com/tldraw/tldraw/pull/1622)) + +- Documentation: Simplified the Editor page. + +#### [docs] Tighten up Introduction page ([#1621](https://github.com/tldraw/tldraw/pull/1621)) + +- Documentation: Simplified the Introduction page. + +#### Lokalise: Translations update ([#1618](https://github.com/tldraw/tldraw/pull/1618)) + +- Added more translations for Simplified Chinese. + +#### [docs] Simplify paths for uncategorised pages ([#1619](https://github.com/tldraw/tldraw/pull/1619)) + +- Documentation: Cleaned up some paths. + +#### `ShapeUtil` refactor, `Editor` cleanup ([#1611](https://github.com/tldraw/tldraw/pull/1611)) + +- [editor] renames `defaultProps` to `getDefaultProps` +- [editor] removes `outline`, `outlineSegments`, `handles`, `bounds` +- [editor] renames `renderBackground` to `backgroundComponent` + +#### Revert "Update dependencies (#1613)" ([#1617](https://github.com/tldraw/tldraw/pull/1617)) + +- + +#### Remove on drop override ([#1612](https://github.com/tldraw/tldraw/pull/1612)) + +- [editor] Remove `onDropOverride` + +#### Make resizeBox a regular function ([#1610](https://github.com/tldraw/tldraw/pull/1610)) + +- [editor] Change `resizeBox` to be a regular function. + +#### Rename `ShapeUtil.render` -> `ShapeUtil.component` ([#1609](https://github.com/tldraw/tldraw/pull/1609)) + +- [editor] rename `ShapeUtil.render` to `ShapeUtil.component` + +#### tldraw.css ([#1607](https://github.com/tldraw/tldraw/pull/1607)) + +- [tldraw] Removes `editor.css` and `ui.css` exports, replaces with `tldraw.css` + +#### [fix] camera culling ([#1602](https://github.com/tldraw/tldraw/pull/1602)) + +- [editor] Adds `Editor.cameraState` +- Adds smart culling to make panning and zooming more smooth + +#### Styles API ([#1580](https://github.com/tldraw/tldraw/pull/1580)) + +- + +#### (1/2) Timeout collaborator cursors ([#1525](https://github.com/tldraw/tldraw/pull/1525)) + +- Brought back cursor timeouts. Collaborator cursors now disappear after 3 seconds of inactivity. + +#### Remove `@tldraw/utils` from the docs site ([#1596](https://github.com/tldraw/tldraw/pull/1596)) + +- [docs] Removed an internal utilities package. + +#### (1/2) Cursor Chat - Presence ([#1487](https://github.com/tldraw/tldraw/pull/1487)) + +- [dev] Added support for cursor chat presence. + +#### [docs] Add barebones note about translations ([#1593](https://github.com/tldraw/tldraw/pull/1593)) + +- [docs] Added brief info on how to join as a translations contributor. + +#### [refactor] snapping ([#1589](https://github.com/tldraw/tldraw/pull/1589)) + +- [editor] fix bug in snapping + +#### remove `ShapeUtil.transform` ([#1590](https://github.com/tldraw/tldraw/pull/1590)) + +- [editor] Remove `ShapeUtil.transform` + +#### Change app to editor in docs ([#1592](https://github.com/tldraw/tldraw/pull/1592)) + +- [docs] Updated 'App' to 'Editor'. + +#### Make sure loading screens use dark mode user preference. ([#1552](https://github.com/tldraw/tldraw/pull/1552)) + +- Make sure our loading and error screens take dark mode setting into account. + +#### remove `ShapeUtil.point` ([#1591](https://github.com/tldraw/tldraw/pull/1591)) + +- [editor] Remove `ShapeUtil.point` + +#### [fix] Remove group shape export backgrounds ([#1587](https://github.com/tldraw/tldraw/pull/1587)) + +- Fix image exports for groups + +#### Add tsdocs to Editor methods ([#1581](https://github.com/tldraw/tldraw/pull/1581)) + +- [dev] Added initial documentation for the Editor class. + +#### add presence to yjs example ([#1582](https://github.com/tldraw/tldraw/pull/1582)) + +- [editor] Add presence to yjs example. + +#### Add optional generic to `updateShapes` / `createShapes` ([#1579](https://github.com/tldraw/tldraw/pull/1579)) + +- [editor] adds an optional shape generic to `updateShapes` and `createShapes` + +#### fix: properly remove awareness from store ([#1565](https://github.com/tldraw/tldraw/pull/1565)) + +- Add a brief release note for your PR here. + +#### [improvement] Embed shape cleanup ([#1569](https://github.com/tldraw/tldraw/pull/1569)) + +- [editor] Remove unused props for `TLEditorShape` +- [editor] Adds `canUnmount` property to embed definitions + +#### Move the loading of assets to the TldrawEditorWithReadyStore so that all code paths load the assets. ([#1561](https://github.com/tldraw/tldraw/pull/1561)) + +- Fix a problem where assets were not loading in some cases (snapshots). + +#### Add anchor targets to our headings. ([#1571](https://github.com/tldraw/tldraw/pull/1571)) + +- Improve documentation to include anchor targets. + +#### shapes folder, move tools into shape defs ([#1574](https://github.com/tldraw/tldraw/pull/1574)) + +n/a + +#### mini `defineShape` API ([#1563](https://github.com/tldraw/tldraw/pull/1563)) + +[dev-facing, notes to come] + +#### Lokalise: Translations update ([#1572](https://github.com/tldraw/tldraw/pull/1572)) + +- Added and updates translations for Italian, Russian, and Ukrainian. + +#### Fix README typo ([#1451](https://github.com/tldraw/tldraw/pull/1451)) + +- None + +#### yjs example ([#1560](https://github.com/tldraw/tldraw/pull/1560)) + +- [editor] Adds yjs example project + +#### `ExternalContentManager` for handling external content (files, images, etc) ([#1550](https://github.com/tldraw/tldraw/pull/1550)) + +- [editor] add `ExternalContentManager` for plopping content onto the canvas +- [editor] remove `onCreateAssetFromFile` prop +- [editor] remove `onCreateBookmarkFromUrl` prop +- [editor] introduce `ExternalContentManager` +- [editor] add cleanup function to `onMount` + +#### Misc sync fixes ([#1555](https://github.com/tldraw/tldraw/pull/1555)) + +- Fixes a handful of state management bugs that manifest in multiplayer rooms + +#### [Docs] Change some editor properties to methods ([#1553](https://github.com/tldraw/tldraw/pull/1553)) + +- [docs] Fixed some methods that were incorrectly marked as properties. + +#### [Docs] Change some internal methods to public ([#1554](https://github.com/tldraw/tldraw/pull/1554)) + +- [docs] Changed some Editor methods from internal to public. + +#### Use unpkg as a default for serving assets. ([#1548](https://github.com/tldraw/tldraw/pull/1548)) + +- Use unpkg asset hosting as a default. + +#### hoist opacity out of props ([#1526](https://github.com/tldraw/tldraw/pull/1526)) + +[internal only for now] + +#### Fix arrows with weird bends crashing ([#1540](https://github.com/tldraw/tldraw/pull/1540)) + +- Fixed a rare crash that could happen when you try to curve an arrow with zero distance. + +#### [feature] add vertical align to note shape ([#1539](https://github.com/tldraw/tldraw/pull/1539)) + +- Adds vertical align prop to note shapes + +#### [fix] Shift key code / nudge ([#1537](https://github.com/tldraw/tldraw/pull/1537)) + +- Fix shift key nudging + +#### scale exported canvases when they reach the browsers max size ([#1536](https://github.com/tldraw/tldraw/pull/1536)) + +- Fix a bug where sometimes exports would fail when they were too big for your browser. Now, they're scaled down to the max supported size. + +#### [fix] control click on mac ([#1535](https://github.com/tldraw/tldraw/pull/1535)) + +- Fix control click to open menu on Mac + +#### Fix being able to undo following ([#1531](https://github.com/tldraw/tldraw/pull/1531)) + +- Fixed a bug where you could undo viewport-following and viewport-unfollowing. + +#### Select locked shapes on long press ([#1529](https://github.com/tldraw/tldraw/pull/1529)) + +#### highlighter fixes ([#1530](https://github.com/tldraw/tldraw/pull/1530)) + +[aq bug fixes] + +#### Lokalise: Translations update ([#1515](https://github.com/tldraw/tldraw/pull/1515)) + +- Added and updated community translations for Galician, Italian, Romanian, Russian, Ukrainian, and Traditional Chinese. + +#### Simplify static cursors ([#1520](https://github.com/tldraw/tldraw/pull/1520)) + +- (editor) Simplifies the cursors in our CSS. + +#### Renaming types, shape utils, tools ([#1513](https://github.com/tldraw/tldraw/pull/1513)) + +- Renaming of types, shape utils, tools + +#### tlschema cleanup ([#1509](https://github.com/tldraw/tldraw/pull/1509)) + +- [editor] Remove `app.createShapeId` +- [tlschema] Cleans up exports + +#### Rename tlstore to store ([#1507](https://github.com/tldraw/tldraw/pull/1507)) + +- Replace @tldraw/tlstore with @tldraw/store + +#### Rename tlvalidate to validate ([#1508](https://github.com/tldraw/tldraw/pull/1508)) + +- Rename tlvalidate to validate + +#### Filter out unused assets. ([#1502](https://github.com/tldraw/tldraw/pull/1502)) + +- Optimize file size of exported files. + +#### Cleanup @tldraw/ui types / exports ([#1504](https://github.com/tldraw/tldraw/pull/1504)) + +- [editor] clean up / unify types + +#### rename app to editor ([#1503](https://github.com/tldraw/tldraw/pull/1503)) + +- Rename `App` to `Editor` and many other things that reference `app` to `editor`. + +#### Revert 09c36781 & tweak linting ([#1501](https://github.com/tldraw/tldraw/pull/1501)) + +[internal-only] + +#### Add support for locking shapes ([#1447](https://github.com/tldraw/tldraw/pull/1447)) + +- Add support for locking shapes. + +#### [3/3] Highlighter styling ([#1490](https://github.com/tldraw/tldraw/pull/1490)) + +Highlighter pen is here! 🎉🎉🎉 + +#### [2/3] renderer changes to support "sandwich mode" highlighting ([#1418](https://github.com/tldraw/tldraw/pull/1418)) + +[not yet!] + +#### [1/3] initial highlighter shape/tool ([#1401](https://github.com/tldraw/tldraw/pull/1401)) + +[internal only change layout ground work for highlighter] + +#### [feature] reduce motion ([#1485](https://github.com/tldraw/tldraw/pull/1485)) + +- [editor] Add `reduceMotion` user preference +- Add reduce motion option to preferences + +#### [feature] Easier store persistence API + persistence example ([#1480](https://github.com/tldraw/tldraw/pull/1480)) + +- [tlstore] adds `getSnapshot` and `loadSnapshot` + +#### Add DSL to make writing shape-layout test cases much easier ([#1413](https://github.com/tldraw/tldraw/pull/1413)) + +[internal only change] + +#### Feature flags rework ([#1474](https://github.com/tldraw/tldraw/pull/1474)) + +[internal only change] + +#### [tiny] add isPageId ([#1482](https://github.com/tldraw/tldraw/pull/1482)) + +- [tlschema] Add `isPageId` + +#### [minor] Mark tlsync-client internal APIs ([#1481](https://github.com/tldraw/tldraw/pull/1481)) + +- Removes internal APIs from `@tldraw/tlsync-client` + +#### [refactor] update record names ([#1473](https://github.com/tldraw/tldraw/pull/1473)) + +- [editor] rename record types + +#### remove safari special-casing for paste ([#1470](https://github.com/tldraw/tldraw/pull/1470)) + +[fixes a regression introduced during this release] + +#### Don't allow `g` keyboard shortcut in readonly mode, show laser tool in the toolbar ([#1459](https://github.com/tldraw/tldraw/pull/1459)) + +- Disable geo tool shortcut in readonly mode. Show laser on the toolbar. + +#### [mini-feature] Following indicator ([#1468](https://github.com/tldraw/tldraw/pull/1468)) + +- Adds viewport following indicator + +#### [chore] refactor user preferences ([#1435](https://github.com/tldraw/tldraw/pull/1435)) + +- Add a brief release note for your PR here. + +#### Add translations for "Leave shared project" action ([#1394](https://github.com/tldraw/tldraw/pull/1394)) + +- None + +#### update use-gesture ([#1453](https://github.com/tldraw/tldraw/pull/1453)) + +- Updates use-gesture to fix pinch gesture bug on iPad. + +#### Add migration for horizontal alignment ([#1443](https://github.com/tldraw/tldraw/pull/1443)) + +- Add support for legacy alignment options. + +#### Stricter ID types ([#1439](https://github.com/tldraw/tldraw/pull/1439)) + +[internal only, covered by #1432 changelog] + +#### [refactor] restore createTLSchema ([#1444](https://github.com/tldraw/tldraw/pull/1444)) + +- [editor] Simplifies custom shape definition +- [tldraw] Updates props for `` component to require a `TldrawEditorConfig`. + +#### Fix cursor shadow getting clipped ([#1441](https://github.com/tldraw/tldraw/pull/1441)) + +- Fixed a bug where custom cursors could have their shadow clipped. + +#### Add SVG cursors for all cursor types ([#1416](https://github.com/tldraw/tldraw/pull/1416)) + +- Added consistent custom cursors. + +#### [refactor] remove `createTLSchema` ([#1440](https://github.com/tldraw/tldraw/pull/1440)) + +- [tlschema] Removes `createTLSchema` in favor of `TldrawEditorConfig` + +#### [refactor] Remove `TLShapeDef`, `getShapeUtilByType`. ([#1432](https://github.com/tldraw/tldraw/pull/1432)) + +- [tlschema] Update props of `createTLSchema` +- [editor] Update props of `TldrawEditorConfig` +- [editor] Remove `App.getShapeUtilByType` +- [editor] Update `App.getShapeUtil` to take a type rather than a shape + +#### [refactor] record migrations ([#1430](https://github.com/tldraw/tldraw/pull/1430)) + +- [tlschema] Improve `defineMigrations` +- [editor] Simplify migration definitions + +#### Measure individual words instead of just line breaks for text exports ([#1397](https://github.com/tldraw/tldraw/pull/1397)) + +- Add a brief release note for your PR here. + +#### Update docs links + guides + build ([#1422](https://github.com/tldraw/tldraw/pull/1422)) + +- [docs] Updated guides to get assets from the new `tldraw/tldraw` repo instead of the old `tldraw/tldraw-examples`. +- [docs] Updated an old CodeSandbox link to the new StackBlitz. + +#### Create @tldraw/indices package ([#1426](https://github.com/tldraw/tldraw/pull/1426)) + +- [@tldraw/editor] Remove fractional indices code into `@tldraw/indices` +- [@tldraw/indices] Create library for fractional indices code + +#### [feature] Add checkbox to toolbar ([#1423](https://github.com/tldraw/tldraw/pull/1423)) + +- Adds missing checkbox to toolbar. + +#### [improvement] set horizontal position using text alignment ([#1419](https://github.com/tldraw/tldraw/pull/1419)) + +- Geo shapes and sticky notes now position their labels based on their alignment. + +#### [fix] reorder handles in front of selection ([#1420](https://github.com/tldraw/tldraw/pull/1420)) + +- Fix a bug where handles would appear behind selection indicators. + +#### [feature] add laser pointer ([#1412](https://github.com/tldraw/tldraw/pull/1412)) + +- Adds the laser pointer tool. + +#### [firefox] Fix the pointer getting stuck down when you press the control key ([#1390](https://github.com/tldraw/tldraw/pull/1390)) + +- [Firefox] Fixed a bug where the pointer could get stuck down when the control key is held down. + +#### Vertical text alignment for geo shapes ([#1414](https://github.com/tldraw/tldraw/pull/1414)) + +- This adds vertical text alignment property to geo shapes. + +#### [fix] page menu, drag handle css ([#1406](https://github.com/tldraw/tldraw/pull/1406)) + +- Fix styling in the page menu + +#### Switch to new collaborators component ([#1405](https://github.com/tldraw/tldraw/pull/1405)) + +- [Breaking] Removes the old version of LiveCollaborators, replacing it with the new one based on `TLInstancePresence` + +#### [improvement] refactor paste to support multi-line text ([#1398](https://github.com/tldraw/tldraw/pull/1398)) + +- Improves clipboard logic when pasting text +- Adds support for pasting multi-line text +- Adds maximum widths when pasting single-line text +- Adds support for RTL languages when pasting multi-line or wrapped text +- Strips leading indentation when pasting text + +#### remove url state, to private ([#1402](https://github.com/tldraw/tldraw/pull/1402)) + +- [editor] remove `useUrlState` + +#### Don't allow the users to use keyboard shortcuts to select tools in readonly mode. ([#1382](https://github.com/tldraw/tldraw/pull/1382)) + +- Disable keyboard shortcut events for tools in readonly mode. We only allow the select, hand tools, and zoom tool. + +#### [fix] Don't synchronize isReadOnly ([#1396](https://github.com/tldraw/tldraw/pull/1396)) + +- Removes the isReadOnly value from the `user_document_settings` record type. + +#### fix pasted tabs not getting converted to space ([#1388](https://github.com/tldraw/tldraw/pull/1388)) + +- Fixed a bug where pasted tabs wouldn't get converted into spaces. + +#### Delete an empty text shape when clicking on another text shape. ([#1384](https://github.com/tldraw/tldraw/pull/1384)) + +- Fix a problem with empty text shapes not getting deleted if you clicked on another text shape. + +#### Fix setting the grid mode. ([#1386](https://github.com/tldraw/tldraw/pull/1386)) + +- Fix grid mode toggle. + +#### Update codesandbox + example link ([#1368](https://github.com/tldraw/tldraw/pull/1368)) + +- [docs] Fixed some links to examples. + +#### Fix selection foreground being misaligned ([#1380](https://github.com/tldraw/tldraw/pull/1380)) + +- None (fix for a bug that hasn't released) + +#### Expand selection outline for single-selected draw shape ([#1379](https://github.com/tldraw/tldraw/pull/1379)) + +- Improve selection outlines around horizontal or vertical draw shapes + +#### Add localizations for snapshots links ([#1347](https://github.com/tldraw/tldraw/pull/1347)) + +- Add localization for creating snapshot links. + +#### [fix] pointer location not updating when moving over editing shape ([#1378](https://github.com/tldraw/tldraw/pull/1378)) + +- Fix a bug where the pointer location would not update when moving the pointer over an editing shape. + +#### [perf] deleteShapes ([#1373](https://github.com/tldraw/tldraw/pull/1373)) + +- Perf improvement for deleting shapes in a document with lots of pages. + +#### Neaten up pr template ([#1369](https://github.com/tldraw/tldraw/pull/1369)) + +- None: internal + +#### fix a couple of consistency assumptions ([#1365](https://github.com/tldraw/tldraw/pull/1365)) + +- Fixes a couple of minor consistency bugs affecting shape updating and page deletion in multiplayer contexts. + +#### Disable nightly/on-demand webdriver scripts ([#1366](https://github.com/tldraw/tldraw/pull/1366)) + +None + +#### avoid lazy race conditions ([#1364](https://github.com/tldraw/tldraw/pull/1364)) + +[internal only] + +#### Adds CI for webdriver tests ([#1343](https://github.com/tldraw/tldraw/pull/1343)) + +- Github action CI workflows added for webdriver tests +- Refactored e2e test runner + +#### enable eslint for test files ([#1363](https://github.com/tldraw/tldraw/pull/1363)) + +internal-only change + +#### [perf] make ensureStoreIsUsable scale better ([#1362](https://github.com/tldraw/tldraw/pull/1362)) + +- Add a brief release note for your PR here. + +#### Export Events stuff ([#1360](https://github.com/tldraw/tldraw/pull/1360)) + +- [ui] export the `TLUiEventSource` type +- [ui] export the `EventsProviderProps ` type +- [ui] export the `useEvents ` hook + +#### presence-related fixes ([#1361](https://github.com/tldraw/tldraw/pull/1361)) + +- Fix a bug where creating a page could throw an error in some multiplayer contexts. + +#### [improvement] rename onEvent to onUiEvent ([#1358](https://github.com/tldraw/tldraw/pull/1358)) + +- [docs] Adds docs for ui events +- [tldraw] Renames `onEvent` to `onUiEvent` + +#### [docs] Update links in docs ([#1357](https://github.com/tldraw/tldraw/pull/1357)) + +- [docs] Update links in docs to point to the tldraw repository rather than tldraw-examples. + +#### [improvement] Ui events followup ([#1354](https://github.com/tldraw/tldraw/pull/1354)) + +- [ui] Adds source to ui events data object +- [ui] Corrects source for toolbar events +- [ui] Corrects source for clipboard events +- [examples] Updates events example + +#### [fix] various text ([#1350](https://github.com/tldraw/tldraw/pull/1350)) + +- Allow leading whitespace + +#### [chore] Bump nanoid ([#1349](https://github.com/tldraw/tldraw/pull/1349)) + +- Remove unused userId and instanceId props from AppOptions + +#### Fix "copy as png" in firefox when `dom.events.asyncClipboard.clipboardItem` is enabled ([#1342](https://github.com/tldraw/tldraw/pull/1342)) + +- Fix "copy as png" in firefox when `dom.events.asyncClipboard.clipboardItem` is enabled + +#### Rework the assets package for strategy-specific imports ([#1341](https://github.com/tldraw/tldraw/pull/1341)) + +- [dev] If you're using the `@tldraw/assets` package, you need to update your code to `import { getAssetUrlsByImport } from '@tldraw/assets/imports'` instead of `import { getBundlerAssetUrls } from '@tldraw/assets` + +--- + +#### 💥 Breaking Change + +- [minor] Mark tlsync-client internal APIs [#1481](https://github.com/tldraw/tldraw/pull/1481) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/store` + - [tweak] migrate store snapshot arguments [#1659](https://github.com/tldraw/tldraw/pull/1659) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/store`, `@tldraw/tlschema` + - [improvement] store snapshot types [#1657](https://github.com/tldraw/tldraw/pull/1657) ([@steveruizok](https://github.com/steveruizok)) + - Rename tlstore to store [#1507](https://github.com/tldraw/tldraw/pull/1507) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/ui` + - [fix] react component runaways, error boundaries [#1625](https://github.com/tldraw/tldraw/pull/1625) ([@steveruizok](https://github.com/steveruizok)) + - Tidy up [#1600](https://github.com/tldraw/tldraw/pull/1600) ([@steveruizok](https://github.com/steveruizok)) + - Use unpkg as a default for serving assets. [#1548](https://github.com/tldraw/tldraw/pull/1548) ([@MitjaBezensek](https://github.com/MitjaBezensek)) + - Switch to new collaborators component [#1405](https://github.com/tldraw/tldraw/pull/1405) ([@ds300](https://github.com/ds300)) + - [improvement] Ui events followup [#1354](https://github.com/tldraw/tldraw/pull/1354) ([@steveruizok](https://github.com/steveruizok)) + - [feature] ui events [#1326](https://github.com/tldraw/tldraw/pull/1326) ([@orangemug](https://github.com/orangemug) [@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/tldraw`, `@tldraw/tlschema` + - `ShapeUtil` refactor, `Editor` cleanup [#1611](https://github.com/tldraw/tldraw/pull/1611) ([@steveruizok](https://github.com/steveruizok)) + - [refactor] restore createTLSchema [#1444](https://github.com/tldraw/tldraw/pull/1444) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor` + - Remove on drop override [#1612](https://github.com/tldraw/tldraw/pull/1612) ([@steveruizok](https://github.com/steveruizok)) + - Rename `ShapeUtil.render` -> `ShapeUtil.component` [#1609](https://github.com/tldraw/tldraw/pull/1609) ([@steveruizok](https://github.com/steveruizok)) + - [fix] camera culling [#1602](https://github.com/tldraw/tldraw/pull/1602) ([@steveruizok](https://github.com/steveruizok)) + - remove `ShapeUtil.transform` [#1590](https://github.com/tldraw/tldraw/pull/1590) ([@steveruizok](https://github.com/steveruizok)) + - remove `ShapeUtil.point` [#1591](https://github.com/tldraw/tldraw/pull/1591) ([@steveruizok](https://github.com/steveruizok)) + - remove url state, to private [#1402](https://github.com/tldraw/tldraw/pull/1402) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/tldraw`, `@tldraw/ui` + - tldraw.css [#1607](https://github.com/tldraw/tldraw/pull/1607) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/tlschema`, `@tldraw/ui`, `@tldraw/utils`, `@tldraw/validate` + - Styles API [#1580](https://github.com/tldraw/tldraw/pull/1580) ([@SomeHats](https://github.com/SomeHats) [@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/tldraw`, `@tldraw/tlschema`, `@tldraw/utils`, `@tldraw/validate` + - mini `defineShape` API [#1563](https://github.com/tldraw/tldraw/pull/1563) ([@SomeHats](https://github.com/SomeHats)) +- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/tldraw`, `@tldraw/ui` + - `ExternalContentManager` for handling external content (files, images, etc) [#1550](https://github.com/tldraw/tldraw/pull/1550) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/tlschema`, `@tldraw/ui` + - hoist opacity out of props [#1526](https://github.com/tldraw/tldraw/pull/1526) ([@SomeHats](https://github.com/SomeHats)) + - Add support for project names [#1340](https://github.com/tldraw/tldraw/pull/1340) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) + - [refactor] Remove `TLShapeDef`, `getShapeUtilByType`. [#1432](https://github.com/tldraw/tldraw/pull/1432) ([@steveruizok](https://github.com/steveruizok) [@SomeHats](https://github.com/SomeHats)) + - [fix] Don't synchronize isReadOnly [#1396](https://github.com/tldraw/tldraw/pull/1396) ([@ds300](https://github.com/ds300)) +- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/store`, `@tldraw/tlschema`, `@tldraw/ui` + - Independent instance state persistence [#1493](https://github.com/tldraw/tldraw/pull/1493) ([@ds300](https://github.com/ds300)) + - tlschema cleanup [#1509](https://github.com/tldraw/tldraw/pull/1509) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/ui` + - Renaming types, shape utils, tools [#1513](https://github.com/tldraw/tldraw/pull/1513) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/tlschema`, `@tldraw/validate` + - Rename tlvalidate to validate [#1508](https://github.com/tldraw/tldraw/pull/1508) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/file-format`, `@tldraw/tlschema`, `@tldraw/ui` + - Cleanup @tldraw/ui types / exports [#1504](https://github.com/tldraw/tldraw/pull/1504) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/indices`, `@tldraw/tldraw`, `@tldraw/ui` + - rename app to editor [#1503](https://github.com/tldraw/tldraw/pull/1503) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/tldraw`, `@tldraw/tlschema`, `@tldraw/ui` + - [refactor] User-facing APIs [#1478](https://github.com/tldraw/tldraw/pull/1478) ([@steveruizok](https://github.com/steveruizok)) + - [chore] refactor user preferences [#1435](https://github.com/tldraw/tldraw/pull/1435) ([@ds300](https://github.com/ds300)) +- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/tlschema`, `@tldraw/ui` + - [refactor] update record names [#1473](https://github.com/tldraw/tldraw/pull/1473) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/tlschema` + - [refactor] remove `createTLSchema` [#1440](https://github.com/tldraw/tldraw/pull/1440) ([@steveruizok](https://github.com/steveruizok)) + - [refactor] record migrations [#1430](https://github.com/tldraw/tldraw/pull/1430) ([@steveruizok](https://github.com/steveruizok)) + - [chore] Bump nanoid [#1349](https://github.com/tldraw/tldraw/pull/1349) ([@ds300](https://github.com/ds300)) +- `@tldraw/editor`, `@tldraw/indices`, `@tldraw/utils` + - Create @tldraw/indices package [#1426](https://github.com/tldraw/tldraw/pull/1426) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/ui` + - [improvement] rename onEvent to onUiEvent [#1358](https://github.com/tldraw/tldraw/pull/1358) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/assets`, `@tldraw/tlschema` + - Rework the assets package for strategy-specific imports [#1341](https://github.com/tldraw/tldraw/pull/1341) ([@SomeHats](https://github.com/SomeHats)) + +#### 🚀 Enhancement + +- [feature] Easier store persistence API + persistence example [#1480](https://github.com/tldraw/tldraw/pull/1480) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/tlschema`, `@tldraw/ui` + - Styles API follow-ups [#1636](https://github.com/tldraw/tldraw/pull/1636) ([@SomeHats](https://github.com/SomeHats) [@steveruizok](https://github.com/steveruizok)) + - (1/2) Cursor Chat - Presence [#1487](https://github.com/tldraw/tldraw/pull/1487) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor` + - Make resizeBox a regular function [#1610](https://github.com/tldraw/tldraw/pull/1610) ([@steveruizok](https://github.com/steveruizok)) + - [improvement] set horizontal position using text alignment [#1419](https://github.com/tldraw/tldraw/pull/1419) ([@steveruizok](https://github.com/steveruizok)) + - [fix] pointer location not updating when moving over editing shape [#1378](https://github.com/tldraw/tldraw/pull/1378) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/tlschema` + - [fix] yjs presence [#1603](https://github.com/tldraw/tldraw/pull/1603) ([@steveruizok](https://github.com/steveruizok)) + - (1/2) Timeout collaborator cursors [#1525](https://github.com/tldraw/tldraw/pull/1525) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) + - [feature] add vertical align to note shape [#1539](https://github.com/tldraw/tldraw/pull/1539) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/file-format` + - Add optional generic to `updateShapes` / `createShapes` [#1579](https://github.com/tldraw/tldraw/pull/1579) ([@steveruizok](https://github.com/steveruizok)) + - move v1 migration code into file-format [#1499](https://github.com/tldraw/tldraw/pull/1499) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/ui` + - Add support for locking shapes [#1447](https://github.com/tldraw/tldraw/pull/1447) ([@MitjaBezensek](https://github.com/MitjaBezensek) [@steveruizok](https://github.com/steveruizok)) + - [feature] reduce motion [#1485](https://github.com/tldraw/tldraw/pull/1485) ([@steveruizok](https://github.com/steveruizok)) + - [mini-feature] Following indicator [#1468](https://github.com/tldraw/tldraw/pull/1468) ([@steveruizok](https://github.com/steveruizok)) + - Add SVG cursors for all cursor types [#1416](https://github.com/tldraw/tldraw/pull/1416) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) + - [improvement] refactor paste to support multi-line text [#1398](https://github.com/tldraw/tldraw/pull/1398) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/assets`, `@tldraw/editor`, `@tldraw/ui` + - [3/3] Highlighter styling [#1490](https://github.com/tldraw/tldraw/pull/1490) ([@SomeHats](https://github.com/SomeHats) [@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/primitives` + - [2/3] renderer changes to support "sandwich mode" highlighting [#1418](https://github.com/tldraw/tldraw/pull/1418) ([@SomeHats](https://github.com/SomeHats)) +- `@tldraw/assets`, `@tldraw/editor`, `@tldraw/tlschema`, `@tldraw/ui` + - [1/3] initial highlighter shape/tool [#1401](https://github.com/tldraw/tldraw/pull/1401) ([@SomeHats](https://github.com/SomeHats)) + - [feature] add laser pointer [#1412](https://github.com/tldraw/tldraw/pull/1412) ([@steveruizok](https://github.com/steveruizok)) + - Vertical text alignment for geo shapes [#1414](https://github.com/tldraw/tldraw/pull/1414) ([@MitjaBezensek](https://github.com/MitjaBezensek) [@steveruizok](https://github.com/steveruizok)) +- `@tldraw/ui` + - [feature] Add checkbox to toolbar [#1423](https://github.com/tldraw/tldraw/pull/1423) ([@steveruizok](https://github.com/steveruizok)) + - Add stuff for new 'share project' flow [#1403](https://github.com/tldraw/tldraw/pull/1403) ([@ds300](https://github.com/ds300)) + - Snapshot link menu translations [#1399](https://github.com/tldraw/tldraw/pull/1399) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/assets`, `@tldraw/ui` + - open menus refactor [#1400](https://github.com/tldraw/tldraw/pull/1400) ([@steveruizok](https://github.com/steveruizok)) + +#### 🐛 Bug Fix + +- Lokalise: Translations update [#1618](https://github.com/tldraw/tldraw/pull/1618) ([@TodePond](https://github.com/TodePond)) +- Fa translation [#1500](https://github.com/tldraw/tldraw/pull/1500) ([@mokazemi](https://github.com/mokazemi) [@steveruizok](https://github.com/steveruizok)) +- Lokalise: Translations update [#1572](https://github.com/tldraw/tldraw/pull/1572) ([@TodePond](https://github.com/TodePond)) +- Update changelog. Bump version. [#1546](https://github.com/tldraw/tldraw/pull/1546) ([@MitjaBezensek](https://github.com/MitjaBezensek)) +- Lokalise: Translations update [#1515](https://github.com/tldraw/tldraw/pull/1515) ([@TodePond](https://github.com/TodePond)) +- VS Code version bump, changelog. [#1497](https://github.com/tldraw/tldraw/pull/1497) ([@MitjaBezensek](https://github.com/MitjaBezensek)) +- Fix issue template label not getting applied [#1428](https://github.com/tldraw/tldraw/pull/1428) ([@TodePond](https://github.com/TodePond)) +- Bump version. [#1421](https://github.com/tldraw/tldraw/pull/1421) ([@MitjaBezensek](https://github.com/MitjaBezensek)) +- Update community translations + remove unused translations [#1356](https://github.com/tldraw/tldraw/pull/1356) ([@TodePond](https://github.com/TodePond)) +- [docs] Update links in docs [#1357](https://github.com/tldraw/tldraw/pull/1357) ([@steveruizok](https://github.com/steveruizok)) +- [chore] Add label options to PR template [#1339](https://github.com/tldraw/tldraw/pull/1339) ([@ds300](https://github.com/ds300)) +- Fix publishing [#1338](https://github.com/tldraw/tldraw/pull/1338) ([@SomeHats](https://github.com/SomeHats)) +- Update README.md [#1331](https://github.com/tldraw/tldraw/pull/1331) ([@steveruizok](https://github.com/steveruizok)) +- [docs] editor API [#1328](https://github.com/tldraw/tldraw/pull/1328) ([@steveruizok](https://github.com/steveruizok)) +- [docs] Add missing params docs [#1223](https://github.com/tldraw/tldraw/pull/1223) ([@TodePond](https://github.com/TodePond)) +- Add link to original tldraw within issue template [#1225](https://github.com/tldraw/tldraw/pull/1225) ([@TodePond](https://github.com/TodePond)) +- Fix issue templates not appearing [#1228](https://github.com/tldraw/tldraw/pull/1228) ([@TodePond](https://github.com/TodePond)) +- [improvement] readme / contributing [#1199](https://github.com/tldraw/tldraw/pull/1199) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) +- [improvement] add bug report / feature request [#1218](https://github.com/tldraw/tldraw/pull/1218) ([@steveruizok](https://github.com/steveruizok)) +- add `env` and prefix output options to exec [#1217](https://github.com/tldraw/tldraw/pull/1217) ([@SomeHats](https://github.com/SomeHats)) +- lite: run prettier on js + json files [#1195](https://github.com/tldraw/tldraw/pull/1195) ([@SomeHats](https://github.com/SomeHats)) +- [chore] use explicit yarn in clean script [#1216](https://github.com/tldraw/tldraw/pull/1216) ([@ds300](https://github.com/ds300)) +- fix husky install [#1212](https://github.com/tldraw/tldraw/pull/1212) ([@SomeHats](https://github.com/SomeHats)) +- Alex/test [#1202](https://github.com/tldraw/tldraw/pull/1202) ([@SomeHats](https://github.com/SomeHats)) +- lite: tweak lockfile name [#1195](https://github.com/tldraw/tldraw/pull/1195) ([@SomeHats](https://github.com/SomeHats)) +- lite: common logfile name [#1195](https://github.com/tldraw/tldraw/pull/1195) ([@SomeHats](https://github.com/SomeHats)) +- lite: open runners [#1195](https://github.com/tldraw/tldraw/pull/1195) ([@SomeHats](https://github.com/SomeHats)) +- poke [#1195](https://github.com/tldraw/tldraw/pull/1195) ([@SomeHats](https://github.com/SomeHats)) +- lite: standalone? [#1195](https://github.com/tldraw/tldraw/pull/1195) ([@SomeHats](https://github.com/SomeHats)) +- `@tldraw/editor` + - Fix crash when rotating a deleted shape [#1658](https://github.com/tldraw/tldraw/pull/1658) ([@TodePond](https://github.com/TodePond)) + - [fix] pen mode touches [#1655](https://github.com/tldraw/tldraw/pull/1655) ([@steveruizok](https://github.com/steveruizok)) + - Fix text shapes not having colour [#1649](https://github.com/tldraw/tldraw/pull/1649) ([@TodePond](https://github.com/TodePond)) + - Fix SVG cursors not being used [#1639](https://github.com/tldraw/tldraw/pull/1639) ([@TodePond](https://github.com/TodePond)) + - [fix] tldraw file drop [#1616](https://github.com/tldraw/tldraw/pull/1616) ([@steveruizok](https://github.com/steveruizok)) + - Make sure loading screens use dark mode user preference. [#1552](https://github.com/tldraw/tldraw/pull/1552) ([@MitjaBezensek](https://github.com/MitjaBezensek) [@steveruizok](https://github.com/steveruizok)) + - [fix] Remove group shape export backgrounds [#1587](https://github.com/tldraw/tldraw/pull/1587) ([@steveruizok](https://github.com/steveruizok)) + - Move the loading of assets to the TldrawEditorWithReadyStore so that all code paths load the assets. [#1561](https://github.com/tldraw/tldraw/pull/1561) ([@MitjaBezensek](https://github.com/MitjaBezensek)) + - shapes folder, move tools into shape defs [#1574](https://github.com/tldraw/tldraw/pull/1574) ([@SomeHats](https://github.com/SomeHats)) + - offset drop point by editor client rect [#1564](https://github.com/tldraw/tldraw/pull/1564) ([@BrianHung](https://github.com/BrianHung)) + - More misc sync fixes [#1559](https://github.com/tldraw/tldraw/pull/1559) ([@ds300](https://github.com/ds300)) + - Misc sync fixes [#1555](https://github.com/tldraw/tldraw/pull/1555) ([@ds300](https://github.com/ds300)) + - [fix] Shift key code / nudge [#1537](https://github.com/tldraw/tldraw/pull/1537) ([@steveruizok](https://github.com/steveruizok)) + - scale exported canvases when they reach the browsers max size [#1536](https://github.com/tldraw/tldraw/pull/1536) ([@SomeHats](https://github.com/SomeHats)) + - [fix] control click on mac [#1535](https://github.com/tldraw/tldraw/pull/1535) ([@steveruizok](https://github.com/steveruizok)) + - Fix being able to undo following [#1531](https://github.com/tldraw/tldraw/pull/1531) ([@TodePond](https://github.com/TodePond)) + - send user prefs data in broadcast msg [#1466](https://github.com/tldraw/tldraw/pull/1466) ([@ds300](https://github.com/ds300)) + - Fix positioning of default cursor [#1458](https://github.com/tldraw/tldraw/pull/1458) ([@TodePond](https://github.com/TodePond)) + - change pointer cursor to white [#1454](https://github.com/tldraw/tldraw/pull/1454) ([@TodePond](https://github.com/TodePond)) + - Fix cursor shadow getting clipped [#1441](https://github.com/tldraw/tldraw/pull/1441) ([@TodePond](https://github.com/TodePond)) + - Fix new wobble [#1431](https://github.com/tldraw/tldraw/pull/1431) ([@TodePond](https://github.com/TodePond)) + - [fix] laser pointer [#1429](https://github.com/tldraw/tldraw/pull/1429) ([@steveruizok](https://github.com/steveruizok)) + - [fix] reorder handles in front of selection [#1420](https://github.com/tldraw/tldraw/pull/1420) ([@steveruizok](https://github.com/steveruizok)) + - [firefox] Fix the pointer getting stuck down when you press the control key [#1390](https://github.com/tldraw/tldraw/pull/1390) ([@TodePond](https://github.com/TodePond)) + - fix viewport following [#1411](https://github.com/tldraw/tldraw/pull/1411) ([@ds300](https://github.com/ds300)) + - fix pasted tabs not getting converted to space [#1388](https://github.com/tldraw/tldraw/pull/1388) ([@TodePond](https://github.com/TodePond)) + - Delete an empty text shape when clicking on another text shape. [#1384](https://github.com/tldraw/tldraw/pull/1384) ([@MitjaBezensek](https://github.com/MitjaBezensek)) + - Fix setting the grid mode. [#1386](https://github.com/tldraw/tldraw/pull/1386) ([@MitjaBezensek](https://github.com/MitjaBezensek)) + - Fix selection foreground being misaligned [#1380](https://github.com/tldraw/tldraw/pull/1380) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) + - Expand selection outline for single-selected draw shape [#1379](https://github.com/tldraw/tldraw/pull/1379) ([@SomeHats](https://github.com/SomeHats)) + - [fix] Allow interactions with embeds in readonly mode [#1333](https://github.com/tldraw/tldraw/pull/1333) ([@MitjaBezensek](https://github.com/MitjaBezensek)) + - [perf] deleteShapes [#1373](https://github.com/tldraw/tldraw/pull/1373) ([@ds300](https://github.com/ds300)) + - fix a couple of consistency assumptions [#1365](https://github.com/tldraw/tldraw/pull/1365) ([@ds300](https://github.com/ds300)) + - [fix] various text [#1350](https://github.com/tldraw/tldraw/pull/1350) ([@steveruizok](https://github.com/steveruizok)) + - [fix] tabs in text exports [#1323](https://github.com/tldraw/tldraw/pull/1323) ([@steveruizok](https://github.com/steveruizok)) + - [fix] update useTransform.ts [#1327](https://github.com/tldraw/tldraw/pull/1327) ([@steveruizok](https://github.com/steveruizok)) + - [improvement] dragging start distance on coarse pointer [#1220](https://github.com/tldraw/tldraw/pull/1220) ([@steveruizok](https://github.com/steveruizok)) + - [fix] SVG export for arrows with labels but no arrowheads [#1229](https://github.com/tldraw/tldraw/pull/1229) ([@steveruizok](https://github.com/steveruizok)) + - add docs for TLShapeUtil [#1215](https://github.com/tldraw/tldraw/pull/1215) ([@TodePond](https://github.com/TodePond)) + - [fix] publish [#1222](https://github.com/tldraw/tldraw/pull/1222) ([@ds300](https://github.com/ds300)) + - [fix] typo in isFocusingInput [#1221](https://github.com/tldraw/tldraw/pull/1221) ([@ds300](https://github.com/ds300)) + - [feat] new LiveCollaborators behind feature flag [#1219](https://github.com/tldraw/tldraw/pull/1219) ([@ds300](https://github.com/ds300)) + - [fix] collaborator render order [#1213](https://github.com/tldraw/tldraw/pull/1213) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/ui` + - 3/2 Cursor chat [#1623](https://github.com/tldraw/tldraw/pull/1623) ([@steveruizok](https://github.com/steveruizok)) + - [fix] embeds [#1578](https://github.com/tldraw/tldraw/pull/1578) ([@steveruizok](https://github.com/steveruizok)) + - highlighter fixes [#1530](https://github.com/tldraw/tldraw/pull/1530) ([@SomeHats](https://github.com/SomeHats)) + - Feature flags rework [#1474](https://github.com/tldraw/tldraw/pull/1474) ([@SomeHats](https://github.com/SomeHats)) + - remove svg layer, html all the things, rs to tl [#1227](https://github.com/tldraw/tldraw/pull/1227) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) + - Added `pHYs` to import/export of png images [#1200](https://github.com/tldraw/tldraw/pull/1200) ([@orangemug](https://github.com/orangemug) [@steveruizok](https://github.com/steveruizok)) +- `@tldraw/tldraw` + - [fix] tldraw api report [#1615](https://github.com/tldraw/tldraw/pull/1615) ([@steveruizok](https://github.com/steveruizok)) + - Fix to not ignore the `userId` option for `` component in `@tldraw/tldraw` [#1205](https://github.com/tldraw/tldraw/pull/1205) ([@orangemug](https://github.com/orangemug)) +- `@tldraw/editor`, `@tldraw/primitives` + - [refactor] snapping [#1589](https://github.com/tldraw/tldraw/pull/1589) ([@steveruizok](https://github.com/steveruizok)) + - Fix arrows with weird bends crashing [#1540](https://github.com/tldraw/tldraw/pull/1540) ([@TodePond](https://github.com/TodePond)) + - ensure that fixed points stay fixed [#1523](https://github.com/tldraw/tldraw/pull/1523) ([@steveruizok](https://github.com/steveruizok)) + - Use `strokePathData` for `` path to avoid bugs in the inner path algo [#1207](https://github.com/tldraw/tldraw/pull/1207) ([@orangemug](https://github.com/orangemug) [@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/tlschema` + - update exports for user presence [#1583](https://github.com/tldraw/tldraw/pull/1583) ([@steveruizok](https://github.com/steveruizok)) + - [improvement] Embed shape cleanup [#1569](https://github.com/tldraw/tldraw/pull/1569) ([@steveruizok](https://github.com/steveruizok)) + - Add migration for horizontal alignment [#1443](https://github.com/tldraw/tldraw/pull/1443) ([@MitjaBezensek](https://github.com/MitjaBezensek) [@steveruizok](https://github.com/steveruizok)) + - [chore] move schema construction to tlschema package [#1334](https://github.com/tldraw/tldraw/pull/1334) ([@ds300](https://github.com/ds300)) +- `@tldraw/assets`, `@tldraw/editor`, `@tldraw/ui`, `@tldraw/utils` + - Asset improvements [#1557](https://github.com/tldraw/tldraw/pull/1557) ([@MitjaBezensek](https://github.com/MitjaBezensek)) +- `@tldraw/ui` + - Use `"Toggle locked"` [#1538](https://github.com/tldraw/tldraw/pull/1538) ([@steveruizok](https://github.com/steveruizok)) + - Select locked shapes on long press [#1529](https://github.com/tldraw/tldraw/pull/1529) ([@steveruizok](https://github.com/steveruizok)) + - remove safari special-casing for paste [#1470](https://github.com/tldraw/tldraw/pull/1470) ([@SomeHats](https://github.com/SomeHats)) + - Don't allow `g` keyboard shortcut in readonly mode, show laser tool in the toolbar [#1459](https://github.com/tldraw/tldraw/pull/1459) ([@MitjaBezensek](https://github.com/MitjaBezensek) [@steveruizok](https://github.com/steveruizok)) + - Fix people menu button border on android [#1471](https://github.com/tldraw/tldraw/pull/1471) ([@TodePond](https://github.com/TodePond)) + - [fix] lock option for laser tool [#1460](https://github.com/tldraw/tldraw/pull/1460) ([@steveruizok](https://github.com/steveruizok)) + - Add laser keyboard shortcut. [#1467](https://github.com/tldraw/tldraw/pull/1467) ([@MitjaBezensek](https://github.com/MitjaBezensek)) + - [fix] make follow icon visible on iPad [#1462](https://github.com/tldraw/tldraw/pull/1462) ([@steveruizok](https://github.com/steveruizok)) + - [fix] page item submenu [#1461](https://github.com/tldraw/tldraw/pull/1461) ([@steveruizok](https://github.com/steveruizok)) + - Add translations for "Leave shared project" action [#1394](https://github.com/tldraw/tldraw/pull/1394) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) + - [fix] page menu, drag handle css [#1406](https://github.com/tldraw/tldraw/pull/1406) ([@steveruizok](https://github.com/steveruizok)) + - Don't allow the users to use keyboard shortcuts to select tools in readonly mode. [#1382](https://github.com/tldraw/tldraw/pull/1382) ([@MitjaBezensek](https://github.com/MitjaBezensek)) + - Disabling middle click paste in favour of panning [#1335](https://github.com/tldraw/tldraw/pull/1335) ([@orangemug](https://github.com/orangemug) [@steveruizok](https://github.com/steveruizok)) + - Export Events stuff [#1360](https://github.com/tldraw/tldraw/pull/1360) ([@steveruizok](https://github.com/steveruizok)) + - Fix "copy as png" in firefox when `dom.events.asyncClipboard.clipboardItem` is enabled [#1342](https://github.com/tldraw/tldraw/pull/1342) ([@orangemug](https://github.com/orangemug)) + - [tiny] rename show menu paste [#1332](https://github.com/tldraw/tldraw/pull/1332) ([@steveruizok](https://github.com/steveruizok)) + - update @radix-ui/react-popover to 1.0.6-rc.5 [#1206](https://github.com/tldraw/tldraw/pull/1206) ([@SomeHats](https://github.com/SomeHats)) +- `@tldraw/file-format` + - Filter out unused assets. [#1502](https://github.com/tldraw/tldraw/pull/1502) ([@MitjaBezensek](https://github.com/MitjaBezensek)) +- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/tlschema`, `@tldraw/ui`, `@tldraw/utils` + - Stricter ID types [#1439](https://github.com/tldraw/tldraw/pull/1439) ([@SomeHats](https://github.com/SomeHats) [@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/primitives`, `@tldraw/ui` + - Measure individual words instead of just line breaks for text exports [#1397](https://github.com/tldraw/tldraw/pull/1397) ([@SomeHats](https://github.com/SomeHats)) +- `@tldraw/tlschema` + - [perf] make ensureStoreIsUsable scale better [#1362](https://github.com/tldraw/tldraw/pull/1362) ([@ds300](https://github.com/ds300)) +- `@tldraw/editor`, `@tldraw/utils` + - presence-related fixes [#1361](https://github.com/tldraw/tldraw/pull/1361) ([@ds300](https://github.com/ds300)) +- `@tldraw/assets`, `@tldraw/editor`, `@tldraw/tlschema`, `@tldraw/ui` + - [feature] `check-box` geo shape [#1330](https://github.com/tldraw/tldraw/pull/1330) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/assets`, `@tldraw/editor`, `@tldraw/tldraw`, `@tldraw/ui` + - New vite-based examples app [#1226](https://github.com/tldraw/tldraw/pull/1226) ([@SomeHats](https://github.com/SomeHats)) +- `@tldraw/assets`, `@tldraw/file-format`, `@tldraw/polyfills`, `@tldraw/primitives`, `@tldraw/tldraw`, `@tldraw/tlschema`, `@tldraw/ui`, `@tldraw/utils` + - readmes [#1195](https://github.com/tldraw/tldraw/pull/1195) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/assets`, `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/polyfills`, `@tldraw/primitives`, `@tldraw/tldraw`, `@tldraw/tlschema`, `@tldraw/ui`, `@tldraw/utils` + - [chore] update lazyrepo [#1211](https://github.com/tldraw/tldraw/pull/1211) ([@ds300](https://github.com/ds300)) + - [lite] upgrade lazyrepo [#1198](https://github.com/tldraw/tldraw/pull/1198) ([@ds300](https://github.com/ds300)) + - transfer-out: transfer out [#1195](https://github.com/tldraw/tldraw/pull/1195) ([@SomeHats](https://github.com/SomeHats)) +- `@tldraw/tlschema`, `@tldraw/ui` + - [fix] pick a better default language [#1201](https://github.com/tldraw/tldraw/pull/1201) ([@steveruizok](https://github.com/steveruizok) [@TodePond](https://github.com/TodePond)) +- `@tldraw/assets`, `@tldraw/editor`, `@tldraw/tldraw`, `@tldraw/tlschema`, `@tldraw/ui`, `@tldraw/utils` + - derived presence state [#1204](https://github.com/tldraw/tldraw/pull/1204) ([@ds300](https://github.com/ds300)) + +#### ⚠️ Pushed to `main` + +- Update publish-new.yml ([@steveruizok](https://github.com/steveruizok)) +- Update lerna.json ([@steveruizok](https://github.com/steveruizok)) +- Update publish-new.ts ([@steveruizok](https://github.com/steveruizok)) +- change App to Editor in docs ([@TodePond](https://github.com/TodePond)) +- rename api.mdx to editor.mdx ([@TodePond](https://github.com/TodePond)) +- remove e2e files ([@steveruizok](https://github.com/steveruizok)) +- main: notify huppy after release ([@SomeHats](https://github.com/SomeHats)) +- main: exclude @tldraw/assets from vite dep optimization to fix examples links ([@SomeHats](https://github.com/SomeHats)) +- `@tldraw/assets`, `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/indices`, `@tldraw/polyfills`, `@tldraw/primitives`, `@tldraw/store`, `@tldraw/tldraw`, `@tldraw/tlschema`, `@tldraw/ui`, `@tldraw/utils`, `@tldraw/validate` + - update lazyrepo ([@ds300](https://github.com/ds300)) + +#### 🏠 Internal + +- [chore] bump vscode extension to 2.0.9 [#1662](https://github.com/tldraw/tldraw/pull/1662) ([@steveruizok](https://github.com/steveruizok)) +- untrack generated files [#1646](https://github.com/tldraw/tldraw/pull/1646) ([@steveruizok](https://github.com/steveruizok)) +- Update pr template [#1570](https://github.com/tldraw/tldraw/pull/1570) ([@steveruizok](https://github.com/steveruizok)) +- Add contributor license agreement. [#1556](https://github.com/tldraw/tldraw/pull/1556) ([@steveruizok](https://github.com/steveruizok)) +- Reinstate auto [#1524](https://github.com/tldraw/tldraw/pull/1524) ([@ds300](https://github.com/ds300)) +- [infra] use npx to run auto [#1521](https://github.com/tldraw/tldraw/pull/1521) ([@ds300](https://github.com/ds300)) +- Revert 09c36781 & tweak linting [#1501](https://github.com/tldraw/tldraw/pull/1501) ([@SomeHats](https://github.com/SomeHats)) +- [fix] eslint from brivate [#1498](https://github.com/tldraw/tldraw/pull/1498) ([@steveruizok](https://github.com/steveruizok)) +- [chore] remove webdriver dependencies / scripts [#1488](https://github.com/tldraw/tldraw/pull/1488) ([@steveruizok](https://github.com/steveruizok)) +- [fix] local e2e script [#1442](https://github.com/tldraw/tldraw/pull/1442) ([@steveruizok](https://github.com/steveruizok)) +- [chore] remove yarnrc-private.yml [#1427](https://github.com/tldraw/tldraw/pull/1427) ([@steveruizok](https://github.com/steveruizok)) +- [fix] example routes on vercel [#1391](https://github.com/tldraw/tldraw/pull/1391) ([@steveruizok](https://github.com/steveruizok)) +- Neaten up pr template [#1369](https://github.com/tldraw/tldraw/pull/1369) ([@TodePond](https://github.com/TodePond)) +- remove references to tldraw-lite [#1367](https://github.com/tldraw/tldraw/pull/1367) ([@SomeHats](https://github.com/SomeHats)) +- `@tldraw/editor`, `@tldraw/ui` + - Explicit shape type checks [#1594](https://github.com/tldraw/tldraw/pull/1594) ([@steveruizok](https://github.com/steveruizok)) + - [improvement] bookmark shape logic [#1568](https://github.com/tldraw/tldraw/pull/1568) ([@steveruizok](https://github.com/steveruizok)) + - Simplify static cursors [#1520](https://github.com/tldraw/tldraw/pull/1520) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/ui` + - move some kbds into actions and tools [#1585](https://github.com/tldraw/tldraw/pull/1585) ([@BrianHung](https://github.com/BrianHung) [@steveruizok](https://github.com/steveruizok)) + - Add localizations for snapshots links [#1347](https://github.com/tldraw/tldraw/pull/1347) ([@MitjaBezensek](https://github.com/MitjaBezensek)) +- `@tldraw/editor` + - use the right TLEventHandlers [#1486](https://github.com/tldraw/tldraw/pull/1486) ([@judicaelandria](https://github.com/judicaelandria) [@steveruizok](https://github.com/steveruizok)) + - yjs example [#1560](https://github.com/tldraw/tldraw/pull/1560) ([@steveruizok](https://github.com/steveruizok)) + - rename app folder to editor [#1528](https://github.com/tldraw/tldraw/pull/1528) ([@steveruizok](https://github.com/steveruizok)) + - [fix] overlay rendering issues [#1389](https://github.com/tldraw/tldraw/pull/1389) ([@steveruizok](https://github.com/steveruizok)) + - Remove commented code in App [#1377](https://github.com/tldraw/tldraw/pull/1377) ([@steveruizok](https://github.com/steveruizok)) + - enable eslint for test files [#1363](https://github.com/tldraw/tldraw/pull/1363) ([@SomeHats](https://github.com/SomeHats)) +- `@tldraw/tlschema` + - restore styles sets exports [#1512](https://github.com/tldraw/tldraw/pull/1512) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/primitives` + - replace console.log with nicelog [#1496](https://github.com/tldraw/tldraw/pull/1496) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/indices`, `@tldraw/primitives`, `@tldraw/tldraw`, `@tldraw/ui` + - [chore] remove benchmark [#1489](https://github.com/tldraw/tldraw/pull/1489) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/tlschema` + - [tiny] add isPageId [#1482](https://github.com/tldraw/tldraw/pull/1482) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor`, `@tldraw/file-format`, `@tldraw/polyfills`, `@tldraw/primitives`, `@tldraw/tldraw`, `@tldraw/tlschema`, `@tldraw/ui`, `@tldraw/utils` + - avoid lazy race conditions [#1364](https://github.com/tldraw/tldraw/pull/1364) ([@SomeHats](https://github.com/SomeHats)) + +#### 📝 Documentation + +- [fix] remove docs scripts [#1651](https://github.com/tldraw/tldraw/pull/1651) ([@steveruizok](https://github.com/steveruizok)) +- (2/2) [docs] Fix links to API. [#1654](https://github.com/tldraw/tldraw/pull/1654) ([@TodePond](https://github.com/TodePond)) +- (1/2) [docs] Restore some missing changes [#1652](https://github.com/tldraw/tldraw/pull/1652) ([@TodePond](https://github.com/TodePond)) +- [docs] Remove embeds page [#1653](https://github.com/tldraw/tldraw/pull/1653) ([@TodePond](https://github.com/TodePond)) +- docs: remove not accepting contributions notice [#1647](https://github.com/tldraw/tldraw/pull/1647) ([@gabrielchl](https://github.com/gabrielchl)) +- [docs] Add table of contents to Editor page [#1642](https://github.com/tldraw/tldraw/pull/1642) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) +- remove docs (again) [#1643](https://github.com/tldraw/tldraw/pull/1643) ([@steveruizok](https://github.com/steveruizok)) +- [1/2] Move docs to brivate [#1640](https://github.com/tldraw/tldraw/pull/1640) ([@steveruizok](https://github.com/steveruizok)) +- [docs] Allow sidebar to be scrolled on short screens [#1632](https://github.com/tldraw/tldraw/pull/1632) ([@TodePond](https://github.com/TodePond)) +- [docs] Add feedback when you search [#1633](https://github.com/tldraw/tldraw/pull/1633) ([@TodePond](https://github.com/TodePond)) +- [docs] Separate some pages out of the Docs section [#1626](https://github.com/tldraw/tldraw/pull/1626) ([@TodePond](https://github.com/TodePond)) +- [docs] Fix wrong cursor when hovering buttons [#1630](https://github.com/tldraw/tldraw/pull/1630) ([@TodePond](https://github.com/TodePond)) +- [docs] Tighten up wording & structure of Usage page [#1624](https://github.com/tldraw/tldraw/pull/1624) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) +- [docs] Tighten up Editor page introduction [#1622](https://github.com/tldraw/tldraw/pull/1622) ([@TodePond](https://github.com/TodePond)) +- [docs] Tighten up Introduction page [#1621](https://github.com/tldraw/tldraw/pull/1621) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) +- [docs] Simplify paths for uncategorised pages [#1619](https://github.com/tldraw/tldraw/pull/1619) ([@TodePond](https://github.com/TodePond)) +- Auto content refresh for docs site [#1606](https://github.com/tldraw/tldraw/pull/1606) ([@steveruizok](https://github.com/steveruizok)) +- Remove `@tldraw/utils` from the docs site [#1596](https://github.com/tldraw/tldraw/pull/1596) ([@TodePond](https://github.com/TodePond)) +- [docs] Add barebones note about translations [#1593](https://github.com/tldraw/tldraw/pull/1593) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) +- Change app to editor in docs [#1592](https://github.com/tldraw/tldraw/pull/1592) ([@TodePond](https://github.com/TodePond)) +- add presence to yjs example [#1582](https://github.com/tldraw/tldraw/pull/1582) ([@steveruizok](https://github.com/steveruizok)) +- fix: properly remove awareness from store [#1565](https://github.com/tldraw/tldraw/pull/1565) ([@shahriar-shojib](https://github.com/shahriar-shojib) [@steveruizok](https://github.com/steveruizok)) +- Add anchor targets to our headings. [#1571](https://github.com/tldraw/tldraw/pull/1571) ([@MitjaBezensek](https://github.com/MitjaBezensek)) +- Fix README typo [#1451](https://github.com/tldraw/tldraw/pull/1451) ([@fossinating](https://github.com/fossinating) [@steveruizok](https://github.com/steveruizok)) +- Update examples links to point to examples folder. [#1522](https://github.com/tldraw/tldraw/pull/1522) ([@steveruizok](https://github.com/steveruizok)) +- Update docs links + guides + build [#1422](https://github.com/tldraw/tldraw/pull/1422) ([@TodePond](https://github.com/TodePond)) +- Update codesandbox + example link [#1368](https://github.com/tldraw/tldraw/pull/1368) ([@TodePond](https://github.com/TodePond)) +- `@tldraw/editor` + - [improvement] custom shapes example [#1660](https://github.com/tldraw/tldraw/pull/1660) ([@steveruizok](https://github.com/steveruizok)) + - Add tsdocs to Editor methods [#1581](https://github.com/tldraw/tldraw/pull/1581) ([@TodePond](https://github.com/TodePond) [@steveruizok](https://github.com/steveruizok)) + - [Docs] Change some editor properties to methods [#1553](https://github.com/tldraw/tldraw/pull/1553) ([@TodePond](https://github.com/TodePond)) + - [Docs] Change some internal methods to public [#1554](https://github.com/tldraw/tldraw/pull/1554) ([@TodePond](https://github.com/TodePond)) +- `@tldraw/editor`, `@tldraw/tlschema` + - Styles API docs [#1641](https://github.com/tldraw/tldraw/pull/1641) ([@SomeHats](https://github.com/SomeHats) [@steveruizok](https://github.com/steveruizok)) +- `@tldraw/tlschema` + - TLSchema readme [#1506](https://github.com/tldraw/tldraw/pull/1506) ([@steveruizok](https://github.com/steveruizok)) + +#### 🧪 Tests + +- speed up playwright and add visual regression tests [#1638](https://github.com/tldraw/tldraw/pull/1638) ([@SomeHats](https://github.com/SomeHats) [@huppy-bot[bot]](https://github.com/huppy-bot[bot])) +- Disable nightly/on-demand webdriver scripts [#1366](https://github.com/tldraw/tldraw/pull/1366) ([@orangemug](https://github.com/orangemug)) +- Adds CI for webdriver tests [#1343](https://github.com/tldraw/tldraw/pull/1343) ([@orangemug](https://github.com/orangemug)) +- Added initial webdriver tests [#1337](https://github.com/tldraw/tldraw/pull/1337) ([@orangemug](https://github.com/orangemug)) +- `@tldraw/editor` + - update editor tests [#1547](https://github.com/tldraw/tldraw/pull/1547) ([@steveruizok](https://github.com/steveruizok)) + - Add DSL to make writing shape-layout test cases much easier [#1413](https://github.com/tldraw/tldraw/pull/1413) ([@SomeHats](https://github.com/SomeHats)) +- `@tldraw/editor`, `@tldraw/ui` + - Add playwright tests [#1484](https://github.com/tldraw/tldraw/pull/1484) ([@steveruizok](https://github.com/steveruizok)) + +#### 🔩 Dependency Updates + +- [chore] update wdio-vscode-service [#1346](https://github.com/tldraw/tldraw/pull/1346) ([@ds300](https://github.com/ds300)) +- `@tldraw/editor`, `@tldraw/state`, `@tldraw/store`, `@tldraw/tlschema`, `@tldraw/ui` + - Incorporate signia as @tldraw/state [#1620](https://github.com/tldraw/tldraw/pull/1620) ([@steveruizok](https://github.com/steveruizok) [@ds300](https://github.com/ds300)) +- `@tldraw/assets`, `@tldraw/editor`, `@tldraw/polyfills`, `@tldraw/tldraw`, `@tldraw/ui` + - Revert "Update dependencies (#1613)" [#1617](https://github.com/tldraw/tldraw/pull/1617) ([@SomeHats](https://github.com/SomeHats)) + - Update dependencies [#1613](https://github.com/tldraw/tldraw/pull/1613) ([@steveruizok](https://github.com/steveruizok)) +- `@tldraw/editor` + - update use-gesture [#1453](https://github.com/tldraw/tldraw/pull/1453) ([@ds300](https://github.com/ds300)) + +#### Authors: 13 + +- [@huppy-bot[bot]](https://github.com/huppy-bot[bot]) +- alex ([@SomeHats](https://github.com/SomeHats)) +- Brian Hung ([@BrianHung](https://github.com/BrianHung)) +- David ([@fossinating](https://github.com/fossinating)) +- David Sheldrick ([@ds300](https://github.com/ds300)) +- Gabriel Lee ([@gabrielchl](https://github.com/gabrielchl)) +- Judicael ([@judicaelandria](https://github.com/judicaelandria)) +- Lu Wilson ([@TodePond](https://github.com/TodePond)) +- Mitja Bezenšek ([@MitjaBezensek](https://github.com/MitjaBezensek)) +- Mohammad Kazemi ([@mokazemi](https://github.com/mokazemi)) +- Orange Mug ([@orangemug](https://github.com/orangemug)) +- Shahriar Shojib ([@shahriar-shojib](https://github.com/shahriar-shojib)) +- Steve Ruiz ([@steveruizok](https://github.com/steveruizok)) diff --git a/apps/docs/content/releases/v2.0.0-alpha.14.mdx b/apps/docs/content/releases/v2.0.0-alpha.14.mdx index 8454f0f31..51ef64977 100644 --- a/apps/docs/content/releases/v2.0.0-alpha.14.mdx +++ b/apps/docs/content/releases/v2.0.0-alpha.14.mdx @@ -9,7 +9,6 @@ status: published [View on GitHub](https://github.com/tldraw/tldraw/releases/tag/v2.0.0-alpha.14) - #### Disable styles panel button on mobile when using the laser tool. ([#1704](https://github.com/tldraw/tldraw/pull/1704)) - Disable the styles panel button for laser tool on mobile. @@ -112,4 +111,4 @@ status: published - David Sheldrick ([@ds300](https://github.com/ds300)) - Lu Wilson ([@TodePond](https://github.com/TodePond)) - Mitja Bezenšek ([@MitjaBezensek](https://github.com/MitjaBezensek)) -- Steve Ruiz ([@steveruizok](https://github.com/steveruizok)) \ No newline at end of file +- Steve Ruiz ([@steveruizok](https://github.com/steveruizok)) diff --git a/apps/docs/content/releases/v2.0.0-alpha.15.mdx b/apps/docs/content/releases/v2.0.0-alpha.15.mdx index 48c179700..8b03eab37 100644 --- a/apps/docs/content/releases/v2.0.0-alpha.15.mdx +++ b/apps/docs/content/releases/v2.0.0-alpha.15.mdx @@ -9,7 +9,6 @@ status: published [View on GitHub](https://github.com/tldraw/tldraw/releases/tag/v2.0.0-alpha.15) - #### frame label fix ([#2016](https://github.com/tldraw/tldraw/pull/2016)) - Add a brief release note for your PR here. @@ -36,8 +35,14 @@ This pr add the custom defined shapes that's being passed to Tldraw Before/After - - + + #### [fix] pinch events ([#1979](https://github.com/tldraw/tldraw/pull/1979)) @@ -49,8 +54,14 @@ Before/After Before/After - - + + #### Remove focus management ([#1953](https://github.com/tldraw/tldraw/pull/1953)) @@ -71,8 +82,14 @@ Before/After Before & After: - - + + #### Allow right clicking selection backgrounds ([#1968](https://github.com/tldraw/tldraw/pull/1968)) @@ -88,7 +105,7 @@ Before & After: #### Lokalise: Translations update ([#1964](https://github.com/tldraw/tldraw/pull/1964)) -* Updated community translations for German and Galician +- Updated community translations for German and Galician #### [improvement] improve arrows (for real) ([#1957](https://github.com/tldraw/tldraw/pull/1957)) @@ -132,7 +149,7 @@ Before & After: #### :recycle: fix: editing is not terminated after the conversion is confirmed. ([#1885](https://github.com/tldraw/tldraw/pull/1885)) -- fix: editing is not terminated after the conversion is confirmed. +- fix: editing is not terminated after the conversion is confirmed. #### Update community translations ([#1889](https://github.com/tldraw/tldraw/pull/1889)) @@ -450,10 +467,12 @@ Removed a feature to reset the viewport back to a shape that is being edited. - `@tldraw/editor`, `@tldraw/store`, `@tldraw/tldraw`, `@tldraw/tlschema` - Migrate snapshot [#1843](https://github.com/tldraw/tldraw/pull/1843) ([@steveruizok](https://github.com/steveruizok)) - `@tldraw/tldraw` - - export asset stuff [#1829](https://github.com/tldraw/tldraw/pull/1829) ([@steveruizok](https://github.com/steveruizok)) + - export asset stuff [#1829](https://github.com/tldraw/tldraw/pull/1829) ([@steveruizok](https://github.com/steveruizok) + ) - [feature] Asset props [#1824](https://github.com/tldraw/tldraw/pull/1824) ([@steveruizok](https://github.com/steveruizok)) - [feature] unlock all action [#1820](https://github.com/tldraw/tldraw/pull/1820) ([@steveruizok](https://github.com/steveruizok)) - - export `UiEventsProvider` [#1774](https://github.com/tldraw/tldraw/pull/1774) ([@steveruizok](https://github.com/steveruizok)) + - export `UiEventsProvider` [#1774](https://github.com/tldraw/tldraw/pull/1774) ([@steveruizok](https://github.com/steveruizok) + ) - `@tldraw/editor` - Add className as prop to Canvas [#1827](https://github.com/tldraw/tldraw/pull/1827) ([@steveruizok](https://github.com/steveruizok)) - refactor `parentsToChildrenWithIndexes` [#1764](https://github.com/tldraw/tldraw/pull/1764) ([@steveruizok](https://github.com/steveruizok)) @@ -634,4 +653,4 @@ Removed a feature to reset the viewport back to a shape that is being edited. - Ricardo Crespo ([@ricardo-crespo](https://github.com/ricardo-crespo)) - Steve Ruiz ([@steveruizok](https://github.com/steveruizok)) - Taha ([@Taha-Hassan-Git](https://github.com/Taha-Hassan-Git)) -- Takuto Mori Gump ([@mr04vv](https://github.com/mr04vv)) \ No newline at end of file +- Takuto Mori Gump ([@mr04vv](https://github.com/mr04vv)) diff --git a/apps/docs/content/releases/v2.0.0-alpha.16.mdx b/apps/docs/content/releases/v2.0.0-alpha.16.mdx index 530c0ab3e..490db3a83 100644 --- a/apps/docs/content/releases/v2.0.0-alpha.16.mdx +++ b/apps/docs/content/releases/v2.0.0-alpha.16.mdx @@ -9,7 +9,6 @@ status: published [View on GitHub](https://github.com/tldraw/tldraw/releases/tag/v2.0.0-alpha.16) - #### Fix shape opacity when erasing ([#2055](https://github.com/tldraw/tldraw/pull/2055)) - Fixes opacity of shapes while erasing in a group or frame. @@ -24,9 +23,15 @@ status: published Before/after: - + - + #### fix: proper label for opacity tooltip on hover ([#2044](https://github.com/tldraw/tldraw/pull/2044)) @@ -97,4 +102,4 @@ Before/after: - Mitja Bezenšek ([@MitjaBezensek](https://github.com/MitjaBezensek)) - Prince Mendiratta ([@Prince-Mendiratta](https://github.com/Prince-Mendiratta)) - Steve Ruiz ([@steveruizok](https://github.com/steveruizok)) -- Taha ([@Taha-Hassan-Git](https://github.com/Taha-Hassan-Git)) \ No newline at end of file +- Taha ([@Taha-Hassan-Git](https://github.com/Taha-Hassan-Git)) diff --git a/apps/docs/content/releases/v2.0.0-alpha.17.mdx b/apps/docs/content/releases/v2.0.0-alpha.17.mdx index d41a0bedd..6ee28de1e 100644 --- a/apps/docs/content/releases/v2.0.0-alpha.17.mdx +++ b/apps/docs/content/releases/v2.0.0-alpha.17.mdx @@ -9,7 +9,6 @@ status: published [View on GitHub](https://github.com/tldraw/tldraw/releases/tag/v2.0.0-alpha.17) - #### Firefox, Touch: Fix not being able to open style dropdowns ([#2092](https://github.com/tldraw/tldraw/pull/2092)) - Firefox Mobile: Fixed a bug where you couldn't open some style dropdown options. @@ -49,8 +48,8 @@ status: published #### [fix] locked shape of opacity problem with eraser.pointing ([#2073](https://github.com/tldraw/tldraw/pull/2073)) - locked shape of opacity problem with eraser.pointing -Before/after: -![A](https://github.com/tldraw/tldraw/assets/59823089/7483506c-72ac-45cc-93aa-f2a794ea8ff0) ![B](https://github.com/tldraw/tldraw/assets/59823089/ef0f988c-83f5-46a2-b891-0a391bca2f87) + Before/after: + ![A](https://github.com/tldraw/tldraw/assets/59823089/7483506c-72ac-45cc-93aa-f2a794ea8ff0) ![B](https://github.com/tldraw/tldraw/assets/59823089/ef0f988c-83f5-46a2-b891-0a391bca2f87) --- @@ -107,4 +106,4 @@ Before/after: - Lu Wilson ([@TodePond](https://github.com/TodePond)) - Mitja Bezenšek ([@MitjaBezensek](https://github.com/MitjaBezensek)) - Steve Ruiz ([@steveruizok](https://github.com/steveruizok)) -- Taha ([@Taha-Hassan-Git](https://github.com/Taha-Hassan-Git)) \ No newline at end of file +- Taha ([@Taha-Hassan-Git](https://github.com/Taha-Hassan-Git)) diff --git a/apps/docs/content/releases/v2.0.0-alpha.18.mdx b/apps/docs/content/releases/v2.0.0-alpha.18.mdx index 798ccd295..66187a4e3 100644 --- a/apps/docs/content/releases/v2.0.0-alpha.18.mdx +++ b/apps/docs/content/releases/v2.0.0-alpha.18.mdx @@ -9,7 +9,6 @@ status: published [View on GitHub](https://github.com/tldraw/tldraw/releases/tag/v2.0.0-alpha.18) - #### Fix an error when using context menu. ([#2186](https://github.com/tldraw/tldraw/pull/2186)) - Fixes the console error when opening the context menu for the first time. @@ -184,4 +183,4 @@ status: published - Lu Wilson ([@TodePond](https://github.com/TodePond)) - Mitja Bezenšek ([@MitjaBezensek](https://github.com/MitjaBezensek)) - Steve Ruiz ([@steveruizok](https://github.com/steveruizok)) -- Taha ([@Taha-Hassan-Git](https://github.com/Taha-Hassan-Git)) \ No newline at end of file +- Taha ([@Taha-Hassan-Git](https://github.com/Taha-Hassan-Git)) diff --git a/apps/docs/content/releases/v2.0.0-alpha.19.mdx b/apps/docs/content/releases/v2.0.0-alpha.19.mdx index dfc5fd359..e55497be8 100644 --- a/apps/docs/content/releases/v2.0.0-alpha.19.mdx +++ b/apps/docs/content/releases/v2.0.0-alpha.19.mdx @@ -9,7 +9,6 @@ status: published [View on GitHub](https://github.com/tldraw/tldraw/releases/tag/v2.0.0-alpha.19) - #### zoom to affected shapes after undo/redo ([#2293](https://github.com/tldraw/tldraw/pull/2293)) - Make sure affected shapes are visible after undo/redo @@ -248,4 +247,4 @@ status: published - Mitja Bezenšek ([@MitjaBezensek](https://github.com/MitjaBezensek)) - Steve Ruiz ([@steveruizok](https://github.com/steveruizok)) - Sugit ([@sugitlab](https://github.com/sugitlab)) -- Taha ([@Taha-Hassan-Git](https://github.com/Taha-Hassan-Git)) \ No newline at end of file +- Taha ([@Taha-Hassan-Git](https://github.com/Taha-Hassan-Git)) diff --git a/apps/docs/content/releases/v2.0.0-beta.1.mdx b/apps/docs/content/releases/v2.0.0-beta.1.mdx index 5f74f8270..6baa7b3a4 100644 --- a/apps/docs/content/releases/v2.0.0-beta.1.mdx +++ b/apps/docs/content/releases/v2.0.0-beta.1.mdx @@ -9,7 +9,6 @@ status: published [View on GitHub](https://github.com/tldraw/tldraw/releases/tag/v2.0.0-beta.1) - #### add speech bubble example ([#2362](https://github.com/tldraw/tldraw/pull/2362)) - Add an example for making a custom shape with handles, this one is a speech bubble with a movable tail. @@ -149,4 +148,4 @@ Updated translations for German, Korean, Russian, Ukrainian, Traditional Chinese - MinhoPark ([@Lennon57](https://github.com/Lennon57)) - Mitja Bezenšek ([@MitjaBezensek](https://github.com/MitjaBezensek)) - Steve Ruiz ([@steveruizok](https://github.com/steveruizok)) -- Taha ([@Taha-Hassan-Git](https://github.com/Taha-Hassan-Git)) \ No newline at end of file +- Taha ([@Taha-Hassan-Git](https://github.com/Taha-Hassan-Git)) diff --git a/apps/docs/content/releases/v2.0.0-beta.2.mdx b/apps/docs/content/releases/v2.0.0-beta.2.mdx index 8c64f978d..a4412e2ca 100644 --- a/apps/docs/content/releases/v2.0.0-beta.2.mdx +++ b/apps/docs/content/releases/v2.0.0-beta.2.mdx @@ -9,7 +9,6 @@ status: published [View on GitHub](https://github.com/tldraw/tldraw/releases/tag/v2.0.0-beta.2) - #### Fix validation when pasting images. ([#2436](https://github.com/tldraw/tldraw/pull/2436)) - Fixes url validations. @@ -164,4 +163,4 @@ status: published - Mitja Bezenšek ([@MitjaBezensek](https://github.com/MitjaBezensek)) - Stan Flint ([@StanFlint](https://github.com/StanFlint)) - Steve Ruiz ([@steveruizok](https://github.com/steveruizok)) -- Taha ([@Taha-Hassan-Git](https://github.com/Taha-Hassan-Git)) \ No newline at end of file +- Taha ([@Taha-Hassan-Git](https://github.com/Taha-Hassan-Git)) diff --git a/apps/docs/next.config.js b/apps/docs/next.config.js index c7493d39b..239e51222 100644 --- a/apps/docs/next.config.js +++ b/apps/docs/next.config.js @@ -34,7 +34,13 @@ const nextConfig = { { // For reverse compatibility with old links source: '/docs/usage', - destination: '/usage', + destination: '/installation', + permanent: true, + }, + { + // For reverse compatibility with old links + source: '/usage', + destination: '/installation', permanent: true, }, { diff --git a/apps/docs/package.json b/apps/docs/package.json index 6f5ba5cb1..93738f48f 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -43,6 +43,7 @@ "watch-content": "tsx ./watcher.ts" }, "dependencies": { + "@ariakit/react": "^0.4.1", "@codesandbox/sandpack-react": "^2.11.3", "@microsoft/api-extractor-model": "^7.26.4", "@microsoft/tsdoc": "^0.14.2", diff --git a/apps/docs/styles/globals.css b/apps/docs/styles/globals.css index d022b57fc..c9e66c85b 100644 --- a/apps/docs/styles/globals.css +++ b/apps/docs/styles/globals.css @@ -959,157 +959,52 @@ body { box-shadow: var(--shadow-small); } -/* --------------------- Search --------------------- */ - .sidebar .search__wrapper { display: none; } .search__wrapper { - display: flex; - flex-direction: row; -} - -.search { position: relative; - z-index: 200; - height: 40px; - padding: 4px; - flex-grow: 2; } -.search__icon { +.search__wrapper:focus-within .search__keyboard { + display: none; +} + +.search__keyboard { + display: block; position: absolute; top: 50%; + right: 12px; + z-index: 2; transform: translateY(-50%); color: var(--color-tint-5); - left: 0px; - z-index: 2; pointer-events: none; transition: color 0.12s; } -.search:focus-within .search__icon { +.search__keyboard kbd { + display: inline-block; + height: 24px; + min-width: 24px; + line-height: 26px; + padding: 0 4px; + text-align: center; + margin-right: 4px; + font-size: 12px; + color: var(--color-tint-6); + background-color: var(--color-tint-2); + border-radius: 2px; +} + +.search__ai-toggle { + border: 0; color: var(--color-text); -} - -.search__input { - position: relative; - padding-left: 20px; - height: 100%; - width: 100%; - border-radius: var(--border-radius-menu); - border: none; - background-color: var(--color-background); - font-family: var(--font-body); font-size: 14px; - background-color: none; - background: none; -} - -.search__input:disabled { - /* background-color: var(--color-tint-1); */ - color: var(--color-tint-5); -} - -.search__input::placeholder { - color: var(--color-tint-5); -} - -.search__input:focus { - outline: none; -} - -.search__check { - display: flex; - align-items: center; - justify-content: center; - flex-direction: row; - right: 0px; - gap: 6px; - font-size: 12px; - text-transform: uppercase; -} - -/* Search Results */ - -.search__results__wrapper { - position: relative; - height: 0px; - width: 100%; - z-index: 100; -} - -.search__results { - padding: 0px; - position: absolute; - top: 0px; - left: 0px; - background-color: var(--color-background); - width: 320px; - border-radius: 8px; - box-shadow: var(--shadow-big); - max-height: 80vh; - overflow-y: auto; -} -.search__results__switcher { - margin-top: 16px; - font-size: 14px; -} - -.article ul.search__results__list { - list-style-type: none; - padding-left: 0px; - margin-left: 0px; -} - -.search__results__article { - flex-direction: column; - align-items: flex-start; - justify-content: center; - font-size: 16px; - padding-bottom: 12px; - height: fit-content; - border-radius: 12px; - margin: 0px; -} - -.search__results__article h4 { - font-size: 12px; - font-weight: 500; - color: var(--color-text); -} - -.search__results__article h3 { - font-size: 16px; - font-weight: 500; -} - -.search__results__article__details { - display: flex; - flex-direction: row; - align-items: center; -} - -.search__results__article__score { - font-size: 12px; - padding: 0px 8px; - border-left: 1px solid var(--color-tint-4); - line-height: 1; - height: min-content; - color: var(--color-tint-5); - margin-left: 8px; - text-decoration: none; -} - -@media (hover: hover) { - .search__results__list a:hover { - text-decoration: none; - } - - .search__results__list a:hover h3 { - text-decoration: underline; - } + text-align: left; + cursor: pointer; + margin: 4px 0; + background: transparent; } /* --------------------- Desktop M --------------------- */ diff --git a/apps/docs/types/content-types.ts b/apps/docs/types/content-types.ts index b6d5473e5..b97574814 100644 --- a/apps/docs/types/content-types.ts +++ b/apps/docs/types/content-types.ts @@ -185,8 +185,6 @@ export type SidebarContentList = { articleId: string | null links: SidebarContentLink[] activeId?: string | null - searchQuery?: string - searchType?: string } /* ---------- Finished / generated content ---------- */ diff --git a/apps/docs/types/search-types.ts b/apps/docs/types/search-types.ts index 20bd49c05..fce24dec2 100644 --- a/apps/docs/types/search-types.ts +++ b/apps/docs/types/search-types.ts @@ -2,7 +2,13 @@ export type SearchResult = { type: 'article' | 'category' | 'section' | 'heading' id: string subtitle: string + sectionType: string title: string url: string score: number } + +export enum SEARCH_TYPE { + AI = 'ai', + NORMAL = 'n', +} diff --git a/apps/docs/utils/search-api.ts b/apps/docs/utils/search-api.ts new file mode 100644 index 000000000..5613727d7 --- /dev/null +++ b/apps/docs/utils/search-api.ts @@ -0,0 +1,9 @@ +export const SEARCH_RESULTS = { + articles: [], + apiDocs: [], + examples: [], +} +export const searchBucket = (sectionId: string) => + sectionId === 'examples' ? 'examples' : sectionId === 'reference' ? 'apiDocs' : 'articles' +export const sectionTypeBucket = (sectionId: string) => + ['examples', 'reference'].includes(sectionId) ? sectionId : 'docs' diff --git a/yarn.lock b/yarn.lock index 35605de59..dda32a3b2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -51,6 +51,39 @@ __metadata: languageName: node linkType: hard +"@ariakit/core@npm:0.4.1": + version: 0.4.1 + resolution: "@ariakit/core@npm:0.4.1" + checksum: 536697f9608c1c0694c76e797a0c54a107fda14dec779a5ebbf8fe7684f2fb3f315e0cd337d4e8cc97956377b061b7a8b2046d70024cb5db45667852f4c40960 + languageName: node + linkType: hard + +"@ariakit/react-core@npm:0.4.1": + version: 0.4.1 + resolution: "@ariakit/react-core@npm:0.4.1" + dependencies: + "@ariakit/core": "npm:0.4.1" + "@floating-ui/dom": "npm:^1.0.0" + use-sync-external-store: "npm:^1.2.0" + peerDependencies: + react: ^17.0.0 || ^18.0.0 + react-dom: ^17.0.0 || ^18.0.0 + checksum: 83731f8be4301555b00d68825c9b195084961dc944affbead636dd7125c95bb5abec6d40646fb051ef8e20108fe641654207da8f7329059d74019a4b29ed28d5 + languageName: node + linkType: hard + +"@ariakit/react@npm:^0.4.1": + version: 0.4.1 + resolution: "@ariakit/react@npm:0.4.1" + dependencies: + "@ariakit/react-core": "npm:0.4.1" + peerDependencies: + react: ^17.0.0 || ^18.0.0 + react-dom: ^17.0.0 || ^18.0.0 + checksum: 1414b8aac17efea15793c2bcade85a32bdeb9b8cad8355a9f889a16e45ce97ad00699001bc2edd181b003fac7e18cd5f4e96792a581d1107d87a403386eb11e8 + languageName: node + linkType: hard + "@auto-it/bot-list@npm:10.46.0": version: 10.46.0 resolution: "@auto-it/bot-list@npm:10.46.0" @@ -3455,22 +3488,22 @@ __metadata: languageName: node linkType: hard -"@floating-ui/core@npm:^1.5.3": - version: 1.5.3 - resolution: "@floating-ui/core@npm:1.5.3" +"@floating-ui/core@npm:^1.6.0": + version: 1.6.0 + resolution: "@floating-ui/core@npm:1.6.0" dependencies: - "@floating-ui/utils": "npm:^0.2.0" - checksum: 7d9feaca2565a2a71bf03d23cd292c03def63097d7fde7d62909cdb8ddb84664781f3922086bcf10443f3310cb92381a0ecf745b2774edb917fa74fe61015c56 + "@floating-ui/utils": "npm:^0.2.1" + checksum: d6a47cacde193cd8ccb4c268b91ccc4ca254dffaec6242b07fd9bcde526044cc976d27933a7917f9a671de0a0e27f8d358f46400677dbd0c8199de293e9746e1 languageName: node linkType: hard -"@floating-ui/dom@npm:^1.5.4": - version: 1.5.4 - resolution: "@floating-ui/dom@npm:1.5.4" +"@floating-ui/dom@npm:^1.0.0, @floating-ui/dom@npm:^1.5.4": + version: 1.6.1 + resolution: "@floating-ui/dom@npm:1.6.1" dependencies: - "@floating-ui/core": "npm:^1.5.3" - "@floating-ui/utils": "npm:^0.2.0" - checksum: 3ba02ba2b4227c1e18df6ccdd029a1c100058db2e76ca1dac60a593ec72b2d4d995fa5c2d1639a5c38adb17e12398fbfe4f6cf5fd45f2ee6170ed0cf64acea06 + "@floating-ui/core": "npm:^1.6.0" + "@floating-ui/utils": "npm:^0.2.1" + checksum: c010feb55be37662eb4cc8d0a22e21359c25247bbdcd9557617fd305cf08c8f020435b17e4b4f410201ba9abe3a0dd96b5c42d56e85f7a5e11e7d30b85afc116 languageName: node linkType: hard @@ -3486,7 +3519,7 @@ __metadata: languageName: node linkType: hard -"@floating-ui/utils@npm:^0.2.0": +"@floating-ui/utils@npm:^0.2.1": version: 0.2.1 resolution: "@floating-ui/utils@npm:0.2.1" checksum: 33c9ab346e7b05c5a1e6a95bc902aafcfc2c9d513a147e2491468843bd5607531b06d0b9aa56aa491cbf22a6c2495c18ccfc4c0344baec54a689a7bb8e4898d6 @@ -7220,6 +7253,7 @@ __metadata: version: 0.0.0-use.local resolution: "@tldraw/docs@workspace:apps/docs" dependencies: + "@ariakit/react": "npm:^0.4.1" "@codesandbox/sandpack-react": "npm:^2.11.3" "@microsoft/api-extractor-model": "npm:^7.26.4" "@microsoft/tsdoc": "npm:^0.14.2" @@ -24611,6 +24645,15 @@ __metadata: languageName: node linkType: hard +"use-sync-external-store@npm:^1.2.0": + version: 1.2.0 + resolution: "use-sync-external-store@npm:1.2.0" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + checksum: a676216affc203876bd47981103f201f28c2731361bb186367e12d287a7566763213a8816910c6eb88265eccd4c230426eb783d64c373c4a180905be8820ed8e + languageName: node + linkType: hard + "user-home@npm:^2.0.0": version: 2.0.0 resolution: "user-home@npm:2.0.0"