@dcl/playground-assets 7.30.2-38752426937.commit-d38a9c4 → 7.30.2-39321726891.commit-9926e63

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/alpha.d.ts CHANGED
@@ -245,6 +245,42 @@ export declare interface AudioStreamComponentDefinitionExtended extends LastWrit
245
245
  getAudioState(entity: Entity): PBAudioEvent | undefined;
246
246
  }
247
247
 
248
+ /**
249
+ * @public
250
+ */
251
+ export declare type AuthoritativePutComponentMessage = CrdtMessageHeader & AuthoritativePutComponentMessageBody;
252
+
253
+ /**
254
+ * Server authoritative message - identical to PutComponentMessageBody but with forced processing
255
+ * Min. length = header (8 bytes) + 16 bytes = 24 bytes
256
+ *
257
+ * @param entity - Uint32 number of the entity
258
+ * @param componentId - Uint32 number of id
259
+ * @param timestamp - Uint32 Lamport timestamp (server's authoritative timestamp)
260
+ * @param data - Uint8[] data of component => length(4 bytes) + block of bytes[0..length-1]
261
+ * @public
262
+ */
263
+ export declare type AuthoritativePutComponentMessageBody = {
264
+ type: CrdtMessageType.AUTHORITATIVE_PUT_COMPONENT;
265
+ entityId: Entity;
266
+ componentId: number;
267
+ timestamp: number;
268
+ data: Uint8Array;
269
+ };
270
+
271
+ /**
272
+ * @public
273
+ */
274
+ export declare namespace AuthoritativePutComponentOperation {
275
+ const MESSAGE_HEADER_LENGTH = 16;
276
+ /**
277
+ * Call this function for an optimal writing data passing the ByteBuffer
278
+ * already allocated
279
+ */
280
+ export function write(entity: Entity, timestamp: number, componentId: number, data: Uint8Array, buf: ByteBuffer): void;
281
+ export function read(buf: ByteBuffer): AuthoritativePutComponentMessage | null;
282
+ }
283
+
248
284
  /** AvatarAnchorPointType determines the part of the avatar's body that anchors the Entity. */
249
285
  /**
250
286
  * @public
@@ -420,6 +456,22 @@ export declare interface BaseComponent<T> {
420
456
  * If the value is undefined, the component was deleted.
421
457
  */
422
458
  onChange(entity: Entity, cb: (value: T | undefined) => void): void;
459
+ /**
460
+ * @public
461
+ *
462
+ */
463
+ validateBeforeChange(entity: Entity, cb: ValidateCallback<T>): void;
464
+ validateBeforeChange(cb: ValidateCallback<T>): void;
465
+ /**
466
+ * Get the CRDT state for an entity (serialized data and timestamp)
467
+ * @param entity - Entity to get the CRDT state for
468
+ * @returns Object with serialized data and timestamp, or null if entity doesn't have the component
469
+ * @public
470
+ */
471
+ getCrdtState(entity: Entity): {
472
+ data: Uint8Array;
473
+ timestamp: number;
474
+ } | null;
423
475
  }
424
476
 
425
477
  /** @public */
@@ -1663,12 +1715,12 @@ export declare const CRDT_MESSAGE_HEADER_LENGTH = 8;
1663
1715
  /**
1664
1716
  * @public
1665
1717
  */
1666
- export declare type CrdtMessage = PutComponentMessage | DeleteComponentMessage | AppendValueMessage | DeleteEntityMessage | PutNetworkComponentMessage | DeleteComponentNetworkMessage | DeleteEntityNetworkMessage;
1718
+ export declare type CrdtMessage = PutComponentMessage | AuthoritativePutComponentMessage | DeleteComponentMessage | AppendValueMessage | DeleteEntityMessage | PutNetworkComponentMessage | DeleteComponentNetworkMessage | DeleteEntityNetworkMessage;
1667
1719
 
1668
1720
  /**
1669
1721
  * @public
1670
1722
  */
1671
- export declare type CrdtMessageBody = PutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessageBody | AppendValueMessageBody | CrdtNetworkMessageBody;
1723
+ export declare type CrdtMessageBody = PutComponentMessageBody | AuthoritativePutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessageBody | AppendValueMessageBody | CrdtNetworkMessageBody;
1672
1724
 
