@dcl/playground-assets 7.4.4 → 7.4.5-8054791102.commit-f06a0a7
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 +385 -1
- package/dist/beta.d.ts +382 -9
- package/dist/index.bundled.d.ts +382 -9
- package/dist/index.js.map +2 -2
- package/dist/playground/sdk/dcl-sdk.package.json +2 -2
- package/dist/playground-assets.d.ts +385 -1
- package/etc/playground-assets.api.json +90 -237
- package/etc/playground-assets.api.md +23 -126
- package/package.json +4 -4
package/dist/alpha.d.ts
CHANGED
@@ -1451,6 +1451,25 @@ export declare function createEntityContainer(opts?: {
|
|
1451
1451
|
reservedStaticEntities: number;
|
1452
1452
|
}): IEntityContainer;
|
1453
1453
|
|
1454
|
+
/**
|
1455
|
+
* This module is exposed by the sdk via `@dcl/sdk/etherum-provider`
|
1456
|
+
*
|
1457
|
+
|
1458
|
+
* @example
|
1459
|
+
* ```tsx
|
1460
|
+
* import { createEthereumProvider } from '@dcl/sdk/ethereum-provider'
|
1461
|
+
* import { ethers } from 'ethers'
|
1462
|
+
|
1463
|
+
* const provider = new ethers.providers.Web3Provider(createEthereumProvider() as any)
|
1464
|
+
* ```
|
1465
|
+
*
|
1466
|
+
* @module Etherum Provider
|
1467
|
+
*
|
1468
|
+
*/
|
1469
|
+
/**
|
1470
|
+
* Etherum Provider
|
1471
|
+
* @public
|
1472
|
+
*/
|
1454
1473
|
export declare function createEthereumProvider(): {
|
1455
1474
|
send(message: RPCSendableMessage, callback?: ((error: Error | null, result?: any) => void) | undefined): void;
|
1456
1475
|
sendAsync(message: RPCSendableMessage, callback: (error: Error | null, result?: any) => void): void;
|
@@ -1707,7 +1726,9 @@ export declare function Engine(options?: IEngineOptions): IEngine;
|
|
1707
1726
|
*/
|
1708
1727
|
export declare const engine: IEngine;
|
1709
1728
|
|
1729
|
+
/** @public */
|
1710
1730
|
export declare type EngineEvent<T extends IEventNames = IEventNames, V = IEvents[T]> = {
|
1731
|
+
/** eventName */
|
1711
1732
|
type: T;
|
1712
1733
|
data: Readonly<V>;
|
1713
1734
|
};
|
@@ -1884,6 +1905,7 @@ export declare function getComponentEntityTree<T>(engine: Pick<IEngine, 'getEnti
|
|
1884
1905
|
*/
|
1885
1906
|
export declare function getCompositeRootComponent(engine: IEngine): LastWriteWinElementSetComponentDefinition<CompositeRootType>;
|
1886
1907
|
|
1908
|
+
/** @public */
|
1887
1909
|
export declare type GizmoDragEndEvent = {
|
1888
1910
|
type: 'gizmoDragEnded';
|
1889
1911
|
transforms: Array<{
|
@@ -1894,6 +1916,7 @@ export declare type GizmoDragEndEvent = {
|
|
1894
1916
|
}>;
|
1895
1917
|
};
|
1896
1918
|
|
1919
|
+
/** @public */
|
1897
1920
|
export declare type GizmoSelectedEvent = {
|
1898
1921
|
type: 'gizmoSelected';
|
1899
1922
|
gizmoType: 'MOVE' | 'ROTATE' | 'SCALE' | 'NONE';
|
@@ -1906,7 +1929,12 @@ export declare type GlobalDirectionRaycastSystemOptions = {
|
|
1906
1929
|
direction?: PBVector3;
|
1907
1930
|
};
|
1908
1931
|
|
1932
|
+
/** @public */
|
1909
1933
|
export declare type GlobalInputEventResult = InputEventResult & {
|
1934
|
+
/**
|
1935
|
+
* DOWN = 0,
|
1936
|
+
* UP = 1
|
1937
|
+
*/
|
1910
1938
|
type: 0 | 1;
|
1911
1939
|
};
|
1912
1940
|
|
@@ -2156,79 +2184,199 @@ export declare type IEntityContainer = {
|
|
2156
2184
|
updateUsedEntity(entity: Entity): boolean;
|
2157
2185
|
};
|
2158
2186
|
|
2187
|
+
/** @public */
|
2159
2188
|
export declare type IEventNames = keyof IEvents;
|
2160
2189
|
|
2190
|
+
/**
|
2191
|
+
* @public
|
2192
|
+
* Note: Don't use `on` prefix for IEvents to avoid redundancy with `event.on("onEventName")` syntax.
|
2193
|
+
*/
|
2161
2194
|
export declare interface IEvents {
|
2195
|
+
/**
|
2196
|
+
* `positionChanged` is triggered when the position of the camera changes
|
2197
|
+
* This event is throttled to 10 times per second.
|
2198
|
+
*/
|
2162
2199
|
positionChanged: {
|
2200
|
+
/** Camera position relative to the base parcel of the scene */
|
2163
2201
|
position: Vector3Type;
|
2202
|
+
/** Camera position, this is a absolute world position */
|
2164
2203
|
cameraPosition: Vector3Type;
|
2204
|
+
/** Eye height, in meters. */
|
2165
2205
|
playerHeight: number;
|
2166
2206
|
};
|
2207
|
+
/**
|
2208
|
+
* `rotationChanged` is triggered when the rotation of the camera changes.
|
2209
|
+
* This event is throttled to 10 times per second.
|
2210
|
+
*/
|
2167
2211
|
rotationChanged: {
|
2212
|
+
/** Degree vector. Same as entities */
|
2168
2213
|
rotation: Vector3Type;
|
2214
|
+
/** Rotation quaternion, useful in some scenarios. */
|
2169
2215
|
quaternion: QuaternionType;
|
2170
2216
|
};
|
2217
|
+
/**
|
2218
|
+
* `cameraModeChanged` is triggered when the user changes the camera mode
|
2219
|
+
*/
|
2171
2220
|
cameraModeChanged: {
|
2221
|
+
/**
|
2222
|
+
* FIRST_PERSON = 0,
|
2223
|
+
* THIRD_PERSON = 1,
|
2224
|
+
* FREE_CAMERA = 2
|
2225
|
+
*/
|
2172
2226
|
cameraMode: 0 | 1 | 2;
|
2173
2227
|
};
|
2228
|
+
/**
|
2229
|
+
* `idleStateChanged` is triggered when the user not moves for a defined period of time
|
2230
|
+
*/
|
2174
2231
|
idleStateChanged: {
|
2175
2232
|
isIdle: boolean;
|
2176
2233
|
};
|
2177
2234
|
playerExpression: {
|
2178
2235
|
expressionId: string;
|
2179
2236
|
};
|
2237
|
+
/**
|
2238
|
+
* `pointerUp` is triggered when the user releases an input pointer.
|
2239
|
+
* It could be a VR controller, a touch screen or the mouse.
|
2240
|
+
*/
|
2180
2241
|
pointerUp: InputEventResult;
|
2242
|
+
/**
|
2243
|
+
* `pointerDown` is triggered when the user press an input pointer.
|
2244
|
+
* It could be a VR controller, a touch screen or the mouse.
|
2245
|
+
*/
|
2181
2246
|
pointerDown: InputEventResult;
|
2247
|
+
/**
|
2248
|
+
* `pointerEvent` is triggered when the user press or releases an input pointer.
|
2249
|
+
* It could be a VR controller, a touch screen or the mouse.
|
2250
|
+
*
|
2251
|
+
* @deprecated use actionButtonEvent instead
|
2252
|
+
*/
|
2182
2253
|
pointerEvent: GlobalInputEventResult;
|
2254
|
+
/**
|
2255
|
+
* `actionButtonEvent` is triggered when the user press or releases an input pointer.
|
2256
|
+
* It could be a VR controller, a touch screen or the mouse.
|
2257
|
+
*
|
2258
|
+
* This event is exactly the same as `pointerEvent` but the logic in the ECS had an unsolvable
|
2259
|
+
* condition that required us to create this new event to handle more cases for new buttons.
|
2260
|
+
*/
|
2183
2261
|
actionButtonEvent: GlobalInputEventResult;
|
2262
|
+
/**
|
2263
|
+
* `raycastResponse` is triggered in response to a raycast query
|
2264
|
+
*/
|
2184
2265
|
raycastResponse: RaycastResponsePayload<any>;
|
2266
|
+
/**
|
2267
|
+
* `chatMessage` is triggered when the user sends a message through chat entity.
|
2268
|
+
*/
|
2185
2269
|
chatMessage: {
|
2186
2270
|
id: string;
|
2187
2271
|
sender: string;
|
2188
2272
|
message: string;
|
2189
2273
|
isCommand: boolean;
|
2190
2274
|
};
|
2275
|
+
/**
|
2276
|
+
* `onChange` is triggered when an entity changes its own internal state.
|
2277
|
+
* Dispatched by the `ui-*` entities when their value is changed. It triggers a callback.
|
2278
|
+
* Notice: Only entities with ID will be listening for click events.
|
2279
|
+
*/
|
2191
2280
|
onChange: {
|
2192
2281
|
value?: any;
|
2282
|
+
/** ID of the pointer that triggered the event */
|
2193
2283
|
pointerId?: number;
|
2194
2284
|
};
|
2285
|
+
/**
|
2286
|
+
* `onEnter` is triggered when the user hits the "Enter" key from the keyboard
|
2287
|
+
* Used principally by the Chat internal scene
|
2288
|
+
*/
|
2195
2289
|
onEnter: unknown;
|
2290
|
+
/**
|
2291
|
+
* `onPointerLock` is triggered when the user clicks the world canvas and the
|
2292
|
+
* pointer locks to it so the pointer moves the camera
|
2293
|
+
*/
|
2196
2294
|
onPointerLock: {
|
2197
2295
|
locked?: boolean;
|
2198
2296
|
};
|
2297
|
+
/**
|
2298
|
+
* `onAnimationEnd` is triggered when an animation clip gets finish
|
2299
|
+
*/
|
2199
2300
|
onAnimationEnd: {
|
2200
2301
|
clipName: string;
|
2201
2302
|
};
|
2303
|
+
/**
|
2304
|
+
* `onFocus` is triggered when an entity focus is active.
|
2305
|
+
* Dispatched by the `ui-input` and `ui-password` entities when the value is changed.
|
2306
|
+
* It triggers a callback.
|
2307
|
+
*
|
2308
|
+
* Notice: Only entities with ID will be listening for click events.
|
2309
|
+
*/
|
2202
2310
|
onFocus: {
|
2311
|
+
/** ID of the entitiy of the event */
|
2203
2312
|
entityId: unknown;
|
2313
|
+
/** ID of the pointer that triggered the event */
|
2204
2314
|
pointerId: number;
|
2205
2315
|
};
|
2316
|
+
/**
|
2317
|
+
* `onBlur` is triggered when an entity loses its focus.
|
2318
|
+
* Dispatched by the `ui-input` and `ui-password` entities when the value is changed.
|
2319
|
+
* It triggers a callback.
|
2320
|
+
*
|
2321
|
+
* Notice: Only entities with ID will be listening for click events.
|
2322
|
+
*/
|
2206
2323
|
onBlur: {
|
2324
|
+
/** ID of the entitiy of the event */
|
2207
2325
|
entityId: unknown;
|
2326
|
+
/** ID of the pointer that triggered the event */
|
2208
2327
|
pointerId: number;
|
2209
2328
|
};
|
2329
|
+
/** The onClick event is only used for UI elements */
|
2210
2330
|
onClick: {
|
2211
2331
|
entityId: unknown;
|
2212
2332
|
};
|
2333
|
+
/**
|
2334
|
+
* This event gets triggered when an entity leaves the scene fences.
|
2335
|
+
*/
|
2213
2336
|
entityOutOfScene: {
|
2214
2337
|
entityId: unknown;
|
2215
2338
|
};
|
2339
|
+
/**
|
2340
|
+
* This event gets triggered when an entity enters the scene fences.
|
2341
|
+
*/
|
2216
2342
|
entityBackInScene: {
|
2217
2343
|
entityId: unknown;
|
2218
2344
|
};
|
2345
|
+
/**
|
2346
|
+
* This event gets triggered when the user enters the scene
|
2347
|
+
*/
|
2219
2348
|
onEnterScene: {
|
2220
2349
|
userId: string;
|
2221
2350
|
};
|
2351
|
+
/**
|
2352
|
+
* This event gets triggered when the user leaves the scene
|
2353
|
+
*/
|
2222
2354
|
onLeaveScene: {
|
2223
2355
|
userId: string;
|
2224
2356
|
};
|
2357
|
+
/**
|
2358
|
+
* This event gets triggered after receiving a comms message.
|
2359
|
+
*/
|
2225
2360
|
comms: {
|
2226
2361
|
sender: string;
|
2227
2362
|
message: string;
|
2228
2363
|
};
|
2364
|
+
/**
|
2365
|
+
* This is triggered once the scene should start.
|
2366
|
+
*/
|
2229
2367
|
sceneStart: unknown;
|
2368
|
+
/**
|
2369
|
+
* This is triggered once the builder scene is loaded.
|
2370
|
+
*/
|
2230
2371
|
builderSceneStart: unknown;
|
2372
|
+
/**
|
2373
|
+
* This is triggered once the builder scene is unloaded.
|
2374
|
+
*/
|
2231
2375
|
builderSceneUnloaded: unknown;
|
2376
|
+
/**
|
2377
|
+
* After checking entities outside the fences, if any is outside, this event
|
2378
|
+
* will be triggered with all the entities outside the scene.
|
2379
|
+
*/
|
2232
2380
|
entitiesOutOfBoundaries: {
|
2233
2381
|
entities: string[];
|
2234
2382
|
};
|
@@ -2247,6 +2395,7 @@ export declare interface IEvents {
|
|
2247
2395
|
given: Record<string, number>;
|
2248
2396
|
limit: Record<string, number>;
|
2249
2397
|
};
|
2398
|
+
/** For gizmos */
|
2250
2399
|
gizmoEvent: GizmoDragEndEvent | GizmoSelectedEvent;
|
2251
2400
|
externalAction: {
|
2252
2401
|
type: string;
|
@@ -2256,29 +2405,38 @@ export declare interface IEvents {
|
|
2256
2405
|
type: string;
|
2257
2406
|
payload: any;
|
2258
2407
|
};
|
2408
|
+
/** This is triggered at least for each videoStatus change */
|
2259
2409
|
videoEvent: {
|
2260
2410
|
componentId: string;
|
2261
2411
|
videoClipId: string;
|
2412
|
+
/** Status, can be NONE = 0, ERROR = 1, LOADING = 2, READY = 3, PLAYING = 4,BUFFERING = 5 */
|
2262
2413
|
videoStatus: number;
|
2414
|
+
/** Current offset position in seconds */
|
2263
2415
|
currentOffset: number;
|
2416
|
+
/** Video length in seconds. Can be -1 */
|
2264
2417
|
totalVideoLength: number;
|
2265
2418
|
};
|
2419
|
+
/** This is trigger everytime a profile is changed */
|
2266
2420
|
profileChanged: {
|
2267
2421
|
ethAddress: string;
|
2268
2422
|
version: number;
|
2269
2423
|
};
|
2424
|
+
/** Triggered when peer's avatar is connected and visible */
|
2270
2425
|
playerConnected: {
|
2271
2426
|
userId: string;
|
2272
2427
|
};
|
2428
|
+
/** Triggered when peer disconnect and/or it avatar is set invisible by comms */
|
2273
2429
|
playerDisconnected: {
|
2274
2430
|
userId: string;
|
2275
2431
|
};
|
2432
|
+
/** Triggered when current realm or island changes */
|
2276
2433
|
onRealmChanged: {
|
2277
2434
|
domain: string;
|
2278
2435
|
room: string;
|
2279
2436
|
serverName: string;
|
2280
2437
|
displayName: string;
|
2281
2438
|
};
|
2439
|
+
/** Triggered when other player's avatar is clicked */
|
2282
2440
|
playerClicked: {
|
2283
2441
|
userId: string;
|
2284
2442
|
ray: {
|
@@ -2287,7 +2445,9 @@ export declare interface IEvents {
|
|
2287
2445
|
distance: number;
|
2288
2446
|
};
|
2289
2447
|
};
|
2448
|
+
/** Triggered when pointer start hovering an entities' shape */
|
2290
2449
|
pointerHoverEnter: unknown;
|
2450
|
+
/** Triggered when pointer stop hovering an entities' shape */
|
2291
2451
|
pointerHoverExit: unknown;
|
2292
2452
|
}
|
2293
2453
|
|
@@ -2387,16 +2547,27 @@ export declare const enum InputAction {
|
|
2387
2547
|
IA_ACTION_6 = 13
|
2388
2548
|
}
|
2389
2549
|
|
2550
|
+
/** @public */
|
2390
2551
|
export declare type InputEventResult = {
|
2552
|
+
/** Origin of the ray, relative to the scene */
|
2391
2553
|
origin: Vector3Type;
|
2554
|
+
/** Direction vector of the ray (normalized) */
|
2392
2555
|
direction: Vector3Type;
|
2556
|
+
/** ID of the pointer that triggered the event */
|
2393
2557
|
buttonId: number;
|
2558
|
+
/** Does this pointer event hit any object? */
|
2394
2559
|
hit?: {
|
2560
|
+
/** Length of the ray */
|
2395
2561
|
length: number;
|
2562
|
+
/** If the ray hits a mesh the intersection point will be this */
|
2396
2563
|
hitPoint: Vector3Type;
|
2564
|
+
/** If the mesh has a name, it will be assigned to meshName */
|
2397
2565
|
meshName: string;
|
2566
|
+
/** Normal of the hit */
|
2398
2567
|
normal: Vector3Type;
|
2568
|
+
/** Normal of the hit, in world space */
|
2399
2569
|
worldNormal: Vector3Type;
|
2570
|
+
/** Hit entity ID if any */
|
2400
2571
|
entityId: unknown;
|
2401
2572
|
};
|
2402
2573
|
};
|
@@ -3466,6 +3637,10 @@ export declare interface MeshRendererComponentDefinitionExtended extends LastWri
|
|
3466
3637
|
setSphere(entity: Entity): void;
|
3467
3638
|
}
|
3468
3639
|
|
3640
|
+
/**
|
3641
|
+
* @alpha
|
3642
|
+
* @deprecated this will only exist for a few releases in ECS7
|
3643
|
+
*/
|
3469
3644
|
export declare class MessageBus {
|
3470
3645
|
private messageQueue;
|
3471
3646
|
private flushing;
|
@@ -3545,42 +3720,198 @@ export declare const enum NftFrameType {
|
|
3545
3720
|
/** @public */
|
3546
3721
|
export declare const NftShape: LastWriteWinElementSetComponentDefinition<PBNftShape>;
|
3547
3722
|
|
3723
|
+
/**
|
3724
|
+
* The Observable class is a simple implementation of the Observable pattern.
|
3725
|
+
*
|
3726
|
+
* There's one slight particularity though: a given Observable can notify its observer using a particular mask value, only the Observers registered with this mask value will be notified.
|
3727
|
+
* This enable a more fine grained execution without having to rely on multiple different Observable objects.
|
3728
|
+
* For instance you may have a given Observable that have four different types of notifications: Move (mask = 0x01), Stop (mask = 0x02), Turn Right (mask = 0X04), Turn Left (mask = 0X08).
|
3729
|
+
* A given observer can register itself with only Move and Stop (mask = 0x03), then it will only be notified when one of these two occurs and will never be for Turn Left/Right.
|
3730
|
+
*
|
3731
|
+
* @public
|
3732
|
+
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed
|
3733
|
+
*/
|
3548
3734
|
export declare class Observable<T> {
|
3549
3735
|
private _observers;
|
3550
3736
|
private _eventState;
|
3551
3737
|
private _onObserverAdded;
|
3738
|
+
/**
|
3739
|
+
* Creates a new observable
|
3740
|
+
* @param onObserverAdded - defines a callback to call when a new observer is added
|
3741
|
+
*/
|
3552
3742
|
constructor(onObserverAdded?: (observer: Observer<T>) => void);
|
3743
|
+
/**
|
3744
|
+
* Create a new Observer with the specified callback
|
3745
|
+
* @param callback - the callback that will be executed for that Observer
|
3746
|
+
* @param mask - the mask used to filter observers
|
3747
|
+
* @param insertFirst - if true the callback will be inserted at the first position, hence executed before the others ones. If false (default behavior) the callback will be inserted at the last position, executed after all the others already present.
|
3748
|
+
* @param scope - optional scope for the callback to be called from
|
3749
|
+
* @param unregisterOnFirstCall - defines if the observer as to be unregistered after the next notification
|
3750
|
+
* @returns the new observer created for the callback
|
3751
|
+
*/
|
3553
3752
|
add(callback: (eventData: T, eventState: ObserverEventState) => void, mask?: number, insertFirst?: boolean, scope?: any, unregisterOnFirstCall?: boolean): null | Observer<T>;
|
3753
|
+
/**
|
3754
|
+
* Create a new Observer with the specified callback and unregisters after the next notification
|
3755
|
+
* @param callback - the callback that will be executed for that Observer
|
3756
|
+
* @returns the new observer created for the callback
|
3757
|
+
*/
|
3554
3758
|
addOnce(callback: (eventData: T, eventState: ObserverEventState) => void): null | Observer<T>;
|
3759
|
+
/**
|
3760
|
+
* Remove an Observer from the Observable object
|
3761
|
+
* @param observer - the instance of the Observer to remove
|
3762
|
+
* @returns false if it doesn't belong to this Observable
|
3763
|
+
*/
|
3555
3764
|
remove(observer: null | Observer<T>): boolean;
|
3765
|
+
/**
|
3766
|
+
* Remove a callback from the Observable object
|
3767
|
+
* @param callback - the callback to remove
|
3768
|
+
* @param scope - optional scope. If used only the callbacks with this scope will be removed
|
3769
|
+
* @returns false if it doesn't belong to this Observable
|
3770
|
+
*/
|
3556
3771
|
removeCallback(callback: (eventData: T, eventState: ObserverEventState) => void, scope?: any): boolean;
|
3772
|
+
/**
|
3773
|
+
* Notify all Observers by calling their respective callback with the given data
|
3774
|
+
* Will return true if all observers were executed, false if an observer set skipNextObservers to true, then prevent the subsequent ones to execute
|
3775
|
+
* @param eventData - defines the data to send to all observers
|
3776
|
+
* @param mask - defines the mask of the current notification (observers with incompatible mask (ie mask & observer.mask === 0) will not be notified)
|
3777
|
+
* @param target - defines the original target of the state
|
3778
|
+
* @param currentTarget - defines the current target of the state
|
3779
|
+
* @returns false if the complete observer chain was not processed (because one observer set the skipNextObservers to true)
|
3780
|
+
*/
|
3557
3781
|
notifyObservers(eventData: T, mask?: number, target?: any, currentTarget?: any): boolean;
|
3782
|
+
/**
|
3783
|
+
* Calling this will execute each callback, expecting it to be a promise or return a value.
|
3784
|
+
* If at any point in the chain one function fails, the promise will fail and the execution will not continue.
|
3785
|
+
* This is useful when a chain of events (sometimes async events) is needed to initialize a certain object
|
3786
|
+
* and it is crucial that all callbacks will be executed.
|
3787
|
+
* The order of the callbacks is kept, callbacks are not executed parallel.
|
3788
|
+
*
|
3789
|
+
* @param eventData - The data to be sent to each callback
|
3790
|
+
* @param mask - is used to filter observers defaults to -1
|
3791
|
+
* @param target - defines the callback target (see EventState)
|
3792
|
+
* @param currentTarget - defines he current object in the bubbling phase
|
3793
|
+
* @returns will return a Promise than resolves when all callbacks executed successfully.
|
3794
|
+
*/
|
3558
3795
|
notifyObserversWithPromise(eventData: T, mask?: number, target?: any, currentTarget?: any): Promise<T>;
|
3796
|
+
/**
|
3797
|
+
* Notify a specific observer
|
3798
|
+
* @param observer - defines the observer to notify
|
3799
|
+
* @param eventData - defines the data to be sent to each callback
|
3800
|
+
* @param mask - is used to filter observers defaults to -1
|
3801
|
+
*/
|
3559
3802
|
notifyObserver(observer: Observer<T>, eventData: T, mask?: number): void;
|
3803
|
+
/**
|
3804
|
+
* Gets a boolean indicating if the observable has at least one observer
|
3805
|
+
* @returns true is the Observable has at least one Observer registered
|
3806
|
+
*/
|
3560
3807
|
hasObservers(): boolean;
|
3808
|
+
/**
|
3809
|
+
* Clear the list of observers
|
3810
|
+
*/
|
3561
3811
|
clear(): void;
|
3812
|
+
/**
|
3813
|
+
* Clone the current observable
|
3814
|
+
* @returns a new observable
|
3815
|
+
*/
|
3562
3816
|
clone(): Observable<T>;
|
3817
|
+
/**
|
3818
|
+
* Does this observable handles observer registered with a given mask
|
3819
|
+
* @param mask - defines the mask to be tested
|
3820
|
+
* @returns whether or not one observer registered with the given mask is handeled
|
3821
|
+
*/
|
3563
3822
|
hasSpecificMask(mask?: number): boolean;
|
3564
3823
|
private _deferUnregister;
|
3565
3824
|
private _remove;
|
3566
3825
|
}
|
3567
3826
|
|
3827
|
+
/**
|
3828
|
+
* Represent an Observer registered to a given Observable object.
|
3829
|
+
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed
|
3830
|
+
* @public
|
3831
|
+
*/
|
3568
3832
|
export declare class Observer<T> {
|
3833
|
+
/**
|
3834
|
+
* Defines the callback to call when the observer is notified
|
3835
|
+
*/
|
3569
3836
|
callback: (eventData: T, eventState: ObserverEventState) => void;
|
3837
|
+
/**
|
3838
|
+
* Defines the mask of the observer (used to filter notifications)
|
3839
|
+
*/
|
3570
3840
|
mask: number;
|
3841
|
+
/**
|
3842
|
+
* Defines the current scope used to restore the JS context
|
3843
|
+
*/
|
3571
3844
|
scope: any;
|
3845
|
+
/**
|
3846
|
+
* Gets or sets a property defining that the observer as to be unregistered after the next notification
|
3847
|
+
*/
|
3572
3848
|
unregisterOnNextCall: boolean;
|
3849
|
+
/** For internal usage */
|
3573
3850
|
_willBeUnregistered: boolean;
|
3574
|
-
|
3851
|
+
/**
|
3852
|
+
* Creates a new observer
|
3853
|
+
* @param callback - defines the callback to call when the observer is notified
|
3854
|
+
* @param mask - defines the mask of the observer (used to filter notifications)
|
3855
|
+
* @param scope - defines the current scope used to restore the JS context
|
3856
|
+
*/
|
3857
|
+
constructor(
|
3858
|
+
/**
|
3859
|
+
* Defines the callback to call when the observer is notified
|
3860
|
+
*/
|
3861
|
+
callback: (eventData: T, eventState: ObserverEventState) => void,
|
3862
|
+
/**
|
3863
|
+
* Defines the mask of the observer (used to filter notifications)
|
3864
|
+
*/
|
3865
|
+
mask: number,
|
3866
|
+
/**
|
3867
|
+
* Defines the current scope used to restore the JS context
|
3868
|
+
*/
|
3869
|
+
scope?: any);
|
3575
3870
|
}
|
3576
3871
|
|
3872
|
+
/**
|
3873
|
+
* A class serves as a medium between the observable and its observers
|
3874
|
+
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed
|
3875
|
+
* @public
|
3876
|
+
*/
|
3577
3877
|
export declare class ObserverEventState {
|
3878
|
+
/**
|
3879
|
+
* An Observer can set this property to true to prevent subsequent observers of being notified
|
3880
|
+
*/
|
3578
3881
|
skipNextObservers: boolean;
|
3882
|
+
/**
|
3883
|
+
* Get the mask value that were used to trigger the event corresponding to this EventState object
|
3884
|
+
*/
|
3579
3885
|
mask: number;
|
3886
|
+
/**
|
3887
|
+
* The object that originally notified the event
|
3888
|
+
*/
|
3580
3889
|
target?: any;
|
3890
|
+
/**
|
3891
|
+
* The current object in the bubbling phase
|
3892
|
+
*/
|
3581
3893
|
currentTarget?: any;
|
3894
|
+
/**
|
3895
|
+
* This will be populated with the return value of the last function that was executed.
|
3896
|
+
* If it is the first function in the callback chain it will be the event data.
|
3897
|
+
*/
|
3582
3898
|
lastReturnValue?: any;
|
3899
|
+
/**
|
3900
|
+
* Create a new EventState
|
3901
|
+
* @param mask - defines the mask associated with this state
|
3902
|
+
* @param skipNextObservers - defines a flag which will instruct the observable to skip following observers when set to true
|
3903
|
+
* @param target - defines the original target of the state
|
3904
|
+
* @param currentTarget - defines the current target of the state
|
3905
|
+
*/
|
3583
3906
|
constructor(mask: number, skipNextObservers?: boolean, target?: any, currentTarget?: any);
|
3907
|
+
/**
|
3908
|
+
* Initialize the current event state
|
3909
|
+
* @param mask - defines the mask associated with this state
|
3910
|
+
* @param skipNextObservers - defines a flag which will instruct the observable to skip following observers when set to true
|
3911
|
+
* @param target - defines the original target of the state
|
3912
|
+
* @param currentTarget - defines the current target of the state
|
3913
|
+
* @returns the current event state
|
3914
|
+
*/
|
3584
3915
|
initalize(mask: number, skipNextObservers?: boolean, target?: any, currentTarget?: any): ObserverEventState;
|
3585
3916
|
}
|
3586
3917
|
|
@@ -3589,18 +3920,34 @@ export declare class ObserverEventState {
|
|
3589
3920
|
*/
|
3590
3921
|
export declare type OnChangeFunction = (entity: Entity, operation: CrdtMessageType, component?: ComponentDefinition<any>, componentValue?: any) => void;
|
3591
3922
|
|
3923
|
+
/** @public
|
3924
|
+
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
|
3925
|
+
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed. Use onEnterSceneObservable instead. */
|
3592
3926
|
export declare const onEnterScene: Observable<{
|
3593
3927
|
userId: string;
|
3594
3928
|
}>;
|
3595
3929
|
|
3930
|
+
/**
|
3931
|
+
* These events are triggered after your character enters the scene.
|
3932
|
+
* @public
|
3933
|
+
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
|
3934
|
+
*/
|
3596
3935
|
export declare const onEnterSceneObservable: Observable<{
|
3597
3936
|
userId: string;
|
3598
3937
|
}>;
|
3599
3938
|
|
3939
|
+
/** @public
|
3940
|
+
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
|
3941
|
+
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed. Use onLeaveSceneObservable instead. */
|
3600
3942
|
export declare const onLeaveScene: Observable<{
|
3601
3943
|
userId: string;
|
3602
3944
|
}>;
|
3603
3945
|
|
3946
|
+
/**
|
3947
|
+
* These events are triggered after your character leaves the scene.
|
3948
|
+
* @public
|
3949
|
+
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
|
3950
|
+
*/
|
3604
3951
|
export declare const onLeaveSceneObservable: Observable<{
|
3605
3952
|
userId: string;
|
3606
3953
|
}>;
|
@@ -3619,6 +3966,10 @@ export declare type OnlyOptionalUndefinedTypes<T> = {
|
|
3619
3966
|
[K in IncludeUndefined<T>]?: T[K];
|
3620
3967
|
};
|
3621
3968
|
|
3969
|
+
/**
|
3970
|
+
* @public
|
3971
|
+
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
|
3972
|
+
*/
|
3622
3973
|
export declare const onPlayerClickedObservable: Observable<{
|
3623
3974
|
userId: string;
|
3624
3975
|
ray: {
|
@@ -3628,23 +3979,43 @@ export declare const onPlayerClickedObservable: Observable<{
|
|
3628
3979
|
};
|
3629
3980
|
}>;
|
3630
3981
|
|
3982
|
+
/**
|
3983
|
+
* @public
|
3984
|
+
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
|
3985
|
+
*/
|
3631
3986
|
export declare const onPlayerConnectedObservable: Observable<{
|
3632
3987
|
userId: string;
|
3633
3988
|
}>;
|
3634
3989
|
|
3990
|
+
/**
|
3991
|
+
* @public
|
3992
|
+
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
|
3993
|
+
*/
|
3635
3994
|
export declare const onPlayerDisconnectedObservable: Observable<{
|
3636
3995
|
userId: string;
|
3637
3996
|
}>;
|
3638
3997
|
|
3998
|
+
/**
|
3999
|
+
* @public
|
4000
|
+
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
|
4001
|
+
*/
|
3639
4002
|
export declare const onPlayerExpressionObservable: Observable<{
|
3640
4003
|
expressionId: string;
|
3641
4004
|
}>;
|
3642
4005
|
|
4006
|
+
/**
|
4007
|
+
* @public
|
4008
|
+
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
|
4009
|
+
*/
|
3643
4010
|
export declare const onProfileChanged: Observable<{
|
3644
4011
|
ethAddress: string;
|
3645
4012
|
version: number;
|
3646
4013
|
}>;
|
3647
4014
|
|
4015
|
+
/**
|
4016
|
+
* @public
|
4017
|
+
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
|
4018
|
+
*/
|
3648
4019
|
export declare const onRealmChangedObservable: Observable<{
|
3649
4020
|
domain: string;
|
3650
4021
|
room: string;
|
@@ -3652,15 +4023,27 @@ export declare const onRealmChangedObservable: Observable<{
|
|
3652
4023
|
displayName: string;
|
3653
4024
|
}>;
|
3654
4025
|
|
4026
|
+
/**
|
4027
|
+
* This event is triggered after all the resources of the scene were loaded (models, textures, etc...)
|
4028
|
+
* @public
|
4029
|
+
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
|
4030
|
+
*/
|
3655
4031
|
export declare const onSceneReadyObservable: Observable<unknown>;
|
3656
4032
|
|
3657
4033
|
export declare function onUpdate(deltaTime: number): Promise<void>;
|
3658
4034
|
|
4035
|
+
/**
|
4036
|
+
* @public
|
4037
|
+
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
|
4038
|
+
*/
|
3659
4039
|
export declare const onVideoEvent: Observable<{
|
3660
4040
|
componentId: string;
|
3661
4041
|
videoClipId: string;
|
4042
|
+
/** Status, can be NONE = 0, ERROR = 1, LOADING = 2, READY = 3, PLAYING = 4,BUFFERING = 5 */
|
3662
4043
|
videoStatus: number;
|
4044
|
+
/** Current offset position in seconds */
|
3663
4045
|
currentOffset: number;
|
4046
|
+
/** Video length in seconds. Can be -1 */
|
3664
4047
|
totalVideoLength: number;
|
3665
4048
|
}>;
|
3666
4049
|
|
@@ -5865,6 +6248,7 @@ export declare const enum RaycastQueryType {
|
|
5865
6248
|
RQT_NONE = 2
|
5866
6249
|
}
|
5867
6250
|
|
6251
|
+
/** @public */
|
5868
6252
|
export declare type RaycastResponsePayload<T> = {
|
5869
6253
|
queryId: string;
|
5870
6254
|
queryType: string;
|