@dcl/playground-assets 7.29.1-35154657340.commit-e2bbcc9 → 7.29.1-35290475382.commit-201a8a3
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 +7 -111
- package/dist/beta.d.ts +7 -111
- package/dist/index.bundled.d.ts +7 -111
- package/dist/index.js +7 -7
- package/dist/playground/sdk/dcl-sdk.package.json +2 -2
- package/dist/playground-assets.d.ts +7 -111
- package/etc/playground-assets.api.json +31 -1001
- package/etc/playground-assets.api.md +6 -80
- package/package.json +5 -6
package/dist/alpha.d.ts
CHANGED
|
@@ -245,42 +245,6 @@ 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
|
-
|
|
284
248
|
/** AvatarAnchorPointType determines the part of the avatar's body that anchors the Entity. */
|
|
285
249
|
/**
|
|
286
250
|
* @public
|
|
@@ -456,22 +420,6 @@ export declare interface BaseComponent<T> {
|
|
|
456
420
|
* If the value is undefined, the component was deleted.
|
|
457
421
|
*/
|
|
458
422
|
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;
|
|
475
423
|
}
|
|
476
424
|
|
|
477
425
|
/** @public */
|
|
@@ -1714,12 +1662,12 @@ export declare const CRDT_MESSAGE_HEADER_LENGTH = 8;
|
|
|
1714
1662
|
/**
|
|
1715
1663
|
* @public
|
|
1716
1664
|
*/
|
|
1717
|
-
export declare type CrdtMessage = PutComponentMessage |
|
|
1665
|
+
export declare type CrdtMessage = PutComponentMessage | DeleteComponentMessage | AppendValueMessage | DeleteEntityMessage | PutNetworkComponentMessage | DeleteComponentNetworkMessage | DeleteEntityNetworkMessage;
|
|
1718
1666
|
|
|
1719
1667
|
/**
|
|
1720
1668
|
* @public
|
|
1721
1669
|
*/
|
|
1722
|
-
export declare type CrdtMessageBody = PutComponentMessageBody |
|
|
1670
|
+
export declare type CrdtMessageBody = PutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessageBody | AppendValueMessageBody | CrdtNetworkMessageBody;
|
|
1723
1671
|
|
|
1724
1672
|
/**
|
|
1725
1673
|
* Min length = 8 bytes
|
|
@@ -1774,8 +1722,7 @@ export declare enum CrdtMessageType {
|
|
|
1774
1722
|
PUT_COMPONENT_NETWORK = 5,
|
|
1775
1723
|
DELETE_COMPONENT_NETWORK = 6,
|
|
1776
1724
|
DELETE_ENTITY_NETWORK = 7,
|
|
1777
|
-
|
|
1778
|
-
MAX_MESSAGE_TYPE = 9
|
|
1725
|
+
MAX_MESSAGE_TYPE = 8
|
|
1779
1726
|
}
|
|
1780
1727
|
|
|
1781
1728
|
/**
|
|
@@ -1783,8 +1730,6 @@ export declare enum CrdtMessageType {
|
|
|
1783
1730
|
*/
|
|
1784
1731
|
export declare type CrdtNetworkMessageBody = PutNetworkComponentMessageBody | DeleteComponentNetworkMessageBody | DeleteEntityNetworkMessageBody;
|
|
1785
1732
|
|
|
1786
|
-
export declare const CreatedBy: ICreatedBy;
|
|
1787
|
-
|
|
1788
1733
|
/**
|
|
1789
1734
|
* @public
|
|
1790
1735
|
*/
|
|
@@ -2556,12 +2501,6 @@ export declare interface GrowOnlyValueSetComponentDefinition<T> extends BaseComp
|
|
|
2556
2501
|
|
|
2557
2502
|
export declare type GSetComponentGetter<T extends GrowOnlyValueSetComponentDefinition<any>> = (engine: Pick<IEngine, 'defineValueSetComponentFromSchema'>) => T;
|
|
2558
2503
|
|
|
2559
|
-
export declare type ICreatedBy = LastWriteWinElementSetComponentDefinition<ICreatedByType>;
|
|
2560
|
-
|
|
2561
|
-
export declare interface ICreatedByType {
|
|
2562
|
-
address: string;
|
|
2563
|
-
}
|
|
2564
|
-
|
|
2565
2504
|
/**
|
|
2566
2505
|
* @public
|
|
2567
2506
|
*/
|
|
@@ -2825,6 +2764,10 @@ export declare interface IEvents {
|
|
|
2825
2764
|
sender: string;
|
|
2826
2765
|
message: string;
|
|
2827
2766
|
};
|
|
2767
|
+
/** Triggered when the player switches the client language. `locale` is a BCP-47 tag */
|
|
2768
|
+
localeChanged: {
|
|
2769
|
+
locale: string;
|
|
2770
|
+
};
|
|
2828
2771
|
/**
|
|
2829
2772
|
* This is triggered once the scene should start.
|
|
2830
2773
|
*/
|
|
@@ -3044,35 +2987,6 @@ export declare const enum InteractionType {
|
|
|
3044
2987
|
PROXIMITY = 1
|
|
3045
2988
|
}
|
|
3046
2989
|
|
|
3047
|
-
/**
|
|
3048
|
-
* Internal component interface that exposes all internal methods for SDK use
|
|
3049
|
-
* This is not exposed to users, only for internal SDK operations
|
|
3050
|
-
*/
|
|
3051
|
-
export declare interface InternalBaseComponent<T> extends BaseComponent<T> {
|
|
3052
|
-
/**
|
|
3053
|
-
* @public
|
|
3054
|
-
* Dry run update to check if a CRDT message would be accepted without actually applying it
|
|
3055
|
-
*/
|
|
3056
|
-
__dry_run_updateFromCrdt(body: CrdtMessageBody): ProcessMessageResultType;
|
|
3057
|
-
/**
|
|
3058
|
-
* @public
|
|
3059
|
-
* Get the iterator to every entity has the component
|
|
3060
|
-
*/
|
|
3061
|
-
iterator(): Iterable<[Entity, any]>;
|
|
3062
|
-
/**
|
|
3063
|
-
* @public
|
|
3064
|
-
*/
|
|
3065
|
-
dirtyIterator(): Iterable<Entity>;
|
|
3066
|
-
/**
|
|
3067
|
-
* @public
|
|
3068
|
-
*/
|
|
3069
|
-
__onChangeCallbacks(entity: Entity, value: T): void;
|
|
3070
|
-
/**
|
|
3071
|
-
* @public
|
|
3072
|
-
*/
|
|
3073
|
-
__run_validateBeforeChange(entity: Entity, newValue: T | undefined, senderAddress: string, createdBy: string): boolean;
|
|
3074
|
-
}
|
|
3075
|
-
|
|
3076
2990
|
/**
|
|
3077
2991
|
* @public
|
|
3078
2992
|
*/
|
|
@@ -9533,16 +9447,6 @@ export declare type Transport = {
|
|
|
9533
9447
|
onmessage?(message: Uint8Array): void;
|
|
9534
9448
|
filter(message: Omit<TransportMessage, 'messageBuffer'>): boolean;
|
|
9535
9449
|
type?: string;
|
|
9536
|
-
/**
|
|
9537
|
-
* Whether this transport is allowed to mutate reserved-range entities
|
|
9538
|
-
* (root/player/camera + avatars, entity number below `RESERVED_STATIC_ENTITIES`).
|
|
9539
|
-
* Only the trusted host/renderer transport sets this. An inbound DELETE_ENTITY
|
|
9540
|
-
* or component operation (PUT_COMPONENT, DELETE_COMPONENT, APPEND_VALUE,
|
|
9541
|
-
* AUTHORITATIVE_PUT_COMPONENT) on a reserved entity from a transport without
|
|
9542
|
-
* this flag (a comms peer, or any scene-added transport) is rejected — see
|
|
9543
|
-
* `receiveMessages`.
|
|
9544
|
-
*/
|
|
9545
|
-
allowReservedEntities?: boolean;
|
|
9546
9450
|
};
|
|
9547
9451
|
|
|
9548
9452
|
/**
|
|
@@ -10121,14 +10025,6 @@ export declare interface UiTransformProps {
|
|
|
10121
10025
|
*/
|
|
10122
10026
|
export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
|
|
10123
10027
|
|
|
10124
|
-
export declare type ValidateCallback<T> = (value: {
|
|
10125
|
-
entity: Entity;
|
|
10126
|
-
currentValue: T | undefined;
|
|
10127
|
-
newValue: T | undefined;
|
|
10128
|
-
senderAddress: string;
|
|
10129
|
-
createdBy: string;
|
|
10130
|
-
}) => boolean;
|
|
10131
|
-
|
|
10132
10028
|
/**
|
|
10133
10029
|
* @public
|
|
10134
10030
|
*/
|
package/dist/beta.d.ts
CHANGED
|
@@ -245,42 +245,6 @@ 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
|
-
|
|
284
248
|
/** AvatarAnchorPointType determines the part of the avatar's body that anchors the Entity. */
|
|
285
249
|
/**
|
|
286
250
|
* @public
|
|
@@ -456,22 +420,6 @@ export declare interface BaseComponent<T> {
|
|
|
456
420
|
* If the value is undefined, the component was deleted.
|
|
457
421
|
*/
|
|
458
422
|
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;
|
|
475
423
|
}
|
|
476
424
|
|
|
477
425
|
/** @public */
|
|
@@ -1714,12 +1662,12 @@ export declare const CRDT_MESSAGE_HEADER_LENGTH = 8;
|
|
|
1714
1662
|
/**
|
|
1715
1663
|
* @public
|
|
1716
1664
|
*/
|
|
1717
|
-
export declare type CrdtMessage = PutComponentMessage |
|
|
1665
|
+
export declare type CrdtMessage = PutComponentMessage | DeleteComponentMessage | AppendValueMessage | DeleteEntityMessage | PutNetworkComponentMessage | DeleteComponentNetworkMessage | DeleteEntityNetworkMessage;
|
|
1718
1666
|
|
|
1719
1667
|
/**
|
|
1720
1668
|
* @public
|
|
1721
1669
|
*/
|
|
1722
|
-
export declare type CrdtMessageBody = PutComponentMessageBody |
|
|
1670
|
+
export declare type CrdtMessageBody = PutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessageBody | AppendValueMessageBody | CrdtNetworkMessageBody;
|
|
1723
1671
|
|
|
1724
1672
|
/**
|
|
1725
1673
|
* Min length = 8 bytes
|
|
@@ -1774,8 +1722,7 @@ export declare enum CrdtMessageType {
|
|
|
1774
1722
|
PUT_COMPONENT_NETWORK = 5,
|
|
1775
1723
|
DELETE_COMPONENT_NETWORK = 6,
|
|
1776
1724
|
DELETE_ENTITY_NETWORK = 7,
|
|
1777
|
-
|
|
1778
|
-
MAX_MESSAGE_TYPE = 9
|
|
1725
|
+
MAX_MESSAGE_TYPE = 8
|
|
1779
1726
|
}
|
|
1780
1727
|
|
|
1781
1728
|
/**
|
|
@@ -1783,8 +1730,6 @@ export declare enum CrdtMessageType {
|
|
|
1783
1730
|
*/
|
|
1784
1731
|
export declare type CrdtNetworkMessageBody = PutNetworkComponentMessageBody | DeleteComponentNetworkMessageBody | DeleteEntityNetworkMessageBody;
|
|
1785
1732
|
|
|
1786
|
-
export declare const CreatedBy: ICreatedBy;
|
|
1787
|
-
|
|
1788
1733
|
/**
|
|
1789
1734
|
* @public
|
|
1790
1735
|
*/
|
|
@@ -2556,12 +2501,6 @@ export declare interface GrowOnlyValueSetComponentDefinition<T> extends BaseComp
|
|
|
2556
2501
|
|
|
2557
2502
|
export declare type GSetComponentGetter<T extends GrowOnlyValueSetComponentDefinition<any>> = (engine: Pick<IEngine, 'defineValueSetComponentFromSchema'>) => T;
|
|
2558
2503
|
|
|
2559
|
-
export declare type ICreatedBy = LastWriteWinElementSetComponentDefinition<ICreatedByType>;
|
|
2560
|
-
|
|
2561
|
-
export declare interface ICreatedByType {
|
|
2562
|
-
address: string;
|
|
2563
|
-
}
|
|
2564
|
-
|
|
2565
2504
|
/**
|
|
2566
2505
|
* @public
|
|
2567
2506
|
*/
|
|
@@ -2816,6 +2755,10 @@ export declare interface IEvents {
|
|
|
2816
2755
|
sender: string;
|
|
2817
2756
|
message: string;
|
|
2818
2757
|
};
|
|
2758
|
+
/** Triggered when the player switches the client language. `locale` is a BCP-47 tag */
|
|
2759
|
+
localeChanged: {
|
|
2760
|
+
locale: string;
|
|
2761
|
+
};
|
|
2819
2762
|
/**
|
|
2820
2763
|
* This is triggered once the scene should start.
|
|
2821
2764
|
*/
|
|
@@ -3035,35 +2978,6 @@ export declare const enum InteractionType {
|
|
|
3035
2978
|
PROXIMITY = 1
|
|
3036
2979
|
}
|
|
3037
2980
|
|
|
3038
|
-
/**
|
|
3039
|
-
* Internal component interface that exposes all internal methods for SDK use
|
|
3040
|
-
* This is not exposed to users, only for internal SDK operations
|
|
3041
|
-
*/
|
|
3042
|
-
export declare interface InternalBaseComponent<T> extends BaseComponent<T> {
|
|
3043
|
-
/**
|
|
3044
|
-
* @public
|
|
3045
|
-
* Dry run update to check if a CRDT message would be accepted without actually applying it
|
|
3046
|
-
*/
|
|
3047
|
-
__dry_run_updateFromCrdt(body: CrdtMessageBody): ProcessMessageResultType;
|
|
3048
|
-
/**
|
|
3049
|
-
* @public
|
|
3050
|
-
* Get the iterator to every entity has the component
|
|
3051
|
-
*/
|
|
3052
|
-
iterator(): Iterable<[Entity, any]>;
|
|
3053
|
-
/**
|
|
3054
|
-
* @public
|
|
3055
|
-
*/
|
|
3056
|
-
dirtyIterator(): Iterable<Entity>;
|
|
3057
|
-
/**
|
|
3058
|
-
* @public
|
|
3059
|
-
*/
|
|
3060
|
-
__onChangeCallbacks(entity: Entity, value: T): void;
|
|
3061
|
-
/**
|
|
3062
|
-
* @public
|
|
3063
|
-
*/
|
|
3064
|
-
__run_validateBeforeChange(entity: Entity, newValue: T | undefined, senderAddress: string, createdBy: string): boolean;
|
|
3065
|
-
}
|
|
3066
|
-
|
|
3067
2981
|
/**
|
|
3068
2982
|
* @public
|
|
3069
2983
|
*/
|
|
@@ -9500,16 +9414,6 @@ export declare type Transport = {
|
|
|
9500
9414
|
onmessage?(message: Uint8Array): void;
|
|
9501
9415
|
filter(message: Omit<TransportMessage, 'messageBuffer'>): boolean;
|
|
9502
9416
|
type?: string;
|
|
9503
|
-
/**
|
|
9504
|
-
* Whether this transport is allowed to mutate reserved-range entities
|
|
9505
|
-
* (root/player/camera + avatars, entity number below `RESERVED_STATIC_ENTITIES`).
|
|
9506
|
-
* Only the trusted host/renderer transport sets this. An inbound DELETE_ENTITY
|
|
9507
|
-
* or component operation (PUT_COMPONENT, DELETE_COMPONENT, APPEND_VALUE,
|
|
9508
|
-
* AUTHORITATIVE_PUT_COMPONENT) on a reserved entity from a transport without
|
|
9509
|
-
* this flag (a comms peer, or any scene-added transport) is rejected — see
|
|
9510
|
-
* `receiveMessages`.
|
|
9511
|
-
*/
|
|
9512
|
-
allowReservedEntities?: boolean;
|
|
9513
9417
|
};
|
|
9514
9418
|
|
|
9515
9419
|
/**
|
|
@@ -10088,14 +9992,6 @@ export declare interface UiTransformProps {
|
|
|
10088
9992
|
*/
|
|
10089
9993
|
export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
|
|
10090
9994
|
|
|
10091
|
-
export declare type ValidateCallback<T> = (value: {
|
|
10092
|
-
entity: Entity;
|
|
10093
|
-
currentValue: T | undefined;
|
|
10094
|
-
newValue: T | undefined;
|
|
10095
|
-
senderAddress: string;
|
|
10096
|
-
createdBy: string;
|
|
10097
|
-
}) => boolean;
|
|
10098
|
-
|
|
10099
9995
|
/**
|
|
10100
9996
|
* @public
|
|
10101
9997
|
*/
|
package/dist/index.bundled.d.ts
CHANGED
|
@@ -245,42 +245,6 @@ 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
|
-
|
|
284
248
|
/** AvatarAnchorPointType determines the part of the avatar's body that anchors the Entity. */
|
|
285
249
|
/**
|
|
286
250
|
* @public
|
|
@@ -456,22 +420,6 @@ export declare interface BaseComponent<T> {
|
|
|
456
420
|
* If the value is undefined, the component was deleted.
|
|
457
421
|
*/
|
|
458
422
|
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;
|
|
475
423
|
}
|
|
476
424
|
|
|
477
425
|
/** @public */
|
|
@@ -1714,12 +1662,12 @@ export declare const CRDT_MESSAGE_HEADER_LENGTH = 8;
|
|
|
1714
1662
|
/**
|
|
1715
1663
|
* @public
|
|
1716
1664
|
*/
|
|
1717
|
-
export declare type CrdtMessage = PutComponentMessage |
|
|
1665
|
+
export declare type CrdtMessage = PutComponentMessage | DeleteComponentMessage | AppendValueMessage | DeleteEntityMessage | PutNetworkComponentMessage | DeleteComponentNetworkMessage | DeleteEntityNetworkMessage;
|
|
1718
1666
|
|
|
1719
1667
|
/**
|
|
1720
1668
|
* @public
|
|
1721
1669
|
*/
|
|
1722
|
-
export declare type CrdtMessageBody = PutComponentMessageBody |
|
|
1670
|
+
export declare type CrdtMessageBody = PutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessageBody | AppendValueMessageBody | CrdtNetworkMessageBody;
|
|
1723
1671
|
|
|
1724
1672
|
/**
|
|
1725
1673
|
* Min length = 8 bytes
|
|
@@ -1774,8 +1722,7 @@ export declare enum CrdtMessageType {
|
|
|
1774
1722
|
PUT_COMPONENT_NETWORK = 5,
|
|
1775
1723
|
DELETE_COMPONENT_NETWORK = 6,
|
|
1776
1724
|
DELETE_ENTITY_NETWORK = 7,
|
|
1777
|
-
|
|
1778
|
-
MAX_MESSAGE_TYPE = 9
|
|
1725
|
+
MAX_MESSAGE_TYPE = 8
|
|
1779
1726
|
}
|
|
1780
1727
|
|
|
1781
1728
|
/**
|
|
@@ -1783,8 +1730,6 @@ export declare enum CrdtMessageType {
|
|
|
1783
1730
|
*/
|
|
1784
1731
|
export declare type CrdtNetworkMessageBody = PutNetworkComponentMessageBody | DeleteComponentNetworkMessageBody | DeleteEntityNetworkMessageBody;
|
|
1785
1732
|
|
|
1786
|
-
export declare const CreatedBy: ICreatedBy;
|
|
1787
|
-
|
|
1788
1733
|
/**
|
|
1789
1734
|
* @public
|
|
1790
1735
|
*/
|
|
@@ -2556,12 +2501,6 @@ export declare interface GrowOnlyValueSetComponentDefinition<T> extends BaseComp
|
|
|
2556
2501
|
|
|
2557
2502
|
export declare type GSetComponentGetter<T extends GrowOnlyValueSetComponentDefinition<any>> = (engine: Pick<IEngine, 'defineValueSetComponentFromSchema'>) => T;
|
|
2558
2503
|
|
|
2559
|
-
export declare type ICreatedBy = LastWriteWinElementSetComponentDefinition<ICreatedByType>;
|
|
2560
|
-
|
|
2561
|
-
export declare interface ICreatedByType {
|
|
2562
|
-
address: string;
|
|
2563
|
-
}
|
|
2564
|
-
|
|
2565
2504
|
/**
|
|
2566
2505
|
* @public
|
|
2567
2506
|
*/
|
|
@@ -2816,6 +2755,10 @@ export declare interface IEvents {
|
|
|
2816
2755
|
sender: string;
|
|
2817
2756
|
message: string;
|
|
2818
2757
|
};
|
|
2758
|
+
/** Triggered when the player switches the client language. `locale` is a BCP-47 tag */
|
|
2759
|
+
localeChanged: {
|
|
2760
|
+
locale: string;
|
|
2761
|
+
};
|
|
2819
2762
|
/**
|
|
2820
2763
|
* This is triggered once the scene should start.
|
|
2821
2764
|
*/
|
|
@@ -3035,35 +2978,6 @@ export declare const enum InteractionType {
|
|
|
3035
2978
|
PROXIMITY = 1
|
|
3036
2979
|
}
|
|
3037
2980
|
|
|
3038
|
-
/**
|
|
3039
|
-
* Internal component interface that exposes all internal methods for SDK use
|
|
3040
|
-
* This is not exposed to users, only for internal SDK operations
|
|
3041
|
-
*/
|
|
3042
|
-
export declare interface InternalBaseComponent<T> extends BaseComponent<T> {
|
|
3043
|
-
/**
|
|
3044
|
-
* @public
|
|
3045
|
-
* Dry run update to check if a CRDT message would be accepted without actually applying it
|
|
3046
|
-
*/
|
|
3047
|
-
__dry_run_updateFromCrdt(body: CrdtMessageBody): ProcessMessageResultType;
|
|
3048
|
-
/**
|
|
3049
|
-
* @public
|
|
3050
|
-
* Get the iterator to every entity has the component
|
|
3051
|
-
*/
|
|
3052
|
-
iterator(): Iterable<[Entity, any]>;
|
|
3053
|
-
/**
|
|
3054
|
-
* @public
|
|
3055
|
-
*/
|
|
3056
|
-
dirtyIterator(): Iterable<Entity>;
|
|
3057
|
-
/**
|
|
3058
|
-
* @public
|
|
3059
|
-
*/
|
|
3060
|
-
__onChangeCallbacks(entity: Entity, value: T): void;
|
|
3061
|
-
/**
|
|
3062
|
-
* @public
|
|
3063
|
-
*/
|
|
3064
|
-
__run_validateBeforeChange(entity: Entity, newValue: T | undefined, senderAddress: string, createdBy: string): boolean;
|
|
3065
|
-
}
|
|
3066
|
-
|
|
3067
2981
|
/**
|
|
3068
2982
|
* @public
|
|
3069
2983
|
*/
|
|
@@ -9500,16 +9414,6 @@ export declare type Transport = {
|
|
|
9500
9414
|
onmessage?(message: Uint8Array): void;
|
|
9501
9415
|
filter(message: Omit<TransportMessage, 'messageBuffer'>): boolean;
|
|
9502
9416
|
type?: string;
|
|
9503
|
-
/**
|
|
9504
|
-
* Whether this transport is allowed to mutate reserved-range entities
|
|
9505
|
-
* (root/player/camera + avatars, entity number below `RESERVED_STATIC_ENTITIES`).
|
|
9506
|
-
* Only the trusted host/renderer transport sets this. An inbound DELETE_ENTITY
|
|
9507
|
-
* or component operation (PUT_COMPONENT, DELETE_COMPONENT, APPEND_VALUE,
|
|
9508
|
-
* AUTHORITATIVE_PUT_COMPONENT) on a reserved entity from a transport without
|
|
9509
|
-
* this flag (a comms peer, or any scene-added transport) is rejected — see
|
|
9510
|
-
* `receiveMessages`.
|
|
9511
|
-
*/
|
|
9512
|
-
allowReservedEntities?: boolean;
|
|
9513
9417
|
};
|
|
9514
9418
|
|
|
9515
9419
|
/**
|
|
@@ -10088,14 +9992,6 @@ export declare interface UiTransformProps {
|
|
|
10088
9992
|
*/
|
|
10089
9993
|
export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
|
|
10090
9994
|
|
|
10091
|
-
export declare type ValidateCallback<T> = (value: {
|
|
10092
|
-
entity: Entity;
|
|
10093
|
-
currentValue: T | undefined;
|
|
10094
|
-
newValue: T | undefined;
|
|
10095
|
-
senderAddress: string;
|
|
10096
|
-
createdBy: string;
|
|
10097
|
-
}) => boolean;
|
|
10098
|
-
|
|
10099
9995
|
/**
|
|
10100
9996
|
* @public
|
|
10101
9997
|
*/
|