1673
1725
  /**
1674
1726
  * Min length = 8 bytes
@@ -1723,7 +1775,8 @@ export declare enum CrdtMessageType {
1723
1775
  PUT_COMPONENT_NETWORK = 5,
1724
1776
  DELETE_COMPONENT_NETWORK = 6,
1725
1777
  DELETE_ENTITY_NETWORK = 7,
1726
- MAX_MESSAGE_TYPE = 8
1778
+ AUTHORITATIVE_PUT_COMPONENT = 8,
1779
+ MAX_MESSAGE_TYPE = 9
1727
1780
  }
1728
1781
 
1729
1782
  /**
@@ -1731,6 +1784,8 @@ export declare enum CrdtMessageType {
1731
1784
  */
1732
1785
  export declare type CrdtNetworkMessageBody = PutNetworkComponentMessageBody | DeleteComponentNetworkMessageBody | DeleteEntityNetworkMessageBody;
1733
1786
 
1787
+ export declare const CreatedBy: ICreatedBy;
1788
+
1734
1789
  /**
1735
1790
  * @public
1736
1791
  */
@@ -2507,6 +2562,12 @@ export declare interface GrowOnlyValueSetComponentDefinition<T> extends BaseComp
2507
2562
 
2508
2563
  export declare type GSetComponentGetter<T extends GrowOnlyValueSetComponentDefinition<any>> = (engine: Pick<IEngine, 'defineValueSetComponentFromSchema'>) => T;
2509
2564
 
2565
+ export declare type ICreatedBy = LastWriteWinElementSetComponentDefinition<ICreatedByType>;
2566
+
2567
+ export declare interface ICreatedByType {
2568
+ address: string;
2569
+ }
2570
+
2510
2571
  /**
2511
2572
  * @public
2512
2573
  */
@@ -2993,6 +3054,35 @@ export declare const enum InteractionType {
2993
3054
  PROXIMITY = 1
2994
3055
  }
2995
3056
 
3057
+ /**
3058
+ * Internal component interface that exposes all internal methods for SDK use
3059
+ * This is not exposed to users, only for internal SDK operations
3060
+ */
3061
+ export declare interface InternalBaseComponent<T> extends BaseComponent<T> {
3062
+ /**
3063
+ * @public
3064
+ * Dry run update to check if a CRDT message would be accepted without actually applying it
3065
+ */
3066
+ __dry_run_updateFromCrdt(body: CrdtMessageBody): ProcessMessageResultType;
3067
+ /**
3068
+ * @public
3069
+ * Get the iterator to every entity has the component
3070
+ */
3071
+ iterator(): Iterable<[Entity, any]>;
3072
+ /**
3073
+ * @public
3074
+ */
3075
+ dirtyIterator(): Iterable<Entity>;
3076
+ /**
3077
+ * @public
3078
+ */
3079
+ __onChangeCallbacks(entity: Entity, value: T): void;
3080
+ /**
3081
+ * @public
3082
+ */
3083
+ __run_validateBeforeChange(entity: Entity, newValue: T | undefined, senderAddress: string, createdBy: string): boolean;
3084
+ }
3085
+
2996
3086
  /**
2997
3087
  * @public
2998
3088
  */
@@ -6712,6 +6802,8 @@ export declare interface PBTextShape {
6712
6802
  outlineColor?: PBColor3 | undefined;
6713
6803
  /** text color (default [1.0, 1.0, 1.0]) */
6714
6804
  textColor?: PBColor4 | undefined;
6805
+ /** a ttf font file in the scene content or a Google Fonts family name; `font` is the fallback (default: unset) */
6806
+ fontSrc?: string | undefined;
6715
6807
  }
6716
6808
 
6717
6809
  /**
@@ -7022,6 +7114,8 @@ export declare interface PBUiDropdown {
7022
7114
  font?: Font | undefined;
7023
7115
  /** default=10 */
7024
7116
  fontSize?: number | undefined;
7117
+ /** a ttf font file in the scene content or a Google Fonts family name; `font` is the fallback (default: unset) */
7118
+ fontSrc?: string | undefined;
7025
7119
  }
7026
7120
 
7027
7121
  /**
@@ -7064,6 +7158,8 @@ export declare interface PBUiInput {
7064
7158
  /** default=10 */
