@dcl/playground-assets 7.30.1 → 7.30.2-37807847179.commit-24c42ea
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 +111 -3
- package/dist/beta.d.ts +111 -3
- package/dist/index.bundled.d.ts +111 -3
- package/dist/index.js +7 -7
- package/dist/playground/sdk/dcl-sdk.package.json +2 -2
- package/dist/playground-assets.d.ts +111 -3
- package/etc/playground-assets.api.json +1001 -4
- package/etc/playground-assets.api.md +80 -3
- package/package.json +6 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/sdk",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "7.30.
|
|
4
|
+
"version": "7.30.2-37807847179.commit-24c42ea",
|
|
5
5
|
"author": "Decentraland",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@dcl/ecs": "file:../ecs",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
},
|
|
34
34
|
"types": "./index.d.ts",
|
|
35
35
|
"typings": "./index.d.ts",
|
|
36
|
-
"commit": "
|
|
36
|
+
"commit": "24c42ea8e31e33815f98d9d436acc3507569de11"
|
|
37
37
|
}
|
|
@@ -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
|
-
|
|
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
|
*/
|
|
@@ -9533,6 +9623,16 @@ export declare type Transport = {
|
|
|
9533
9623
|
onmessage?(message: Uint8Array): void;
|
|
9534
9624
|
filter(message: Omit<TransportMessage, 'messageBuffer'>): boolean;
|
|
9535
9625
|
type?: string;
|
|
9626
|
+
/**
|
|
9627
|
+
* Whether this transport is allowed to mutate reserved-range entities
|
|
9628
|
+
* (root/player/camera + avatars, entity number below `RESERVED_STATIC_ENTITIES`).
|
|
9629
|
+
* Only the trusted host/renderer transport sets this. An inbound DELETE_ENTITY
|
|
9630
|
+
* or component operation (PUT_COMPONENT, DELETE_COMPONENT, APPEND_VALUE,
|
|
9631
|
+
* AUTHORITATIVE_PUT_COMPONENT) on a reserved entity from a transport without
|
|
9632
|
+
* this flag (a comms peer, or any scene-added transport) is rejected — see
|
|
9633
|
+
* `receiveMessages`.
|
|
9634
|
+
*/
|
|
9635
|
+
allowReservedEntities?: boolean;
|
|
9536
9636
|
};
|
|
9537
9637
|
|
|
9538
9638
|
/**
|
|
@@ -10112,6 +10212,14 @@ export declare interface UiTransformProps {
|
|
|
10112
10212
|
*/
|
|
10113
10213
|
export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
|
|
10114
10214
|
|
|
10215
|
+
export declare type ValidateCallback<T> = (value: {
|
|
10216
|
+
entity: Entity;
|
|
10217
|
+
currentValue: T | undefined;
|
|
10218
|
+
newValue: T | undefined;
|
|
10219
|
+
senderAddress: string;
|
|
10220
|
+
createdBy: string;
|
|
10221
|
+
}) => boolean;
|
|
10222
|
+
|
|
10115
10223
|
/**
|
|
10116
10224
|
* @public
|
|
10117
10225
|
*/
|