@bigbluebutton/tlschema 2.0.0-alpha.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -0
- package/dist-cjs/TLStore.js +133 -0
- package/dist-cjs/TLStore.js.map +7 -0
- package/dist-cjs/assets/TLBaseAsset.js +37 -0
- package/dist-cjs/assets/TLBaseAsset.js.map +7 -0
- package/dist-cjs/assets/TLBookmarkAsset.js +38 -0
- package/dist-cjs/assets/TLBookmarkAsset.js.map +7 -0
- package/dist-cjs/assets/TLImageAsset.js +76 -0
- package/dist-cjs/assets/TLImageAsset.js.map +7 -0
- package/dist-cjs/assets/TLVideoAsset.js +76 -0
- package/dist-cjs/assets/TLVideoAsset.js.map +7 -0
- package/dist-cjs/createPresenceStateDerivation.js +68 -0
- package/dist-cjs/createPresenceStateDerivation.js.map +7 -0
- package/dist-cjs/createTLSchema.js +68 -0
- package/dist-cjs/createTLSchema.js.map +7 -0
- package/dist-cjs/index.d.ts +1414 -0
- package/dist-cjs/index.js +142 -0
- package/dist-cjs/index.js.map +7 -0
- package/dist-cjs/misc/TLColor.js +36 -0
- package/dist-cjs/misc/TLColor.js.map +7 -0
- package/dist-cjs/misc/TLCursor.js +55 -0
- package/dist-cjs/misc/TLCursor.js.map +7 -0
- package/dist-cjs/misc/TLHandle.js +36 -0
- package/dist-cjs/misc/TLHandle.js.map +7 -0
- package/dist-cjs/misc/TLOpacity.js +30 -0
- package/dist-cjs/misc/TLOpacity.js.map +7 -0
- package/dist-cjs/misc/TLScribble.js +40 -0
- package/dist-cjs/misc/TLScribble.js.map +7 -0
- package/dist-cjs/misc/geometry-types.js +37 -0
- package/dist-cjs/misc/geometry-types.js.map +7 -0
- package/dist-cjs/misc/id-validator.js +33 -0
- package/dist-cjs/misc/id-validator.js.map +7 -0
- package/dist-cjs/records/TLAsset.js +74 -0
- package/dist-cjs/records/TLAsset.js.map +7 -0
- package/dist-cjs/records/TLCamera.js +74 -0
- package/dist-cjs/records/TLCamera.js.map +7 -0
- package/dist-cjs/records/TLDocument.js +82 -0
- package/dist-cjs/records/TLDocument.js.map +7 -0
- package/dist-cjs/records/TLInstance.js +452 -0
- package/dist-cjs/records/TLInstance.js.map +7 -0
- package/dist-cjs/records/TLPage.js +74 -0
- package/dist-cjs/records/TLPage.js.map +7 -0
- package/dist-cjs/records/TLPageState.js +209 -0
- package/dist-cjs/records/TLPageState.js.map +7 -0
- package/dist-cjs/records/TLPointer.js +76 -0
- package/dist-cjs/records/TLPointer.js.map +7 -0
- package/dist-cjs/records/TLPresence.js +170 -0
- package/dist-cjs/records/TLPresence.js.map +7 -0
- package/dist-cjs/records/TLRecord.js +17 -0
- package/dist-cjs/records/TLRecord.js.map +7 -0
- package/dist-cjs/records/TLShape.js +147 -0
- package/dist-cjs/records/TLShape.js.map +7 -0
- package/dist-cjs/shapes/TLArrowShape.js +156 -0
- package/dist-cjs/shapes/TLArrowShape.js.map +7 -0
- package/dist-cjs/shapes/TLBaseShape.js +52 -0
- package/dist-cjs/shapes/TLBaseShape.js.map +7 -0
- package/dist-cjs/shapes/TLBookmarkShape.js +57 -0
- package/dist-cjs/shapes/TLBookmarkShape.js.map +7 -0
- package/dist-cjs/shapes/TLDrawShape.js +89 -0
- package/dist-cjs/shapes/TLDrawShape.js.map +7 -0
- package/dist-cjs/shapes/TLEmbedShape.js +709 -0
- package/dist-cjs/shapes/TLEmbedShape.js.map +7 -0
- package/dist-cjs/shapes/TLFrameShape.js +33 -0
- package/dist-cjs/shapes/TLFrameShape.js.map +7 -0
- package/dist-cjs/shapes/TLGeoShape.js +230 -0
- package/dist-cjs/shapes/TLGeoShape.js.map +7 -0
- package/dist-cjs/shapes/TLGroupShape.js +28 -0
- package/dist-cjs/shapes/TLGroupShape.js.map +7 -0
- package/dist-cjs/shapes/TLHighlightShape.js +38 -0
- package/dist-cjs/shapes/TLHighlightShape.js.map +7 -0
- package/dist-cjs/shapes/TLImageShape.js +69 -0
- package/dist-cjs/shapes/TLImageShape.js.map +7 -0
- package/dist-cjs/shapes/TLLineShape.js +70 -0
- package/dist-cjs/shapes/TLLineShape.js.map +7 -0
- package/dist-cjs/shapes/TLNoteShape.js +144 -0
- package/dist-cjs/shapes/TLNoteShape.js.map +7 -0
- package/dist-cjs/shapes/TLTextShape.js +67 -0
- package/dist-cjs/shapes/TLTextShape.js.map +7 -0
- package/dist-cjs/shapes/TLVideoShape.js +53 -0
- package/dist-cjs/shapes/TLVideoShape.js.map +7 -0
- package/dist-cjs/store-migrations.js +81 -0
- package/dist-cjs/store-migrations.js.map +7 -0
- package/dist-cjs/styles/StyleProp.js +94 -0
- package/dist-cjs/styles/StyleProp.js.map +7 -0
- package/dist-cjs/styles/TLColorStyle.js +283 -0
- package/dist-cjs/styles/TLColorStyle.js.map +7 -0
- package/dist-cjs/styles/TLDashStyle.js +29 -0
- package/dist-cjs/styles/TLDashStyle.js.map +7 -0
- package/dist-cjs/styles/TLFillStyle.js +29 -0
- package/dist-cjs/styles/TLFillStyle.js.map +7 -0
- package/dist-cjs/styles/TLFontStyle.js +36 -0
- package/dist-cjs/styles/TLFontStyle.js.map +7 -0
- package/dist-cjs/styles/TLHorizontalAlignStyle.js +29 -0
- package/dist-cjs/styles/TLHorizontalAlignStyle.js.map +7 -0
- package/dist-cjs/styles/TLSizeStyle.js +29 -0
- package/dist-cjs/styles/TLSizeStyle.js.map +7 -0
- package/dist-cjs/styles/TLVerticalAlignStyle.js +29 -0
- package/dist-cjs/styles/TLVerticalAlignStyle.js.map +7 -0
- package/dist-cjs/translations/languages.js +59 -0
- package/dist-cjs/translations/languages.js.map +7 -0
- package/dist-cjs/translations/translations.js +63 -0
- package/dist-cjs/translations/translations.js.map +7 -0
- package/dist-cjs/util-types.js +17 -0
- package/dist-cjs/util-types.js.map +7 -0
- package/dist-esm/TLStore.mjs +113 -0
- package/dist-esm/TLStore.mjs.map +7 -0
- package/dist-esm/assets/TLBaseAsset.mjs +17 -0
- package/dist-esm/assets/TLBaseAsset.mjs.map +7 -0
- package/dist-esm/assets/TLBookmarkAsset.mjs +18 -0
- package/dist-esm/assets/TLBookmarkAsset.mjs.map +7 -0
- package/dist-esm/assets/TLImageAsset.mjs +56 -0
- package/dist-esm/assets/TLImageAsset.mjs.map +7 -0
- package/dist-esm/assets/TLVideoAsset.mjs +56 -0
- package/dist-esm/assets/TLVideoAsset.mjs.map +7 -0
- package/dist-esm/createPresenceStateDerivation.mjs +48 -0
- package/dist-esm/createPresenceStateDerivation.mjs.map +7 -0
- package/dist-esm/createTLSchema.mjs +48 -0
- package/dist-esm/createTLSchema.mjs.map +7 -0
- package/dist-esm/index.d.mts +1414 -0
- package/dist-esm/index.mjs +193 -0
- package/dist-esm/index.mjs.map +7 -0
- package/dist-esm/misc/TLColor.mjs +16 -0
- package/dist-esm/misc/TLColor.mjs.map +7 -0
- package/dist-esm/misc/TLCursor.mjs +35 -0
- package/dist-esm/misc/TLCursor.mjs.map +7 -0
- package/dist-esm/misc/TLHandle.mjs +16 -0
- package/dist-esm/misc/TLHandle.mjs.map +7 -0
- package/dist-esm/misc/TLOpacity.mjs +10 -0
- package/dist-esm/misc/TLOpacity.mjs.map +7 -0
- package/dist-esm/misc/TLScribble.mjs +20 -0
- package/dist-esm/misc/TLScribble.mjs.map +7 -0
- package/dist-esm/misc/geometry-types.mjs +17 -0
- package/dist-esm/misc/geometry-types.mjs.map +7 -0
- package/dist-esm/misc/id-validator.mjs +13 -0
- package/dist-esm/misc/id-validator.mjs.map +7 -0
- package/dist-esm/records/TLAsset.mjs +57 -0
- package/dist-esm/records/TLAsset.mjs.map +7 -0
- package/dist-esm/records/TLCamera.mjs +54 -0
- package/dist-esm/records/TLCamera.mjs.map +7 -0
- package/dist-esm/records/TLDocument.mjs +62 -0
- package/dist-esm/records/TLDocument.mjs.map +7 -0
- package/dist-esm/records/TLInstance.mjs +432 -0
- package/dist-esm/records/TLInstance.mjs.map +7 -0
- package/dist-esm/records/TLPage.mjs +54 -0
- package/dist-esm/records/TLPage.mjs.map +7 -0
- package/dist-esm/records/TLPageState.mjs +189 -0
- package/dist-esm/records/TLPageState.mjs.map +7 -0
- package/dist-esm/records/TLPointer.mjs +56 -0
- package/dist-esm/records/TLPointer.mjs.map +7 -0
- package/dist-esm/records/TLPresence.mjs +150 -0
- package/dist-esm/records/TLPresence.mjs.map +7 -0
- package/dist-esm/records/TLRecord.mjs +1 -0
- package/dist-esm/records/TLRecord.mjs.map +7 -0
- package/dist-esm/records/TLShape.mjs +127 -0
- package/dist-esm/records/TLShape.mjs.map +7 -0
- package/dist-esm/shapes/TLArrowShape.mjs +136 -0
- package/dist-esm/shapes/TLArrowShape.mjs.map +7 -0
- package/dist-esm/shapes/TLBaseShape.mjs +32 -0
- package/dist-esm/shapes/TLBaseShape.mjs.map +7 -0
- package/dist-esm/shapes/TLBookmarkShape.mjs +37 -0
- package/dist-esm/shapes/TLBookmarkShape.mjs.map +7 -0
- package/dist-esm/shapes/TLDrawShape.mjs +69 -0
- package/dist-esm/shapes/TLDrawShape.mjs.map +7 -0
- package/dist-esm/shapes/TLEmbedShape.mjs +689 -0
- package/dist-esm/shapes/TLEmbedShape.mjs.map +7 -0
- package/dist-esm/shapes/TLFrameShape.mjs +13 -0
- package/dist-esm/shapes/TLFrameShape.mjs.map +7 -0
- package/dist-esm/shapes/TLGeoShape.mjs +212 -0
- package/dist-esm/shapes/TLGeoShape.mjs.map +7 -0
- package/dist-esm/shapes/TLGroupShape.mjs +8 -0
- package/dist-esm/shapes/TLGroupShape.mjs.map +7 -0
- package/dist-esm/shapes/TLHighlightShape.mjs +18 -0
- package/dist-esm/shapes/TLHighlightShape.mjs.map +7 -0
- package/dist-esm/shapes/TLImageShape.mjs +49 -0
- package/dist-esm/shapes/TLImageShape.mjs.map +7 -0
- package/dist-esm/shapes/TLLineShape.mjs +50 -0
- package/dist-esm/shapes/TLLineShape.mjs.map +7 -0
- package/dist-esm/shapes/TLNoteShape.mjs +126 -0
- package/dist-esm/shapes/TLNoteShape.mjs.map +7 -0
- package/dist-esm/shapes/TLTextShape.mjs +47 -0
- package/dist-esm/shapes/TLTextShape.mjs.map +7 -0
- package/dist-esm/shapes/TLVideoShape.mjs +33 -0
- package/dist-esm/shapes/TLVideoShape.mjs.map +7 -0
- package/dist-esm/store-migrations.mjs +61 -0
- package/dist-esm/store-migrations.mjs.map +7 -0
- package/dist-esm/styles/StyleProp.mjs +74 -0
- package/dist-esm/styles/StyleProp.mjs.map +7 -0
- package/dist-esm/styles/TLColorStyle.mjs +263 -0
- package/dist-esm/styles/TLColorStyle.mjs.map +7 -0
- package/dist-esm/styles/TLDashStyle.mjs +9 -0
- package/dist-esm/styles/TLDashStyle.mjs.map +7 -0
- package/dist-esm/styles/TLFillStyle.mjs +9 -0
- package/dist-esm/styles/TLFillStyle.mjs.map +7 -0
- package/dist-esm/styles/TLFontStyle.mjs +16 -0
- package/dist-esm/styles/TLFontStyle.mjs.map +7 -0
- package/dist-esm/styles/TLHorizontalAlignStyle.mjs +9 -0
- package/dist-esm/styles/TLHorizontalAlignStyle.mjs.map +7 -0
- package/dist-esm/styles/TLSizeStyle.mjs +9 -0
- package/dist-esm/styles/TLSizeStyle.mjs.map +7 -0
- package/dist-esm/styles/TLVerticalAlignStyle.mjs +9 -0
- package/dist-esm/styles/TLVerticalAlignStyle.mjs.map +7 -0
- package/dist-esm/translations/languages.mjs +39 -0
- package/dist-esm/translations/languages.mjs.map +7 -0
- package/dist-esm/translations/translations.mjs +43 -0
- package/dist-esm/translations/translations.mjs.map +7 -0
- package/dist-esm/util-types.mjs +1 -0
- package/dist-esm/util-types.mjs.map +7 -0
- package/package.json +64 -0
- package/src/TLStore.ts +160 -0
- package/src/assets/TLBaseAsset.ts +44 -0
- package/src/assets/TLBookmarkAsset.ts +31 -0
- package/src/assets/TLImageAsset.ts +73 -0
- package/src/assets/TLVideoAsset.ts +73 -0
- package/src/createPresenceStateDerivation.ts +53 -0
- package/src/createTLSchema.ts +65 -0
- package/src/index.ts +168 -0
- package/src/migrations.test.ts +1768 -0
- package/src/misc/TLColor.ts +28 -0
- package/src/misc/TLCursor.ts +54 -0
- package/src/misc/TLHandle.ts +41 -0
- package/src/misc/TLOpacity.ts +11 -0
- package/src/misc/TLScribble.ts +39 -0
- package/src/misc/geometry-types.ts +37 -0
- package/src/misc/id-validator.ts +14 -0
- package/src/records/TLAsset.ts +80 -0
- package/src/records/TLCamera.ts +74 -0
- package/src/records/TLDocument.ts +77 -0
- package/src/records/TLInstance.ts +493 -0
- package/src/records/TLPage.ts +72 -0
- package/src/records/TLPageState.ts +216 -0
- package/src/records/TLPointer.ts +74 -0
- package/src/records/TLPresence.ts +179 -0
- package/src/records/TLRecord.ts +21 -0
- package/src/records/TLShape.ts +214 -0
- package/src/shapes/TLArrowShape.ts +160 -0
- package/src/shapes/TLBaseShape.ts +67 -0
- package/src/shapes/TLBookmarkShape.ts +44 -0
- package/src/shapes/TLDrawShape.ts +89 -0
- package/src/shapes/TLEmbedShape.ts +754 -0
- package/src/shapes/TLFrameShape.ts +18 -0
- package/src/shapes/TLGeoShape.ts +226 -0
- package/src/shapes/TLGroupShape.ts +14 -0
- package/src/shapes/TLHighlightShape.ts +24 -0
- package/src/shapes/TLImageShape.ts +59 -0
- package/src/shapes/TLLineShape.ts +61 -0
- package/src/shapes/TLNoteShape.ts +137 -0
- package/src/shapes/TLTextShape.ts +55 -0
- package/src/shapes/TLVideoShape.ts +40 -0
- package/src/store-migrations.ts +63 -0
- package/src/styles/StyleProp.ts +105 -0
- package/src/styles/TLColorStyle.ts +296 -0
- package/src/styles/TLDashStyle.ts +11 -0
- package/src/styles/TLFillStyle.ts +11 -0
- package/src/styles/TLFontStyle.ts +19 -0
- package/src/styles/TLHorizontalAlignStyle.ts +11 -0
- package/src/styles/TLSizeStyle.ts +11 -0
- package/src/styles/TLVerticalAlignStyle.ts +11 -0
- package/src/translations/languages.ts +39 -0
- package/src/translations/translations.test.ts +43 -0
- package/src/translations/translations.ts +73 -0
- package/src/util-types.ts +2 -0
|
@@ -0,0 +1,1414 @@
|
|
|
1
|
+
import { BaseRecord } from '@bigbluebutton/store';
|
|
2
|
+
import { Expand } from '@bigbluebutton/utils';
|
|
3
|
+
import { JsonObject } from '@bigbluebutton/utils';
|
|
4
|
+
import { Migrations } from '@bigbluebutton/store';
|
|
5
|
+
import { RecordId } from '@bigbluebutton/store';
|
|
6
|
+
import { RecordType } from '@bigbluebutton/store';
|
|
7
|
+
import { SerializedStore } from '@bigbluebutton/store';
|
|
8
|
+
import { Signal } from '@bigbluebutton/state';
|
|
9
|
+
import { Store } from '@bigbluebutton/store';
|
|
10
|
+
import { StoreSchema } from '@bigbluebutton/store';
|
|
11
|
+
import { StoreSnapshot } from '@bigbluebutton/store';
|
|
12
|
+
import { T } from '@bigbluebutton/validate';
|
|
13
|
+
import { UnknownRecord } from '@bigbluebutton/store';
|
|
14
|
+
|
|
15
|
+
/** @public */
|
|
16
|
+
export declare const ArrowShapeArrowheadEndStyle: EnumStyleProp<"arrow" | "bar" | "diamond" | "dot" | "inverted" | "none" | "pipe" | "square" | "triangle">;
|
|
17
|
+
|
|
18
|
+
/** @public */
|
|
19
|
+
export declare const ArrowShapeArrowheadStartStyle: EnumStyleProp<"arrow" | "bar" | "diamond" | "dot" | "inverted" | "none" | "pipe" | "square" | "triangle">;
|
|
20
|
+
|
|
21
|
+
/* Excluded from this release type: arrowShapeMigrations */
|
|
22
|
+
|
|
23
|
+
/** @public */
|
|
24
|
+
export declare const arrowShapeProps: {
|
|
25
|
+
labelColor: EnumStyleProp<"black" | "blue" | "green" | "grey" | "light-blue" | "light-green" | "light-red" | "light-violet" | "orange" | "red" | "violet" | "yellow">;
|
|
26
|
+
color: EnumStyleProp<"black" | "blue" | "green" | "grey" | "light-blue" | "light-green" | "light-red" | "light-violet" | "orange" | "red" | "violet" | "yellow">;
|
|
27
|
+
fill: EnumStyleProp<"none" | "pattern" | "semi" | "solid">;
|
|
28
|
+
dash: EnumStyleProp<"dashed" | "dotted" | "draw" | "solid">;
|
|
29
|
+
size: EnumStyleProp<"l" | "m" | "s" | "xl">;
|
|
30
|
+
arrowheadStart: EnumStyleProp<"arrow" | "bar" | "diamond" | "dot" | "inverted" | "none" | "pipe" | "square" | "triangle">;
|
|
31
|
+
arrowheadEnd: EnumStyleProp<"arrow" | "bar" | "diamond" | "dot" | "inverted" | "none" | "pipe" | "square" | "triangle">;
|
|
32
|
+
font: EnumStyleProp<"draw" | "mono" | "sans" | "serif">;
|
|
33
|
+
start: T.UnionValidator<"type", {
|
|
34
|
+
binding: T.ObjectValidator<{
|
|
35
|
+
type: "binding";
|
|
36
|
+
boundShapeId: TLShapeId;
|
|
37
|
+
normalizedAnchor: Vec2dModel;
|
|
38
|
+
isExact: boolean;
|
|
39
|
+
isPrecise: boolean;
|
|
40
|
+
}>;
|
|
41
|
+
point: T.ObjectValidator<{
|
|
42
|
+
type: "point";
|
|
43
|
+
x: number;
|
|
44
|
+
y: number;
|
|
45
|
+
}>;
|
|
46
|
+
}, never>;
|
|
47
|
+
end: T.UnionValidator<"type", {
|
|
48
|
+
binding: T.ObjectValidator<{
|
|
49
|
+
type: "binding";
|
|
50
|
+
boundShapeId: TLShapeId;
|
|
51
|
+
normalizedAnchor: Vec2dModel;
|
|
52
|
+
isExact: boolean;
|
|
53
|
+
isPrecise: boolean;
|
|
54
|
+
}>;
|
|
55
|
+
point: T.ObjectValidator<{
|
|
56
|
+
type: "point";
|
|
57
|
+
x: number;
|
|
58
|
+
y: number;
|
|
59
|
+
}>;
|
|
60
|
+
}, never>;
|
|
61
|
+
bend: T.Validator<number>;
|
|
62
|
+
text: T.Validator<string>;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/** @public */
|
|
66
|
+
declare const ArrowShapeTerminal: T.UnionValidator<"type", {
|
|
67
|
+
binding: T.ObjectValidator<{
|
|
68
|
+
type: "binding";
|
|
69
|
+
boundShapeId: TLShapeId;
|
|
70
|
+
normalizedAnchor: Vec2dModel;
|
|
71
|
+
isExact: boolean;
|
|
72
|
+
isPrecise: boolean;
|
|
73
|
+
}>;
|
|
74
|
+
point: T.ObjectValidator<{
|
|
75
|
+
type: "point";
|
|
76
|
+
x: number;
|
|
77
|
+
y: number;
|
|
78
|
+
}>;
|
|
79
|
+
}, never>;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* A validator for asset record type Ids.
|
|
83
|
+
*
|
|
84
|
+
* @public */
|
|
85
|
+
export declare const assetIdValidator: T.Validator<TLAssetId>;
|
|
86
|
+
|
|
87
|
+
/* Excluded from this release type: assetMigrations */
|
|
88
|
+
|
|
89
|
+
/** @public */
|
|
90
|
+
export declare const AssetRecordType: RecordType<TLAsset, "props" | "type">;
|
|
91
|
+
|
|
92
|
+
/* Excluded from this release type: assetValidator */
|
|
93
|
+
|
|
94
|
+
/* Excluded from this release type: bookmarkShapeMigrations */
|
|
95
|
+
|
|
96
|
+
/** @public */
|
|
97
|
+
export declare const bookmarkShapeProps: {
|
|
98
|
+
w: T.Validator<number>;
|
|
99
|
+
h: T.Validator<number>;
|
|
100
|
+
assetId: T.Validator<TLAssetId | null>;
|
|
101
|
+
url: T.Validator<string>;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* A serializable model for 2D boxes.
|
|
106
|
+
*
|
|
107
|
+
* @public */
|
|
108
|
+
export declare interface Box2dModel {
|
|
109
|
+
x: number;
|
|
110
|
+
y: number;
|
|
111
|
+
w: number;
|
|
112
|
+
h: number;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** @public */
|
|
116
|
+
export declare const box2dModelValidator: T.Validator<Box2dModel>;
|
|
117
|
+
|
|
118
|
+
/** @public */
|
|
119
|
+
export declare const CameraRecordType: RecordType<TLCamera, never>;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* A validator for the colors used by tldraw's default shapes.
|
|
123
|
+
*
|
|
124
|
+
* @public */
|
|
125
|
+
export declare const canvasUiColorTypeValidator: T.Validator<"accent" | "black" | "laser" | "muted-1" | "selection-fill" | "selection-stroke" | "white">;
|
|
126
|
+
|
|
127
|
+
declare const colors: readonly ["black", "grey", "light-violet", "violet", "blue", "light-blue", "yellow", "orange", "green", "light-green", "light-red", "red"];
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Create a validator for an asset record type.
|
|
131
|
+
*
|
|
132
|
+
* @param type - The type of the asset
|
|
133
|
+
* @param props - The validator for the asset's props
|
|
134
|
+
*
|
|
135
|
+
* @public */
|
|
136
|
+
export declare function createAssetValidator<Type extends string, Props extends JsonObject>(type: Type, props: T.Validator<Props>): T.ObjectValidator<{
|
|
137
|
+
id: TLAssetId;
|
|
138
|
+
typeName: 'asset';
|
|
139
|
+
type: Type;
|
|
140
|
+
props: Props;
|
|
141
|
+
meta: JsonObject;
|
|
142
|
+
}>;
|
|
143
|
+
|
|
144
|
+
/** @public */
|
|
145
|
+
export declare const createPresenceStateDerivation: ($user: Signal<{
|
|
146
|
+
id: string;
|
|
147
|
+
color: string;
|
|
148
|
+
name: string;
|
|
149
|
+
}>, instanceId?: TLInstancePresence['id']) => (store: TLStore) => Signal<null | TLInstancePresence>;
|
|
150
|
+
|
|
151
|
+
/** @public */
|
|
152
|
+
export declare function createShapeId(id?: string): TLShapeId;
|
|
153
|
+
|
|
154
|
+
/** @public */
|
|
155
|
+
export declare function createShapeValidator<Type extends string, Props extends JsonObject, Meta extends JsonObject>(type: Type, props?: {
|
|
156
|
+
[K in keyof Props]: T.Validatable<Props[K]>;
|
|
157
|
+
}, meta?: {
|
|
158
|
+
[K in keyof Meta]: T.Validatable<Meta[K]>;
|
|
159
|
+
}): T.ObjectValidator<TLBaseShape<Type, Props>>;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Create a TLSchema with custom shapes. Custom shapes cannot override default shapes.
|
|
163
|
+
*
|
|
164
|
+
* @param opts - Options
|
|
165
|
+
*
|
|
166
|
+
* @public */
|
|
167
|
+
export declare function createTLSchema({ shapes }: {
|
|
168
|
+
shapes: Record<string, SchemaShapeInfo>;
|
|
169
|
+
}): TLSchema;
|
|
170
|
+
|
|
171
|
+
/** @public */
|
|
172
|
+
export declare const DefaultColorStyle: EnumStyleProp<"black" | "blue" | "green" | "grey" | "light-blue" | "light-green" | "light-red" | "light-violet" | "orange" | "red" | "violet" | "yellow">;
|
|
173
|
+
|
|
174
|
+
/** @public */
|
|
175
|
+
export declare const DefaultColorThemePalette: {
|
|
176
|
+
lightMode: TLDefaultColorTheme;
|
|
177
|
+
darkMode: TLDefaultColorTheme;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
/** @public */
|
|
181
|
+
export declare const DefaultDashStyle: EnumStyleProp<"dashed" | "dotted" | "draw" | "solid">;
|
|
182
|
+
|
|
183
|
+
/** @public */
|
|
184
|
+
export declare const DefaultFillStyle: EnumStyleProp<"none" | "pattern" | "semi" | "solid">;
|
|
185
|
+
|
|
186
|
+
/** @public */
|
|
187
|
+
export declare const DefaultFontFamilies: {
|
|
188
|
+
draw: string;
|
|
189
|
+
sans: string;
|
|
190
|
+
serif: string;
|
|
191
|
+
mono: string;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
/** @public */
|
|
195
|
+
export declare const DefaultFontStyle: EnumStyleProp<"draw" | "mono" | "sans" | "serif">;
|
|
196
|
+
|
|
197
|
+
/** @public */
|
|
198
|
+
export declare const DefaultHorizontalAlignStyle: EnumStyleProp<"end-legacy" | "end" | "middle-legacy" | "middle" | "start-legacy" | "start">;
|
|
199
|
+
|
|
200
|
+
/** @public */
|
|
201
|
+
export declare const DefaultSizeStyle: EnumStyleProp<"l" | "m" | "s" | "xl">;
|
|
202
|
+
|
|
203
|
+
/** @public */
|
|
204
|
+
export declare const DefaultVerticalAlignStyle: EnumStyleProp<"end" | "middle" | "start">;
|
|
205
|
+
|
|
206
|
+
/** @public */
|
|
207
|
+
export declare const DocumentRecordType: RecordType<TLDocument, never>;
|
|
208
|
+
|
|
209
|
+
/* Excluded from this release type: drawShapeMigrations */
|
|
210
|
+
|
|
211
|
+
/** @public */
|
|
212
|
+
export declare const drawShapeProps: {
|
|
213
|
+
color: EnumStyleProp<"black" | "blue" | "green" | "grey" | "light-blue" | "light-green" | "light-red" | "light-violet" | "orange" | "red" | "violet" | "yellow">;
|
|
214
|
+
fill: EnumStyleProp<"none" | "pattern" | "semi" | "solid">;
|
|
215
|
+
dash: EnumStyleProp<"dashed" | "dotted" | "draw" | "solid">;
|
|
216
|
+
size: EnumStyleProp<"l" | "m" | "s" | "xl">;
|
|
217
|
+
segments: T.ArrayOfValidator<{
|
|
218
|
+
type: "free" | "straight";
|
|
219
|
+
points: Vec2dModel[];
|
|
220
|
+
}>;
|
|
221
|
+
isComplete: T.Validator<boolean>;
|
|
222
|
+
isClosed: T.Validator<boolean>;
|
|
223
|
+
isPen: T.Validator<boolean>;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
declare const DrawShapeSegment: T.ObjectValidator<{
|
|
227
|
+
type: "free" | "straight";
|
|
228
|
+
points: Vec2dModel[];
|
|
229
|
+
}>;
|
|
230
|
+
|
|
231
|
+
/** @public */
|
|
232
|
+
export declare const EMBED_DEFINITIONS: readonly [{
|
|
233
|
+
readonly type: "tldraw";
|
|
234
|
+
readonly title: "tldraw";
|
|
235
|
+
readonly hostnames: readonly ["beta.tldraw.com", "tldraw.com"];
|
|
236
|
+
readonly minWidth: 300;
|
|
237
|
+
readonly minHeight: 300;
|
|
238
|
+
readonly width: 720;
|
|
239
|
+
readonly height: 500;
|
|
240
|
+
readonly doesResize: true;
|
|
241
|
+
readonly canUnmount: true;
|
|
242
|
+
readonly toEmbedUrl: (url: string) => string | undefined;
|
|
243
|
+
readonly fromEmbedUrl: (url: string) => string | undefined;
|
|
244
|
+
}, {
|
|
245
|
+
readonly type: "figma";
|
|
246
|
+
readonly title: "Figma";
|
|
247
|
+
readonly hostnames: readonly ["figma.com"];
|
|
248
|
+
readonly width: 720;
|
|
249
|
+
readonly height: 500;
|
|
250
|
+
readonly doesResize: true;
|
|
251
|
+
readonly canUnmount: true;
|
|
252
|
+
readonly toEmbedUrl: (url: string) => string | undefined;
|
|
253
|
+
readonly fromEmbedUrl: (url: string) => string | undefined;
|
|
254
|
+
}, {
|
|
255
|
+
readonly type: "google_maps";
|
|
256
|
+
readonly title: "Google Maps";
|
|
257
|
+
readonly hostnames: readonly ["google.*"];
|
|
258
|
+
readonly width: 720;
|
|
259
|
+
readonly height: 500;
|
|
260
|
+
readonly doesResize: true;
|
|
261
|
+
readonly canUnmount: false;
|
|
262
|
+
readonly toEmbedUrl: (url: string) => string | undefined;
|
|
263
|
+
readonly fromEmbedUrl: (url: string) => string | undefined;
|
|
264
|
+
}, {
|
|
265
|
+
readonly type: "val_town";
|
|
266
|
+
readonly title: "Val Town";
|
|
267
|
+
readonly hostnames: readonly ["val.town"];
|
|
268
|
+
readonly minWidth: 260;
|
|
269
|
+
readonly minHeight: 100;
|
|
270
|
+
readonly width: 720;
|
|
271
|
+
readonly height: 500;
|
|
272
|
+
readonly doesResize: true;
|
|
273
|
+
readonly canUnmount: false;
|
|
274
|
+
readonly toEmbedUrl: (url: string) => string | undefined;
|
|
275
|
+
readonly fromEmbedUrl: (url: string) => string | undefined;
|
|
276
|
+
}, {
|
|
277
|
+
readonly type: "codesandbox";
|
|
278
|
+
readonly title: "CodeSandbox";
|
|
279
|
+
readonly hostnames: readonly ["codesandbox.io"];
|
|
280
|
+
readonly minWidth: 300;
|
|
281
|
+
readonly minHeight: 300;
|
|
282
|
+
readonly width: 720;
|
|
283
|
+
readonly height: 500;
|
|
284
|
+
readonly doesResize: true;
|
|
285
|
+
readonly canUnmount: false;
|
|
286
|
+
readonly toEmbedUrl: (url: string) => string | undefined;
|
|
287
|
+
readonly fromEmbedUrl: (url: string) => string | undefined;
|
|
288
|
+
}, {
|
|
289
|
+
readonly type: "codepen";
|
|
290
|
+
readonly title: "Codepen";
|
|
291
|
+
readonly hostnames: readonly ["codepen.io"];
|
|
292
|
+
readonly minWidth: 300;
|
|
293
|
+
readonly minHeight: 300;
|
|
294
|
+
readonly width: 520;
|
|
295
|
+
readonly height: 400;
|
|
296
|
+
readonly doesResize: true;
|
|
297
|
+
readonly canUnmount: false;
|
|
298
|
+
readonly toEmbedUrl: (url: string) => string | undefined;
|
|
299
|
+
readonly fromEmbedUrl: (url: string) => string | undefined;
|
|
300
|
+
}, {
|
|
301
|
+
readonly type: "scratch";
|
|
302
|
+
readonly title: "Scratch";
|
|
303
|
+
readonly hostnames: readonly ["scratch.mit.edu"];
|
|
304
|
+
readonly width: 520;
|
|
305
|
+
readonly height: 400;
|
|
306
|
+
readonly doesResize: false;
|
|
307
|
+
readonly canUnmount: false;
|
|
308
|
+
readonly toEmbedUrl: (url: string) => string | undefined;
|
|
309
|
+
readonly fromEmbedUrl: (url: string) => string | undefined;
|
|
310
|
+
}, {
|
|
311
|
+
readonly type: "youtube";
|
|
312
|
+
readonly title: "YouTube";
|
|
313
|
+
readonly hostnames: readonly ["*.youtube.com", "youtube.com", "youtu.be"];
|
|
314
|
+
readonly width: 800;
|
|
315
|
+
readonly height: 450;
|
|
316
|
+
readonly doesResize: true;
|
|
317
|
+
readonly canUnmount: false;
|
|
318
|
+
readonly overridePermissions: {
|
|
319
|
+
readonly 'allow-presentation': true;
|
|
320
|
+
};
|
|
321
|
+
readonly isAspectRatioLocked: true;
|
|
322
|
+
readonly toEmbedUrl: (url: string) => string | undefined;
|
|
323
|
+
readonly fromEmbedUrl: (url: string) => string | undefined;
|
|
324
|
+
}, {
|
|
325
|
+
readonly type: "google_calendar";
|
|
326
|
+
readonly title: "Google Calendar";
|
|
327
|
+
readonly hostnames: readonly ["calendar.google.*"];
|
|
328
|
+
readonly width: 720;
|
|
329
|
+
readonly height: 500;
|
|
330
|
+
readonly minWidth: 460;
|
|
331
|
+
readonly minHeight: 360;
|
|
332
|
+
readonly doesResize: true;
|
|
333
|
+
readonly canUnmount: false;
|
|
334
|
+
readonly instructionLink: "https://support.google.com/calendar/answer/41207?hl=en";
|
|
335
|
+
readonly toEmbedUrl: (url: string) => string | undefined;
|
|
336
|
+
readonly fromEmbedUrl: (url: string) => string | undefined;
|
|
337
|
+
}, {
|
|
338
|
+
readonly type: "google_slides";
|
|
339
|
+
readonly title: "Google Slides";
|
|
340
|
+
readonly hostnames: readonly ["docs.google.*"];
|
|
341
|
+
readonly width: 720;
|
|
342
|
+
readonly height: 500;
|
|
343
|
+
readonly minWidth: 460;
|
|
344
|
+
readonly minHeight: 360;
|
|
345
|
+
readonly doesResize: true;
|
|
346
|
+
readonly canUnmount: false;
|
|
347
|
+
readonly toEmbedUrl: (url: string) => string | undefined;
|
|
348
|
+
readonly fromEmbedUrl: (url: string) => string | undefined;
|
|
349
|
+
}, {
|
|
350
|
+
readonly type: "github_gist";
|
|
351
|
+
readonly title: "GitHub Gist";
|
|
352
|
+
readonly hostnames: readonly ["gist.github.com"];
|
|
353
|
+
readonly width: 720;
|
|
354
|
+
readonly height: 500;
|
|
355
|
+
readonly doesResize: true;
|
|
356
|
+
readonly canUnmount: true;
|
|
357
|
+
readonly toEmbedUrl: (url: string) => string | undefined;
|
|
358
|
+
readonly fromEmbedUrl: (url: string) => string | undefined;
|
|
359
|
+
}, {
|
|
360
|
+
readonly type: "replit";
|
|
361
|
+
readonly title: "Replit";
|
|
362
|
+
readonly hostnames: readonly ["replit.com"];
|
|
363
|
+
readonly width: 720;
|
|
364
|
+
readonly height: 500;
|
|
365
|
+
readonly doesResize: true;
|
|
366
|
+
readonly canUnmount: false;
|
|
367
|
+
readonly toEmbedUrl: (url: string) => string | undefined;
|
|
368
|
+
readonly fromEmbedUrl: (url: string) => string | undefined;
|
|
369
|
+
}, {
|
|
370
|
+
readonly type: "felt";
|
|
371
|
+
readonly title: "Felt";
|
|
372
|
+
readonly hostnames: readonly ["felt.com"];
|
|
373
|
+
readonly width: 720;
|
|
374
|
+
readonly height: 500;
|
|
375
|
+
readonly doesResize: true;
|
|
376
|
+
readonly canUnmount: false;
|
|
377
|
+
readonly toEmbedUrl: (url: string) => string | undefined;
|
|
378
|
+
readonly fromEmbedUrl: (url: string) => string | undefined;
|
|
379
|
+
}, {
|
|
380
|
+
readonly type: "spotify";
|
|
381
|
+
readonly title: "Spotify";
|
|
382
|
+
readonly hostnames: readonly ["open.spotify.com"];
|
|
383
|
+
readonly width: 720;
|
|
384
|
+
readonly height: 500;
|
|
385
|
+
readonly minHeight: 500;
|
|
386
|
+
readonly overrideOutlineRadius: 12;
|
|
387
|
+
readonly doesResize: true;
|
|
388
|
+
readonly canUnmount: false;
|
|
389
|
+
readonly toEmbedUrl: (url: string) => string | undefined;
|
|
390
|
+
readonly fromEmbedUrl: (url: string) => string | undefined;
|
|
391
|
+
}, {
|
|
392
|
+
readonly type: "vimeo";
|
|
393
|
+
readonly title: "Vimeo";
|
|
394
|
+
readonly hostnames: readonly ["vimeo.com", "player.vimeo.com"];
|
|
395
|
+
readonly width: 640;
|
|
396
|
+
readonly height: 360;
|
|
397
|
+
readonly doesResize: true;
|
|
398
|
+
readonly canUnmount: false;
|
|
399
|
+
readonly isAspectRatioLocked: true;
|
|
400
|
+
readonly toEmbedUrl: (url: string) => string | undefined;
|
|
401
|
+
readonly fromEmbedUrl: (url: string) => string | undefined;
|
|
402
|
+
}, {
|
|
403
|
+
readonly type: "excalidraw";
|
|
404
|
+
readonly title: "Excalidraw";
|
|
405
|
+
readonly hostnames: readonly ["excalidraw.com"];
|
|
406
|
+
readonly width: 720;
|
|
407
|
+
readonly height: 500;
|
|
408
|
+
readonly doesResize: true;
|
|
409
|
+
readonly canUnmount: false;
|
|
410
|
+
readonly isAspectRatioLocked: true;
|
|
411
|
+
readonly toEmbedUrl: (url: string) => string | undefined;
|
|
412
|
+
readonly fromEmbedUrl: (url: string) => string | undefined;
|
|
413
|
+
}, {
|
|
414
|
+
readonly type: "observable";
|
|
415
|
+
readonly title: "Observable";
|
|
416
|
+
readonly hostnames: readonly ["observablehq.com"];
|
|
417
|
+
readonly width: 720;
|
|
418
|
+
readonly height: 500;
|
|
419
|
+
readonly doesResize: true;
|
|
420
|
+
readonly canUnmount: false;
|
|
421
|
+
readonly isAspectRatioLocked: false;
|
|
422
|
+
readonly backgroundColor: "#fff";
|
|
423
|
+
readonly toEmbedUrl: (url: string) => string | undefined;
|
|
424
|
+
readonly fromEmbedUrl: (url: string) => string | undefined;
|
|
425
|
+
}];
|
|
426
|
+
|
|
427
|
+
/** @public */
|
|
428
|
+
export declare type EmbedDefinition = {
|
|
429
|
+
readonly type: string;
|
|
430
|
+
readonly title: string;
|
|
431
|
+
readonly hostnames: readonly string[];
|
|
432
|
+
readonly minWidth?: number;
|
|
433
|
+
readonly minHeight?: number;
|
|
434
|
+
readonly width: number;
|
|
435
|
+
readonly height: number;
|
|
436
|
+
readonly doesResize: boolean;
|
|
437
|
+
readonly canUnmount: boolean;
|
|
438
|
+
readonly isAspectRatioLocked?: boolean;
|
|
439
|
+
readonly overridePermissions?: TLEmbedShapePermissions;
|
|
440
|
+
readonly instructionLink?: string;
|
|
441
|
+
readonly backgroundColor?: string;
|
|
442
|
+
readonly overrideOutlineRadius?: number;
|
|
443
|
+
readonly toEmbedUrl: (url: string) => string | undefined;
|
|
444
|
+
readonly fromEmbedUrl: (url: string) => string | undefined;
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
/* Excluded from this release type: embedShapeMigrations */
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Permissions with note inline from
|
|
451
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox
|
|
452
|
+
*
|
|
453
|
+
* @public
|
|
454
|
+
*/
|
|
455
|
+
export declare const embedShapePermissionDefaults: {
|
|
456
|
+
readonly 'allow-downloads-without-user-activation': false;
|
|
457
|
+
readonly 'allow-downloads': false;
|
|
458
|
+
readonly 'allow-modals': false;
|
|
459
|
+
readonly 'allow-orientation-lock': false;
|
|
460
|
+
readonly 'allow-pointer-lock': false;
|
|
461
|
+
readonly 'allow-popups': true;
|
|
462
|
+
readonly 'allow-popups-to-escape-sandbox': false;
|
|
463
|
+
readonly 'allow-presentation': false;
|
|
464
|
+
readonly 'allow-storage-access-by-user-activation': false;
|
|
465
|
+
readonly 'allow-top-navigation': false;
|
|
466
|
+
readonly 'allow-top-navigation-by-user-activation': false;
|
|
467
|
+
readonly 'allow-scripts': true;
|
|
468
|
+
readonly 'allow-same-origin': true;
|
|
469
|
+
readonly 'allow-forms': true;
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
/** @public */
|
|
473
|
+
export declare const embedShapeProps: {
|
|
474
|
+
w: T.Validator<number>;
|
|
475
|
+
h: T.Validator<number>;
|
|
476
|
+
url: T.Validator<string>;
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* See {@link StyleProp} & {@link StyleProp.defineEnum}
|
|
481
|
+
*
|
|
482
|
+
* @public
|
|
483
|
+
*/
|
|
484
|
+
export declare class EnumStyleProp<T> extends StyleProp<T> {
|
|
485
|
+
readonly values: readonly T[];
|
|
486
|
+
/* Excluded from this release type: __constructor */
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/* Excluded from this release type: frameShapeMigrations */
|
|
490
|
+
|
|
491
|
+
/** @public */
|
|
492
|
+
export declare const frameShapeProps: {
|
|
493
|
+
w: T.Validator<number>;
|
|
494
|
+
h: T.Validator<number>;
|
|
495
|
+
name: T.Validator<string>;
|
|
496
|
+
};
|
|
497
|
+
|
|
498
|
+
/** @public */
|
|
499
|
+
export declare const GeoShapeGeoStyle: EnumStyleProp<"arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "check-box" | "cloud" | "diamond" | "ellipse" | "hexagon" | "octagon" | "oval" | "pentagon" | "rectangle" | "rhombus-2" | "rhombus" | "star" | "trapezoid" | "triangle" | "x-box">;
|
|
500
|
+
|
|
501
|
+
/* Excluded from this release type: geoShapeMigrations */
|
|
502
|
+
|
|
503
|
+
/** @public */
|
|
504
|
+
export declare const geoShapeProps: {
|
|
505
|
+
geo: EnumStyleProp<"arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "check-box" | "cloud" | "diamond" | "ellipse" | "hexagon" | "octagon" | "oval" | "pentagon" | "rectangle" | "rhombus-2" | "rhombus" | "star" | "trapezoid" | "triangle" | "x-box">;
|
|
506
|
+
labelColor: EnumStyleProp<"black" | "blue" | "green" | "grey" | "light-blue" | "light-green" | "light-red" | "light-violet" | "orange" | "red" | "violet" | "yellow">;
|
|
507
|
+
color: EnumStyleProp<"black" | "blue" | "green" | "grey" | "light-blue" | "light-green" | "light-red" | "light-violet" | "orange" | "red" | "violet" | "yellow">;
|
|
508
|
+
fill: EnumStyleProp<"none" | "pattern" | "semi" | "solid">;
|
|
509
|
+
dash: EnumStyleProp<"dashed" | "dotted" | "draw" | "solid">;
|
|
510
|
+
size: EnumStyleProp<"l" | "m" | "s" | "xl">;
|
|
511
|
+
font: EnumStyleProp<"draw" | "mono" | "sans" | "serif">;
|
|
512
|
+
align: EnumStyleProp<"end-legacy" | "end" | "middle-legacy" | "middle" | "start-legacy" | "start">;
|
|
513
|
+
verticalAlign: EnumStyleProp<"end" | "middle" | "start">;
|
|
514
|
+
url: T.Validator<string>;
|
|
515
|
+
w: T.Validator<number>;
|
|
516
|
+
h: T.Validator<number>;
|
|
517
|
+
growY: T.Validator<number>;
|
|
518
|
+
text: T.Validator<string>;
|
|
519
|
+
};
|
|
520
|
+
|
|
521
|
+
/** @public */
|
|
522
|
+
export declare function getDefaultColorTheme(opts: {
|
|
523
|
+
isDarkMode: boolean;
|
|
524
|
+
}): TLDefaultColorTheme;
|
|
525
|
+
|
|
526
|
+
/** @public */
|
|
527
|
+
export declare function getDefaultTranslationLocale(): TLLanguage['locale'];
|
|
528
|
+
|
|
529
|
+
/* Excluded from this release type: getShapePropKeysByStyle */
|
|
530
|
+
|
|
531
|
+
/* Excluded from this release type: groupShapeMigrations */
|
|
532
|
+
|
|
533
|
+
/* Excluded from this release type: groupShapeProps */
|
|
534
|
+
|
|
535
|
+
/* Excluded from this release type: highlightShapeMigrations */
|
|
536
|
+
|
|
537
|
+
/** @public */
|
|
538
|
+
export declare const highlightShapeProps: {
|
|
539
|
+
color: EnumStyleProp<"black" | "blue" | "green" | "grey" | "light-blue" | "light-green" | "light-red" | "light-violet" | "orange" | "red" | "violet" | "yellow">;
|
|
540
|
+
size: EnumStyleProp<"l" | "m" | "s" | "xl">;
|
|
541
|
+
segments: T.ArrayOfValidator<{
|
|
542
|
+
type: "free" | "straight";
|
|
543
|
+
points: Vec2dModel[];
|
|
544
|
+
}>;
|
|
545
|
+
isComplete: T.Validator<boolean>;
|
|
546
|
+
isPen: T.Validator<boolean>;
|
|
547
|
+
};
|
|
548
|
+
|
|
549
|
+
declare type Identity<T> = {
|
|
550
|
+
[K in keyof T]: T[K];
|
|
551
|
+
};
|
|
552
|
+
|
|
553
|
+
/* Excluded from this release type: idValidator */
|
|
554
|
+
|
|
555
|
+
/** @public */
|
|
556
|
+
declare const ImageShapeCrop: T.ObjectValidator<{
|
|
557
|
+
topLeft: Vec2dModel;
|
|
558
|
+
bottomRight: Vec2dModel;
|
|
559
|
+
}>;
|
|
560
|
+
|
|
561
|
+
/* Excluded from this release type: imageShapeMigrations */
|
|
562
|
+
|
|
563
|
+
/** @public */
|
|
564
|
+
export declare const imageShapeProps: {
|
|
565
|
+
w: T.Validator<number>;
|
|
566
|
+
h: T.Validator<number>;
|
|
567
|
+
playing: T.Validator<boolean>;
|
|
568
|
+
url: T.Validator<string>;
|
|
569
|
+
assetId: T.Validator<TLAssetId | null>;
|
|
570
|
+
crop: T.Validator<{
|
|
571
|
+
topLeft: Vec2dModel;
|
|
572
|
+
bottomRight: Vec2dModel;
|
|
573
|
+
} | null>;
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
/** @public */
|
|
577
|
+
export declare const InstancePageStateRecordType: RecordType<TLInstancePageState, "pageId">;
|
|
578
|
+
|
|
579
|
+
/** @public */
|
|
580
|
+
export declare const InstancePresenceRecordType: RecordType<TLInstancePresence, "currentPageId" | "userId" | "userName">;
|
|
581
|
+
|
|
582
|
+
/** @public */
|
|
583
|
+
export declare function isPageId(id: string): id is TLPageId;
|
|
584
|
+
|
|
585
|
+
/** @public */
|
|
586
|
+
export declare function isShape(record?: UnknownRecord): record is TLShape;
|
|
587
|
+
|
|
588
|
+
/** @public */
|
|
589
|
+
export declare function isShapeId(id?: string): id is TLShapeId;
|
|
590
|
+
|
|
591
|
+
/** @public */
|
|
592
|
+
export declare const LANGUAGES: readonly [{
|
|
593
|
+
readonly locale: "ar";
|
|
594
|
+
readonly label: "عربي";
|
|
595
|
+
}, {
|
|
596
|
+
readonly locale: "ca";
|
|
597
|
+
readonly label: "Català";
|
|
598
|
+
}, {
|
|
599
|
+
readonly locale: "da";
|
|
600
|
+
readonly label: "Danish";
|
|
601
|
+
}, {
|
|
602
|
+
readonly locale: "de";
|
|
603
|
+
readonly label: "Deutsch";
|
|
604
|
+
}, {
|
|
605
|
+
readonly locale: "en";
|
|
606
|
+
readonly label: "English";
|
|
607
|
+
}, {
|
|
608
|
+
readonly locale: "es";
|
|
609
|
+
readonly label: "Español";
|
|
610
|
+
}, {
|
|
611
|
+
readonly locale: "fa";
|
|
612
|
+
readonly label: "فارسی";
|
|
613
|
+
}, {
|
|
614
|
+
readonly locale: "fi";
|
|
615
|
+
readonly label: "Suomi";
|
|
616
|
+
}, {
|
|
617
|
+
readonly locale: "fr";
|
|
618
|
+
readonly label: "Français";
|
|
619
|
+
}, {
|
|
620
|
+
readonly locale: "gl";
|
|
621
|
+
readonly label: "Galego";
|
|
622
|
+
}, {
|
|
623
|
+
readonly locale: "he";
|
|
624
|
+
readonly label: "עברית";
|
|
625
|
+
}, {
|
|
626
|
+
readonly locale: "it";
|
|
627
|
+
readonly label: "Italiano";
|
|
628
|
+
}, {
|
|
629
|
+
readonly locale: "ja";
|
|
630
|
+
readonly label: "日本語";
|
|
631
|
+
}, {
|
|
632
|
+
readonly locale: "ko-kr";
|
|
633
|
+
readonly label: "한국어";
|
|
634
|
+
}, {
|
|
635
|
+
readonly locale: "ku";
|
|
636
|
+
readonly label: "کوردی";
|
|
637
|
+
}, {
|
|
638
|
+
readonly locale: "hi-in";
|
|
639
|
+
readonly label: "हिन्दी";
|
|
640
|
+
}, {
|
|
641
|
+
readonly locale: "hu";
|
|
642
|
+
readonly label: "Magyar";
|
|
643
|
+
}, {
|
|
644
|
+
readonly locale: "my";
|
|
645
|
+
readonly label: "မြန်မာစာ";
|
|
646
|
+
}, {
|
|
647
|
+
readonly locale: "ne";
|
|
648
|
+
readonly label: "नेपाली";
|
|
649
|
+
}, {
|
|
650
|
+
readonly locale: "no";
|
|
651
|
+
readonly label: "Norwegian";
|
|
652
|
+
}, {
|
|
653
|
+
readonly locale: "pl";
|
|
654
|
+
readonly label: "Polski";
|
|
655
|
+
}, {
|
|
656
|
+
readonly locale: "pt-br";
|
|
657
|
+
readonly label: "Português - Brasil";
|
|
658
|
+
}, {
|
|
659
|
+
readonly locale: "pt-pt";
|
|
660
|
+
readonly label: "Português - Europeu";
|
|
661
|
+
}, {
|
|
662
|
+
readonly locale: "ro";
|
|
663
|
+
readonly label: "Română";
|
|
664
|
+
}, {
|
|
665
|
+
readonly locale: "ru";
|
|
666
|
+
readonly label: "Russian";
|
|
667
|
+
}, {
|
|
668
|
+
readonly locale: "sv";
|
|
669
|
+
readonly label: "Svenska";
|
|
670
|
+
}, {
|
|
671
|
+
readonly locale: "te";
|
|
672
|
+
readonly label: "తెలుగు";
|
|
673
|
+
}, {
|
|
674
|
+
readonly locale: "th";
|
|
675
|
+
readonly label: "ภาษาไทย";
|
|
676
|
+
}, {
|
|
677
|
+
readonly locale: "tr";
|
|
678
|
+
readonly label: "Türkçe";
|
|
679
|
+
}, {
|
|
680
|
+
readonly locale: "uk";
|
|
681
|
+
readonly label: "Ukrainian";
|
|
682
|
+
}, {
|
|
683
|
+
readonly locale: "vi";
|
|
684
|
+
readonly label: "Tiếng Việt";
|
|
685
|
+
}, {
|
|
686
|
+
readonly locale: "zh-cn";
|
|
687
|
+
readonly label: "Chinese - Simplified";
|
|
688
|
+
}, {
|
|
689
|
+
readonly locale: "zh-tw";
|
|
690
|
+
readonly label: "繁體中文 (台灣)";
|
|
691
|
+
}];
|
|
692
|
+
|
|
693
|
+
/* Excluded from this release type: lineShapeMigrations */
|
|
694
|
+
|
|
695
|
+
/** @public */
|
|
696
|
+
export declare const lineShapeProps: {
|
|
697
|
+
color: EnumStyleProp<"black" | "blue" | "green" | "grey" | "light-blue" | "light-green" | "light-red" | "light-violet" | "orange" | "red" | "violet" | "yellow">;
|
|
698
|
+
dash: EnumStyleProp<"dashed" | "dotted" | "draw" | "solid">;
|
|
699
|
+
size: EnumStyleProp<"l" | "m" | "s" | "xl">;
|
|
700
|
+
spline: EnumStyleProp<"cubic" | "line">;
|
|
701
|
+
handles: T.DictValidator<string, TLHandle>;
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
/** @public */
|
|
705
|
+
export declare const LineShapeSplineStyle: EnumStyleProp<"cubic" | "line">;
|
|
706
|
+
|
|
707
|
+
/* Excluded from this release type: noteShapeMigrations */
|
|
708
|
+
|
|
709
|
+
/** @public */
|
|
710
|
+
export declare const noteShapeProps: {
|
|
711
|
+
color: EnumStyleProp<"black" | "blue" | "green" | "grey" | "light-blue" | "light-green" | "light-red" | "light-violet" | "orange" | "red" | "violet" | "yellow">;
|
|
712
|
+
size: EnumStyleProp<"l" | "m" | "s" | "xl">;
|
|
713
|
+
font: EnumStyleProp<"draw" | "mono" | "sans" | "serif">;
|
|
714
|
+
align: EnumStyleProp<"end-legacy" | "end" | "middle-legacy" | "middle" | "start-legacy" | "start">;
|
|
715
|
+
verticalAlign: EnumStyleProp<"end" | "middle" | "start">;
|
|
716
|
+
growY: T.Validator<number>;
|
|
717
|
+
url: T.Validator<string>;
|
|
718
|
+
text: T.Validator<string>;
|
|
719
|
+
};
|
|
720
|
+
|
|
721
|
+
/* Excluded from this release type: opacityValidator */
|
|
722
|
+
|
|
723
|
+
/* Excluded from this release type: pageIdValidator */
|
|
724
|
+
|
|
725
|
+
/** @public */
|
|
726
|
+
export declare const PageRecordType: RecordType<TLPage, "index" | "name">;
|
|
727
|
+
|
|
728
|
+
/** @public */
|
|
729
|
+
export declare const parentIdValidator: T.Validator<TLParentId>;
|
|
730
|
+
|
|
731
|
+
/** @public */
|
|
732
|
+
export declare const PointerRecordType: RecordType<TLPointer, never>;
|
|
733
|
+
|
|
734
|
+
/* Excluded from this release type: rootShapeMigrations */
|
|
735
|
+
|
|
736
|
+
/** @public */
|
|
737
|
+
export declare type SchemaShapeInfo = {
|
|
738
|
+
migrations?: Migrations;
|
|
739
|
+
props?: Record<string, {
|
|
740
|
+
validate: (prop: any) => any;
|
|
741
|
+
}>;
|
|
742
|
+
meta?: Record<string, {
|
|
743
|
+
validate: (prop: any) => any;
|
|
744
|
+
}>;
|
|
745
|
+
};
|
|
746
|
+
|
|
747
|
+
/* Excluded from this release type: scribbleValidator */
|
|
748
|
+
|
|
749
|
+
/** @public */
|
|
750
|
+
declare type SetValue<T extends Set<any>> = T extends Set<infer U> ? U : never;
|
|
751
|
+
|
|
752
|
+
/** @public */
|
|
753
|
+
export declare const shapeIdValidator: T.Validator<TLShapeId>;
|
|
754
|
+
|
|
755
|
+
/** @public */
|
|
756
|
+
export declare type ShapeProps<Shape extends TLBaseShape<any, any>> = {
|
|
757
|
+
[K in keyof Shape['props']]: T.Validatable<Shape['props'][K]>;
|
|
758
|
+
};
|
|
759
|
+
|
|
760
|
+
declare type ShapePropsType<Config extends Record<string, T.Validatable<any>>> = Expand<{
|
|
761
|
+
[K in keyof Config]: T.TypeOf<Config[K]>;
|
|
762
|
+
}>;
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* A `StyleProp` is a property of a shape that follows some special rules.
|
|
766
|
+
*
|
|
767
|
+
* 1. The same value can be set on lots of shapes at the same time.
|
|
768
|
+
*
|
|
769
|
+
* 2. The last used value is automatically saved and applied to new shapes.
|
|
770
|
+
*
|
|
771
|
+
* For example, {@link DefaultColorStyle} is a style prop used by tldraw's default shapes to set
|
|
772
|
+
* their color. If you try selecting several shapes on tldraw.com and changing their color, you'll
|
|
773
|
+
* see that the color is applied to all of them. Then, if you draw a new shape, it'll have the same
|
|
774
|
+
* color as the one you just set.
|
|
775
|
+
*
|
|
776
|
+
* You can use styles in your own shapes by either defining your own (see {@link StyleProp.define}
|
|
777
|
+
* and {@link StyleProp.defineEnum}) or using tldraw's default ones, like {@link DefaultColorStyle}.
|
|
778
|
+
* When you define a shape, pass a `props` object describing all of your shape's properties, using
|
|
779
|
+
* `StyleProp`s for the ones you want to be styles. See the
|
|
780
|
+
* {@link https://github.com/bigbluebutton/tldraw/tree/main/apps/examples | custom styles example}
|
|
781
|
+
* for more.
|
|
782
|
+
*
|
|
783
|
+
* @public
|
|
784
|
+
*/
|
|
785
|
+
export declare class StyleProp<Type> implements T.Validatable<Type> {
|
|
786
|
+
readonly id: string;
|
|
787
|
+
readonly defaultValue: Type;
|
|
788
|
+
readonly type: T.Validatable<Type>;
|
|
789
|
+
/**
|
|
790
|
+
* Define a new {@link StyleProp}.
|
|
791
|
+
*
|
|
792
|
+
* @param uniqueId - Each StyleProp must have a unique ID. We recommend you prefix this with
|
|
793
|
+
* your app/library name.
|
|
794
|
+
* @param options -
|
|
795
|
+
* - `defaultValue`: The default value for this style prop.
|
|
796
|
+
*
|
|
797
|
+
* - `type`: Optionally, describe what type of data you expect for this style prop.
|
|
798
|
+
*
|
|
799
|
+
* @example
|
|
800
|
+
* ```ts
|
|
801
|
+
* import {T} from '@bigbluebutton/validate'
|
|
802
|
+
* import {StyleProp} from '@bigbluebutton/tlschema'
|
|
803
|
+
*
|
|
804
|
+
* const MyLineWidthProp = StyleProp.define('myApp:lineWidth', {
|
|
805
|
+
* defaultValue: 1,
|
|
806
|
+
* type: T.number,
|
|
807
|
+
* })
|
|
808
|
+
* ```
|
|
809
|
+
* @public
|
|
810
|
+
*/
|
|
811
|
+
static define<Type>(uniqueId: string, options: {
|
|
812
|
+
defaultValue: Type;
|
|
813
|
+
type?: T.Validatable<Type>;
|
|
814
|
+
}): StyleProp<Type>;
|
|
815
|
+
/**
|
|
816
|
+
* Define a new {@link StyleProp} as a list of possible values.
|
|
817
|
+
*
|
|
818
|
+
* @param uniqueId - Each StyleProp must have a unique ID. We recommend you prefix this with
|
|
819
|
+
* your app/library name.
|
|
820
|
+
* @param options -
|
|
821
|
+
* - `defaultValue`: The default value for this style prop.
|
|
822
|
+
*
|
|
823
|
+
* - `values`: An array of possible values of this style prop.
|
|
824
|
+
*
|
|
825
|
+
* @example
|
|
826
|
+
* ```ts
|
|
827
|
+
* import {StyleProp} from '@bigbluebutton/tlschema'
|
|
828
|
+
*
|
|
829
|
+
* const MySizeProp = StyleProp.defineEnum('myApp:size', {
|
|
830
|
+
* defaultValue: 'medium',
|
|
831
|
+
* values: ['small', 'medium', 'large'],
|
|
832
|
+
* })
|
|
833
|
+
* ```
|
|
834
|
+
*/
|
|
835
|
+
static defineEnum<const Values extends readonly unknown[]>(uniqueId: string, options: {
|
|
836
|
+
defaultValue: Values[number];
|
|
837
|
+
values: Values;
|
|
838
|
+
}): EnumStyleProp<Values[number]>;
|
|
839
|
+
/* Excluded from this release type: __constructor */
|
|
840
|
+
validate(value: unknown): Type;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/* Excluded from this release type: textShapeMigrations */
|
|
844
|
+
|
|
845
|
+
/** @public */
|
|
846
|
+
export declare const textShapeProps: {
|
|
847
|
+
color: EnumStyleProp<"black" | "blue" | "green" | "grey" | "light-blue" | "light-green" | "light-red" | "light-violet" | "orange" | "red" | "violet" | "yellow">;
|
|
848
|
+
size: EnumStyleProp<"l" | "m" | "s" | "xl">;
|
|
849
|
+
font: EnumStyleProp<"draw" | "mono" | "sans" | "serif">;
|
|
850
|
+
align: EnumStyleProp<"end-legacy" | "end" | "middle-legacy" | "middle" | "start-legacy" | "start">;
|
|
851
|
+
w: T.Validator<number>;
|
|
852
|
+
text: T.Validator<string>;
|
|
853
|
+
scale: T.Validator<number>;
|
|
854
|
+
autoSize: T.Validator<boolean>;
|
|
855
|
+
};
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* The colors used by tldraw's default shapes.
|
|
859
|
+
*
|
|
860
|
+
* @public */
|
|
861
|
+
export declare const TL_CANVAS_UI_COLOR_TYPES: Set<"accent" | "black" | "laser" | "muted-1" | "selection-fill" | "selection-stroke" | "white">;
|
|
862
|
+
|
|
863
|
+
/**
|
|
864
|
+
* The cursor types used by tldraw's default shapes.
|
|
865
|
+
*
|
|
866
|
+
* @public */
|
|
867
|
+
declare const TL_CURSOR_TYPES: Set<string>;
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* The handle types used by tldraw's default shapes.
|
|
871
|
+
*
|
|
872
|
+
* @public */
|
|
873
|
+
declare const TL_HANDLE_TYPES: Set<"create" | "vertex" | "virtual">;
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* The scribble states used by tldraw.
|
|
877
|
+
*
|
|
878
|
+
* @public */
|
|
879
|
+
declare const TL_SCRIBBLE_STATES: Set<"active" | "paused" | "starting" | "stopping">;
|
|
880
|
+
|
|
881
|
+
/** @public */
|
|
882
|
+
export declare type TLArrowShape = TLBaseShape<'arrow', TLArrowShapeProps>;
|
|
883
|
+
|
|
884
|
+
/** @public */
|
|
885
|
+
export declare type TLArrowShapeArrowheadStyle = T.TypeOf<typeof ArrowShapeArrowheadStartStyle>;
|
|
886
|
+
|
|
887
|
+
/** @public */
|
|
888
|
+
export declare type TLArrowShapeProps = ShapePropsType<typeof arrowShapeProps>;
|
|
889
|
+
|
|
890
|
+
/** @public */
|
|
891
|
+
export declare type TLArrowShapeTerminal = T.TypeOf<typeof ArrowShapeTerminal>;
|
|
892
|
+
|
|
893
|
+
/** @public */
|
|
894
|
+
export declare type TLAsset = TLBookmarkAsset | TLImageAsset | TLVideoAsset;
|
|
895
|
+
|
|
896
|
+
/** @public */
|
|
897
|
+
export declare type TLAssetId = RecordId<TLBaseAsset<any, any>>;
|
|
898
|
+
|
|
899
|
+
/** @public */
|
|
900
|
+
export declare type TLAssetPartial<T extends TLAsset = TLAsset> = T extends T ? {
|
|
901
|
+
id: TLAssetId;
|
|
902
|
+
type: T['type'];
|
|
903
|
+
props?: Partial<T['props']>;
|
|
904
|
+
meta?: Partial<T['meta']>;
|
|
905
|
+
} & Partial<Omit<T, 'id' | 'meta' | 'props' | 'type'>> : never;
|
|
906
|
+
|
|
907
|
+
/** @public */
|
|
908
|
+
export declare type TLAssetShape = Extract<TLShape, {
|
|
909
|
+
props: {
|
|
910
|
+
assetId: TLAssetId;
|
|
911
|
+
};
|
|
912
|
+
}>;
|
|
913
|
+
|
|
914
|
+
/** @public */
|
|
915
|
+
export declare interface TLBaseAsset<Type extends string, Props> extends BaseRecord<'asset', TLAssetId> {
|
|
916
|
+
type: Type;
|
|
917
|
+
props: Props;
|
|
918
|
+
meta: JsonObject;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
/** @public */
|
|
922
|
+
export declare interface TLBaseShape<Type extends string, Props extends object> extends BaseRecord<'shape', TLShapeId> {
|
|
923
|
+
type: Type;
|
|
924
|
+
x: number;
|
|
925
|
+
y: number;
|
|
926
|
+
rotation: number;
|
|
927
|
+
index: string;
|
|
928
|
+
parentId: TLParentId;
|
|
929
|
+
isLocked: boolean;
|
|
930
|
+
opacity: TLOpacityType;
|
|
931
|
+
props: Props;
|
|
932
|
+
meta: JsonObject;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
/**
|
|
936
|
+
* An asset used for URL bookmarks, used by the TLBookmarkShape.
|
|
937
|
+
*
|
|
938
|
+
* @public */
|
|
939
|
+
export declare type TLBookmarkAsset = TLBaseAsset<'bookmark', {
|
|
940
|
+
title: string;
|
|
941
|
+
description: string;
|
|
942
|
+
image: string;
|
|
943
|
+
src: null | string;
|
|
944
|
+
}>;
|
|
945
|
+
|
|
946
|
+
/** @public */
|
|
947
|
+
export declare type TLBookmarkShape = TLBaseShape<'bookmark', TLBookmarkShapeProps>;
|
|
948
|
+
|
|
949
|
+
/** @public */
|
|
950
|
+
declare type TLBookmarkShapeProps = ShapePropsType<typeof bookmarkShapeProps>;
|
|
951
|
+
|
|
952
|
+
/**
|
|
953
|
+
* A camera record.
|
|
954
|
+
*
|
|
955
|
+
* @public
|
|
956
|
+
*/
|
|
957
|
+
export declare interface TLCamera extends BaseRecord<'camera', TLCameraId> {
|
|
958
|
+
x: number;
|
|
959
|
+
y: number;
|
|
960
|
+
z: number;
|
|
961
|
+
meta: JsonObject;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
/**
|
|
965
|
+
* The id of a camera record.
|
|
966
|
+
*
|
|
967
|
+
* @public */
|
|
968
|
+
export declare type TLCameraId = RecordId<TLCamera>;
|
|
969
|
+
|
|
970
|
+
/**
|
|
971
|
+
* A type for the colors used by tldraw's default shapes.
|
|
972
|
+
*
|
|
973
|
+
* @public */
|
|
974
|
+
export declare type TLCanvasUiColor = SetValue<typeof TL_CANVAS_UI_COLOR_TYPES>;
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
* A cursor used by tldraw.
|
|
978
|
+
*
|
|
979
|
+
* @public */
|
|
980
|
+
export declare interface TLCursor {
|
|
981
|
+
type: TLCursorType;
|
|
982
|
+
rotation: number;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
/**
|
|
986
|
+
* A type for the cursor types used by tldraw's default shapes.
|
|
987
|
+
*
|
|
988
|
+
* @public */
|
|
989
|
+
export declare type TLCursorType = SetValue<typeof TL_CURSOR_TYPES>;
|
|
990
|
+
|
|
991
|
+
/** @public */
|
|
992
|
+
export declare type TLDefaultColorStyle = T.TypeOf<typeof DefaultColorStyle>;
|
|
993
|
+
|
|
994
|
+
/** @public */
|
|
995
|
+
export declare type TLDefaultColorTheme = Expand<{
|
|
996
|
+
id: 'dark' | 'light';
|
|
997
|
+
text: string;
|
|
998
|
+
background: string;
|
|
999
|
+
solid: string;
|
|
1000
|
+
} & Record<(typeof colors)[number], TLDefaultColorThemeColor>>;
|
|
1001
|
+
|
|
1002
|
+
/** @public */
|
|
1003
|
+
export declare type TLDefaultColorThemeColor = {
|
|
1004
|
+
solid: string;
|
|
1005
|
+
semi: string;
|
|
1006
|
+
pattern: string;
|
|
1007
|
+
highlight: {
|
|
1008
|
+
srgb: string;
|
|
1009
|
+
p3: string;
|
|
1010
|
+
};
|
|
1011
|
+
};
|
|
1012
|
+
|
|
1013
|
+
/** @public */
|
|
1014
|
+
export declare type TLDefaultDashStyle = T.TypeOf<typeof DefaultDashStyle>;
|
|
1015
|
+
|
|
1016
|
+
/** @public */
|
|
1017
|
+
export declare type TLDefaultFillStyle = T.TypeOf<typeof DefaultFillStyle>;
|
|
1018
|
+
|
|
1019
|
+
/** @public */
|
|
1020
|
+
export declare type TLDefaultFontStyle = T.TypeOf<typeof DefaultFontStyle>;
|
|
1021
|
+
|
|
1022
|
+
/** @public */
|
|
1023
|
+
export declare type TLDefaultHorizontalAlignStyle = T.TypeOf<typeof DefaultHorizontalAlignStyle>;
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* The default set of shapes that are available in the editor.
|
|
1027
|
+
*
|
|
1028
|
+
* @public */
|
|
1029
|
+
export declare type TLDefaultShape = TLArrowShape | TLBookmarkShape | TLDrawShape | TLEmbedShape | TLFrameShape | TLGeoShape | TLGroupShape | TLHighlightShape | TLImageShape | TLLineShape | TLNoteShape | TLTextShape | TLVideoShape;
|
|
1030
|
+
|
|
1031
|
+
/** @public */
|
|
1032
|
+
export declare type TLDefaultSizeStyle = T.TypeOf<typeof DefaultSizeStyle>;
|
|
1033
|
+
|
|
1034
|
+
/** @public */
|
|
1035
|
+
export declare type TLDefaultVerticalAlignStyle = T.TypeOf<typeof DefaultVerticalAlignStyle>;
|
|
1036
|
+
|
|
1037
|
+
/**
|
|
1038
|
+
* TLDocument
|
|
1039
|
+
*
|
|
1040
|
+
* @public
|
|
1041
|
+
*/
|
|
1042
|
+
export declare interface TLDocument extends BaseRecord<'document', RecordId<TLDocument>> {
|
|
1043
|
+
gridSize: number;
|
|
1044
|
+
name: string;
|
|
1045
|
+
meta: JsonObject;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
/** @public */
|
|
1049
|
+
export declare const TLDOCUMENT_ID: RecordId<TLDocument>;
|
|
1050
|
+
|
|
1051
|
+
/** @public */
|
|
1052
|
+
export declare type TLDrawShape = TLBaseShape<'draw', TLDrawShapeProps>;
|
|
1053
|
+
|
|
1054
|
+
/** @public */
|
|
1055
|
+
declare type TLDrawShapeProps = ShapePropsType<typeof drawShapeProps>;
|
|
1056
|
+
|
|
1057
|
+
/** @public */
|
|
1058
|
+
export declare type TLDrawShapeSegment = T.TypeOf<typeof DrawShapeSegment>;
|
|
1059
|
+
|
|
1060
|
+
/** @public */
|
|
1061
|
+
export declare type TLEmbedShape = TLBaseShape<'embed', TLEmbedShapeProps>;
|
|
1062
|
+
|
|
1063
|
+
/** @public */
|
|
1064
|
+
export declare type TLEmbedShapePermissions = {
|
|
1065
|
+
[K in keyof typeof embedShapePermissionDefaults]?: boolean;
|
|
1066
|
+
};
|
|
1067
|
+
|
|
1068
|
+
/** @public */
|
|
1069
|
+
declare type TLEmbedShapeProps = ShapePropsType<typeof embedShapeProps>;
|
|
1070
|
+
|
|
1071
|
+
/** @public */
|
|
1072
|
+
export declare type TLFrameShape = TLBaseShape<'frame', TLFrameShapeProps>;
|
|
1073
|
+
|
|
1074
|
+
declare type TLFrameShapeProps = ShapePropsType<typeof frameShapeProps>;
|
|
1075
|
+
|
|
1076
|
+
/** @public */
|
|
1077
|
+
export declare type TLGeoShape = TLBaseShape<'geo', TLGeoShapeProps>;
|
|
1078
|
+
|
|
1079
|
+
/** @public */
|
|
1080
|
+
declare type TLGeoShapeProps = ShapePropsType<typeof geoShapeProps>;
|
|
1081
|
+
|
|
1082
|
+
/** @public */
|
|
1083
|
+
export declare type TLGroupShape = TLBaseShape<'group', TLGroupShapeProps>;
|
|
1084
|
+
|
|
1085
|
+
/** @public */
|
|
1086
|
+
declare type TLGroupShapeProps = {
|
|
1087
|
+
[key in never]: undefined;
|
|
1088
|
+
};
|
|
1089
|
+
|
|
1090
|
+
/**
|
|
1091
|
+
* A base interface for a shape's handles.
|
|
1092
|
+
*
|
|
1093
|
+
* @public
|
|
1094
|
+
*/
|
|
1095
|
+
export declare interface TLHandle {
|
|
1096
|
+
/** A unique identifier for the handle. */
|
|
1097
|
+
id: string;
|
|
1098
|
+
type: TLHandleType;
|
|
1099
|
+
canBind?: boolean;
|
|
1100
|
+
canSnap?: boolean;
|
|
1101
|
+
index: string;
|
|
1102
|
+
x: number;
|
|
1103
|
+
y: number;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
/**
|
|
1107
|
+
* A type for the handle types used by tldraw's default shapes.
|
|
1108
|
+
*
|
|
1109
|
+
* @public */
|
|
1110
|
+
export declare type TLHandleType = SetValue<typeof TL_HANDLE_TYPES>;
|
|
1111
|
+
|
|
1112
|
+
/** @public */
|
|
1113
|
+
export declare type TLHighlightShape = TLBaseShape<'highlight', TLHighlightShapeProps>;
|
|
1114
|
+
|
|
1115
|
+
/** @public */
|
|
1116
|
+
declare type TLHighlightShapeProps = ShapePropsType<typeof highlightShapeProps>;
|
|
1117
|
+
|
|
1118
|
+
/**
|
|
1119
|
+
* An asset for images such as PNGs and JPEGs, used by the TLImageShape.
|
|
1120
|
+
*
|
|
1121
|
+
* @public */
|
|
1122
|
+
export declare type TLImageAsset = TLBaseAsset<'image', {
|
|
1123
|
+
w: number;
|
|
1124
|
+
h: number;
|
|
1125
|
+
name: string;
|
|
1126
|
+
isAnimated: boolean;
|
|
1127
|
+
mimeType: null | string;
|
|
1128
|
+
src: null | string;
|
|
1129
|
+
}>;
|
|
1130
|
+
|
|
1131
|
+
/** @public */
|
|
1132
|
+
export declare type TLImageShape = TLBaseShape<'image', TLImageShapeProps>;
|
|
1133
|
+
|
|
1134
|
+
/** @public */
|
|
1135
|
+
export declare type TLImageShapeCrop = T.TypeOf<typeof ImageShapeCrop>;
|
|
1136
|
+
|
|
1137
|
+
/** @public */
|
|
1138
|
+
export declare type TLImageShapeProps = ShapePropsType<typeof imageShapeProps>;
|
|
1139
|
+
|
|
1140
|
+
/**
|
|
1141
|
+
* TLInstance
|
|
1142
|
+
*
|
|
1143
|
+
* State that is particular to a single browser tab
|
|
1144
|
+
*
|
|
1145
|
+
* @public
|
|
1146
|
+
*/
|
|
1147
|
+
export declare interface TLInstance extends BaseRecord<'instance', TLInstanceId> {
|
|
1148
|
+
currentPageId: TLPageId;
|
|
1149
|
+
opacityForNextShape: TLOpacityType;
|
|
1150
|
+
stylesForNextShape: Record<string, unknown>;
|
|
1151
|
+
followingUserId: null | string;
|
|
1152
|
+
highlightedUserIds: string[];
|
|
1153
|
+
brush: Box2dModel | null;
|
|
1154
|
+
cursor: TLCursor;
|
|
1155
|
+
scribbles: TLScribble[];
|
|
1156
|
+
isFocusMode: boolean;
|
|
1157
|
+
isDebugMode: boolean;
|
|
1158
|
+
isToolLocked: boolean;
|
|
1159
|
+
exportBackground: boolean;
|
|
1160
|
+
screenBounds: Box2dModel;
|
|
1161
|
+
zoomBrush: Box2dModel | null;
|
|
1162
|
+
chatMessage: string;
|
|
1163
|
+
isChatting: boolean;
|
|
1164
|
+
isPenMode: boolean;
|
|
1165
|
+
isGridMode: boolean;
|
|
1166
|
+
canMoveCamera: boolean;
|
|
1167
|
+
isFocused: boolean;
|
|
1168
|
+
devicePixelRatio: number;
|
|
1169
|
+
isCoarsePointer: boolean;
|
|
1170
|
+
/**
|
|
1171
|
+
* Will be null if the pointer doesn't support hovering (e.g. touch), but true or false
|
|
1172
|
+
* otherwise
|
|
1173
|
+
*/
|
|
1174
|
+
isHoveringCanvas: boolean | null;
|
|
1175
|
+
openMenus: string[];
|
|
1176
|
+
isChangingStyle: boolean;
|
|
1177
|
+
isReadonly: boolean;
|
|
1178
|
+
meta: JsonObject;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
/** @public */
|
|
1182
|
+
export declare const TLINSTANCE_ID: TLInstanceId;
|
|
1183
|
+
|
|
1184
|
+
/** @public */
|
|
1185
|
+
export declare type TLInstanceId = RecordId<TLInstance>;
|
|
1186
|
+
|
|
1187
|
+
/**
|
|
1188
|
+
* TLInstancePageState
|
|
1189
|
+
*
|
|
1190
|
+
* State that is unique to a particular page of the document in a particular browser tab
|
|
1191
|
+
*
|
|
1192
|
+
* @public
|
|
1193
|
+
*/
|
|
1194
|
+
export declare interface TLInstancePageState extends BaseRecord<'instance_page_state', TLInstancePageStateId> {
|
|
1195
|
+
pageId: RecordId<TLPage>;
|
|
1196
|
+
selectedShapeIds: TLShapeId[];
|
|
1197
|
+
hintingShapeIds: TLShapeId[];
|
|
1198
|
+
erasingShapeIds: TLShapeId[];
|
|
1199
|
+
hoveredShapeId: null | TLShapeId;
|
|
1200
|
+
editingShapeId: null | TLShapeId;
|
|
1201
|
+
croppingShapeId: null | TLShapeId;
|
|
1202
|
+
focusedGroupId: null | TLShapeId;
|
|
1203
|
+
meta: JsonObject;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
/** @public */
|
|
1207
|
+
declare type TLInstancePageStateId = RecordId<TLInstancePageState>;
|
|
1208
|
+
|
|
1209
|
+
/** @public */
|
|
1210
|
+
export declare interface TLInstancePresence extends BaseRecord<'instance_presence', TLInstancePresenceID> {
|
|
1211
|
+
userId: string;
|
|
1212
|
+
userName: string;
|
|
1213
|
+
lastActivityTimestamp: number;
|
|
1214
|
+
color: string;
|
|
1215
|
+
camera: {
|
|
1216
|
+
x: number;
|
|
1217
|
+
y: number;
|
|
1218
|
+
z: number;
|
|
1219
|
+
};
|
|
1220
|
+
selectedShapeIds: TLShapeId[];
|
|
1221
|
+
currentPageId: TLPageId;
|
|
1222
|
+
brush: Box2dModel | null;
|
|
1223
|
+
scribbles: TLScribble[];
|
|
1224
|
+
screenBounds: Box2dModel;
|
|
1225
|
+
followingUserId: null | string;
|
|
1226
|
+
cursor: {
|
|
1227
|
+
x: number;
|
|
1228
|
+
y: number;
|
|
1229
|
+
type: TLCursor['type'];
|
|
1230
|
+
rotation: number;
|
|
1231
|
+
};
|
|
1232
|
+
chatMessage: string;
|
|
1233
|
+
meta: JsonObject;
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
/** @public */
|
|
1237
|
+
declare type TLInstancePresenceID = RecordId<TLInstancePresence>;
|
|
1238
|
+
|
|
1239
|
+
/** @public */
|
|
1240
|
+
export declare type TLLanguage = (typeof LANGUAGES)[number];
|
|
1241
|
+
|
|
1242
|
+
/** @public */
|
|
1243
|
+
export declare type TLLineShape = TLBaseShape<'line', TLLineShapeProps>;
|
|
1244
|
+
|
|
1245
|
+
/** @public */
|
|
1246
|
+
declare type TLLineShapeProps = ShapePropsType<typeof lineShapeProps>;
|
|
1247
|
+
|
|
1248
|
+
/** @public */
|
|
1249
|
+
export declare type TLNoteShape = TLBaseShape<'note', TLNoteShapeProps>;
|
|
1250
|
+
|
|
1251
|
+
/** @public */
|
|
1252
|
+
declare type TLNoteShapeProps = ShapePropsType<typeof noteShapeProps>;
|
|
1253
|
+
|
|
1254
|
+
/** @public */
|
|
1255
|
+
export declare type TLOpacityType = number;
|
|
1256
|
+
|
|
1257
|
+
/**
|
|
1258
|
+
* TLPage
|
|
1259
|
+
*
|
|
1260
|
+
* @public
|
|
1261
|
+
*/
|
|
1262
|
+
export declare interface TLPage extends BaseRecord<'page', TLPageId> {
|
|
1263
|
+
name: string;
|
|
1264
|
+
index: string;
|
|
1265
|
+
meta: JsonObject;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
/** @public */
|
|
1269
|
+
export declare type TLPageId = RecordId<TLPage>;
|
|
1270
|
+
|
|
1271
|
+
/** @public */
|
|
1272
|
+
export declare type TLParentId = TLPageId | TLShapeId;
|
|
1273
|
+
|
|
1274
|
+
/**
|
|
1275
|
+
* TLPointer
|
|
1276
|
+
*
|
|
1277
|
+
* @public
|
|
1278
|
+
*/
|
|
1279
|
+
declare interface TLPointer extends BaseRecord<'pointer', TLPointerId> {
|
|
1280
|
+
x: number;
|
|
1281
|
+
y: number;
|
|
1282
|
+
lastActivityTimestamp: number;
|
|
1283
|
+
meta: JsonObject;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
/** @public */
|
|
1287
|
+
export declare const TLPOINTER_ID: TLPointerId;
|
|
1288
|
+
|
|
1289
|
+
/** @public */
|
|
1290
|
+
declare type TLPointerId = RecordId<TLPointer>;
|
|
1291
|
+
|
|
1292
|
+
/** @public */
|
|
1293
|
+
export declare type TLRecord = TLAsset | TLCamera | TLDocument | TLInstance | TLInstancePageState | TLInstancePresence | TLPage | TLPointer | TLShape;
|
|
1294
|
+
|
|
1295
|
+
/** @public */
|
|
1296
|
+
export declare type TLSchema = StoreSchema<TLRecord, TLStoreProps>;
|
|
1297
|
+
|
|
1298
|
+
/**
|
|
1299
|
+
* A type for the scribble used by tldraw.
|
|
1300
|
+
*
|
|
1301
|
+
* @public */
|
|
1302
|
+
export declare type TLScribble = {
|
|
1303
|
+
id: string;
|
|
1304
|
+
points: Vec2dModel[];
|
|
1305
|
+
size: number;
|
|
1306
|
+
color: TLCanvasUiColor;
|
|
1307
|
+
opacity: number;
|
|
1308
|
+
state: SetValue<typeof TL_SCRIBBLE_STATES>;
|
|
1309
|
+
delay: number;
|
|
1310
|
+
shrink: number;
|
|
1311
|
+
taper: boolean;
|
|
1312
|
+
};
|
|
1313
|
+
|
|
1314
|
+
/** @public */
|
|
1315
|
+
export declare type TLSerializedStore = SerializedStore<TLRecord>;
|
|
1316
|
+
|
|
1317
|
+
/**
|
|
1318
|
+
* The set of all shapes that are available in the editor, including unknown shapes.
|
|
1319
|
+
*
|
|
1320
|
+
* @public
|
|
1321
|
+
*/
|
|
1322
|
+
export declare type TLShape = TLDefaultShape | TLUnknownShape;
|
|
1323
|
+
|
|
1324
|
+
/** @public */
|
|
1325
|
+
export declare type TLShapeId = RecordId<TLUnknownShape>;
|
|
1326
|
+
|
|
1327
|
+
/** @public */
|
|
1328
|
+
export declare type TLShapePartial<T extends TLShape = TLShape> = T extends T ? {
|
|
1329
|
+
id: TLShapeId;
|
|
1330
|
+
type: T['type'];
|
|
1331
|
+
props?: Partial<T['props']>;
|
|
1332
|
+
meta?: Partial<T['meta']>;
|
|
1333
|
+
} & Partial<Omit<T, 'id' | 'meta' | 'props' | 'type'>> : never;
|
|
1334
|
+
|
|
1335
|
+
/** @public */
|
|
1336
|
+
export declare type TLShapeProp = keyof TLShapeProps;
|
|
1337
|
+
|
|
1338
|
+
/** @public */
|
|
1339
|
+
export declare type TLShapeProps = Identity<UnionToIntersection<TLDefaultShape['props']>>;
|
|
1340
|
+
|
|
1341
|
+
/** @public */
|
|
1342
|
+
export declare type TLStore = Store<TLRecord, TLStoreProps>;
|
|
1343
|
+
|
|
1344
|
+
/** @public */
|
|
1345
|
+
export declare type TLStoreProps = {
|
|
1346
|
+
defaultName: string;
|
|
1347
|
+
};
|
|
1348
|
+
|
|
1349
|
+
/** @public */
|
|
1350
|
+
export declare type TLStoreSchema = StoreSchema<TLRecord, TLStoreProps>;
|
|
1351
|
+
|
|
1352
|
+
/** @public */
|
|
1353
|
+
export declare type TLStoreSnapshot = StoreSnapshot<TLRecord>;
|
|
1354
|
+
|
|
1355
|
+
/** @public */
|
|
1356
|
+
export declare type TLTextShape = TLBaseShape<'text', TLTextShapeProps>;
|
|
1357
|
+
|
|
1358
|
+
/** @public */
|
|
1359
|
+
export declare type TLTextShapeProps = ShapePropsType<typeof textShapeProps>;
|
|
1360
|
+
|
|
1361
|
+
/**
|
|
1362
|
+
* A type for a shape that is available in the editor but whose type is
|
|
1363
|
+
* unknown—either one of the editor's default shapes or else a custom shape.
|
|
1364
|
+
*
|
|
1365
|
+
* @public */
|
|
1366
|
+
export declare type TLUnknownShape = TLBaseShape<string, object>;
|
|
1367
|
+
|
|
1368
|
+
/**
|
|
1369
|
+
* An asset used for videos, used by the TLVideoShape.
|
|
1370
|
+
*
|
|
1371
|
+
* @public */
|
|
1372
|
+
export declare type TLVideoAsset = TLBaseAsset<'video', {
|
|
1373
|
+
w: number;
|
|
1374
|
+
h: number;
|
|
1375
|
+
name: string;
|
|
1376
|
+
isAnimated: boolean;
|
|
1377
|
+
mimeType: null | string;
|
|
1378
|
+
src: null | string;
|
|
1379
|
+
}>;
|
|
1380
|
+
|
|
1381
|
+
/** @public */
|
|
1382
|
+
export declare type TLVideoShape = TLBaseShape<'video', TLVideoShapeProps>;
|
|
1383
|
+
|
|
1384
|
+
/** @public */
|
|
1385
|
+
declare type TLVideoShapeProps = ShapePropsType<typeof videoShapeProps>;
|
|
1386
|
+
|
|
1387
|
+
declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
1388
|
+
|
|
1389
|
+
/**
|
|
1390
|
+
* A serializable model for 2D vectors.
|
|
1391
|
+
*
|
|
1392
|
+
* @public */
|
|
1393
|
+
export declare interface Vec2dModel {
|
|
1394
|
+
x: number;
|
|
1395
|
+
y: number;
|
|
1396
|
+
z?: number;
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
/** @public */
|
|
1400
|
+
export declare const vec2dModelValidator: T.Validator<Vec2dModel>;
|
|
1401
|
+
|
|
1402
|
+
/* Excluded from this release type: videoShapeMigrations */
|
|
1403
|
+
|
|
1404
|
+
/** @public */
|
|
1405
|
+
export declare const videoShapeProps: {
|
|
1406
|
+
w: T.Validator<number>;
|
|
1407
|
+
h: T.Validator<number>;
|
|
1408
|
+
time: T.Validator<number>;
|
|
1409
|
+
playing: T.Validator<boolean>;
|
|
1410
|
+
url: T.Validator<string>;
|
|
1411
|
+
assetId: T.Validator<TLAssetId | null>;
|
|
1412
|
+
};
|
|
1413
|
+
|
|
1414
|
+
export { }
|