7065
7159
  fontSize?: number | undefined;
7066
7160
  value?: string | undefined;
7161
+ /** a ttf font file in the scene content or a Google Fonts family name; `font` is the fallback (default: unset) */
7162
+ fontSrc?: string | undefined;
7067
7163
  }
7068
7164
 
7069
7165
  /**
@@ -7143,6 +7239,8 @@ export declare interface PBUiText {
7143
7239
  fontSize?: number | undefined;
7144
7240
  /** wrap text when the border is reached (default: TW_WRAP) */
7145
7241
  textWrap?: TextWrap | undefined;
7242
+ /** a ttf font file in the scene content or a Google Fonts family name; `font` is the fallback (default: unset) */
7243
+ fontSrc?: string | undefined;
7146
7244
  }
7147
7245
 
7148
7246
  /**
@@ -9533,6 +9631,16 @@ export declare type Transport = {
9533
9631
  onmessage?(message: Uint8Array): void;
9534
9632
  filter(message: Omit<TransportMessage, 'messageBuffer'>): boolean;
9535
9633
  type?: string;
9634
+ /**
9635
+ * Whether this transport is allowed to mutate reserved-range entities
9636
+ * (root/player/camera + avatars, entity number below `RESERVED_STATIC_ENTITIES`).
9637
+ * Only the trusted host/renderer transport sets this. An inbound DELETE_ENTITY
9638
+ * or component operation (PUT_COMPONENT, DELETE_COMPONENT, APPEND_VALUE,
9639
+ * AUTHORITATIVE_PUT_COMPONENT) on a reserved entity from a transport without
9640
+ * this flag (a comms peer, or any scene-added transport) is rejected — see
9641
+ * `receiveMessages`.
9642
+ */
9643
+ allowReservedEntities?: boolean;
9536
9644
  };
9537
9645
 
9538
9646
  /**
@@ -9958,6 +10066,8 @@ export declare interface UiLabelProps {
9958
10066
  textAlign?: TextAlignType | undefined;
9959
10067
  /** Label font type. @defaultValue 'sans-serif' */
9960
10068
  font?: UiFontType | undefined;
10069
+ /** Path to a `.ttf` file in the scene content. `font` is used when it can't be loaded. */
10070
+ fontSrc?: string | undefined;
9961
10071
  /** Behaviour when text reached. @defaultValue 'wrap' */
9962
10072
  textWrap?: UiTextWrapType | undefined;
9963
10073
  }
@@ -10112,6 +10222,14 @@ export declare interface UiTransformProps {
10112
10222
  */
10113
10223
  export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
10114
10224
 
10225
+ export declare type ValidateCallback<T> = (value: {
10226
+ entity: Entity;
10227
+ currentValue: T | undefined;
10228
+ newValue: T | undefined;
10229
+ senderAddress: string;
10230
+ createdBy: string;
10231
+ }) => boolean;
10232
+
10115
10233
  /**
10116
10234
  * @public
10117
10235
  */
package/dist/beta.d.ts CHANGED
@@ -245,6 +245,42 @@ export declare interface AudioStreamComponentDefinitionExtended extends LastWrit
245
245
  getAudioState(entity: Entity): PBAudioEvent | undefined;
246
246
  }
247
247
 
248
+ /**
249
+ * @public
250
+ */
251
+ export declare type AuthoritativePutComponentMessage = CrdtMessageHeader & AuthoritativePutComponentMessageBody;
252
+
253
+ /**
254
+ * Server authoritative message - identical to PutComponentMessageBody but with forced processing
255
+ * Min. length = header (8 bytes) + 16 bytes = 24 bytes
256
+ *
257
+ * @param entity - Uint32 number of the entity
258
+ * @param componentId - Uint32 number of id
259
+ * @param timestamp - Uint32 Lamport timestamp (server's authoritative timestamp)
260
+ * @param data - Uint8[] data of component => length(4 bytes) + block of bytes[0..length-1]
261
+ * @public
262
+ */
263
+ export declare type AuthoritativePutComponentMessageBody = {
264
+ type: CrdtMessageType.AUTHORITATIVE_PUT_COMPONENT;
265
+ entityId: Entity;
266
+ componentId: number;
267
+ timestamp: number;
268
+ data: Uint8Array;
269
+ };
270
+
271
+ /**
272
+ * @public
273
+ */
274
+ export declare namespace AuthoritativePutComponentOperation {
275
+ const MESSAGE_HEADER_LENGTH = 16;
276
+ /**
277
+ * Call this function for an optimal writing data passing the ByteBuffer
278
+ * already allocated
279
+ */
280
+ export function write(entity: Entity, timestamp: number, componentId: number, data: Uint8Array, buf: ByteBuffer): void;
281
+ export function read(buf: ByteBuffer): AuthoritativePutComponentMessage | null;
282
+ }
283
+
248
284
  /** AvatarAnchorPointType determines the part of the avatar's body that anchors the Entity. */
