{ "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/utils!", "docComment": "", "name": "@tldraw/utils", "preserveMemberOrder": false, "members": [ { "kind": "EntryPoint", "canonicalReference": "@tldraw/utils!", "name": "", "preserveMemberOrder": false, "members": [ { "kind": "Function", "canonicalReference": "@tldraw/utils!debounce:function(1)", "docComment": "/**\n * Debounce a function.\n *\n * @example\n * ```ts\n * const A = debounce(myFunction, 1000)\n * ```\n *\n * @see\n *\n * source - https://gist.github.com/ca0v/73a31f57b397606c9813472f7493a940\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function debounce(callback: " }, { "kind": "Content", "text": "(...args: T) => " }, { "kind": "Reference", "text": "PromiseLike", "canonicalReference": "!PromiseLike:interface" }, { "kind": "Content", "text": " | U" }, { "kind": "Content", "text": ", wait: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "{\n (...args: T): " }, { "kind": "Reference", "text": "Promise", "canonicalReference": "!Promise:interface" }, { "kind": "Content", "text": ";\n cancel(): void;\n}" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/debounce.ts", "returnTypeTokenRange": { "startIndex": 9, "endIndex": 12 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "callback", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 6 }, "isOptional": false }, { "parameterName": "wait", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "U", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "debounce" }, { "kind": "Function", "canonicalReference": "@tldraw/utils!dedupe:function(1)", "docComment": "/**\n * Deduplicate the items in an array\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function dedupe(input: " }, { "kind": "Content", "text": "T[]" }, { "kind": "Content", "text": ", equals?: " }, { "kind": "Content", "text": "(a: any, b: any) => boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "T[]" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/array.ts", "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "input", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "equals", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "dedupe" }, { "kind": "Function", "canonicalReference": "@tldraw/utils!deepCopy:function(1)", "docComment": "/**\n * Deep copy function for TypeScript.\n *\n * @param obj - Target value to be copied.\n *\n * @example\n * ```ts\n * const A = deepCopy({ a: 1, b: { c: 2 } })\n * ```\n *\n * @see\n *\n * Source - project, ts-deeply https://github.com/ykdr2017/ts-deepcopy\n *\n * @see\n *\n * Code - pen https://codepen.io/erikvullings/pen/ejyBYg\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function deepCopy(obj: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/object.ts", "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "obj", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "name": "deepCopy" }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/utils!ErrorResult:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type ErrorResult = " }, { "kind": "Content", "text": "{\n readonly ok: false;\n readonly error: E;\n}" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/control.ts", "releaseTag": "Public", "name": "ErrorResult", "typeParameters": [ { "typeParameterName": "E", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "typeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/utils!Expand:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type Expand = " }, { "kind": "Content", "text": "T extends infer O ? {\n [K in keyof O]: O[K];\n} : never" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/types.ts", "releaseTag": "Public", "name": "Expand", "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "typeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "Class", "canonicalReference": "@tldraw/utils!FileHelpers:class", "docComment": "/**\n * Helpers for files\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare class FileHelpers " } ], "fileUrlPath": "packages/utils/src/lib/file.ts", "releaseTag": "Public", "isAbstract": false, "name": "FileHelpers", "preserveMemberOrder": false, "members": [ { "kind": "Method", "canonicalReference": "@tldraw/utils!FileHelpers.fileToBase64:member(1)", "docComment": "/**\n * Convert a file to base64.\n *\n * @param value - The file as a blob.\n *\n * @example\n * ```ts\n * const A = fileToBase64('./test.png')\n * ```\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "static fileToBase64(file: " }, { "kind": "Reference", "text": "Blob", "canonicalReference": "!Blob:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "Promise", "canonicalReference": "!Promise:interface" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "isStatic": true, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "file", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "isOptional": false, "isAbstract": false, "name": "fileToBase64" } ], "implementsTokenRanges": [] }, { "kind": "Function", "canonicalReference": "@tldraw/utils!getFirstFromIterable:function(1)", "docComment": "/**\n * Get the first item from an iterable Set or Map.\n *\n * @param value - The iterable Set or Map.\n *\n * @example\n * ```ts\n * const A = getFirstItem(new Set([1, 2, 3])) // 1\n * const B = getFirstItem(\n * \tnew Map([\n * \t\t['a', 1],\n * \t\t['b', 2],\n * \t])\n * ) // 1\n * ```\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function getFirstFromIterable(set: " }, { "kind": "Reference", "text": "Map", "canonicalReference": "!Map:interface" }, { "kind": "Content", "text": " | " }, { "kind": "Reference", "text": "Set", "canonicalReference": "!Set:interface" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/iterable.ts", "returnTypeTokenRange": { "startIndex": 8, "endIndex": 9 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "set", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 7 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "name": "getFirstFromIterable" }, { "kind": "Function", "canonicalReference": "@tldraw/utils!getHashForObject:function(1)", "docComment": "/**\n * Hash a string using the FNV-1a algorithm.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function getHashForObject(obj: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/hash.ts", "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "obj", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "getHashForObject" }, { "kind": "Function", "canonicalReference": "@tldraw/utils!getHashForString:function(1)", "docComment": "/**\n * Hash a string using the FNV-1a algorithm.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function getHashForString(string: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/hash.ts", "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "string", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "getHashForString" }, { "kind": "Function", "canonicalReference": "@tldraw/utils!isDefined:function(1)", "docComment": "/**\n * Get whether a value is not undefined.\n *\n * @param value - The value to check.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function isDefined(value: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "value", "canonicalReference": "@tldraw/utils!~value" }, { "kind": "Content", "text": " is typeof " }, { "kind": "Reference", "text": "value", "canonicalReference": "@tldraw/utils!~value:var" }, { "kind": "Content", "text": " extends undefined ? never : T" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/value.ts", "returnTypeTokenRange": { "startIndex": 3, "endIndex": 7 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "isDefined" }, { "kind": "Function", "canonicalReference": "@tldraw/utils!isNonNull:function(1)", "docComment": "/**\n * Get whether a value is null\n *\n * @param value - The value to check.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function isNonNull(value: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "value", "canonicalReference": "@tldraw/utils!~value" }, { "kind": "Content", "text": " is typeof " }, { "kind": "Reference", "text": "value", "canonicalReference": "@tldraw/utils!~value:var" }, { "kind": "Content", "text": " extends null ? never : T" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/value.ts", "returnTypeTokenRange": { "startIndex": 3, "endIndex": 7 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "isNonNull" }, { "kind": "Function", "canonicalReference": "@tldraw/utils!isNonNullish:function(1)", "docComment": "/**\n * Get whether a value is nullish (null, undefined).\n *\n * @param value - The value to check.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function isNonNullish(value: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "value", "canonicalReference": "@tldraw/utils!~value" }, { "kind": "Content", "text": " is typeof " }, { "kind": "Reference", "text": "value", "canonicalReference": "@tldraw/utils!~value:var" }, { "kind": "Content", "text": " extends undefined ? never : typeof " }, { "kind": "Reference", "text": "value", "canonicalReference": "@tldraw/utils!~value:var" }, { "kind": "Content", "text": " extends null ? never : T" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/value.ts", "returnTypeTokenRange": { "startIndex": 3, "endIndex": 9 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "isNonNullish" }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/utils!JsonArray:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type JsonArray = " }, { "kind": "Reference", "text": "JsonValue", "canonicalReference": "@tldraw/utils!JsonValue:type" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/json-value.ts", "releaseTag": "Public", "name": "JsonArray", "typeTokenRange": { "startIndex": 1, "endIndex": 3 } }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/utils!JsonObject:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type JsonObject = " }, { "kind": "Content", "text": "{\n [key: string]: " }, { "kind": "Reference", "text": "JsonValue", "canonicalReference": "@tldraw/utils!JsonValue:type" }, { "kind": "Content", "text": " | undefined;\n}" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/json-value.ts", "releaseTag": "Public", "name": "JsonObject", "typeTokenRange": { "startIndex": 1, "endIndex": 4 } }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/utils!JsonPrimitive:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type JsonPrimitive = " }, { "kind": "Content", "text": "boolean | null | number | string" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/json-value.ts", "releaseTag": "Public", "name": "JsonPrimitive", "typeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/utils!JsonValue:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type JsonValue = " }, { "kind": "Reference", "text": "JsonArray", "canonicalReference": "@tldraw/utils!JsonArray:type" }, { "kind": "Content", "text": " | " }, { "kind": "Reference", "text": "JsonObject", "canonicalReference": "@tldraw/utils!JsonObject:type" }, { "kind": "Content", "text": " | " }, { "kind": "Reference", "text": "JsonPrimitive", "canonicalReference": "@tldraw/utils!JsonPrimitive:type" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/json-value.ts", "releaseTag": "Public", "name": "JsonValue", "typeTokenRange": { "startIndex": 1, "endIndex": 6 } }, { "kind": "Function", "canonicalReference": "@tldraw/utils!lerp:function(1)", "docComment": "/**\n * Linear interpolate between two values.\n *\n * @example\n * ```ts\n * const A = lerp(0, 1, 0.5)\n * ```\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function lerp(a: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ", b: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ", t: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/number.ts", "returnTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "a", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "b", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "t", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false } ], "name": "lerp" }, { "kind": "Function", "canonicalReference": "@tldraw/utils!lns:function(1)", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function lns(str: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/hash.ts", "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "str", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "lns" }, { "kind": "Class", "canonicalReference": "@tldraw/utils!MediaHelpers:class", "docComment": "/**\n * Helpers for media\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare class MediaHelpers " } ], "fileUrlPath": "packages/utils/src/lib/media.ts", "releaseTag": "Public", "isAbstract": false, "name": "MediaHelpers", "preserveMemberOrder": false, "members": [ { "kind": "Method", "canonicalReference": "@tldraw/utils!MediaHelpers.getImageSizeFromSrc:member(1)", "docComment": "/**\n * Get the size of an image from its source.\n *\n * @param dataURL - The file as a string.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "static getImageSizeFromSrc(dataURL: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "Promise", "canonicalReference": "!Promise:interface" }, { "kind": "Content", "text": "<{\n w: number;\n h: number;\n }>" }, { "kind": "Content", "text": ";" } ], "isStatic": true, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "dataURL", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "isOptional": false, "isAbstract": false, "name": "getImageSizeFromSrc" }, { "kind": "Method", "canonicalReference": "@tldraw/utils!MediaHelpers.getVideoSizeFromSrc:member(1)", "docComment": "/**\n * Get the size of a video from its source.\n *\n * @param src - The source of the video.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "static getVideoSizeFromSrc(src: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "Promise", "canonicalReference": "!Promise:interface" }, { "kind": "Content", "text": "<{\n w: number;\n h: number;\n }>" }, { "kind": "Content", "text": ";" } ], "isStatic": true, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "src", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "isOptional": false, "isAbstract": false, "name": "getVideoSizeFromSrc" } ], "implementsTokenRanges": [] }, { "kind": "Function", "canonicalReference": "@tldraw/utils!modulate:function(1)", "docComment": "/**\n * Modulate a value between two ranges.\n *\n * @param value - The interpolation value.\n *\n * @param rangeA - From [low, high]\n *\n * @param rangeB - To [low, high]\n *\n * @param clamp - Whether to clamp the the result to [low, high]\n *\n * @example\n * ```ts\n * const A = modulate(0, [0, 1], [0, 100])\n * ```\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function modulate(value: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ", rangeA: " }, { "kind": "Content", "text": "number[]" }, { "kind": "Content", "text": ", rangeB: " }, { "kind": "Content", "text": "number[]" }, { "kind": "Content", "text": ", clamp?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/number.ts", "returnTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "rangeA", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "rangeB", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false }, { "parameterName": "clamp", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true } ], "name": "modulate" }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/utils!OkResult:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type OkResult = " }, { "kind": "Content", "text": "{\n readonly ok: true;\n readonly value: T;\n}" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/control.ts", "releaseTag": "Public", "name": "OkResult", "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "typeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "Class", "canonicalReference": "@tldraw/utils!PngHelpers:class", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare class PngHelpers " } ], "fileUrlPath": "packages/utils/src/lib/png.ts", "releaseTag": "Public", "isAbstract": false, "name": "PngHelpers", "preserveMemberOrder": false, "members": [ { "kind": "Method", "canonicalReference": "@tldraw/utils!PngHelpers.findChunk:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "static findChunk(view: " }, { "kind": "Reference", "text": "DataView", "canonicalReference": "!DataView:interface" }, { "kind": "Content", "text": ", type: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "{\n dataOffset: number;\n size: number;\n start: number;\n }" }, { "kind": "Content", "text": ";" } ], "isStatic": true, "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "view", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "type", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "isOptional": false, "isAbstract": false, "name": "findChunk" }, { "kind": "Method", "canonicalReference": "@tldraw/utils!PngHelpers.getChunkType:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "static getChunkType(view: " }, { "kind": "Reference", "text": "DataView", "canonicalReference": "!DataView:interface" }, { "kind": "Content", "text": ", offset: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isStatic": true, "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "view", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "offset", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "isOptional": false, "isAbstract": false, "name": "getChunkType" }, { "kind": "Method", "canonicalReference": "@tldraw/utils!PngHelpers.isPng:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "static isPng(view: " }, { "kind": "Reference", "text": "DataView", "canonicalReference": "!DataView:interface" }, { "kind": "Content", "text": ", offset: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "isStatic": true, "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "view", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "offset", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "isOptional": false, "isAbstract": false, "name": "isPng" }, { "kind": "Method", "canonicalReference": "@tldraw/utils!PngHelpers.parsePhys:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "static parsePhys(view: " }, { "kind": "Reference", "text": "DataView", "canonicalReference": "!DataView:interface" }, { "kind": "Content", "text": ", offset: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "{\n ppux: number;\n ppuy: number;\n unit: number;\n }" }, { "kind": "Content", "text": ";" } ], "isStatic": true, "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "view", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "offset", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "isOptional": false, "isAbstract": false, "name": "parsePhys" }, { "kind": "Method", "canonicalReference": "@tldraw/utils!PngHelpers.readChunks:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "static readChunks(view: " }, { "kind": "Reference", "text": "DataView", "canonicalReference": "!DataView:interface" }, { "kind": "Content", "text": ", offset?: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "Record", "canonicalReference": "!Record:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "isStatic": true, "returnTypeTokenRange": { "startIndex": 5, "endIndex": 7 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "view", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "offset", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true } ], "isOptional": false, "isAbstract": false, "name": "readChunks" }, { "kind": "Method", "canonicalReference": "@tldraw/utils!PngHelpers.setPhysChunk:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "static setPhysChunk(view: " }, { "kind": "Reference", "text": "DataView", "canonicalReference": "!DataView:interface" }, { "kind": "Content", "text": ", dpr?: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ", options?: " }, { "kind": "Reference", "text": "BlobPropertyBag", "canonicalReference": "!BlobPropertyBag:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "Blob", "canonicalReference": "!Blob:interface" }, { "kind": "Content", "text": ";" } ], "isStatic": true, "returnTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "releaseTag": "Public", "isProtected": false, "overloadIndex": 1, "parameters": [ { "parameterName": "view", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "dpr", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true }, { "parameterName": "options", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true } ], "isOptional": false, "isAbstract": false, "name": "setPhysChunk" } ], "implementsTokenRanges": [] }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/utils!RecursivePartial:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type RecursivePartial = " }, { "kind": "Content", "text": "{\n [P in keyof T]?: " }, { "kind": "Reference", "text": "RecursivePartial", "canonicalReference": "@tldraw/utils!RecursivePartial:type" }, { "kind": "Content", "text": ";\n}" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/types.ts", "releaseTag": "Public", "name": "RecursivePartial", "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "typeTokenRange": { "startIndex": 1, "endIndex": 4 } }, { "kind": "TypeAlias", "canonicalReference": "@tldraw/utils!Result:type", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export type Result = " }, { "kind": "Reference", "text": "ErrorResult", "canonicalReference": "@tldraw/utils!ErrorResult:type" }, { "kind": "Content", "text": " | " }, { "kind": "Reference", "text": "OkResult", "canonicalReference": "@tldraw/utils!OkResult:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/control.ts", "releaseTag": "Public", "name": "Result", "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "E", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "typeTokenRange": { "startIndex": 1, "endIndex": 5 } }, { "kind": "Variable", "canonicalReference": "@tldraw/utils!Result:var", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "Result: " }, { "kind": "Content", "text": "{\n ok(value: T): " }, { "kind": "Reference", "text": "OkResult", "canonicalReference": "@tldraw/utils!OkResult:type" }, { "kind": "Content", "text": ";\n err(error: E): " }, { "kind": "Reference", "text": "ErrorResult", "canonicalReference": "@tldraw/utils!ErrorResult:type" }, { "kind": "Content", "text": ";\n}" } ], "fileUrlPath": "packages/utils/src/lib/control.ts", "isReadonly": true, "releaseTag": "Public", "name": "Result", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 6 } }, { "kind": "Function", "canonicalReference": "@tldraw/utils!rng:function(1)", "docComment": "/**\n * Seeded random number generator, using [xorshift](https://en.wikipedia.org/wiki/Xorshift). The result will always be betweeen -1 and 1.\n *\n * Adapted from [seedrandom](https://github.com/davidbau/seedrandom).\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function rng(seed?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "() => number" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/number.ts", "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "seed", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true } ], "name": "rng" }, { "kind": "Function", "canonicalReference": "@tldraw/utils!rotateArray:function(1)", "docComment": "/**\n * Rotate the contents of an array.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function rotateArray(arr: " }, { "kind": "Content", "text": "T[]" }, { "kind": "Content", "text": ", offset: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "T[]" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/array.ts", "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "arr", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "offset", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "rotateArray" }, { "kind": "Function", "canonicalReference": "@tldraw/utils!sortById:function(1)", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function sortById(a: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ", b: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "-1 | 1" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/sort.ts", "returnTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "a", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "b", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "sortById" }, { "kind": "Variable", "canonicalReference": "@tldraw/utils!structuredClone_2:var", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "structuredClone: " }, { "kind": "Content", "text": "(i: T) => T" } ], "fileUrlPath": "packages/utils/src/lib/value.ts", "isReadonly": true, "releaseTag": "Public", "name": "structuredClone_2", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "Function", "canonicalReference": "@tldraw/utils!throttle:function(1)", "docComment": "/**\n * Throttle a function.\n *\n * @example\n * ```ts\n * const A = throttle(myFunction, 1000)\n * ```\n *\n * @see\n *\n * source - https://github.com/bameyrick/throttle-typescript\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function throttle any" }, { "kind": "Content", "text": ">(func: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ", limit: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "(...args: " }, { "kind": "Reference", "text": "Parameters", "canonicalReference": "!Parameters:type" }, { "kind": "Content", "text": ") => " }, { "kind": "Reference", "text": "ReturnType", "canonicalReference": "!ReturnType:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "fileUrlPath": "packages/utils/src/lib/function.ts", "returnTypeTokenRange": { "startIndex": 7, "endIndex": 12 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "func", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "limit", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "throttle" } ] } ] }