@dcl/sdk 7.0.0-3000224008.commit-8bf3645 → 7.0.0-3038080345.commit-de046a3
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/ecs7/index.d.ts +582 -11
- package/dist/ecs7/index.js +1843 -244
- package/dist/ecs7/index.min.js +1 -1
- package/dist/ecs7/index.min.js.map +1 -1
- package/dist/ecs7/proto-definitions/PointerEvents.proto +28 -0
- package/dist/ecs7/proto-definitions/PointerEventsResult.proto +22 -0
- package/dist/ecs7/proto-definitions/RaycastResult.proto +23 -0
- package/dist/ecs7/proto-definitions/UiTransform.proto +3 -2
- package/package.json +4 -4
- package/types/dcl/decentraland-ecs.api.json +102 -102
- package/types/dcl/decentraland-ecs.api.md +35 -35
- package/types/ecs7/index.d.ts +582 -11
- package/types/tsconfig.ecs7.json +2 -0
package/dist/ecs7/index.d.ts
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
/// <reference types="@dcl/posix" />
|
2
|
+
|
1
3
|
declare const enum ActionButton {
|
2
4
|
POINTER = 0,
|
3
5
|
PRIMARY = 1,
|
@@ -245,14 +247,22 @@ export declare namespace Components {
|
|
245
247
|
/** @public */
|
246
248
|
const PlaneShape: ComponentDefinition<ISchema<PBPlaneShape>, PBPlaneShape>;
|
247
249
|
/** @public */
|
250
|
+
const PointerEvents: ComponentDefinition<ISchema<PBPointerEvents>, PBPointerEvents>;
|
251
|
+
/** @public */
|
252
|
+
const PointerEventsResult: ComponentDefinition<ISchema<PBPointerEventsResult>, PBPointerEventsResult>;
|
253
|
+
/** @public */
|
248
254
|
const PointerLock: ComponentDefinition<ISchema<PBPointerLock>, PBPointerLock>;
|
249
255
|
/** @public */
|
256
|
+
const RaycastResult: ComponentDefinition<ISchema<PBRaycastResult>, PBRaycastResult>;
|
257
|
+
/** @public */
|
250
258
|
const SphereShape: ComponentDefinition<ISchema<PBSphereShape>, PBSphereShape>;
|
251
259
|
/** @public */
|
252
260
|
const TextShape: ComponentDefinition<ISchema<PBTextShape>, PBTextShape>;
|
253
261
|
/** @public */
|
254
262
|
const UiText: ComponentDefinition<ISchema<PBUiText>, PBUiText>;
|
255
263
|
/** @public */
|
264
|
+
const UiTransform: ComponentDefinition<ISchema<PBUiTransform>, PBUiTransform>;
|
265
|
+
/** @public */
|
256
266
|
const VisibilityComponent: ComponentDefinition<ISchema<PBVisibilityComponent>, PBVisibilityComponent>;
|
257
267
|
}
|
258
268
|
|
@@ -478,10 +488,14 @@ declare function defineSdkComponents(engine: PreEngine): {
|
|
478
488
|
OnPointerUp: ComponentDefinition<ISchema<PBOnPointerUp>, PBOnPointerUp>;
|
479
489
|
OnPointerUpResult: ComponentDefinition<ISchema<PBOnPointerUpResult>, PBOnPointerUpResult>;
|
480
490
|
PlaneShape: ComponentDefinition<ISchema<PBPlaneShape>, PBPlaneShape>;
|
491
|
+
PointerEvents: ComponentDefinition<ISchema<PBPointerEvents>, PBPointerEvents>;
|
492
|
+
PointerEventsResult: ComponentDefinition<ISchema<PBPointerEventsResult>, PBPointerEventsResult>;
|
481
493
|
PointerLock: ComponentDefinition<ISchema<PBPointerLock>, PBPointerLock>;
|
494
|
+
RaycastResult: ComponentDefinition<ISchema<PBRaycastResult>, PBRaycastResult>;
|
482
495
|
SphereShape: ComponentDefinition<ISchema<PBSphereShape>, PBSphereShape>;
|
483
496
|
TextShape: ComponentDefinition<ISchema<PBTextShape>, PBTextShape>;
|
484
497
|
UiText: ComponentDefinition<ISchema<PBUiText>, PBUiText>;
|
498
|
+
UiTransform: ComponentDefinition<ISchema<PBUiTransform>, PBUiTransform>;
|
485
499
|
VisibilityComponent: ComponentDefinition<ISchema<PBVisibilityComponent>, PBVisibilityComponent>;
|
486
500
|
};
|
487
501
|
|
@@ -585,13 +599,13 @@ export declare type IEngine = {
|
|
585
599
|
* engine.addSystem(mySystem, 10)
|
586
600
|
* ```
|
587
601
|
*/
|
588
|
-
addSystem(system:
|
602
|
+
addSystem(system: SystemFn, priority?: number, name?: string): void;
|
589
603
|
/**
|
590
604
|
* Remove a system from the engine.
|
591
605
|
* @param selector the function or the unique name to identify
|
592
606
|
* @returns if it was found and removed
|
593
607
|
*/
|
594
|
-
removeSystem(selector: string |
|
608
|
+
removeSystem(selector: string | SystemFn): boolean;
|
595
609
|
/**
|
596
610
|
* Define a component and add it to the engine.
|
597
611
|
* @param spec An object with schema fields
|
@@ -608,7 +622,7 @@ export declare type IEngine = {
|
|
608
622
|
*
|
609
623
|
* ```
|
610
624
|
*/
|
611
|
-
defineComponent<T extends Spec, ConstructorType = Partial<Result<T>>>(spec: T, componentId: number, constructorDefault?:
|
625
|
+
defineComponent<T extends Spec, ConstructorType = Partial<Result<T>>>(spec: T, componentId: number, constructorDefault?: ConstructorType): ComponentDefinition<ISchema<Result<T>>, Partial<Result<T>>>;
|
612
626
|
/**
|
613
627
|
* Define a component and add it to the engine.
|
614
628
|
* @param spec An object with schema fields
|
@@ -644,6 +658,7 @@ export declare type IEngine = {
|
|
644
658
|
* ```
|
645
659
|
*/
|
646
660
|
getEntitiesWith<T extends [ComponentDefinition, ...ComponentDefinition[]]>(...components: T): Iterable<[Entity, ...ReadonlyComponentSchema<T>]>;
|
661
|
+
RootEntity: Entity;
|
647
662
|
baseComponents: SdkComponents;
|
648
663
|
};
|
649
664
|
|
@@ -698,6 +713,17 @@ export declare interface ISize {
|
|
698
713
|
height: number;
|
699
714
|
}
|
700
715
|
|
716
|
+
/**
|
717
|
+
* Check if a pointer event has been emited in the last tick-update.
|
718
|
+
* @param entity the entity to query, for global clicks use `engine.RootEntity`
|
719
|
+
* @param actionButton
|
720
|
+
* @param pointerEventType
|
721
|
+
* @returns
|
722
|
+
*/
|
723
|
+
export declare function isPointerEventActive(entity: Entity, actionButton: ActionButton, pointerEventType: PointerEventType): boolean;
|
724
|
+
|
725
|
+
export declare function isPointerEventActiveGenerator(engine: IEngine): (entity: Entity, actionButton: ActionButton, pointerEventType: PointerEventType) => boolean;
|
726
|
+
|
701
727
|
export declare const log: (...a: any[]) => void;
|
702
728
|
|
703
729
|
/** @public */
|
@@ -1434,6 +1460,248 @@ export declare const NFTShape: ComponentDefinition<ISchema<PBNFTShape>, PBNFTSha
|
|
1434
1460
|
/** @public */
|
1435
1461
|
export declare type Nullable<T> = T | null;
|
1436
1462
|
|
1463
|
+
/**
|
1464
|
+
* The Observable class is a simple implementation of the Observable pattern.
|
1465
|
+
*
|
1466
|
+
* 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.
|
1467
|
+
* This enable a more fine grained execution without having to rely on multiple different Observable objects.
|
1468
|
+
* 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).
|
1469
|
+
* 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.
|
1470
|
+
*
|
1471
|
+
* @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
|
1472
|
+
*/
|
1473
|
+
export declare class Observable<T> {
|
1474
|
+
private _observers;
|
1475
|
+
private _eventState;
|
1476
|
+
private _onObserverAdded;
|
1477
|
+
/**
|
1478
|
+
* Creates a new observable
|
1479
|
+
* @param onObserverAdded - defines a callback to call when a new observer is added
|
1480
|
+
*/
|
1481
|
+
constructor(onObserverAdded?: (observer: Observer<T>) => void);
|
1482
|
+
/**
|
1483
|
+
* Create a new Observer with the specified callback
|
1484
|
+
* @param callback - the callback that will be executed for that Observer
|
1485
|
+
* @param mask - the mask used to filter observers
|
1486
|
+
* @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.
|
1487
|
+
* @param scope - optional scope for the callback to be called from
|
1488
|
+
* @param unregisterOnFirstCall - defines if the observer as to be unregistered after the next notification
|
1489
|
+
* @returns the new observer created for the callback
|
1490
|
+
*/
|
1491
|
+
add(callback: (eventData: T, eventState: ObserverEventState) => void, mask?: number, insertFirst?: boolean, scope?: any, unregisterOnFirstCall?: boolean): null | Observer<T>;
|
1492
|
+
/**
|
1493
|
+
* Create a new Observer with the specified callback and unregisters after the next notification
|
1494
|
+
* @param callback - the callback that will be executed for that Observer
|
1495
|
+
* @returns the new observer created for the callback
|
1496
|
+
*/
|
1497
|
+
addOnce(callback: (eventData: T, eventState: ObserverEventState) => void): null | Observer<T>;
|
1498
|
+
/**
|
1499
|
+
* Remove an Observer from the Observable object
|
1500
|
+
* @param observer - the instance of the Observer to remove
|
1501
|
+
* @returns false if it doesn't belong to this Observable
|
1502
|
+
*/
|
1503
|
+
remove(observer: null | Observer<T>): boolean;
|
1504
|
+
/**
|
1505
|
+
* Remove a callback from the Observable object
|
1506
|
+
* @param callback - the callback to remove
|
1507
|
+
* @param scope - optional scope. If used only the callbacks with this scope will be removed
|
1508
|
+
* @returns false if it doesn't belong to this Observable
|
1509
|
+
*/
|
1510
|
+
removeCallback(callback: (eventData: T, eventState: ObserverEventState) => void, scope?: any): boolean;
|
1511
|
+
/**
|
1512
|
+
* Notify all Observers by calling their respective callback with the given data
|
1513
|
+
* Will return true if all observers were executed, false if an observer set skipNextObservers to true, then prevent the subsequent ones to execute
|
1514
|
+
* @param eventData - defines the data to send to all observers
|
1515
|
+
* @param mask - defines the mask of the current notification (observers with incompatible mask (ie mask & observer.mask === 0) will not be notified)
|
1516
|
+
* @param target - defines the original target of the state
|
1517
|
+
* @param currentTarget - defines the current target of the state
|
1518
|
+
* @returns false if the complete observer chain was not processed (because one observer set the skipNextObservers to true)
|
1519
|
+
*/
|
1520
|
+
notifyObservers(eventData: T, mask?: number, target?: any, currentTarget?: any): boolean;
|
1521
|
+
/**
|
1522
|
+
* Calling this will execute each callback, expecting it to be a promise or return a value.
|
1523
|
+
* If at any point in the chain one function fails, the promise will fail and the execution will not continue.
|
1524
|
+
* This is useful when a chain of events (sometimes async events) is needed to initialize a certain object
|
1525
|
+
* and it is crucial that all callbacks will be executed.
|
1526
|
+
* The order of the callbacks is kept, callbacks are not executed parallel.
|
1527
|
+
*
|
1528
|
+
* @param eventData - The data to be sent to each callback
|
1529
|
+
* @param mask - is used to filter observers defaults to -1
|
1530
|
+
* @param target - defines the callback target (see EventState)
|
1531
|
+
* @param currentTarget - defines he current object in the bubbling phase
|
1532
|
+
* @returns will return a Promise than resolves when all callbacks executed successfully.
|
1533
|
+
*/
|
1534
|
+
notifyObserversWithPromise(eventData: T, mask?: number, target?: any, currentTarget?: any): Promise<T>;
|
1535
|
+
/**
|
1536
|
+
* Notify a specific observer
|
1537
|
+
* @param observer - defines the observer to notify
|
1538
|
+
* @param eventData - defines the data to be sent to each callback
|
1539
|
+
* @param mask - is used to filter observers defaults to -1
|
1540
|
+
*/
|
1541
|
+
notifyObserver(observer: Observer<T>, eventData: T, mask?: number): void;
|
1542
|
+
/**
|
1543
|
+
* Gets a boolean indicating if the observable has at least one observer
|
1544
|
+
* @returns true is the Observable has at least one Observer registered
|
1545
|
+
*/
|
1546
|
+
hasObservers(): boolean;
|
1547
|
+
/**
|
1548
|
+
* Clear the list of observers
|
1549
|
+
*/
|
1550
|
+
clear(): void;
|
1551
|
+
/**
|
1552
|
+
* Clone the current observable
|
1553
|
+
* @returns a new observable
|
1554
|
+
*/
|
1555
|
+
clone(): Observable<T>;
|
1556
|
+
/**
|
1557
|
+
* Does this observable handles observer registered with a given mask
|
1558
|
+
* @param mask - defines the mask to be tested
|
1559
|
+
* @returns whether or not one observer registered with the given mask is handeled
|
1560
|
+
*/
|
1561
|
+
hasSpecificMask(mask?: number): boolean;
|
1562
|
+
private _deferUnregister;
|
1563
|
+
private _remove;
|
1564
|
+
}
|
1565
|
+
|
1566
|
+
/**
|
1567
|
+
* Represent an Observer registered to a given Observable object.
|
1568
|
+
* @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
|
1569
|
+
*/
|
1570
|
+
export declare class Observer<T> {
|
1571
|
+
/**
|
1572
|
+
* Defines the callback to call when the observer is notified
|
1573
|
+
*/
|
1574
|
+
callback: (eventData: T, eventState: ObserverEventState) => void;
|
1575
|
+
/**
|
1576
|
+
* Defines the mask of the observer (used to filter notifications)
|
1577
|
+
*/
|
1578
|
+
mask: number;
|
1579
|
+
/**
|
1580
|
+
* Defines the current scope used to restore the JS context
|
1581
|
+
*/
|
1582
|
+
scope: any;
|
1583
|
+
/**
|
1584
|
+
* Gets or sets a property defining that the observer as to be unregistered after the next notification
|
1585
|
+
*/
|
1586
|
+
unregisterOnNextCall: boolean;
|
1587
|
+
/** For internal usage */
|
1588
|
+
_willBeUnregistered: boolean;
|
1589
|
+
/**
|
1590
|
+
* Creates a new observer
|
1591
|
+
* @param callback - defines the callback to call when the observer is notified
|
1592
|
+
* @param mask - defines the mask of the observer (used to filter notifications)
|
1593
|
+
* @param scope - defines the current scope used to restore the JS context
|
1594
|
+
*/
|
1595
|
+
constructor(
|
1596
|
+
/**
|
1597
|
+
* Defines the callback to call when the observer is notified
|
1598
|
+
*/
|
1599
|
+
callback: (eventData: T, eventState: ObserverEventState) => void,
|
1600
|
+
/**
|
1601
|
+
* Defines the mask of the observer (used to filter notifications)
|
1602
|
+
*/
|
1603
|
+
mask: number,
|
1604
|
+
/**
|
1605
|
+
* Defines the current scope used to restore the JS context
|
1606
|
+
*/
|
1607
|
+
scope?: any);
|
1608
|
+
}
|
1609
|
+
|
1610
|
+
/**
|
1611
|
+
* A class serves as a medium between the observable and its observers
|
1612
|
+
* @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
|
1613
|
+
*/
|
1614
|
+
export declare class ObserverEventState {
|
1615
|
+
/**
|
1616
|
+
* An Observer can set this property to true to prevent subsequent observers of being notified
|
1617
|
+
*/
|
1618
|
+
skipNextObservers: boolean;
|
1619
|
+
/**
|
1620
|
+
* Get the mask value that were used to trigger the event corresponding to this EventState object
|
1621
|
+
*/
|
1622
|
+
mask: number;
|
1623
|
+
/**
|
1624
|
+
* The object that originally notified the event
|
1625
|
+
*/
|
1626
|
+
target?: any;
|
1627
|
+
/**
|
1628
|
+
* The current object in the bubbling phase
|
1629
|
+
*/
|
1630
|
+
currentTarget?: any;
|
1631
|
+
/**
|
1632
|
+
* This will be populated with the return value of the last function that was executed.
|
1633
|
+
* If it is the first function in the callback chain it will be the event data.
|
1634
|
+
*/
|
1635
|
+
lastReturnValue?: any;
|
1636
|
+
/**
|
1637
|
+
* Create a new EventState
|
1638
|
+
* @param mask - defines the mask associated with this state
|
1639
|
+
* @param skipNextObservers - defines a flag which will instruct the observable to skip following observers when set to true
|
1640
|
+
* @param target - defines the original target of the state
|
1641
|
+
* @param currentTarget - defines the current target of the state
|
1642
|
+
*/
|
1643
|
+
constructor(mask: number, skipNextObservers?: boolean, target?: any, currentTarget?: any);
|
1644
|
+
/**
|
1645
|
+
* Initialize the current event state
|
1646
|
+
* @param mask - defines the mask associated with this state
|
1647
|
+
* @param skipNextObservers - defines a flag which will instruct the observable to skip following observers when set to true
|
1648
|
+
* @param target - defines the original target of the state
|
1649
|
+
* @param currentTarget - defines the current target of the state
|
1650
|
+
* @returns the current event state
|
1651
|
+
*/
|
1652
|
+
initalize(mask: number, skipNextObservers?: boolean, target?: any, currentTarget?: any): ObserverEventState;
|
1653
|
+
}
|
1654
|
+
|
1655
|
+
/**
|
1656
|
+
* This event is triggered when you change your camera between 1st and 3rd person
|
1657
|
+
* @public
|
1658
|
+
* @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.
|
1659
|
+
*/
|
1660
|
+
export declare const onCameraModeChangedObservable: Observable<{
|
1661
|
+
cameraMode: 0 | 1 | 2;
|
1662
|
+
}>;
|
1663
|
+
|
1664
|
+
/** @public
|
1665
|
+
* @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.
|
1666
|
+
* @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. */
|
1667
|
+
export declare const onEnterScene: Observable<{
|
1668
|
+
userId: string;
|
1669
|
+
}>;
|
1670
|
+
|
1671
|
+
/**
|
1672
|
+
* These events are triggered after your character enters the scene.
|
1673
|
+
* @public
|
1674
|
+
* @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.
|
1675
|
+
*/
|
1676
|
+
export declare const onEnterSceneObservable: Observable<{
|
1677
|
+
userId: string;
|
1678
|
+
}>;
|
1679
|
+
|
1680
|
+
/**
|
1681
|
+
* This event is triggered when you change your camera between 1st and 3rd person
|
1682
|
+
* @public
|
1683
|
+
* @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.
|
1684
|
+
*/
|
1685
|
+
export declare const onIdleStateChangedObservable: Observable<{
|
1686
|
+
isIdle: boolean;
|
1687
|
+
}>;
|
1688
|
+
|
1689
|
+
/** @public
|
1690
|
+
* @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.
|
1691
|
+
* @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. */
|
1692
|
+
export declare const onLeaveScene: Observable<{
|
1693
|
+
userId: string;
|
1694
|
+
}>;
|
1695
|
+
|
1696
|
+
/**
|
1697
|
+
* These events are triggered after your character leaves the scene.
|
1698
|
+
* @public
|
1699
|
+
* @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.
|
1700
|
+
*/
|
1701
|
+
export declare const onLeaveSceneObservable: Observable<{
|
1702
|
+
userId: string;
|
1703
|
+
}>;
|
1704
|
+
|
1437
1705
|
declare type OnlyNonUndefinedTypes<T> = {
|
1438
1706
|
[K in ExcludeUndefined<T>]: T[K];
|
1439
1707
|
};
|
@@ -1442,18 +1710,102 @@ declare type OnlyOptionalUndefinedTypes<T> = {
|
|
1442
1710
|
[K in IncludeUndefined<T>]?: T[K];
|
1443
1711
|
};
|
1444
1712
|
|
1713
|
+
/**
|
1714
|
+
* @public
|
1715
|
+
* @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.
|
1716
|
+
*/
|
1717
|
+
export declare const onPlayerClickedObservable: Observable<{
|
1718
|
+
userId: string;
|
1719
|
+
ray: {
|
1720
|
+
origin: ReadOnlyVector3;
|
1721
|
+
direction: ReadOnlyVector3;
|
1722
|
+
distance: number;
|
1723
|
+
};
|
1724
|
+
}>;
|
1725
|
+
|
1726
|
+
/**
|
1727
|
+
* @public
|
1728
|
+
* @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.
|
1729
|
+
*/
|
1730
|
+
export declare const onPlayerConnectedObservable: Observable<{
|
1731
|
+
userId: string;
|
1732
|
+
}>;
|
1733
|
+
|
1734
|
+
/**
|
1735
|
+
* @public
|
1736
|
+
* @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.
|
1737
|
+
*/
|
1738
|
+
export declare const onPlayerDisconnectedObservable: Observable<{
|
1739
|
+
userId: string;
|
1740
|
+
}>;
|
1741
|
+
|
1742
|
+
/**
|
1743
|
+
* @public
|
1744
|
+
* @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.
|
1745
|
+
*/
|
1746
|
+
export declare const onPlayerExpressionObservable: Observable<{
|
1747
|
+
expressionId: string;
|
1748
|
+
}>;
|
1749
|
+
|
1445
1750
|
/** @public */
|
1446
1751
|
export declare const OnPointerDown: ComponentDefinition<ISchema<PBOnPointerDown>, PBOnPointerDown>;
|
1447
1752
|
|
1448
1753
|
/** @public */
|
1449
1754
|
export declare const OnPointerDownResult: ComponentDefinition<ISchema<PBOnPointerDownResult>, PBOnPointerDownResult>;
|
1450
1755
|
|
1756
|
+
/**
|
1757
|
+
* @public
|
1758
|
+
* @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.
|
1759
|
+
*/
|
1760
|
+
export declare const onPointerLockedStateChange: Observable<{
|
1761
|
+
locked?: boolean | undefined;
|
1762
|
+
}>;
|
1763
|
+
|
1451
1764
|
/** @public */
|
1452
1765
|
export declare const OnPointerUp: ComponentDefinition<ISchema<PBOnPointerUp>, PBOnPointerUp>;
|
1453
1766
|
|
1454
1767
|
/** @public */
|
1455
1768
|
export declare const OnPointerUpResult: ComponentDefinition<ISchema<PBOnPointerUpResult>, PBOnPointerUpResult>;
|
1456
1769
|
|
1770
|
+
/**
|
1771
|
+
* @public
|
1772
|
+
* @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.
|
1773
|
+
*/
|
1774
|
+
export declare const onProfileChanged: Observable<{
|
1775
|
+
ethAddress: string;
|
1776
|
+
version: number;
|
1777
|
+
}>;
|
1778
|
+
|
1779
|
+
/**
|
1780
|
+
* @public
|
1781
|
+
* @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.
|
1782
|
+
*/
|
1783
|
+
export declare const onRealmChangedObservable: Observable<{
|
1784
|
+
domain: string;
|
1785
|
+
room: string;
|
1786
|
+
serverName: string;
|
1787
|
+
displayName: string;
|
1788
|
+
}>;
|
1789
|
+
|
1790
|
+
/**
|
1791
|
+
* This event is triggered after all the resources of the scene were loaded (models, textures, etc...)
|
1792
|
+
* @public
|
1793
|
+
* @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.
|
1794
|
+
*/
|
1795
|
+
export declare const onSceneReadyObservable: Observable<{}>;
|
1796
|
+
|
1797
|
+
/**
|
1798
|
+
* @public
|
1799
|
+
* @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.
|
1800
|
+
*/
|
1801
|
+
export declare const onVideoEvent: Observable<{
|
1802
|
+
componentId: string;
|
1803
|
+
videoClipId: string;
|
1804
|
+
videoStatus: number;
|
1805
|
+
currentOffset: number;
|
1806
|
+
totalVideoLength: number;
|
1807
|
+
}>;
|
1808
|
+
|
1457
1809
|
/**
|
1458
1810
|
* Defines potential orientation for back face culling
|
1459
1811
|
* @public
|
@@ -1744,10 +2096,55 @@ declare interface PBPlaneShape {
|
|
1744
2096
|
uvs: number[];
|
1745
2097
|
}
|
1746
2098
|
|
2099
|
+
declare interface PBPointerEvents {
|
2100
|
+
pointerEvents: PBPointerEvents_Entry[];
|
2101
|
+
}
|
2102
|
+
|
2103
|
+
declare interface PBPointerEvents_Entry {
|
2104
|
+
eventType: PointerEventType;
|
2105
|
+
eventInfo: PBPointerEvents_Info | undefined;
|
2106
|
+
}
|
2107
|
+
|
2108
|
+
declare interface PBPointerEvents_Info {
|
2109
|
+
/** default=ActionButton.ANY */
|
2110
|
+
button?: ActionButton | undefined;
|
2111
|
+
/** default='Interact' */
|
2112
|
+
hoverText?: string | undefined;
|
2113
|
+
/** default=10 */
|
2114
|
+
maxDistance?: number | undefined;
|
2115
|
+
/** default=true */
|
2116
|
+
showFeedback?: boolean | undefined;
|
2117
|
+
}
|
2118
|
+
|
2119
|
+
/** the renderer will set this component to the root entity once per frame with all the events */
|
2120
|
+
declare interface PBPointerEventsResult {
|
2121
|
+
/** a list of the last N pointer commands (from the engine) */
|
2122
|
+
commands: PBPointerEventsResult_PointerCommand[];
|
2123
|
+
}
|
2124
|
+
|
2125
|
+
/** this message represents a pointer event, used both for UP and DOWN actions */
|
2126
|
+
declare interface PBPointerEventsResult_PointerCommand {
|
2127
|
+
/** identifier of the input */
|
2128
|
+
button: ActionButton;
|
2129
|
+
hit: RaycastHit | undefined;
|
2130
|
+
state: PointerEventType;
|
2131
|
+
/** could be a Lamport timestamp */
|
2132
|
+
timestamp: number;
|
2133
|
+
/** if the input is analog then we store it here */
|
2134
|
+
analog?: number | undefined;
|
2135
|
+
}
|
2136
|
+
|
1747
2137
|
declare interface PBPointerLock {
|
1748
2138
|
isPointerLocked: boolean;
|
1749
2139
|
}
|
1750
2140
|
|
2141
|
+
declare interface PBRaycastResult {
|
2142
|
+
timestamp: number;
|
2143
|
+
origin: Vector3_2 | undefined;
|
2144
|
+
direction: Vector3_2 | undefined;
|
2145
|
+
hits: RaycastHit[];
|
2146
|
+
}
|
2147
|
+
|
1751
2148
|
declare interface PBSphereShape {
|
1752
2149
|
/** @deprecated use MeshCollider instead https://github.com/decentraland/sdk/issues/366 */
|
1753
2150
|
withCollisions?: boolean | undefined;
|
@@ -1799,6 +2196,67 @@ declare interface PBUiText {
|
|
1799
2196
|
textColor: Color3 | undefined;
|
1800
2197
|
}
|
1801
2198
|
|
2199
|
+
declare interface PBUiTransform {
|
2200
|
+
parent: number;
|
2201
|
+
rightOf: number;
|
2202
|
+
positionType: YGPositionType;
|
2203
|
+
alignContent: YGAlign;
|
2204
|
+
alignItems: YGAlign;
|
2205
|
+
alignSelf: YGAlign;
|
2206
|
+
flexDirection: YGFlexDirection;
|
2207
|
+
flexWrap: YGWrap;
|
2208
|
+
justifyContent: YGJustify;
|
2209
|
+
overflow: YGOverflow;
|
2210
|
+
display: YGDisplay;
|
2211
|
+
direction: YGDirection;
|
2212
|
+
flex: number;
|
2213
|
+
flexBasisUnit: YGUnit;
|
2214
|
+
flexBasis: number;
|
2215
|
+
flexGrow: number;
|
2216
|
+
flexShrink: number;
|
2217
|
+
widthUnit: YGUnit;
|
2218
|
+
width: number;
|
2219
|
+
heightUnit: YGUnit;
|
2220
|
+
height: number;
|
2221
|
+
minWidthUnit: YGUnit;
|
2222
|
+
minWidth: number;
|
2223
|
+
minHeightUnit: YGUnit;
|
2224
|
+
minHeight: number;
|
2225
|
+
maxWidthUnit: YGUnit;
|
2226
|
+
maxWidth: number;
|
2227
|
+
maxHeightUnit: YGUnit;
|
2228
|
+
maxHeight: number;
|
2229
|
+
positionLeftUnit: YGUnit;
|
2230
|
+
positionLeft: number;
|
2231
|
+
positionTopUnit: YGUnit;
|
2232
|
+
positionTop: number;
|
2233
|
+
positionRightUnit: YGUnit;
|
2234
|
+
positionRight: number;
|
2235
|
+
positionBottomUnit: YGUnit;
|
2236
|
+
positionBottom: number;
|
2237
|
+
/** margin */
|
2238
|
+
marginLeftUnit: YGUnit;
|
2239
|
+
marginLeft: number;
|
2240
|
+
marginTopUnit: YGUnit;
|
2241
|
+
marginTop: number;
|
2242
|
+
marginRightUnit: YGUnit;
|
2243
|
+
marginRight: number;
|
2244
|
+
marginBottomUnit: YGUnit;
|
2245
|
+
marginBottom: number;
|
2246
|
+
paddingLeftUnit: YGUnit;
|
2247
|
+
paddingLeft: number;
|
2248
|
+
paddingTopUnit: YGUnit;
|
2249
|
+
paddingTop: number;
|
2250
|
+
paddingRightUnit: YGUnit;
|
2251
|
+
paddingRight: number;
|
2252
|
+
paddingBottomUnit: YGUnit;
|
2253
|
+
paddingBottom: number;
|
2254
|
+
borderLeft: number;
|
2255
|
+
borderTop: number;
|
2256
|
+
borderRight: number;
|
2257
|
+
borderBottom: number;
|
2258
|
+
}
|
2259
|
+
|
1802
2260
|
declare interface PBVisibilityComponent {
|
1803
2261
|
/** default=true */
|
1804
2262
|
visible?: boolean | undefined;
|
@@ -1916,6 +2374,20 @@ declare namespace Plane {
|
|
1916
2374
|
/** @public */
|
1917
2375
|
export declare const PlaneShape: ComponentDefinition<ISchema<PBPlaneShape>, PBPlaneShape>;
|
1918
2376
|
|
2377
|
+
/** @public */
|
2378
|
+
export declare const PointerEvents: ComponentDefinition<ISchema<PBPointerEvents>, PBPointerEvents>;
|
2379
|
+
|
2380
|
+
/** @public */
|
2381
|
+
export declare const PointerEventsResult: ComponentDefinition<ISchema<PBPointerEventsResult>, PBPointerEventsResult>;
|
2382
|
+
|
2383
|
+
declare const enum PointerEventType {
|
2384
|
+
UP = 0,
|
2385
|
+
DOWN = 1,
|
2386
|
+
HOVER_ENTER = 2,
|
2387
|
+
HOVER_LEAVE = 3,
|
2388
|
+
UNRECOGNIZED = -1
|
2389
|
+
}
|
2390
|
+
|
1919
2391
|
/** @public */
|
1920
2392
|
export declare const PointerLock: ComponentDefinition<ISchema<PBPointerLock>, PBPointerLock>;
|
1921
2393
|
|
@@ -1930,13 +2402,13 @@ declare function preEngine(): {
|
|
1930
2402
|
addEntity: (dynamic?: boolean) => Entity;
|
1931
2403
|
addDynamicEntity: () => Entity;
|
1932
2404
|
removeEntity: (entity: Entity) => boolean;
|
1933
|
-
addSystem: (fn:
|
2405
|
+
addSystem: (fn: SystemFn, priority?: number, name?: string | undefined) => void;
|
1934
2406
|
getSystems: () => {
|
1935
|
-
fn:
|
2407
|
+
fn: SystemFn;
|
1936
2408
|
priority: number;
|
1937
2409
|
name?: string | undefined;
|
1938
2410
|
}[];
|
1939
|
-
removeSystem: (selector: string |
|
2411
|
+
removeSystem: (selector: string | SystemFn) => boolean;
|
1940
2412
|
defineComponent: <T extends Spec, ConstructorType = Partial<Result<T>>>(spec: T, componentId: number, constructorDefault?: ConstructorType | undefined) => ComponentDefinition<ISchema<Result<T>>, ConstructorType>;
|
1941
2413
|
defineComponentFromSchema: <T_1 extends ISchema<any>, ConstructorType_1 = EcsResult<T_1>>(spec: T_1, componentId: number, constructorDefault?: ConstructorType_1 | undefined) => ComponentDefinition<T_1, ConstructorType_1>;
|
1942
2414
|
getEntitiesWith: <T_2 extends [ComponentDefinition<ISchema<any>, any>, ...ComponentDefinition<ISchema<any>, any>[]]>(...components: T_2) => Iterable<[Entity, ...ReadonlyComponentSchema<T_2>]>;
|
@@ -2114,6 +2586,20 @@ export declare namespace Quaternion {
|
|
2114
2586
|
*/
|
2115
2587
|
export declare const RAD2DEG: number;
|
2116
2588
|
|
2589
|
+
/** Position will be relative to the scene */
|
2590
|
+
declare interface RaycastHit {
|
2591
|
+
position: Vector3_2 | undefined;
|
2592
|
+
origin: Vector3_2 | undefined;
|
2593
|
+
direction: Vector3_2 | undefined;
|
2594
|
+
normalHit: Vector3_2 | undefined;
|
2595
|
+
length: number;
|
2596
|
+
meshName?: string | undefined;
|
2597
|
+
entityId?: number | undefined;
|
2598
|
+
}
|
2599
|
+
|
2600
|
+
/** @public */
|
2601
|
+
export declare const RaycastResult: ComponentDefinition<ISchema<PBRaycastResult>, PBRaycastResult>;
|
2602
|
+
|
2117
2603
|
/**
|
2118
2604
|
* @public
|
2119
2605
|
*/
|
@@ -2191,6 +2677,11 @@ export declare interface Spec {
|
|
2191
2677
|
/** @public */
|
2192
2678
|
export declare const SphereShape: ComponentDefinition<ISchema<PBSphereShape>, PBSphereShape>;
|
2193
2679
|
|
2680
|
+
/**
|
2681
|
+
* @public
|
2682
|
+
*/
|
2683
|
+
export declare type SystemFn = (dt: number) => void;
|
2684
|
+
|
2194
2685
|
/** @public */
|
2195
2686
|
export declare const TextShape: ComponentDefinition<ISchema<PBTextShape>, PBTextShape>;
|
2196
2687
|
|
@@ -2265,15 +2756,13 @@ declare type Uint32 = number;
|
|
2265
2756
|
/** @public */
|
2266
2757
|
export declare const UiText: ComponentDefinition<ISchema<PBUiText>, PBUiText>;
|
2267
2758
|
|
2268
|
-
/**
|
2269
|
-
|
2270
|
-
*/
|
2271
|
-
export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
|
2759
|
+
/** @public */
|
2760
|
+
export declare const UiTransform: ComponentDefinition<ISchema<PBUiTransform>, PBUiTransform>;
|
2272
2761
|
|
2273
2762
|
/**
|
2274
2763
|
* @public
|
2275
2764
|
*/
|
2276
|
-
export declare type
|
2765
|
+
export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
|
2277
2766
|
|
2278
2767
|
/**
|
2279
2768
|
* @public
|
@@ -2487,6 +2976,16 @@ declare interface Vector3_2 {
|
|
2487
2976
|
/** @public */
|
2488
2977
|
export declare const VisibilityComponent: ComponentDefinition<ISchema<PBVisibilityComponent>, PBVisibilityComponent>;
|
2489
2978
|
|
2979
|
+
/**
|
2980
|
+
* Check if an entity emitted a clicked event
|
2981
|
+
* @param entity the entity to query, for global clicks use `engine.RootEntity`
|
2982
|
+
* @param actionButton
|
2983
|
+
* @returns true if the entity was clicked in the last tick-update
|
2984
|
+
*/
|
2985
|
+
export declare function wasEntityClicked(entity: Entity, actionButton: ActionButton): boolean;
|
2986
|
+
|
2987
|
+
export declare function wasEntityClickedGenerator(engine: IEngine): (entity: Entity, actionButton: ActionButton) => boolean;
|
2988
|
+
|
2490
2989
|
declare namespace WireMessage {
|
2491
2990
|
enum Enum {
|
2492
2991
|
RESERVED = 0,
|
@@ -2511,4 +3010,76 @@ declare namespace WireMessage {
|
|
2511
3010
|
function readHeader(buf: ByteBuffer): Header | null;
|
2512
3011
|
}
|
2513
3012
|
|
3013
|
+
declare const enum YGAlign {
|
3014
|
+
YGAlignAuto = 0,
|
3015
|
+
YGAlignFlexStart = 1,
|
3016
|
+
YGAlignCenter = 2,
|
3017
|
+
YGAlignFlexEnd = 3,
|
3018
|
+
YGAlignStretch = 4,
|
3019
|
+
YGAlignBaseline = 5,
|
3020
|
+
YGAlignSpaceBetween = 6,
|
3021
|
+
YGAlignSpaceAround = 7,
|
3022
|
+
UNRECOGNIZED = -1
|
3023
|
+
}
|
3024
|
+
|
3025
|
+
declare const enum YGDirection {
|
3026
|
+
YGDirectionInherit = 0,
|
3027
|
+
YGDirectionLTR = 1,
|
3028
|
+
YGDirectionRTL = 2,
|
3029
|
+
UNRECOGNIZED = -1
|
3030
|
+
}
|
3031
|
+
|
3032
|
+
declare const enum YGDisplay {
|
3033
|
+
YGDisplayFlex = 0,
|
3034
|
+
YGDisplayNone = 1,
|
3035
|
+
UNRECOGNIZED = -1
|
3036
|
+
}
|
3037
|
+
|
3038
|
+
declare const enum YGFlexDirection {
|
3039
|
+
YGFlexDirectionColumn = 0,
|
3040
|
+
YGFlexDirectionColumnReverse = 1,
|
3041
|
+
YGFlexDirectionRow = 2,
|
3042
|
+
YGFlexDirectionRowReverse = 3,
|
3043
|
+
UNRECOGNIZED = -1
|
3044
|
+
}
|
3045
|
+
|
3046
|
+
declare const enum YGJustify {
|
3047
|
+
YGJustifyFlexStart = 0,
|
3048
|
+
YGJustifyCenter = 1,
|
3049
|
+
YGJustifyFlexEnd = 2,
|
3050
|
+
YGJustifySpaceBetween = 3,
|
3051
|
+
YGJustifySpaceAround = 4,
|
3052
|
+
YGJustifySpaceEvenly = 5,
|
3053
|
+
UNRECOGNIZED = -1
|
3054
|
+
}
|
3055
|
+
|
3056
|
+
declare const enum YGOverflow {
|
3057
|
+
YGOverflowVisible = 0,
|
3058
|
+
YGOverflowHidden = 1,
|
3059
|
+
YGOverflowScroll = 2,
|
3060
|
+
UNRECOGNIZED = -1
|
3061
|
+
}
|
3062
|
+
|
3063
|
+
declare const enum YGPositionType {
|
3064
|
+
YGPositionTypeStatic = 0,
|
3065
|
+
YGPositionTypeRelative = 1,
|
3066
|
+
YGPositionTypeAbsolute = 2,
|
3067
|
+
UNRECOGNIZED = -1
|
3068
|
+
}
|
3069
|
+
|
3070
|
+
declare const enum YGUnit {
|
3071
|
+
YGUnitUndefined = 0,
|
3072
|
+
YGUnitPoint = 1,
|
3073
|
+
YGUnitPercent = 2,
|
3074
|
+
YGUnitAuto = 3,
|
3075
|
+
UNRECOGNIZED = -1
|
3076
|
+
}
|
3077
|
+
|
3078
|
+
declare const enum YGWrap {
|
3079
|
+
YGWrapNoWrap = 0,
|
3080
|
+
YGWrapWrap = 1,
|
3081
|
+
YGWrapWrapReverse = 2,
|
3082
|
+
UNRECOGNIZED = -1
|
3083
|
+
}
|
3084
|
+
|
2514
3085
|
export { }
|