249
285
  /**
250
286
  * @public
@@ -420,6 +456,22 @@ export declare interface BaseComponent<T> {
420
456
  * If the value is undefined, the component was deleted.
421
457
  */
422
458
  onChange(entity: Entity, cb: (value: T | undefined) => void): void;
459
+ /**
460
+ * @public
461
+ *
462
+ */
463
+ validateBeforeChange(entity: Entity, cb: ValidateCallback<T>): void;
464
+ validateBeforeChange(cb: ValidateCallback<T>): void;
465
+ /**
466
+ * Get the CRDT state for an entity (serialized data and timestamp)
467
+ * @param entity - Entity to get the CRDT state for
468
+ * @returns Object with serialized data and timestamp, or null if entity doesn't have the component
469
+ * @public
470
+ */
471
+ getCrdtState(entity: Entity): {
472
+ data: Uint8Array;
473
+ timestamp: number;
474
+ } | null;
423
475
  }
424
476
 
425
477
  /** @public */
@@ -1663,12 +1715,12 @@ export declare const CRDT_MESSAGE_HEADER_LENGTH = 8;
1663
1715
  /**
1664
1716
  * @public
1665
1717
  */
1666
- export declare type CrdtMessage = PutComponentMessage | DeleteComponentMessage | AppendValueMessage | DeleteEntityMessage | PutNetworkComponentMessage | DeleteComponentNetworkMessage | DeleteEntityNetworkMessage;
1718
+ export declare type CrdtMessage = PutComponentMessage | AuthoritativePutComponentMessage | DeleteComponentMessage | AppendValueMessage | DeleteEntityMessage | PutNetworkComponentMessage | DeleteComponentNetworkMessage | DeleteEntityNetworkMessage;
1667
1719
 
1668
1720
  /**
1669
1721
  * @public
1670
1722
  */
1671
- export declare type CrdtMessageBody = PutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessageBody | AppendValueMessageBody | CrdtNetworkMessageBody;
1723
+ export declare type CrdtMessageBody = PutComponentMessageBody | AuthoritativePutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessageBody | AppendValueMessageBody | CrdtNetworkMessageBody;
1672
1724
 
1673
1725
  /**
1674
1726
  * Min length = 8 bytes
@@ -1723,7 +1775,8 @@ export declare enum CrdtMessageType {
1723
1775
  PUT_COMPONENT_NETWORK = 5,
1724
1776
  DELETE_COMPONENT_NETWORK = 6,
1725
1777
  DELETE_ENTITY_NETWORK = 7,
1726
- MAX_MESSAGE_TYPE = 8
1778
+ AUTHORITATIVE_PUT_COMPONENT = 8,
1779
+ MAX_MESSAGE_TYPE = 9
1727
1780
  }
1728
1781
 
1729
1782
  /**
@@ -1731,6 +1784,8 @@ export declare enum CrdtMessageType {
1731
1784
  */
1732
1785
  export declare type CrdtNetworkMessageBody = PutNetworkComponentMessageBody | DeleteComponentNetworkMessageBody | DeleteEntityNetworkMessageBody;
1733
1786
 
1787
+ export declare const CreatedBy: ICreatedBy;
1788
+
1734
1789
  /**
1735
1790
  * @public
1736
1791
  */
@@ -2507,6 +2562,12 @@ export declare interface GrowOnlyValueSetComponentDefinition<T> extends BaseComp
2507
2562
 
2508
2563
  export declare type GSetComponentGetter<T extends GrowOnlyValueSetComponentDefinition<any>> = (engine: Pick<IEngine, 'defineValueSetComponentFromSchema'>) => T;
