@dcl/playground-assets 7.29.1-36591934525.commit-48aa9b5 → 7.29.1-36624944101.commit-bb81ac6
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 +116 -94
- package/dist/beta.d.ts +116 -94
- package/dist/index.bundled.d.ts +116 -94
- package/dist/index.js +7 -7
- package/dist/playground/sdk/apis.d.ts +2 -11
- package/dist/playground/sdk/dcl-sdk.package.json +2 -2
- package/dist/playground-assets.d.ts +116 -94
- package/etc/playground-assets.api.json +1264 -1187
- package/etc/playground-assets.api.md +80 -72
- package/package.json +6 -5
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 */
|
|
@@ -1453,7 +1505,6 @@ export declare const componentDefinitionByName: {
|
|
|
1453
1505
|
"core::CameraMode": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBCameraMode>>;
|
|
1454
1506
|
"core::CameraModeArea": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBCameraModeArea>>;
|
|
1455
1507
|
"core::EngineInfo": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBEngineInfo>>;
|
|
1456
|
-
"core::ExplorerItemPurchaseResult": GSetComponentGetter<GrowOnlyValueSetComponentDefinition<PBExplorerItemPurchaseResult>>;
|
|
1457
1508
|
"core::ExplorerUiEventsResult": GSetComponentGetter<GrowOnlyValueSetComponentDefinition<PBExplorerUiEventsResult>>;
|
|
1458
1509
|
"core::GltfContainer": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBGltfContainer>>;
|
|
1459
1510
|
"core::GltfContainerLoadingState": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBGltfContainerLoadingState>>;
|
|
@@ -1663,12 +1714,12 @@ export declare const CRDT_MESSAGE_HEADER_LENGTH = 8;
|
|
|
1663
1714
|
/**
|
|
1664
1715
|
* @public
|
|
1665
1716
|
*/
|
|
1666
|
-
export declare type CrdtMessage = PutComponentMessage | DeleteComponentMessage | AppendValueMessage | DeleteEntityMessage | PutNetworkComponentMessage | DeleteComponentNetworkMessage | DeleteEntityNetworkMessage;
|
|
1717
|
+
export declare type CrdtMessage = PutComponentMessage | AuthoritativePutComponentMessage | DeleteComponentMessage | AppendValueMessage | DeleteEntityMessage | PutNetworkComponentMessage | DeleteComponentNetworkMessage | DeleteEntityNetworkMessage;
|
|
1667
1718
|
|
|
1668
1719
|
/**
|
|
1669
1720
|
* @public
|
|
1670
1721
|
*/
|
|
1671
|
-
export declare type CrdtMessageBody = PutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessageBody | AppendValueMessageBody | CrdtNetworkMessageBody;
|
|
1722
|
+
export declare type CrdtMessageBody = PutComponentMessageBody | AuthoritativePutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessageBody | AppendValueMessageBody | CrdtNetworkMessageBody;
|
|
1672
1723
|
|
|
1673
1724
|
/**
|
|
1674
1725
|
* Min length = 8 bytes
|
|
@@ -1723,7 +1774,8 @@ export declare enum CrdtMessageType {
|
|
|
1723
1774
|
PUT_COMPONENT_NETWORK = 5,
|
|
1724
1775
|
DELETE_COMPONENT_NETWORK = 6,
|
|
1725
1776
|
DELETE_ENTITY_NETWORK = 7,
|
|
1726
|
-
|
|
1777
|
+
AUTHORITATIVE_PUT_COMPONENT = 8,
|
|
1778
|
+
MAX_MESSAGE_TYPE = 9
|
|
1727
1779
|
}
|
|
1728
1780
|
|
|
1729
1781
|
/**
|
|
@@ -1731,6 +1783,8 @@ export declare enum CrdtMessageType {
|
|
|
1731
1783
|
*/
|
|
1732
1784
|
export declare type CrdtNetworkMessageBody = PutNetworkComponentMessageBody | DeleteComponentNetworkMessageBody | DeleteEntityNetworkMessageBody;
|
|
1733
1785
|
|
|
1786
|
+
export declare const CreatedBy: ICreatedBy;
|
|
1787
|
+
|
|
1734
1788
|
/**
|
|
1735
1789
|
* @public
|
|
1736
1790
|
*/
|
|
@@ -2207,11 +2261,8 @@ export declare type ExcludeUndefined<T> = {
|
|
|
2207
2261
|
*/
|
|
2208
2262
|
export declare const executeTask: (task: Task<unknown>) => void;
|
|
2209
2263
|
|
|
2210
|
-
/** @public */
|
|
2211
|
-
export declare const ExplorerItemPurchaseResult: GrowOnlyValueSetComponentDefinition<PBExplorerItemPurchaseResult>;
|
|
2212
|
-
|
|
2213
2264
|
/**
|
|
2214
|
-
* Identifies which explorer panel OpenExplorerUi targets.
|
|
2265
|
+
* Identifies which fullscreen explorer panel OpenExplorerUi targets.
|
|
2215
2266
|
* EU_SETTINGS holds 0 so an unset `ui` field defaults to the least-intrusive panel.
|
|
2216
2267
|
*/
|
|
2217
2268
|
/**
|
|
@@ -2224,9 +2275,7 @@ export declare const enum ExplorerUi {
|
|
|
2224
2275
|
EU_CAMERA_REEL = 3,
|
|
2225
2276
|
EU_COMMUNITIES = 4,
|
|
2226
2277
|
EU_PLACES = 5,
|
|
2227
|
-
EU_EVENTS = 6
|
|
2228
|
-
/** EU_ITEM_PURCHASE - the item-purchase confirmation modal; see OpenExplorerUi for its parameters and result component */
|
|
2229
|
-
EU_ITEM_PURCHASE = 7
|
|
2278
|
+
EU_EVENTS = 6
|
|
2230
2279
|
}
|
|
2231
2280
|
|
|
2232
2281
|
/** @public */
|
|
@@ -2507,6 +2556,12 @@ export declare interface GrowOnlyValueSetComponentDefinition<T> extends BaseComp
|
|
|
2507
2556
|
|
|
2508
2557
|
export declare type GSetComponentGetter<T extends GrowOnlyValueSetComponentDefinition<any>> = (engine: Pick<IEngine, 'defineValueSetComponentFromSchema'>) => T;
|
|
2509
2558
|
|
|
2559
|
+
export declare type ICreatedBy = LastWriteWinElementSetComponentDefinition<ICreatedByType>;
|
|
2560
|
+
|
|
2561
|
+
export declare interface ICreatedByType {
|
|
2562
|
+
address: string;
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2510
2565
|
/**
|
|
2511
2566
|
* @public
|
|
2512
2567
|
*/
|
|
@@ -2993,6 +3048,35 @@ export declare const enum InteractionType {
|
|
|
2993
3048
|
PROXIMITY = 1
|
|
2994
3049
|
}
|
|
2995
3050
|
|
|
3051
|
+
/**
|
|
3052
|
+
* Internal component interface that exposes all internal methods for SDK use
|
|
3053
|
+
* This is not exposed to users, only for internal SDK operations
|
|
3054
|
+
*/
|
|
3055
|
+
export declare interface InternalBaseComponent<T> extends BaseComponent<T> {
|
|
3056
|
+
/**
|
|
3057
|
+
* @public
|
|
3058
|
+
* Dry run update to check if a CRDT message would be accepted without actually applying it
|
|
3059
|
+
*/
|
|
3060
|
+
__dry_run_updateFromCrdt(body: CrdtMessageBody): ProcessMessageResultType;
|
|
3061
|
+
/**
|
|
3062
|
+
* @public
|
|
3063
|
+
* Get the iterator to every entity has the component
|
|
3064
|
+
*/
|
|
3065
|
+
iterator(): Iterable<[Entity, any]>;
|
|
3066
|
+
/**
|
|
3067
|
+
* @public
|
|
3068
|
+
*/
|
|
3069
|
+
dirtyIterator(): Iterable<Entity>;
|
|
3070
|
+
/**
|
|
3071
|
+
* @public
|
|
3072
|
+
*/
|
|
3073
|
+
__onChangeCallbacks(entity: Entity, value: T): void;
|
|
3074
|
+
/**
|
|
3075
|
+
* @public
|
|
3076
|
+
*/
|
|
3077
|
+
__run_validateBeforeChange(entity: Entity, newValue: T | undefined, senderAddress: string, createdBy: string): boolean;
|
|
3078
|
+
}
|
|
3079
|
+
|
|
2996
3080
|
/**
|
|
2997
3081
|
* @public
|
|
2998
3082
|
*/
|
|
@@ -5280,82 +5364,7 @@ export declare namespace PBEngineInfo {
|
|
|
5280
5364
|
}
|
|
5281
5365
|
|
|
5282
5366
|
/**
|
|
5283
|
-
*
|
|
5284
|
-
* Reports the outcome of an EU_ITEM_PURCHASE flow triggered via OpenExplorerUi.
|
|
5285
|
-
*/
|
|
5286
|
-
/**
|
|
5287
|
-
* @public
|
|
5288
|
-
*/
|
|
5289
|
-
export declare interface PBExplorerItemPurchaseResult {
|
|
5290
|
-
urn: string;
|
|
5291
|
-
/** The scene tick when the event occurred */
|
|
5292
|
-
timestamp: number;
|
|
5293
|
-
/** The OpenExplorerUiRequest.request_id that caused this event; 0 when the request carried none */
|
|
5294
|
-
requestId: number;
|
|
5295
|
-
status?: {
|
|
5296
|
-
$case: "purchased";
|
|
5297
|
-
purchased: PBExplorerItemPurchaseResult_Purchased;
|
|
5298
|
-
} | {
|
|
5299
|
-
$case: "dismissed";
|
|
5300
|
-
dismissed: PBExplorerItemPurchaseResult_Dismissed;
|
|
5301
|
-
} | {
|
|
5302
|
-
$case: "failed";
|
|
5303
|
-
failed: PBExplorerItemPurchaseResult_Failed;
|
|
5304
|
-
} | undefined;
|
|
5305
|
-
}
|
|
5306
|
-
|
|
5307
|
-
/**
|
|
5308
|
-
* @public
|
|
5309
|
-
*/
|
|
5310
|
-
export declare namespace PBExplorerItemPurchaseResult {
|
|
5311
|
-
export function encode(message: PBExplorerItemPurchaseResult, writer?: _m0.Writer): _m0.Writer;
|
|
5312
|
-
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBExplorerItemPurchaseResult;
|
|
5313
|
-
}
|
|
5314
|
-
|
|
5315
|
-
/**
|
|
5316
|
-
* @public
|
|
5317
|
-
*/
|
|
5318
|
-
export declare interface PBExplorerItemPurchaseResult_Dismissed {
|
|
5319
|
-
}
|
|
5320
|
-
|
|
5321
|
-
/**
|
|
5322
|
-
* @public
|
|
5323
|
-
*/
|
|
5324
|
-
export declare namespace PBExplorerItemPurchaseResult_Dismissed {
|
|
5325
|
-
export function encode(_: PBExplorerItemPurchaseResult_Dismissed, writer?: _m0.Writer): _m0.Writer;
|
|
5326
|
-
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBExplorerItemPurchaseResult_Dismissed;
|
|
5327
|
-
}
|
|
5328
|
-
|
|
5329
|
-
/**
|
|
5330
|
-
* @public
|
|
5331
|
-
*/
|
|
5332
|
-
export declare interface PBExplorerItemPurchaseResult_Failed {
|
|
5333
|
-
}
|
|
5334
|
-
|
|
5335
|
-
/**
|
|
5336
|
-
* @public
|
|
5337
|
-
*/
|
|
5338
|
-
export declare namespace PBExplorerItemPurchaseResult_Failed {
|
|
5339
|
-
export function encode(_: PBExplorerItemPurchaseResult_Failed, writer?: _m0.Writer): _m0.Writer;
|
|
5340
|
-
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBExplorerItemPurchaseResult_Failed;
|
|
5341
|
-
}
|
|
5342
|
-
|
|
5343
|
-
/**
|
|
5344
|
-
* @public
|
|
5345
|
-
*/
|
|
5346
|
-
export declare interface PBExplorerItemPurchaseResult_Purchased {
|
|
5347
|
-
}
|
|
5348
|
-
|
|
5349
|
-
/**
|
|
5350
|
-
* @public
|
|
5351
|
-
*/
|
|
5352
|
-
export declare namespace PBExplorerItemPurchaseResult_Purchased {
|
|
5353
|
-
export function encode(_: PBExplorerItemPurchaseResult_Purchased, writer?: _m0.Writer): _m0.Writer;
|
|
5354
|
-
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBExplorerItemPurchaseResult_Purchased;
|
|
5355
|
-
}
|
|
5356
|
-
|
|
5357
|
-
/**
|
|
5358
|
-
* PBExplorerUiEventsResult transports the lifecycle events of explorer UI panels — a panel was
|
|
5367
|
+
* PBExplorerUiEventsResult transports the lifecycle events of fullscreen explorer panels — a panel was
|
|
5359
5368
|
* opened, a panel was closed. It is a grow only value set appended to the scene root entity, so every
|
|
5360
5369
|
* event of a tick is delivered and none overwrites another.
|
|
5361
5370
|
*/
|
|
@@ -5367,8 +5376,6 @@ export declare interface PBExplorerUiEventsResult {
|
|
|
5367
5376
|
ui: ExplorerUi;
|
|
5368
5377
|
/** The scene tick when the event occurred */
|
|
5369
5378
|
timestamp: number;
|
|
5370
|
-
/** The OpenExplorerUiRequest.request_id that caused this event; 0 when the request carried none */
|
|
5371
|
-
requestId: number;
|
|
5372
5379
|
event?: {
|
|
5373
5380
|
$case: "opened";
|
|
5374
5381
|
opened: PBExplorerUiEventsResult_UiOpened;
|
|
@@ -5386,7 +5393,7 @@ export declare namespace PBExplorerUiEventsResult {
|
|
|
5386
5393
|
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBExplorerUiEventsResult;
|
|
5387
5394
|
}
|
|
5388
5395
|
|
|
5389
|
-
/** Emitted when
|
|
5396
|
+
/** Emitted when a fullscreen explorer panel is closed. */
|
|
5390
5397
|
/**
|
|
5391
5398
|
* @public
|
|
5392
5399
|
*/
|
|
@@ -5401,10 +5408,7 @@ export declare namespace PBExplorerUiEventsResult_UiClosed {
|
|
|
5401
5408
|
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBExplorerUiEventsResult_UiClosed;
|
|
5402
5409
|
}
|
|
5403
5410
|
|
|
5404
|
-
/**
|
|
5405
|
-
* Emitted when an explorer panel is opened. The OpenExplorerUi response carries the same fact,
|
|
5406
|
-
* but it reaches only the caller; this channel is scene wide.
|
|
5407
|
-
*/
|
|
5411
|
+
/** Emitted when a fullscreen explorer panel is opened. */
|
|
5408
5412
|
/**
|
|
5409
5413
|
* @public
|
|
5410
5414
|
*/
|
|
@@ -9533,6 +9537,16 @@ export declare type Transport = {
|
|
|
9533
9537
|
onmessage?(message: Uint8Array): void;
|
|
9534
9538
|
filter(message: Omit<TransportMessage, 'messageBuffer'>): boolean;
|
|
9535
9539
|
type?: string;
|
|
9540
|
+
/**
|
|
9541
|
+
* Whether this transport is allowed to mutate reserved-range entities
|
|
9542
|
+
* (root/player/camera + avatars, entity number below `RESERVED_STATIC_ENTITIES`).
|
|
9543
|
+
* Only the trusted host/renderer transport sets this. An inbound DELETE_ENTITY
|
|
9544
|
+
* or component operation (PUT_COMPONENT, DELETE_COMPONENT, APPEND_VALUE,
|
|
9545
|
+
* AUTHORITATIVE_PUT_COMPONENT) on a reserved entity from a transport without
|
|
9546
|
+
* this flag (a comms peer, or any scene-added transport) is rejected — see
|
|
9547
|
+
* `receiveMessages`.
|
|
9548
|
+
*/
|
|
9549
|
+
allowReservedEntities?: boolean;
|
|
9536
9550
|
};
|
|
9537
9551
|
|
|
9538
9552
|
/**
|
|
@@ -10112,6 +10126,14 @@ export declare interface UiTransformProps {
|
|
|
10112
10126
|
*/
|
|
10113
10127
|
export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
|
|
10114
10128
|
|
|
10129
|
+
export declare type ValidateCallback<T> = (value: {
|
|
10130
|
+
entity: Entity;
|
|
10131
|
+
currentValue: T | undefined;
|
|
10132
|
+
newValue: T | undefined;
|
|
10133
|
+
senderAddress: string;
|
|
10134
|
+
createdBy: string;
|
|
10135
|
+
}) => boolean;
|
|
10136
|
+
|
|
10115
10137
|
/**
|
|
10116
10138
|
* @public
|
|
10117
10139
|
*/
|
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 */
|
|
@@ -1453,7 +1505,6 @@ export declare const componentDefinitionByName: {
|
|
|
1453
1505
|
"core::CameraMode": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBCameraMode>>;
|
|
1454
1506
|
"core::CameraModeArea": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBCameraModeArea>>;
|
|
1455
1507
|
"core::EngineInfo": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBEngineInfo>>;
|
|
1456
|
-
"core::ExplorerItemPurchaseResult": GSetComponentGetter<GrowOnlyValueSetComponentDefinition<PBExplorerItemPurchaseResult>>;
|
|
1457
1508
|
"core::ExplorerUiEventsResult": GSetComponentGetter<GrowOnlyValueSetComponentDefinition<PBExplorerUiEventsResult>>;
|
|
1458
1509
|
"core::GltfContainer": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBGltfContainer>>;
|
|
1459
1510
|
"core::GltfContainerLoadingState": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBGltfContainerLoadingState>>;
|
|
@@ -1663,12 +1714,12 @@ export declare const CRDT_MESSAGE_HEADER_LENGTH = 8;
|
|
|
1663
1714
|
/**
|
|
1664
1715
|
* @public
|
|
1665
1716
|
*/
|
|
1666
|
-
export declare type CrdtMessage = PutComponentMessage | DeleteComponentMessage | AppendValueMessage | DeleteEntityMessage | PutNetworkComponentMessage | DeleteComponentNetworkMessage | DeleteEntityNetworkMessage;
|
|
1717
|
+
export declare type CrdtMessage = PutComponentMessage | AuthoritativePutComponentMessage | DeleteComponentMessage | AppendValueMessage | DeleteEntityMessage | PutNetworkComponentMessage | DeleteComponentNetworkMessage | DeleteEntityNetworkMessage;
|
|
1667
1718
|
|
|
1668
1719
|
/**
|
|
1669
1720
|
* @public
|
|
1670
1721
|
*/
|
|
1671
|
-
export declare type CrdtMessageBody = PutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessageBody | AppendValueMessageBody | CrdtNetworkMessageBody;
|
|
1722
|
+
export declare type CrdtMessageBody = PutComponentMessageBody | AuthoritativePutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessageBody | AppendValueMessageBody | CrdtNetworkMessageBody;
|
|
1672
1723
|
|
|
1673
1724
|
/**
|
|
1674
1725
|
* Min length = 8 bytes
|
|
@@ -1723,7 +1774,8 @@ export declare enum CrdtMessageType {
|
|
|
1723
1774
|
PUT_COMPONENT_NETWORK = 5,
|
|
1724
1775
|
DELETE_COMPONENT_NETWORK = 6,
|
|
1725
1776
|
DELETE_ENTITY_NETWORK = 7,
|
|
1726
|
-
|
|
1777
|
+
AUTHORITATIVE_PUT_COMPONENT = 8,
|
|
1778
|
+
MAX_MESSAGE_TYPE = 9
|
|
1727
1779
|
}
|
|
1728
1780
|
|
|
1729
1781
|
/**
|
|
@@ -1731,6 +1783,8 @@ export declare enum CrdtMessageType {
|
|
|
1731
1783
|
*/
|
|
1732
1784
|
export declare type CrdtNetworkMessageBody = PutNetworkComponentMessageBody | DeleteComponentNetworkMessageBody | DeleteEntityNetworkMessageBody;
|
|
1733
1785
|
|
|
1786
|
+
export declare const CreatedBy: ICreatedBy;
|
|
1787
|
+
|
|
1734
1788
|
/**
|
|
1735
1789
|
* @public
|
|
1736
1790
|
*/
|
|
@@ -2207,11 +2261,8 @@ export declare type ExcludeUndefined<T> = {
|
|
|
2207
2261
|
*/
|
|
2208
2262
|
export declare const executeTask: (task: Task<unknown>) => void;
|
|
2209
2263
|
|
|
2210
|
-
/** @public */
|
|
2211
|
-
export declare const ExplorerItemPurchaseResult: GrowOnlyValueSetComponentDefinition<PBExplorerItemPurchaseResult>;
|
|
2212
|
-
|
|
2213
2264
|
/**
|
|
2214
|
-
* Identifies which explorer panel OpenExplorerUi targets.
|
|
2265
|
+
* Identifies which fullscreen explorer panel OpenExplorerUi targets.
|
|
2215
2266
|
* EU_SETTINGS holds 0 so an unset `ui` field defaults to the least-intrusive panel.
|
|
2216
2267
|
*/
|
|
2217
2268
|
/**
|
|
@@ -2224,9 +2275,7 @@ export declare const enum ExplorerUi {
|
|
|
2224
2275
|
EU_CAMERA_REEL = 3,
|
|
2225
2276
|
EU_COMMUNITIES = 4,
|
|
2226
2277
|
EU_PLACES = 5,
|
|
2227
|
-
EU_EVENTS = 6
|
|
2228
|
-
/** EU_ITEM_PURCHASE - the item-purchase confirmation modal; see OpenExplorerUi for its parameters and result component */
|
|
2229
|
-
EU_ITEM_PURCHASE = 7
|
|
2278
|
+
EU_EVENTS = 6
|
|
2230
2279
|
}
|
|
2231
2280
|
|
|
2232
2281
|
/** @public */
|
|
@@ -2507,6 +2556,12 @@ export declare interface GrowOnlyValueSetComponentDefinition<T> extends BaseComp
|
|
|
2507
2556
|
|
|
2508
2557
|
export declare type GSetComponentGetter<T extends GrowOnlyValueSetComponentDefinition<any>> = (engine: Pick<IEngine, 'defineValueSetComponentFromSchema'>) => T;
|
|
2509
2558
|
|
|
2559
|
+
export declare type ICreatedBy = LastWriteWinElementSetComponentDefinition<ICreatedByType>;
|
|
2560
|
+
|
|
2561
|
+
export declare interface ICreatedByType {
|
|
2562
|
+
address: string;
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2510
2565
|
/**
|
|
2511
2566
|
* @public
|
|
2512
2567
|
*/
|
|
@@ -2984,6 +3039,35 @@ export declare const enum InteractionType {
|
|
|
2984
3039
|
PROXIMITY = 1
|
|
2985
3040
|
}
|
|
2986
3041
|
|
|
3042
|
+
/**
|
|
3043
|
+
* Internal component interface that exposes all internal methods for SDK use
|
|
3044
|
+
* This is not exposed to users, only for internal SDK operations
|
|
3045
|
+
*/
|
|
3046
|
+
export declare interface InternalBaseComponent<T> extends BaseComponent<T> {
|
|
3047
|
+
/**
|
|
3048
|
+
* @public
|
|
3049
|
+
* Dry run update to check if a CRDT message would be accepted without actually applying it
|
|
3050
|
+
*/
|
|
3051
|
+
__dry_run_updateFromCrdt(body: CrdtMessageBody): ProcessMessageResultType;
|
|
3052
|
+
/**
|
|
3053
|
+
* @public
|
|
3054
|
+
* Get the iterator to every entity has the component
|
|
3055
|
+
*/
|
|
3056
|
+
iterator(): Iterable<[Entity, any]>;
|
|
3057
|
+
/**
|
|
3058
|
+
* @public
|
|
3059
|
+
*/
|
|
3060
|
+
dirtyIterator(): Iterable<Entity>;
|
|
3061
|
+
/**
|
|
3062
|
+
* @public
|
|
3063
|
+
*/
|
|
3064
|
+
__onChangeCallbacks(entity: Entity, value: T): void;
|
|
3065
|
+
/**
|
|
3066
|
+
* @public
|
|
3067
|
+
*/
|
|
3068
|
+
__run_validateBeforeChange(entity: Entity, newValue: T | undefined, senderAddress: string, createdBy: string): boolean;
|
|
3069
|
+
}
|
|
3070
|
+
|
|
2987
3071
|
/**
|
|
2988
3072
|
* @public
|
|
2989
3073
|
*/
|
|
@@ -5252,82 +5336,7 @@ export declare namespace PBEngineInfo {
|
|
|
5252
5336
|
}
|
|
5253
5337
|
|
|
5254
5338
|
/**
|
|
5255
|
-
*
|
|
5256
|
-
* Reports the outcome of an EU_ITEM_PURCHASE flow triggered via OpenExplorerUi.
|
|
5257
|
-
*/
|
|
5258
|
-
/**
|
|
5259
|
-
* @public
|
|
5260
|
-
*/
|
|
5261
|
-
export declare interface PBExplorerItemPurchaseResult {
|
|
5262
|
-
urn: string;
|
|
5263
|
-
/** The scene tick when the event occurred */
|
|
5264
|
-
timestamp: number;
|
|
5265
|
-
/** The OpenExplorerUiRequest.request_id that caused this event; 0 when the request carried none */
|
|
5266
|
-
requestId: number;
|
|
5267
|
-
status?: {
|
|
5268
|
-
$case: "purchased";
|
|
5269
|
-
purchased: PBExplorerItemPurchaseResult_Purchased;
|
|
5270
|
-
} | {
|
|
5271
|
-
$case: "dismissed";
|
|
5272
|
-
dismissed: PBExplorerItemPurchaseResult_Dismissed;
|
|
5273
|
-
} | {
|
|
5274
|
-
$case: "failed";
|
|
5275
|
-
failed: PBExplorerItemPurchaseResult_Failed;
|
|
5276
|
-
} | undefined;
|
|
5277
|
-
}
|
|
5278
|
-
|
|
5279
|
-
/**
|
|
5280
|
-
* @public
|
|
5281
|
-
*/
|
|
5282
|
-
export declare namespace PBExplorerItemPurchaseResult {
|
|
5283
|
-
export function encode(message: PBExplorerItemPurchaseResult, writer?: _m0.Writer): _m0.Writer;
|
|
5284
|
-
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBExplorerItemPurchaseResult;
|
|
5285
|
-
}
|
|
5286
|
-
|
|
5287
|
-
/**
|
|
5288
|
-
* @public
|
|
5289
|
-
*/
|
|
5290
|
-
export declare interface PBExplorerItemPurchaseResult_Dismissed {
|
|
5291
|
-
}
|
|
5292
|
-
|
|
5293
|
-
/**
|
|
5294
|
-
* @public
|
|
5295
|
-
*/
|
|
5296
|
-
export declare namespace PBExplorerItemPurchaseResult_Dismissed {
|
|
5297
|
-
export function encode(_: PBExplorerItemPurchaseResult_Dismissed, writer?: _m0.Writer): _m0.Writer;
|
|
5298
|
-
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBExplorerItemPurchaseResult_Dismissed;
|
|
5299
|
-
}
|
|
5300
|
-
|
|
5301
|
-
/**
|
|
5302
|
-
* @public
|
|
5303
|
-
*/
|
|
5304
|
-
export declare interface PBExplorerItemPurchaseResult_Failed {
|
|
5305
|
-
}
|
|
5306
|
-
|
|
5307
|
-
/**
|
|
5308
|
-
* @public
|
|
5309
|
-
*/
|
|
5310
|
-
export declare namespace PBExplorerItemPurchaseResult_Failed {
|
|
5311
|
-
export function encode(_: PBExplorerItemPurchaseResult_Failed, writer?: _m0.Writer): _m0.Writer;
|
|
5312
|
-
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBExplorerItemPurchaseResult_Failed;
|
|
5313
|
-
}
|
|
5314
|
-
|
|
5315
|
-
/**
|
|
5316
|
-
* @public
|
|
5317
|
-
*/
|
|
5318
|
-
export declare interface PBExplorerItemPurchaseResult_Purchased {
|
|
5319
|
-
}
|
|
5320
|
-
|
|
5321
|
-
/**
|
|
5322
|
-
* @public
|
|
5323
|
-
*/
|
|
5324
|
-
export declare namespace PBExplorerItemPurchaseResult_Purchased {
|
|
5325
|
-
export function encode(_: PBExplorerItemPurchaseResult_Purchased, writer?: _m0.Writer): _m0.Writer;
|
|
5326
|
-
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBExplorerItemPurchaseResult_Purchased;
|
|
5327
|
-
}
|
|
5328
|
-
|
|
5329
|
-
/**
|
|
5330
|
-
* PBExplorerUiEventsResult transports the lifecycle events of explorer UI panels — a panel was
|
|
5339
|
+
* PBExplorerUiEventsResult transports the lifecycle events of fullscreen explorer panels — a panel was
|
|
5331
5340
|
* opened, a panel was closed. It is a grow only value set appended to the scene root entity, so every
|
|
5332
5341
|
* event of a tick is delivered and none overwrites another.
|
|
5333
5342
|
*/
|
|
@@ -5339,8 +5348,6 @@ export declare interface PBExplorerUiEventsResult {
|
|
|
5339
5348
|
ui: ExplorerUi;
|
|
5340
5349
|
/** The scene tick when the event occurred */
|
|
5341
5350
|
timestamp: number;
|
|
5342
|
-
/** The OpenExplorerUiRequest.request_id that caused this event; 0 when the request carried none */
|
|
5343
|
-
requestId: number;
|
|
5344
5351
|
event?: {
|
|
5345
5352
|
$case: "opened";
|
|
5346
5353
|
opened: PBExplorerUiEventsResult_UiOpened;
|
|
@@ -5358,7 +5365,7 @@ export declare namespace PBExplorerUiEventsResult {
|
|
|
5358
5365
|
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBExplorerUiEventsResult;
|
|
5359
5366
|
}
|
|
5360
5367
|
|
|
5361
|
-
/** Emitted when
|
|
5368
|
+
/** Emitted when a fullscreen explorer panel is closed. */
|
|
5362
5369
|
/**
|
|
5363
5370
|
* @public
|
|
5364
5371
|
*/
|
|
@@ -5373,10 +5380,7 @@ export declare namespace PBExplorerUiEventsResult_UiClosed {
|
|
|
5373
5380
|
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBExplorerUiEventsResult_UiClosed;
|
|
5374
5381
|
}
|
|
5375
5382
|
|
|
5376
|
-
/**
|
|
5377
|
-
* Emitted when an explorer panel is opened. The OpenExplorerUi response carries the same fact,
|
|
5378
|
-
* but it reaches only the caller; this channel is scene wide.
|
|
5379
|
-
*/
|
|
5383
|
+
/** Emitted when a fullscreen explorer panel is opened. */
|
|
5380
5384
|
/**
|
|
5381
5385
|
* @public
|
|
5382
5386
|
*/
|
|
@@ -9500,6 +9504,16 @@ export declare type Transport = {
|
|
|
9500
9504
|
onmessage?(message: Uint8Array): void;
|
|
9501
9505
|
filter(message: Omit<TransportMessage, 'messageBuffer'>): boolean;
|
|
9502
9506
|
type?: string;
|
|
9507
|
+
/**
|
|
9508
|
+
* Whether this transport is allowed to mutate reserved-range entities
|
|
9509
|
+
* (root/player/camera + avatars, entity number below `RESERVED_STATIC_ENTITIES`).
|
|
9510
|
+
* Only the trusted host/renderer transport sets this. An inbound DELETE_ENTITY
|
|
9511
|
+
* or component operation (PUT_COMPONENT, DELETE_COMPONENT, APPEND_VALUE,
|
|
9512
|
+
* AUTHORITATIVE_PUT_COMPONENT) on a reserved entity from a transport without
|
|
9513
|
+
* this flag (a comms peer, or any scene-added transport) is rejected — see
|
|
9514
|
+
* `receiveMessages`.
|
|
9515
|
+
*/
|
|
9516
|
+
allowReservedEntities?: boolean;
|
|
9503
9517
|
};
|
|
9504
9518
|
|
|
9505
9519
|
/**
|
|
@@ -10079,6 +10093,14 @@ export declare interface UiTransformProps {
|
|
|
10079
10093
|
*/
|
|
10080
10094
|
export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
|
|
10081
10095
|
|
|
10096
|
+
export declare type ValidateCallback<T> = (value: {
|
|
10097
|
+
entity: Entity;
|
|
10098
|
+
currentValue: T | undefined;
|
|
10099
|
+
newValue: T | undefined;
|
|
10100
|
+
senderAddress: string;
|
|
10101
|
+
createdBy: string;
|
|
10102
|
+
}) => boolean;
|
|
10103
|
+
|
|
10082
10104
|
/**
|
|
10083
10105
|
* @public
|
|
10084
10106
|
*/
|