@ibodr/schema 0.2.6 → 0.2.7
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/dist/index.d.ts +184 -102
- package/dist/index.mjs +575 -364
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1789,6 +1789,12 @@ interface DrDrawShapeSegment {
|
|
|
1789
1789
|
* First point stored as Float32 (12 bytes) for precision, subsequent points as Float16 deltas (6 bytes each).
|
|
1790
1790
|
*/
|
|
1791
1791
|
path: string;
|
|
1792
|
+
/**
|
|
1793
|
+
* Encoding dimension of `path`. `2` means (x, y) only — the constant 0.5 pressure
|
|
1794
|
+
* was omitted, for input from devices that don't report pressure. `3` or absent
|
|
1795
|
+
* (the legacy default) means (x, y, z). Added in the `OmitNonPressureZ` migration.
|
|
1796
|
+
*/
|
|
1797
|
+
dim?: 2 | 3;
|
|
1792
1798
|
}
|
|
1793
1799
|
/**
|
|
1794
1800
|
* Properties for the draw shape, which represents freehand drawing and sketching.
|
|
@@ -2777,8 +2783,8 @@ interface DrNoteShapeProps {
|
|
|
2777
2783
|
richText: DrRichText;
|
|
2778
2784
|
/** Scale factor applied to the note shape for display */
|
|
2779
2785
|
scale: number;
|
|
2780
|
-
/** User ID of the person who
|
|
2781
|
-
|
|
2786
|
+
/** User ID of the person who last edited the note text */
|
|
2787
|
+
textLastEditedBy: string | null;
|
|
2782
2788
|
}
|
|
2783
2789
|
/**
|
|
2784
2790
|
* A note shape representing a sticky note or text annotation on the canvas.
|
|
@@ -3162,6 +3168,24 @@ declare const pageIdValidator: T.Validator<DrPageId>;
|
|
|
3162
3168
|
* @public
|
|
3163
3169
|
*/
|
|
3164
3170
|
declare const PageRecordType: _ibodr_store.RecordType<DrPage, "name" | "index">;
|
|
3171
|
+
/**
|
|
3172
|
+
* Type guard to check if a record is a page.
|
|
3173
|
+
*
|
|
3174
|
+
* @param record - The record to check
|
|
3175
|
+
* @returns True if the record is a page, false otherwise
|
|
3176
|
+
*
|
|
3177
|
+
* @example
|
|
3178
|
+
* ```ts
|
|
3179
|
+
* const record = store.get('page:abc123')
|
|
3180
|
+
|
|
3181
|
+
* if (isPage(record)) {
|
|
3182
|
+
* console.log(`Page name: ${record.name}`)
|
|
3183
|
+
* }
|
|
3184
|
+
* ```
|
|
3185
|
+
*
|
|
3186
|
+
* @public
|
|
3187
|
+
*/
|
|
3188
|
+
declare function isPage(record?: UnknownRecord): record is DrPage;
|
|
3165
3189
|
/**
|
|
3166
3190
|
* Type guard to check if a string is a valid DrPageId.
|
|
3167
3191
|
*
|
|
@@ -4683,6 +4707,66 @@ interface DrScribble {
|
|
|
4683
4707
|
*/
|
|
4684
4708
|
declare const scribbleValidator: T.ObjectValidator<DrScribble>;
|
|
4685
4709
|
|
|
4710
|
+
/**
|
|
4711
|
+
* A user record in a tldraw store. User records are document-scoped and
|
|
4712
|
+
* persist alongside shapes, assets, and pages. They are automatically
|
|
4713
|
+
* included in snapshots, clipboard content, and `.drawdoc` files so that
|
|
4714
|
+
* attribution display names survive across boards and sessions.
|
|
4715
|
+
*
|
|
4716
|
+
* User records are populated from the {@link @ibodr/schema#DrUserStore}
|
|
4717
|
+
* when the editor stamps attribution metadata onto shapes.
|
|
4718
|
+
*
|
|
4719
|
+
* Extend user records with custom metadata by passing validators to
|
|
4720
|
+
* {@link @ibodr/schema#createDrSchema} or {@link createUserRecordType}.
|
|
4721
|
+
*
|
|
4722
|
+
* @public
|
|
4723
|
+
*/
|
|
4724
|
+
interface DrUser extends BaseRecord<'user', DrUserId> {
|
|
4725
|
+
name: string;
|
|
4726
|
+
color: string;
|
|
4727
|
+
imageUrl: string;
|
|
4728
|
+
meta: JsonObject;
|
|
4729
|
+
}
|
|
4730
|
+
/** @public */
|
|
4731
|
+
type DrUserId = RecordId<DrUser>;
|
|
4732
|
+
/** @public */
|
|
4733
|
+
declare const userIdValidator: T.Validator<DrUserId>;
|
|
4734
|
+
/**
|
|
4735
|
+
* Creates a user record type with optional custom meta validation.
|
|
4736
|
+
*
|
|
4737
|
+
* When `meta` validators are provided, the user record's `meta` field will
|
|
4738
|
+
* validate those specific fields (when present) while still allowing
|
|
4739
|
+
* arbitrary additional JSON properties. Custom meta fields are treated as
|
|
4740
|
+
* optional so that user records created without them remain valid.
|
|
4741
|
+
*
|
|
4742
|
+
* @param config - Optional configuration for custom meta validators
|
|
4743
|
+
* @returns A configured user record type
|
|
4744
|
+
*
|
|
4745
|
+
* @example
|
|
4746
|
+
* ```ts
|
|
4747
|
+
* import { createUserRecordType } from '@ibodr/schema'
|
|
4748
|
+
* import { T } from '@ibodr/validate'
|
|
4749
|
+
*
|
|
4750
|
+
* const CustomUserRecordType = createUserRecordType({
|
|
4751
|
+
* meta: {
|
|
4752
|
+
* isAdmin: T.boolean,
|
|
4753
|
+
* department: T.string,
|
|
4754
|
+
* },
|
|
4755
|
+
* })
|
|
4756
|
+
* ```
|
|
4757
|
+
*
|
|
4758
|
+
* @public
|
|
4759
|
+
*/
|
|
4760
|
+
declare function createUserRecordType(config?: {
|
|
4761
|
+
meta?: Record<string, T.Validatable<any>>;
|
|
4762
|
+
}): _ibodr_store.RecordType<DrUser, never>;
|
|
4763
|
+
/** @public */
|
|
4764
|
+
declare const UserRecordType: _ibodr_store.RecordType<DrUser, never>;
|
|
4765
|
+
/** @public */
|
|
4766
|
+
declare function isUserId(id: string): id is DrUserId;
|
|
4767
|
+
/** @public */
|
|
4768
|
+
declare function createUserId(id: string): DrUserId;
|
|
4769
|
+
|
|
4686
4770
|
/**
|
|
4687
4771
|
* The available visual background patterns that can be drawn behind the shapes
|
|
4688
4772
|
* on the canvas (e.g. a dotted grid, ruled notebook paper, etc).
|
|
@@ -4732,8 +4816,8 @@ interface DrInstance extends BaseRecord<'instance', DrInstanceId> {
|
|
|
4732
4816
|
currentPageId: DrPageId;
|
|
4733
4817
|
opacityForNextShape: DrOpacityType;
|
|
4734
4818
|
stylesForNextShape: Record<string, unknown>;
|
|
4735
|
-
followingUserId:
|
|
4736
|
-
highlightedUserIds:
|
|
4819
|
+
followingUserId: DrUserId | null;
|
|
4820
|
+
highlightedUserIds: DrUserId[];
|
|
4737
4821
|
brush: BoxModel | null;
|
|
4738
4822
|
cursor: DrCursor;
|
|
4739
4823
|
scribbles: DrScribble[];
|
|
@@ -4990,7 +5074,7 @@ declare const DrPOINTER_ID: DrPointerId;
|
|
|
4990
5074
|
* @public
|
|
4991
5075
|
*/
|
|
4992
5076
|
interface DrInstancePresence extends BaseRecord<'instance_presence', DrInstancePresenceID> {
|
|
4993
|
-
userId:
|
|
5077
|
+
userId: DrUserId;
|
|
4994
5078
|
userName: string;
|
|
4995
5079
|
lastActivityTimestamp: number | null;
|
|
4996
5080
|
color: string;
|
|
@@ -5004,7 +5088,7 @@ interface DrInstancePresence extends BaseRecord<'instance_presence', DrInstanceP
|
|
|
5004
5088
|
brush: BoxModel | null;
|
|
5005
5089
|
scribbles: DrScribble[];
|
|
5006
5090
|
screenBounds: BoxModel | null;
|
|
5007
|
-
followingUserId:
|
|
5091
|
+
followingUserId: DrUserId | null;
|
|
5008
5092
|
cursor: {
|
|
5009
5093
|
x: number;
|
|
5010
5094
|
y: number;
|
|
@@ -5051,66 +5135,6 @@ type DrInstancePresenceID = RecordId<DrInstancePresence>;
|
|
|
5051
5135
|
*/
|
|
5052
5136
|
declare const InstancePresenceRecordType: _ibodr_store.RecordType<DrInstancePresence, "currentPageId" | "userId" | "userName">;
|
|
5053
5137
|
|
|
5054
|
-
/**
|
|
5055
|
-
* A user record in a tldraw store. User records are document-scoped and
|
|
5056
|
-
* persist alongside shapes, assets, and pages. They are automatically
|
|
5057
|
-
* included in snapshots, clipboard content, and `.drawdoc` files so that
|
|
5058
|
-
* attribution display names survive across boards and sessions.
|
|
5059
|
-
*
|
|
5060
|
-
* User records are populated from the {@link @ibodr/schema#DrUserStore}
|
|
5061
|
-
* when the editor stamps attribution metadata onto shapes.
|
|
5062
|
-
*
|
|
5063
|
-
* Extend user records with custom metadata by passing validators to
|
|
5064
|
-
* {@link @ibodr/schema#createDrSchema} or {@link createUserRecordType}.
|
|
5065
|
-
*
|
|
5066
|
-
* @public
|
|
5067
|
-
*/
|
|
5068
|
-
interface DrUser extends BaseRecord<'user', DrUserId> {
|
|
5069
|
-
name: string;
|
|
5070
|
-
color: string;
|
|
5071
|
-
imageUrl: string;
|
|
5072
|
-
meta: JsonObject;
|
|
5073
|
-
}
|
|
5074
|
-
/** @public */
|
|
5075
|
-
type DrUserId = RecordId<DrUser>;
|
|
5076
|
-
/** @public */
|
|
5077
|
-
declare const userIdValidator: T.Validator<DrUserId>;
|
|
5078
|
-
/**
|
|
5079
|
-
* Creates a user record type with optional custom meta validation.
|
|
5080
|
-
*
|
|
5081
|
-
* When `meta` validators are provided, the user record's `meta` field will
|
|
5082
|
-
* validate those specific fields (when present) while still allowing
|
|
5083
|
-
* arbitrary additional JSON properties. Custom meta fields are treated as
|
|
5084
|
-
* optional so that user records created without them remain valid.
|
|
5085
|
-
*
|
|
5086
|
-
* @param config - Optional configuration for custom meta validators
|
|
5087
|
-
* @returns A configured user record type
|
|
5088
|
-
*
|
|
5089
|
-
* @example
|
|
5090
|
-
* ```ts
|
|
5091
|
-
* import { createUserRecordType } from '@ibodr/schema'
|
|
5092
|
-
* import { T } from '@ibodr/validate'
|
|
5093
|
-
*
|
|
5094
|
-
* const CustomUserRecordType = createUserRecordType({
|
|
5095
|
-
* meta: {
|
|
5096
|
-
* isAdmin: T.boolean,
|
|
5097
|
-
* department: T.string,
|
|
5098
|
-
* },
|
|
5099
|
-
* })
|
|
5100
|
-
* ```
|
|
5101
|
-
*
|
|
5102
|
-
* @public
|
|
5103
|
-
*/
|
|
5104
|
-
declare function createUserRecordType(config?: {
|
|
5105
|
-
meta?: Record<string, T.Validatable<any>>;
|
|
5106
|
-
}): _ibodr_store.RecordType<DrUser, never>;
|
|
5107
|
-
/** @public */
|
|
5108
|
-
declare const UserRecordType: _ibodr_store.RecordType<DrUser, never>;
|
|
5109
|
-
/** @public */
|
|
5110
|
-
declare function isUserId(id: string): id is DrUserId;
|
|
5111
|
-
/** @public */
|
|
5112
|
-
declare function createUserId(id: string): DrUserId;
|
|
5113
|
-
|
|
5114
5138
|
/**
|
|
5115
5139
|
* Interface for extending tldraw with custom record types via TypeScript module augmentation.
|
|
5116
5140
|
*
|
|
@@ -6273,7 +6297,7 @@ declare function getDefaultUserPresence(store: DrStore, user: DrUser): {
|
|
|
6273
6297
|
scribbles: DrScribble[];
|
|
6274
6298
|
userId: DrUserId;
|
|
6275
6299
|
userName: string;
|
|
6276
|
-
followingUserId:
|
|
6300
|
+
followingUserId: DrUserId | null;
|
|
6277
6301
|
camera: {
|
|
6278
6302
|
x: number;
|
|
6279
6303
|
y: number;
|
|
@@ -6293,28 +6317,6 @@ declare function getDefaultUserPresence(store: DrStore, user: DrUser): {
|
|
|
6293
6317
|
meta: {};
|
|
6294
6318
|
} | null;
|
|
6295
6319
|
|
|
6296
|
-
/**
|
|
6297
|
-
* Creates a validator for typed record IDs that ensures they follow the correct
|
|
6298
|
-
* format with the specified prefix. Record IDs in tldraw follow the pattern
|
|
6299
|
-
* "prefix:identifier" where the prefix indicates the record type.
|
|
6300
|
-
*
|
|
6301
|
-
* @param prefix - The required prefix for the ID (e.g., 'shape', 'page', 'asset')
|
|
6302
|
-
* @returns A validator that checks the ID format and returns the typed ID
|
|
6303
|
-
* @public
|
|
6304
|
-
* @example
|
|
6305
|
-
* ```ts
|
|
6306
|
-
* const shapeIdValidator = idValidator<DrShapeId>('shape')
|
|
6307
|
-
* const validId = shapeIdValidator.validate('shape:abc123') // Returns 'shape:abc123' as DrShapeId
|
|
6308
|
-
*
|
|
6309
|
-
* const pageIdValidator = idValidator<DrPageId>('page')
|
|
6310
|
-
* const pageId = pageIdValidator.validate('page:main') // Returns 'page:main' as DrPageId
|
|
6311
|
-
*
|
|
6312
|
-
* // This would throw an error:
|
|
6313
|
-
* // shapeIdValidator.validate('page:abc123') // Error: shape ID must start with "shape:"
|
|
6314
|
-
* ```
|
|
6315
|
-
*/
|
|
6316
|
-
declare function idValidator<Id extends RecordId<UnknownRecord>>(prefix: Id['__type__']['typeName']): T.Validator<Id>;
|
|
6317
|
-
|
|
6318
6320
|
/**
|
|
6319
6321
|
* All available handle types used by shapes in the tldraw editor.
|
|
6320
6322
|
*
|
|
@@ -6423,6 +6425,28 @@ interface DrHandle {
|
|
|
6423
6425
|
y: number;
|
|
6424
6426
|
}
|
|
6425
6427
|
|
|
6428
|
+
/**
|
|
6429
|
+
* Creates a validator for typed record IDs that ensures they follow the correct
|
|
6430
|
+
* format with the specified prefix. Record IDs in tldraw follow the pattern
|
|
6431
|
+
* "prefix:identifier" where the prefix indicates the record type.
|
|
6432
|
+
*
|
|
6433
|
+
* @param prefix - The required prefix for the ID (e.g., 'shape', 'page', 'asset')
|
|
6434
|
+
* @returns A validator that checks the ID format and returns the typed ID
|
|
6435
|
+
* @public
|
|
6436
|
+
* @example
|
|
6437
|
+
* ```ts
|
|
6438
|
+
* const shapeIdValidator = idValidator<DrShapeId>('shape')
|
|
6439
|
+
* const validId = shapeIdValidator.validate('shape:abc123') // Returns 'shape:abc123' as DrShapeId
|
|
6440
|
+
*
|
|
6441
|
+
* const pageIdValidator = idValidator<DrPageId>('page')
|
|
6442
|
+
* const pageId = pageIdValidator.validate('page:main') // Returns 'page:main' as DrPageId
|
|
6443
|
+
*
|
|
6444
|
+
* // This would throw an error:
|
|
6445
|
+
* // shapeIdValidator.validate('page:abc123') // Error: shape ID must start with "shape:"
|
|
6446
|
+
* ```
|
|
6447
|
+
*/
|
|
6448
|
+
declare function idValidator<Id extends RecordId<UnknownRecord>>(prefix: Id['__type__']['typeName']): T.Validator<Id>;
|
|
6449
|
+
|
|
6426
6450
|
/** @public */
|
|
6427
6451
|
declare const LANGUAGES: readonly [{
|
|
6428
6452
|
readonly locale: "id";
|
|
@@ -6638,14 +6662,10 @@ type DrLanguage = (typeof LANGUAGES)[number];
|
|
|
6638
6662
|
*/
|
|
6639
6663
|
declare function getDefaultTranslationLocale(): DrLanguage['locale'];
|
|
6640
6664
|
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
interface Uint8ArrayConstructor {
|
|
6646
|
-
fromBase64?(base64: string): Uint8Array;
|
|
6647
|
-
}
|
|
6648
|
-
}
|
|
6665
|
+
/** Draw segment path encoded with 2 dimensions, XY — the constant pressure Z is dropped. @public */
|
|
6666
|
+
declare const DIM_2D = 2;
|
|
6667
|
+
/** Draw segment path encoded with 3 dimensions, XYZ. @public */
|
|
6668
|
+
declare const DIM_3D = 3;
|
|
6649
6669
|
/**
|
|
6650
6670
|
* Utilities for encoding and decoding points using base64 and Float16 encoding.
|
|
6651
6671
|
* Provides functions for converting between VecModel arrays and compact base64 strings,
|
|
@@ -6696,38 +6716,100 @@ declare class b64Vecs {
|
|
|
6696
6716
|
* - Delta points: 3 Float16 values each = 6 bytes = 8 base64 chars each
|
|
6697
6717
|
*
|
|
6698
6718
|
* @param points - An array of VecModel objects to encode
|
|
6719
|
+
* @param dim - Encoding dimension; `2` routes through the 2D variant (drops z), `3` (default) keeps x, y, z
|
|
6699
6720
|
* @returns A base64-encoded string containing delta-encoded points
|
|
6700
6721
|
* @public
|
|
6701
6722
|
*/
|
|
6702
|
-
static encodePoints(points: VecModel[]): string;
|
|
6723
|
+
static encodePoints(points: VecModel[], dim?: 2 | 3): string;
|
|
6703
6724
|
/**
|
|
6704
6725
|
* Decode a delta-encoded base64 string back to an array of absolute VecModels.
|
|
6705
6726
|
* The first point is stored as Float32 (high precision), subsequent points are
|
|
6706
6727
|
* Float16 deltas that are accumulated to reconstruct absolute positions.
|
|
6707
6728
|
*
|
|
6708
6729
|
* @param base64 - The base64-encoded string containing delta-encoded point data
|
|
6730
|
+
* @param dim - Encoding dimension; `2` expects x/y only (z supplied as 0.5), `3` (default) expects x/y/z
|
|
6709
6731
|
* @returns An array of VecModel objects with absolute coordinates
|
|
6710
6732
|
* @public
|
|
6711
6733
|
*/
|
|
6712
|
-
static decodePoints(base64: string): VecModel[];
|
|
6734
|
+
static decodePoints(base64: string, dim?: 2 | 3): VecModel[];
|
|
6713
6735
|
/**
|
|
6714
6736
|
* Get the first point from a delta-encoded base64 string.
|
|
6715
6737
|
* The first point is stored as Float32 for full precision.
|
|
6716
6738
|
*
|
|
6717
6739
|
* @param b64Points - The delta-encoded base64 string
|
|
6740
|
+
* @param dim - Encoding dimension; `2` expects x/y only (z supplied as 0.5), `3` (default) expects x/y/z
|
|
6718
6741
|
* @returns The first point as a VecModel, or null if the string is too short
|
|
6719
6742
|
* @public
|
|
6720
6743
|
*/
|
|
6721
|
-
static decodeFirstPoint(b64Points: string): VecModel | null;
|
|
6744
|
+
static decodeFirstPoint(b64Points: string, dim?: 2 | 3): VecModel | null;
|
|
6722
6745
|
/**
|
|
6723
6746
|
* Get the last point from a delta-encoded base64 string.
|
|
6724
6747
|
* Requires decoding all points to accumulate deltas.
|
|
6725
6748
|
*
|
|
6726
6749
|
* @param b64Points - The delta-encoded base64 string
|
|
6750
|
+
* @param dim - Encoding dimension; `2` expects x/y only (z supplied as 0.5), `3` (default) expects x/y/z
|
|
6727
6751
|
* @returns The last point as a VecModel, or null if the string is too short
|
|
6728
6752
|
* @public
|
|
6729
6753
|
*/
|
|
6730
|
-
static decodeLastPoint(b64Points: string): VecModel | null;
|
|
6754
|
+
static decodeLastPoint(b64Points: string, dim?: 2 | 3): VecModel | null;
|
|
6755
|
+
/**
|
|
6756
|
+
* Encode an array of VecModels as 2D delta-encoded points, dropping z entirely.
|
|
6757
|
+
* Use for draw shapes from devices that don't report pressure, where z is a
|
|
6758
|
+
* constant 0.5 and storing it wastes ~33% of per-point bytes.
|
|
6759
|
+
*
|
|
6760
|
+
* Format:
|
|
6761
|
+
* - First point: 2 Float32 values (x, y) = 8 bytes
|
|
6762
|
+
* - Delta points: 2 Float16 values (dx, dy) = 4 bytes each
|
|
6763
|
+
*
|
|
6764
|
+
* @param points - An array of VecModel objects to encode (z is discarded)
|
|
6765
|
+
* @returns A base64-encoded string containing 2D delta-encoded points
|
|
6766
|
+
* @public
|
|
6767
|
+
*/
|
|
6768
|
+
static encodePoints2D(points: VecModel[]): string;
|
|
6769
|
+
/**
|
|
6770
|
+
* Decode a 2D delta-encoded base64 string back to an array of absolute VecModels.
|
|
6771
|
+
* The z coordinate is always set to 0.5 (the default pressure value) so downstream
|
|
6772
|
+
* consumers don't need a separate code path.
|
|
6773
|
+
*
|
|
6774
|
+
* @param base64 - The base64-encoded string containing 2D delta-encoded point data
|
|
6775
|
+
* @returns An array of VecModel objects with absolute (x, y) and z = 0.5
|
|
6776
|
+
* @public
|
|
6777
|
+
*/
|
|
6778
|
+
static decodePoints2D(base64: string): VecModel[];
|
|
6779
|
+
/**
|
|
6780
|
+
* Get the first point from a 2D delta-encoded base64 string.
|
|
6781
|
+
*
|
|
6782
|
+
* @param b64Points - The 2D delta-encoded base64 string
|
|
6783
|
+
* @returns The first point with z = 0.5, or null if the string is too short
|
|
6784
|
+
* @public
|
|
6785
|
+
*/
|
|
6786
|
+
static decodeFirstPoint2D(b64Points: string): VecModel | null;
|
|
6787
|
+
/**
|
|
6788
|
+
* Get the last point from a 2D delta-encoded base64 string.
|
|
6789
|
+
* Requires decoding all points to accumulate deltas.
|
|
6790
|
+
*
|
|
6791
|
+
* @param b64Points - The 2D delta-encoded base64 string
|
|
6792
|
+
* @returns The last point with z = 0.5, or null if the string is too short
|
|
6793
|
+
* @public
|
|
6794
|
+
*/
|
|
6795
|
+
static decodeLastPoint2D(b64Points: string): VecModel | null;
|
|
6796
|
+
/**
|
|
6797
|
+
* Whether an encoded path contains only a single point (a "dot"), inferred from
|
|
6798
|
+
* the encoded length without decoding — cheap enough for the render path.
|
|
6799
|
+
*
|
|
6800
|
+
* The single-point length depends on the encoding dimension, so this takes the
|
|
6801
|
+
* segment's `dim`: a one-point path is `FIRST_POINT_B64_LENGTH` chars (3D) or
|
|
6802
|
+
* `FIRST_POINT_2D_B64_LENGTH` chars (2D). Keeping this beside the layout constants
|
|
6803
|
+
* is deliberate — it is the single source of truth for "how long is one point", so
|
|
6804
|
+
* callers never hard-code a length threshold (which silently breaks when a new
|
|
6805
|
+
* encoding is added).
|
|
6806
|
+
*
|
|
6807
|
+
* @param b64Points - The encoded path string
|
|
6808
|
+
* @param dim - Encoding dimension; `2` for (x, y), `3` (default) for (x, y, z)
|
|
6809
|
+
* @returns true if the path encodes exactly one point
|
|
6810
|
+
* @public
|
|
6811
|
+
*/
|
|
6812
|
+
static isSinglePoint(b64Points: string, dim?: 2 | 3): boolean;
|
|
6731
6813
|
}
|
|
6732
6814
|
|
|
6733
|
-
export { ArrowShapeArrowheadEndStyle, ArrowShapeArrowheadStartStyle, ArrowShapeKindStyle, AssetRecordType, type BoxModel, CameraRecordType, type CreatePresenceStateDerivationOpts, type CustomRecordInfo, DR_BOARD_BACKGROUND_TYPES, DefaultColorStyle, DefaultDashStyle, DefaultFillStyle, DefaultFontFamilies, DefaultFontStyle, DefaultHorizontalAlignStyle, DefaultLabelColorStyle, DefaultSizeStyle, DefaultTextAlignStyle, DefaultVerticalAlignStyle, DocumentRecordType, type DrArrowBinding, type DrArrowBindingProps, type DrArrowShape, type DrArrowShapeArrowheadStyle, type DrArrowShapeKind, type DrArrowShapeProps, type DrAsset, type DrAssetContext, type DrAssetId, type DrAssetPartial, type DrAssetShape, type DrAssetStore, type DrBaseAsset, type DrBaseBinding, type DrBaseShape, type DrBinding, type DrBindingCreate, type DrBindingId, type DrBindingUpdate, type DrBoardBackgroundType, type DrBookmarkAsset, type DrBookmarkShape, type DrBookmarkShapeProps, type DrCamera, type DrCameraId, type DrCanvasUiColor, type DrColorStyle, type DrCreateShapePartial, type DrCursor, type DrCursorType, type DrCustomRecord, DrDOCUMENT_ID, type DrDefaultAsset, type DrDefaultBinding, type DrDefaultColor, type DrDefaultColorStyle, type DrDefaultDashStyle, type DrDefaultFillStyle, type DrDefaultFontStyle, type DrDefaultHorizontalAlignStyle, type DrDefaultRecord, type DrDefaultShape, type DrDefaultSizeStyle, type DrDefaultTextAlignStyle, type DrDefaultVerticalAlignStyle, type DrDocument, type DrDrawShape, type DrDrawShapeProps, type DrDrawShapeSegment, type DrEmbedShape, type DrEmbedShapeProps, type DrFontFace, type DrFontFaceSource, type DrFrameShape, type DrFrameShapeProps, type DrGeoShape, type DrGeoShapeGeoStyle, type DrGeoShapeProps, type DrGlobalAssetPropsMap, type DrGlobalBindingPropsMap, type DrGlobalRecordPropsMap, type DrGlobalShapePropsMap, type DrGroupShape, type DrGroupShapeProps, type DrHandle, type DrHandleType, type DrHighlightShape, type DrHighlightShapeProps, DrINSTANCE_ID, type DrImageAsset, type DrImageShape, type DrImageShapeProps, type DrIndexedAssets, type DrIndexedBindings, type DrIndexedRecords, type DrIndexedShapes, type DrInstance, type DrInstanceId, type DrInstancePageState, type DrInstancePageStateId, type DrInstancePresence, type DrInstancePresenceID, type DrLanguage, type DrLineShape, type DrLineShapePoint, type DrLineShapeProps, type DrLineShapeSplineStyle, type DrNoteShape, type DrNoteShapeProps, type DrOpacityType, DrPOINTER_ID, type DrPage, type DrPageId, type DrParentId, type DrPointer, type DrPointerId, type DrPresenceStateInfo, type DrPropsMigration, type DrPropsMigrations, type DrRecord, type DrRemovedDefaultThemeColors, type DrRichText, type DrSchema, type DrScribble, type DrSerializedStore, type DrShape, type DrShapeCrop, type DrShapeId, type DrShapePartial, type DrStore, type DrStoreProps, type DrStoreSchema, type DrStoreSnapshot, type DrTextShape, type DrTextShapeProps, type DrTheme, type DrThemeColors, type DrThemeDefaultColors, type DrThemeFont, type DrThemeFonts, type DrThemeId, type DrThemeUiColorKeys, type DrThemes, type DrUnknownAsset, type DrUnknownBinding, type DrUnknownShape, type DrUser, type DrUserId, type DrUserStore, type DrVideoAsset, type DrVideoShape, type DrVideoShapeProps, ElbowArrowSnap, EnumStyleProp, type ExtractShapeByProps, GeoShapeGeoStyle, ImageShapeCrop, InstancePageStateRecordType, InstancePresenceRecordType, LANGUAGES, LineShapeSplineStyle, PageRecordType, PointerRecordType, type RecordProps, type RecordPropsType, type SchemaPropsInfo, type SetValue, type ShapeWithCrop, StyleProp, type StylePropValue, TL_CANVAS_UI_COLOR_TYPES, TL_CURSOR_TYPES, TL_HANDLE_TYPES, TL_SCRIBBLE_STATES, UserRecordType, type UserSchemaInfo, type VecModel, arrowBindingMigrations, arrowBindingProps, arrowBindingVersions, arrowShapeMigrations, arrowShapeProps, arrowShapeVersions, assetIdValidator, assetMigrations, b64Vecs, bindingIdValidator, bookmarkAssetMigrations, bookmarkAssetProps, bookmarkShapeMigrations, bookmarkShapeProps, boxModelValidator, canvasUiColorTypeValidator, compressLegacySegments, createAssetPropsMigrationIds, createAssetPropsMigrationSequence, createAssetRecordType, createAssetValidator, createBindingId, createBindingPropsMigrationIds, createBindingPropsMigrationSequence, createBindingValidator, createCachedUserResolve, createCustomRecordId, createCustomRecordMigrationIds, createCustomRecordMigrationSequence, createDrSchema, createPresenceStateDerivation, createShapeId, createShapePropsMigrationIds, createShapePropsMigrationSequence, createShapeValidator, createUserId, createUserRecordType, defaultAssetSchemas, defaultBindingSchemas, defaultShapeSchemas, drawShapeMigrations, drawShapeProps, embedShapeMigrations, embedShapeProps, frameShapeMigrations, frameShapeProps, geoShapeMigrations, geoShapeProps, getDefaultTranslationLocale, getDefaultUserPresence, getShapePropKeysByStyle, groupShapeMigrations, groupShapeProps, highlightShapeMigrations, highlightShapeProps, idValidator, imageAssetMigrations, imageAssetProps, imageShapeMigrations, imageShapeProps, isBinding, isBindingId, isCssHexColor, isCustomRecord, isCustomRecordId, isDocument, isFontEntry, isPageId, isShape, isShapeId, isUserId, lineShapeMigrations, lineShapeProps, noteShapeMigrations, noteShapeProps, opacityValidator, pageIdValidator, parentIdValidator, pluckPreservingValues, registerColorsFromThemes, registerFontsFromThemes, richTextValidator, rootBindingMigrations, rootShapeMigrations, scribbleValidator, shapeIdValidator, textShapeMigrations, textShapeProps, toRichText, userIdValidator, vecModelValidator, videoAssetMigrations, videoAssetProps, videoShapeMigrations, videoShapeProps };
|
|
6815
|
+
export { ArrowShapeArrowheadEndStyle, ArrowShapeArrowheadStartStyle, ArrowShapeKindStyle, AssetRecordType, type BoxModel, CameraRecordType, type CreatePresenceStateDerivationOpts, type CustomRecordInfo, DIM_2D, DIM_3D, DR_BOARD_BACKGROUND_TYPES, DefaultColorStyle, DefaultDashStyle, DefaultFillStyle, DefaultFontFamilies, DefaultFontStyle, DefaultHorizontalAlignStyle, DefaultLabelColorStyle, DefaultSizeStyle, DefaultTextAlignStyle, DefaultVerticalAlignStyle, DocumentRecordType, type DrArrowBinding, type DrArrowBindingProps, type DrArrowShape, type DrArrowShapeArrowheadStyle, type DrArrowShapeKind, type DrArrowShapeProps, type DrAsset, type DrAssetContext, type DrAssetId, type DrAssetPartial, type DrAssetShape, type DrAssetStore, type DrBaseAsset, type DrBaseBinding, type DrBaseShape, type DrBinding, type DrBindingCreate, type DrBindingId, type DrBindingUpdate, type DrBoardBackgroundType, type DrBookmarkAsset, type DrBookmarkShape, type DrBookmarkShapeProps, type DrCamera, type DrCameraId, type DrCanvasUiColor, type DrColorStyle, type DrCreateShapePartial, type DrCursor, type DrCursorType, type DrCustomRecord, DrDOCUMENT_ID, type DrDefaultAsset, type DrDefaultBinding, type DrDefaultColor, type DrDefaultColorStyle, type DrDefaultDashStyle, type DrDefaultFillStyle, type DrDefaultFontStyle, type DrDefaultHorizontalAlignStyle, type DrDefaultRecord, type DrDefaultShape, type DrDefaultSizeStyle, type DrDefaultTextAlignStyle, type DrDefaultVerticalAlignStyle, type DrDocument, type DrDrawShape, type DrDrawShapeProps, type DrDrawShapeSegment, type DrEmbedShape, type DrEmbedShapeProps, type DrFontFace, type DrFontFaceSource, type DrFrameShape, type DrFrameShapeProps, type DrGeoShape, type DrGeoShapeGeoStyle, type DrGeoShapeProps, type DrGlobalAssetPropsMap, type DrGlobalBindingPropsMap, type DrGlobalRecordPropsMap, type DrGlobalShapePropsMap, type DrGroupShape, type DrGroupShapeProps, type DrHandle, type DrHandleType, type DrHighlightShape, type DrHighlightShapeProps, DrINSTANCE_ID, type DrImageAsset, type DrImageShape, type DrImageShapeProps, type DrIndexedAssets, type DrIndexedBindings, type DrIndexedRecords, type DrIndexedShapes, type DrInstance, type DrInstanceId, type DrInstancePageState, type DrInstancePageStateId, type DrInstancePresence, type DrInstancePresenceID, type DrLanguage, type DrLineShape, type DrLineShapePoint, type DrLineShapeProps, type DrLineShapeSplineStyle, type DrNoteShape, type DrNoteShapeProps, type DrOpacityType, DrPOINTER_ID, type DrPage, type DrPageId, type DrParentId, type DrPointer, type DrPointerId, type DrPresenceStateInfo, type DrPropsMigration, type DrPropsMigrations, type DrRecord, type DrRemovedDefaultThemeColors, type DrRichText, type DrSchema, type DrScribble, type DrSerializedStore, type DrShape, type DrShapeCrop, type DrShapeId, type DrShapePartial, type DrStore, type DrStoreProps, type DrStoreSchema, type DrStoreSnapshot, type DrTextShape, type DrTextShapeProps, type DrTheme, type DrThemeColors, type DrThemeDefaultColors, type DrThemeFont, type DrThemeFonts, type DrThemeId, type DrThemeUiColorKeys, type DrThemes, type DrUnknownAsset, type DrUnknownBinding, type DrUnknownShape, type DrUser, type DrUserId, type DrUserStore, type DrVideoAsset, type DrVideoShape, type DrVideoShapeProps, ElbowArrowSnap, EnumStyleProp, type ExtractShapeByProps, GeoShapeGeoStyle, ImageShapeCrop, InstancePageStateRecordType, InstancePresenceRecordType, LANGUAGES, LineShapeSplineStyle, PageRecordType, PointerRecordType, type RecordProps, type RecordPropsType, type SchemaPropsInfo, type SetValue, type ShapeWithCrop, StyleProp, type StylePropValue, TL_CANVAS_UI_COLOR_TYPES, TL_CURSOR_TYPES, TL_HANDLE_TYPES, TL_SCRIBBLE_STATES, UserRecordType, type UserSchemaInfo, type VecModel, arrowBindingMigrations, arrowBindingProps, arrowBindingVersions, arrowShapeMigrations, arrowShapeProps, arrowShapeVersions, assetIdValidator, assetMigrations, b64Vecs, bindingIdValidator, bookmarkAssetMigrations, bookmarkAssetProps, bookmarkShapeMigrations, bookmarkShapeProps, boxModelValidator, canvasUiColorTypeValidator, compressLegacySegments, createAssetPropsMigrationIds, createAssetPropsMigrationSequence, createAssetRecordType, createAssetValidator, createBindingId, createBindingPropsMigrationIds, createBindingPropsMigrationSequence, createBindingValidator, createCachedUserResolve, createCustomRecordId, createCustomRecordMigrationIds, createCustomRecordMigrationSequence, createDrSchema, createPresenceStateDerivation, createShapeId, createShapePropsMigrationIds, createShapePropsMigrationSequence, createShapeValidator, createUserId, createUserRecordType, defaultAssetSchemas, defaultBindingSchemas, defaultShapeSchemas, drawShapeMigrations, drawShapeProps, embedShapeMigrations, embedShapeProps, frameShapeMigrations, frameShapeProps, geoShapeMigrations, geoShapeProps, getDefaultTranslationLocale, getDefaultUserPresence, getShapePropKeysByStyle, groupShapeMigrations, groupShapeProps, highlightShapeMigrations, highlightShapeProps, idValidator, imageAssetMigrations, imageAssetProps, imageShapeMigrations, imageShapeProps, isBinding, isBindingId, isCssHexColor, isCustomRecord, isCustomRecordId, isDocument, isFontEntry, isPage, isPageId, isShape, isShapeId, isUserId, lineShapeMigrations, lineShapeProps, noteShapeMigrations, noteShapeProps, opacityValidator, pageIdValidator, parentIdValidator, pluckPreservingValues, registerColorsFromThemes, registerFontsFromThemes, richTextValidator, rootBindingMigrations, rootShapeMigrations, scribbleValidator, shapeIdValidator, textShapeMigrations, textShapeProps, toRichText, userIdValidator, vecModelValidator, videoAssetMigrations, videoAssetProps, videoShapeMigrations, videoShapeProps };
|