2509
2564
 
2565
+ export declare type ICreatedBy = LastWriteWinElementSetComponentDefinition<ICreatedByType>;
2566
+
2567
+ export declare interface ICreatedByType {
2568
+ address: string;
2569
+ }
2570
+
2510
2571
  /**
2511
2572
  * @public
2512
2573
  */
@@ -2984,6 +3045,35 @@ export declare const enum InteractionType {
2984
3045
  PROXIMITY = 1
2985
3046
  }
2986
3047
 
3048
+ /**
3049
+ * Internal component interface that exposes all internal methods for SDK use
3050
+ * This is not exposed to users, only for internal SDK operations
3051
+ */
3052
+ export declare interface InternalBaseComponent<T> extends BaseComponent<T> {
3053
+ /**
3054
+ * @public
3055
+ * Dry run update to check if a CRDT message would be accepted without actually applying it
3056
+ */
3057
+ __dry_run_updateFromCrdt(body: CrdtMessageBody): ProcessMessageResultType;
3058
+ /**
3059
+ * @public
3060
+ * Get the iterator to every entity has the component
3061
+ */
3062
+ iterator(): Iterable<[Entity, any]>;
3063
+ /**
3064
+ * @public
3065
+ */
3066
+ dirtyIterator(): Iterable<Entity>;
3067
+ /**
3068
+ * @public
3069
+ */
3070
+ __onChangeCallbacks(entity: Entity, value: T): void;
3071
+ /**
3072
+ * @public
3073
+ */
3074
+ __run_validateBeforeChange(entity: Entity, newValue: T | undefined, senderAddress: string, createdBy: string): boolean;
3075
+ }
3076
+
2987
3077
  /**
2988
3078
  * @public
2989
3079
  */
@@ -6684,6 +6774,8 @@ export declare interface PBTextShape {
6684
6774
  outlineColor?: PBColor3 | undefined;
6685
6775
  /** text color (default [1.0, 1.0, 1.0]) */
6686
6776
  textColor?: PBColor4 | undefined;
6777
+ /** a ttf font file in the scene content or a Google Fonts family name; `font` is the fallback (default: unset) */
6778
+ fontSrc?: string | undefined;
6687
6779
  }
6688
6780
 
6689
6781
  /**
@@ -6994,6 +7086,8 @@ export declare interface PBUiDropdown {
6994
7086
  font?: Font | undefined;
6995
7087
  /** default=10 */
6996
7088
  fontSize?: number | undefined;
7089
+ /** a ttf font file in the scene content or a Google Fonts family name; `font` is the fallback (default: unset) */
7090
+ fontSrc?: string | undefined;
6997
7091
  }
6998
7092
 
6999
7093
  /**
@@ -7036,6 +7130,8 @@ export declare interface PBUiInput {
7036
7130
  /** default=10 */
7037
7131
  fontSize?: number | undefined;
7038
7132
  value?: string | undefined;
7133
+ /** a ttf font file in the scene content or a Google Fonts family name; `font` is the fallback (default: unset) */
7134
+ fontSrc?: string | undefined;
7039
7135
  }
7040
7136
 
7041
7137
  /**
@@ -7115,6 +7211,8 @@ export declare interface PBUiText {
7115
7211
  fontSize?: number | undefined;
7116
7212
  /** wrap text when the border is reached (default: TW_WRAP) */
7117
7213
  textWrap?: TextWrap | undefined;
7214
+ /** a ttf font file in the scene content or a Google Fonts family name; `font` is the fallback (default: unset) */
7215
+ fontSrc?: string | undefined;
7118
7216
  }
7119
7217
 
7120
7218
  /**
@@ -9500,6 +9598,16 @@ export declare type Transport = {
9500
9598
  onmessage?(message: Uint8Array): void;
9501
9599
  filter(message: Omit<TransportMessage, 'messageBuffer'>): boolean;
9502
9600
  type?: string;
9601
+ /**
9602
+ * Whether this transport is allowed to mutate reserved-range entities
9603
+ * (root/player/camera + avatars, entity number below `RESERVED_STATIC_ENTITIES`).
9604
+ * Only the trusted host/renderer transport sets this. An inbound DELETE_ENTITY
9605
+ * or component operation (PUT_COMPONENT, DELETE_COMPONENT, APPEND_VALUE,
9606
+ * AUTHORITATIVE_PUT_COMPONENT) on a reserved entity from a transport without
9607
+ * this flag (a comms peer, or any scene-added transport) is rejected — see
9608
+ * `receiveMessages`.
9609
+ */
9610
+ allowReservedEntities?: boolean;
9503
9611
  };
9504
9612
 
9505
9613
  /**
@@ -9925,6 +10033,8 @@ export declare interface UiLabelProps {
9925
10033
  textAlign?: TextAlignType | undefined;
9926
10034
  /** Label font type. @defaultValue 'sans-serif' */
9927
10035
  font?: UiFontType | undefined;
10036
+ /** Path to a `.ttf` file in the scene content. `font` is used when it can't be loaded. */
10037
+ fontSrc?: string | undefined;
9928
10038
  /** Behaviour when text reached. @defaultValue 'wrap' */
9929
10039
  textWrap?: UiTextWrapType | undefined;
9930
10040
  }
@@ -10079,6 +10189,14 @@ export declare interface UiTransformProps {
10079
10189
  */
10080
10190
  export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
10081
10191
 
10192
+ export declare type ValidateCallback<T> = (value: {
10193
+ entity: Entity;
10194
+ currentValue: T | undefined;
10195
+ newValue: T | undefined;
10196
+ senderAddress: string;
10197
+ createdBy: string;
10198
+ }) => boolean;
10199
+
10082
10200
  /**
10083
10201
  * @public
10084
10202
  */
@@ -245,6 +245,42 @@ export declare interface AudioStreamComponentDefinitionExtended extends LastWrit
245
245
  getAudioState(entity: Entity): PBAudioEvent | undefined;
246
246
  }
247
247
 
248
+ /**
249
+ * @public
250
+ */
251
+ export declare type AuthoritativePutComponentMessage = CrdtMessageHeader & AuthoritativePutComponentMessageBody;
252
+
253
+ /**
254
+ * Server authoritative message - identical to PutComponentMessageBody but with forced processing
255
+ * Min. length = header (8 bytes) + 16 bytes = 24 bytes
256
+ *
257
+ * @param entity - Uint32 number of the entity
258
+ * @param componentId - Uint32 number of id
259
+ * @param timestamp - Uint32 Lamport timestamp (server's authoritative timestamp)
260
+ * @param data - Uint8[] data of component => length(4 bytes) + block of bytes[0..length-1]
261
+ * @public
262
+ */
263
+ export declare type AuthoritativePutComponentMessageBody = {
264
+ type: CrdtMessageType.AUTHORITATIVE_PUT_COMPONENT;
265
+ entityId: Entity;
266
+ componentId: number;
267
+ timestamp: number;
268
+ data: Uint8Array;
269
+ };
270
+
271
+ /**
272
+ * @public
273
+ */
274
+ export declare namespace AuthoritativePutComponentOperation {
275
+ const MESSAGE_HEADER_LENGTH = 16;
276
+ /**
277
+ * Call this function for an optimal writing data passing the ByteBuffer
278
+ * already allocated
279
+ */
280
+ export function write(entity: Entity, timestamp: number, componentId: number, data: Uint8Array, buf: ByteBuffer): void;
281
+ export function read(buf: ByteBuffer): AuthoritativePutComponentMessage | null;
282
+ }
283
+
248
284
  /** AvatarAnchorPointType determines the part of the avatar's body that anchors the Entity. */
249
285
  /**
250
286
  * @public
@@ -420,6 +456,22 @@ export declare interface BaseComponent<T> {
420
456
  * If the value is undefined, the component was deleted.
421
457
  */
422
458
  onChange(entity: Entity, cb: (value: T | undefined) => void): void;
459
+ /**
460
+ * @public
461
+ *
462
+ */
463
+ validateBeforeChange(entity: Entity, cb: ValidateCallback<T>): void;
464
+ validateBeforeChange(cb: ValidateCallback<T>): void;
465
+ /**
466
+ * Get the CRDT state for an entity (serialized data and timestamp)
467
+ * @param entity - Entity to get the CRDT state for
468
+ * @returns Object with serialized data and timestamp, or null if entity doesn't have the component
469
+ * @public
470
+ */
471
+ getCrdtState(entity: Entity): {
472
+ data: Uint8Array;
473
+ timestamp: number;
474
+ } | null;
423
475
  }
424
476
 
425
477
  /** @public */
@@ -1663,12 +1715,12 @@ export declare const CRDT_MESSAGE_HEADER_LENGTH = 8;
1663
1715
  /**
1664
1716
  * @public
1665
1717
  */
1666
- export declare type CrdtMessage = PutComponentMessage | DeleteComponentMessage | AppendValueMessage | DeleteEntityMessage | PutNetworkComponentMessage | DeleteComponentNetworkMessage | DeleteEntityNetworkMessage;
1718
+ export declare type CrdtMessage = PutComponentMessage | AuthoritativePutComponentMessage | DeleteComponentMessage | AppendValueMessage | DeleteEntityMessage | PutNetworkComponentMessage | DeleteComponentNetworkMessage | DeleteEntityNetworkMessage;
1667
1719
 
1668
1720
  /**
1669
1721
  * @public
1670
1722
  */
1671
- export declare type CrdtMessageBody = PutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessageBody | AppendValueMessageBody | CrdtNetworkMessageBody;
1723
+ export declare type CrdtMessageBody = PutComponentMessageBody | AuthoritativePutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessageBody | AppendValueMessageBody | CrdtNetworkMessageBody;
1672
1724
 
1673
1725
  /**
1674
1726
  * Min length = 8 bytes
@@ -1723,7 +1775,8 @@ export declare enum CrdtMessageType {
1723
1775
  PUT_COMPONENT_NETWORK = 5,
1724
1776
  DELETE_COMPONENT_NETWORK = 6,
1725
1777
  DELETE_ENTITY_NETWORK = 7,
1726
- MAX_MESSAGE_TYPE = 8
1778
+ AUTHORITATIVE_PUT_COMPONENT = 8,
1779
+ MAX_MESSAGE_TYPE = 9
1727
1780
  }
1728
1781
 
1729
1782
  /**
@@ -1731,6 +1784,8 @@ export declare enum CrdtMessageType {
1731
1784
  */
1732
1785
  export declare type CrdtNetworkMessageBody = PutNetworkComponentMessageBody | DeleteComponentNetworkMessageBody | DeleteEntityNetworkMessageBody;
1733
1786
 
1787
+ export declare const CreatedBy: ICreatedBy;
1788
+
1734
1789
  /**
1735
1790
  * @public
1736
1791
  */
@@ -2507,6 +2562,12 @@ export declare interface GrowOnlyValueSetComponentDefinition<T> extends BaseComp
2507
2562
 
2508
2563
  export declare type GSetComponentGetter<T extends GrowOnlyValueSetComponentDefinition<any>> = (engine: Pick<IEngine, 'defineValueSetComponentFromSchema'>) => T;
2509
2564
 
2565
+ export declare type ICreatedBy = LastWriteWinElementSetComponentDefinition<ICreatedByType>;
2566
+
2567
+ export declare interface ICreatedByType {
2568
+ address: string;
2569
+ }
2570
+
2510
2571
  /**
2511
2572
  * @public
2512
2573
  */
@@ -2984,6 +3045,35 @@ export declare const enum InteractionType {
2984
3045
  PROXIMITY = 1
2985
3046
  }
2986
3047
 
3048
+ /**
3049
+ * Internal component interface that exposes all internal methods for SDK use
3050
+ * This is not exposed to users, only for internal SDK operations
3051
+ */
3052
+ export declare interface InternalBaseComponent<T> extends BaseComponent<T> {
3053
+ /**
3054
+ * @public
3055
+ * Dry run update to check if a CRDT message would be accepted without actually applying it
3056
+ */
3057
+ __dry_run_updateFromCrdt(body: CrdtMessageBody): ProcessMessageResultType;
3058
+ /**
3059
+ * @public
3060
+ * Get the iterator to every entity has the component
3061
+ */
3062
+ iterator(): Iterable<[Entity, any]>;
3063
+ /**
3064
+ * @public
3065
+ */
3066
+ dirtyIterator(): Iterable<Entity>;
3067
+ /**
3068
+ * @public
3069
+ */
3070
+ __onChangeCallbacks(entity: Entity, value: T): void;
3071
+ /**
3072
+ * @public
3073
+ */
3074
+ __run_validateBeforeChange(entity: Entity, newValue: T | undefined, senderAddress: string, createdBy: string): boolean;
3075
+ }
3076
+
2987
3077
  /**
2988
3078
  * @public
2989
3079
  */
@@ -6684,6 +6774,8 @@ export declare interface PBTextShape {
6684
6774
  outlineColor?: PBColor3 | undefined;
6685
6775
  /** text color (default [1.0, 1.0, 1.0]) */
6686
6776
  textColor?: PBColor4 | undefined;
6777
+ /** a ttf font file in the scene content or a Google Fonts family name; `font` is the fallback (default: unset) */
6778
+ fontSrc?: string | undefined;
6687
6779
  }
6688
6780
 
6689
6781
  /**
@@ -6994,6 +7086,8 @@ export declare interface PBUiDropdown {
6994
7086
  font?: Font | undefined;
6995
7087
  /** default=10 */
6996
7088
  fontSize?: number | undefined;
7089
+ /** a ttf font file in the scene content or a Google Fonts family name; `font` is the fallback (default: unset) */
7090
+ fontSrc?: string | undefined;
6997
7091
  }
6998
7092
 
6999
7093
  /**
@@ -7036,6 +7130,8 @@ export declare interface PBUiInput {
7036
7130
  /** default=10 */
7037
7131
  fontSize?: number | undefined;
7038
7132
  value?: string | undefined;
7133
+ /** a ttf font file in the scene content or a Google Fonts family name; `font` is the fallback (default: unset) */
7134
+ fontSrc?: string | undefined;
7039
7135
  }
7040
7136
 
7041
7137
  /**
@@ -7115,6 +7211,8 @@ export declare interface PBUiText {
7115
7211
  fontSize?: number | undefined;
7116
7212
  /** wrap text when the border is reached (default: TW_WRAP) */
7117
7213
  textWrap?: TextWrap | undefined;
7214
+ /** a ttf font file in the scene content or a Google Fonts family name; `font` is the fallback (default: unset) */
7215
+ fontSrc?: string | undefined;
7118
7216
  }
7119
7217
 
7120
7218
  /**
@@ -9500,6 +9598,16 @@ export declare type Transport = {
9500
9598
  onmessage?(message: Uint8Array): void;
9501
9599
  filter(message: Omit<TransportMessage, 'messageBuffer'>): boolean;
9502
9600
  type?: string;
9601
+ /**
9602
+ * Whether this transport is allowed to mutate reserved-range entities
9603
+ * (root/player/camera + avatars, entity number below `RESERVED_STATIC_ENTITIES`).
9604
+ * Only the trusted host/renderer transport sets this. An inbound DELETE_ENTITY
9605
+ * or component operation (PUT_COMPONENT, DELETE_COMPONENT, APPEND_VALUE,
9606
+ * AUTHORITATIVE_PUT_COMPONENT) on a reserved entity from a transport without
9607
+ * this flag (a comms peer, or any scene-added transport) is rejected — see
9608
+ * `receiveMessages`.
9609
+ */
9610
+ allowReservedEntities?: boolean;
9503
9611
  };
9504
9612
 
9505
9613
  /**
@@ -9925,6 +10033,8 @@ export declare interface UiLabelProps {
9925
10033
  textAlign?: TextAlignType | undefined;
9926
10034
  /** Label font type. @defaultValue 'sans-serif' */
9927
10035
  font?: UiFontType | undefined;
10036
+ /** Path to a `.ttf` file in the scene content. `font` is used when it can't be loaded. */
10037
+ fontSrc?: string | undefined;
9928
10038
  /** Behaviour when text reached. @defaultValue 'wrap' */
9929
10039
  textWrap?: UiTextWrapType | undefined;
9930
10040
  }
@@ -10079,6 +10189,14 @@ export declare interface UiTransformProps {
10079
10189
  */
10080
10190
  export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
10081
10191
 
10192
+ export declare type ValidateCallback<T> = (value: {
10193
+ entity: Entity;
10194
+ currentValue: T | undefined;
10195
+ newValue: T | undefined;
10196
+ senderAddress: string;
10197
+ createdBy: string;
10198
+ }) => boolean;
10199
+
10082
10200
  /**
10083
10201
  * @public
10084
10202
  */