@dcl/sdk 7.0.0-2982061039.commit-9cc9ea8 → 7.0.0-3008112906.commit-524d1bd

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.
Files changed (34) hide show
  1. package/dist/ecs7/index.d.ts +328 -0
  2. package/dist/ecs7/index.js +502 -4
  3. package/dist/ecs7/index.min.js +1 -1
  4. package/dist/ecs7/index.min.js.map +1 -1
  5. package/package.json +5 -5
  6. package/types/ecs7/index.d.ts +328 -0
  7. package/types/rpc-modules/CommunicationsController/index.d.ts +14 -0
  8. package/types/rpc-modules/DevTools/index.d.ts +15 -0
  9. package/types/rpc-modules/EngineAPI/index.d.ts +160 -0
  10. package/types/rpc-modules/EnvironmentAPI/index.d.ts +81 -0
  11. package/types/rpc-modules/EthereumController/index.d.ts +60 -0
  12. package/types/rpc-modules/ExperimentalAPI/index.d.ts +20 -0
  13. package/types/rpc-modules/ParcelIdentity/index.d.ts +48 -0
  14. package/types/rpc-modules/Permissions/index.d.ts +30 -0
  15. package/types/rpc-modules/Players/index.d.ts +52 -0
  16. package/types/rpc-modules/PortableExperiences/index.d.ts +38 -0
  17. package/types/rpc-modules/RestrictedActions/index.d.ts +26 -0
  18. package/types/rpc-modules/SceneStateStorageController/index.d.ts +90 -0
  19. package/types/rpc-modules/SignedFetch/index.d.ts +37 -0
  20. package/types/rpc-modules/SocialController/index.d.ts +18 -0
  21. package/types/rpc-modules/UserActionModule/index.d.ts +14 -0
  22. package/types/rpc-modules/UserIdentity/index.d.ts +45 -0
  23. package/types/tsconfig.ecs7.json +15 -11
  24. package/types/@decentraland/CommunicationsController/index.d.ts +0 -7
  25. package/types/@decentraland/EnvironmentAPI/index.d.ts +0 -45
  26. package/types/@decentraland/EthereumController/index.d.ts +0 -47
  27. package/types/@decentraland/Identity/index.d.ts +0 -44
  28. package/types/@decentraland/ParcelIdentity/index.d.ts +0 -49
  29. package/types/@decentraland/Players/index.d.ts +0 -49
  30. package/types/@decentraland/PortableExperiences/index.d.ts +0 -39
  31. package/types/@decentraland/RestrictedActions/index.d.ts +0 -41
  32. package/types/@decentraland/SignedFetch/index.d.ts +0 -16
  33. package/types/@decentraland/SocialController/index.d.ts +0 -1
  34. package/types/@decentraland/web3-provider/index.d.ts +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl/sdk",
3
- "version": "7.0.0-2982061039.commit-9cc9ea8",
3
+ "version": "7.0.0-3008112906.commit-524d1bd",
4
4
  "description": "",
5
5
  "main": "dist/src/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -27,9 +27,9 @@
27
27
  "src/cli/**/*.js"
28
28
  ],
29
29
  "dependencies": {
30
- "@dcl/amd": "6.11.7-2982061039.commit-9cc9ea8",
31
- "@dcl/build-ecs": "6.11.7-2982061039.commit-9cc9ea8",
32
- "@dcl/kernel": "1.0.0-2638443584.commit-696a74b",
30
+ "@dcl/amd": "6.11.7-3008112906.commit-524d1bd",
31
+ "@dcl/build-ecs": "6.11.7-3008112906.commit-524d1bd",
32
+ "@dcl/kernel": "1.0.0-2994874542.commit-c3ae489",
33
33
  "@dcl/posix": "^1.0.4",
34
34
  "@dcl/schemas": "4.8.0",
35
35
  "@dcl/unity-renderer": "^1.0.40531-20220621125654.commit-472137e",
@@ -38,5 +38,5 @@
38
38
  "ignore": "^5.1.8"
39
39
  },
40
40
  "minCliVersion": "3.10.2",
41
- "commit": "9cc9ea8eafb942a535f33ed483b653c88720ecb2"
41
+ "commit": "524d1bd3c7f72f177f73f7cf5298aaaf1d79f4c7"
42
42
  }
@@ -1,3 +1,5 @@
1
+ /// <reference types="@dcl/posix" />
2
+
1
3
  declare const enum ActionButton {
2
4
  POINTER = 0,
3
5
  PRIMARY = 1,
@@ -1434,6 +1436,248 @@ declare const NFTShape: ComponentDefinition<ISchema<PBNFTShape>, PBNFTShape>;
1434
1436
  /** @public */
1435
1437
  declare type Nullable<T> = T | null;
1436
1438
 
1439
+ /**
1440
+ * The Observable class is a simple implementation of the Observable pattern.
1441
+ *
1442
+ * 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.
1443
+ * This enable a more fine grained execution without having to rely on multiple different Observable objects.
1444
+ * 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).
1445
+ * 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.
1446
+ *
1447
+ * @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
1448
+ */
1449
+ declare class Observable<T> {
1450
+ private _observers;
1451
+ private _eventState;
1452
+ private _onObserverAdded;
1453
+ /**
1454
+ * Creates a new observable
1455
+ * @param onObserverAdded - defines a callback to call when a new observer is added
1456
+ */
1457
+ constructor(onObserverAdded?: (observer: Observer<T>) => void);
1458
+ /**
1459
+ * Create a new Observer with the specified callback
1460
+ * @param callback - the callback that will be executed for that Observer
1461
+ * @param mask - the mask used to filter observers
1462
+ * @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.
1463
+ * @param scope - optional scope for the callback to be called from
1464
+ * @param unregisterOnFirstCall - defines if the observer as to be unregistered after the next notification
1465
+ * @returns the new observer created for the callback
1466
+ */
1467
+ add(callback: (eventData: T, eventState: ObserverEventState) => void, mask?: number, insertFirst?: boolean, scope?: any, unregisterOnFirstCall?: boolean): null | Observer<T>;
1468
+ /**
1469
+ * Create a new Observer with the specified callback and unregisters after the next notification
1470
+ * @param callback - the callback that will be executed for that Observer
1471
+ * @returns the new observer created for the callback
1472
+ */
1473
+ addOnce(callback: (eventData: T, eventState: ObserverEventState) => void): null | Observer<T>;
1474
+ /**
1475
+ * Remove an Observer from the Observable object
1476
+ * @param observer - the instance of the Observer to remove
1477
+ * @returns false if it doesn't belong to this Observable
1478
+ */
1479
+ remove(observer: null | Observer<T>): boolean;
1480
+ /**
1481
+ * Remove a callback from the Observable object
1482
+ * @param callback - the callback to remove
1483
+ * @param scope - optional scope. If used only the callbacks with this scope will be removed
1484
+ * @returns false if it doesn't belong to this Observable
1485
+ */
1486
+ removeCallback(callback: (eventData: T, eventState: ObserverEventState) => void, scope?: any): boolean;
1487
+ /**
1488
+ * Notify all Observers by calling their respective callback with the given data
1489
+ * Will return true if all observers were executed, false if an observer set skipNextObservers to true, then prevent the subsequent ones to execute
1490
+ * @param eventData - defines the data to send to all observers
1491
+ * @param mask - defines the mask of the current notification (observers with incompatible mask (ie mask & observer.mask === 0) will not be notified)
1492
+ * @param target - defines the original target of the state
1493
+ * @param currentTarget - defines the current target of the state
1494
+ * @returns false if the complete observer chain was not processed (because one observer set the skipNextObservers to true)
1495
+ */
1496
+ notifyObservers(eventData: T, mask?: number, target?: any, currentTarget?: any): boolean;
1497
+ /**
1498
+ * Calling this will execute each callback, expecting it to be a promise or return a value.
1499
+ * If at any point in the chain one function fails, the promise will fail and the execution will not continue.
1500
+ * This is useful when a chain of events (sometimes async events) is needed to initialize a certain object
1501
+ * and it is crucial that all callbacks will be executed.
1502
+ * The order of the callbacks is kept, callbacks are not executed parallel.
1503
+ *
1504
+ * @param eventData - The data to be sent to each callback
1505
+ * @param mask - is used to filter observers defaults to -1
1506
+ * @param target - defines the callback target (see EventState)
1507
+ * @param currentTarget - defines he current object in the bubbling phase
1508
+ * @returns will return a Promise than resolves when all callbacks executed successfully.
1509
+ */
1510
+ notifyObserversWithPromise(eventData: T, mask?: number, target?: any, currentTarget?: any): Promise<T>;
1511
+ /**
1512
+ * Notify a specific observer
1513
+ * @param observer - defines the observer to notify
1514
+ * @param eventData - defines the data to be sent to each callback
1515
+ * @param mask - is used to filter observers defaults to -1
1516
+ */
1517
+ notifyObserver(observer: Observer<T>, eventData: T, mask?: number): void;
1518
+ /**
1519
+ * Gets a boolean indicating if the observable has at least one observer
1520
+ * @returns true is the Observable has at least one Observer registered
1521
+ */
1522
+ hasObservers(): boolean;
1523
+ /**
1524
+ * Clear the list of observers
1525
+ */
1526
+ clear(): void;
1527
+ /**
1528
+ * Clone the current observable
1529
+ * @returns a new observable
1530
+ */
1531
+ clone(): Observable<T>;
1532
+ /**
1533
+ * Does this observable handles observer registered with a given mask
1534
+ * @param mask - defines the mask to be tested
1535
+ * @returns whether or not one observer registered with the given mask is handeled
1536
+ */
1537
+ hasSpecificMask(mask?: number): boolean;
1538
+ private _deferUnregister;
1539
+ private _remove;
1540
+ }
1541
+
1542
+ /**
1543
+ * Represent an Observer registered to a given Observable object.
1544
+ * @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
1545
+ */
1546
+ declare class Observer<T> {
1547
+ /**
1548
+ * Defines the callback to call when the observer is notified
1549
+ */
1550
+ callback: (eventData: T, eventState: ObserverEventState) => void;
1551
+ /**
1552
+ * Defines the mask of the observer (used to filter notifications)
1553
+ */
1554
+ mask: number;
1555
+ /**
1556
+ * Defines the current scope used to restore the JS context
1557
+ */
1558
+ scope: any;
1559
+ /**
1560
+ * Gets or sets a property defining that the observer as to be unregistered after the next notification
1561
+ */
1562
+ unregisterOnNextCall: boolean;
1563
+ /** For internal usage */
1564
+ _willBeUnregistered: boolean;
1565
+ /**
1566
+ * Creates a new observer
1567
+ * @param callback - defines the callback to call when the observer is notified
1568
+ * @param mask - defines the mask of the observer (used to filter notifications)
1569
+ * @param scope - defines the current scope used to restore the JS context
1570
+ */
1571
+ constructor(
1572
+ /**
1573
+ * Defines the callback to call when the observer is notified
1574
+ */
1575
+ callback: (eventData: T, eventState: ObserverEventState) => void,
1576
+ /**
1577
+ * Defines the mask of the observer (used to filter notifications)
1578
+ */
1579
+ mask: number,
1580
+ /**
1581
+ * Defines the current scope used to restore the JS context
1582
+ */
1583
+ scope?: any);
1584
+ }
1585
+
1586
+ /**
1587
+ * A class serves as a medium between the observable and its observers
1588
+ * @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
1589
+ */
1590
+ declare class ObserverEventState {
1591
+ /**
1592
+ * An Observer can set this property to true to prevent subsequent observers of being notified
1593
+ */
1594
+ skipNextObservers: boolean;
1595
+ /**
1596
+ * Get the mask value that were used to trigger the event corresponding to this EventState object
1597
+ */
1598
+ mask: number;
1599
+ /**
1600
+ * The object that originally notified the event
1601
+ */
1602
+ target?: any;
1603
+ /**
1604
+ * The current object in the bubbling phase
1605
+ */
1606
+ currentTarget?: any;
1607
+ /**
1608
+ * This will be populated with the return value of the last function that was executed.
1609
+ * If it is the first function in the callback chain it will be the event data.
1610
+ */
1611
+ lastReturnValue?: any;
1612
+ /**
1613
+ * Create a new EventState
1614
+ * @param mask - defines the mask associated with this state
1615
+ * @param skipNextObservers - defines a flag which will instruct the observable to skip following observers when set to true
1616
+ * @param target - defines the original target of the state
1617
+ * @param currentTarget - defines the current target of the state
1618
+ */
1619
+ constructor(mask: number, skipNextObservers?: boolean, target?: any, currentTarget?: any);
1620
+ /**
1621
+ * Initialize the current event state
1622
+ * @param mask - defines the mask associated with this state
1623
+ * @param skipNextObservers - defines a flag which will instruct the observable to skip following observers when set to true
1624
+ * @param target - defines the original target of the state
1625
+ * @param currentTarget - defines the current target of the state
1626
+ * @returns the current event state
1627
+ */
1628
+ initalize(mask: number, skipNextObservers?: boolean, target?: any, currentTarget?: any): ObserverEventState;
1629
+ }
1630
+
1631
+ /**
1632
+ * This event is triggered when you change your camera between 1st and 3rd person
1633
+ * @public
1634
+ * @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.
1635
+ */
1636
+ declare const onCameraModeChangedObservable: Observable<{
1637
+ cameraMode: 0 | 1 | 2;
1638
+ }>;
1639
+
1640
+ /** @public
1641
+ * @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.
1642
+ * @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. */
1643
+ declare const onEnterScene: Observable<{
1644
+ userId: string;
1645
+ }>;
1646
+
1647
+ /**
1648
+ * These events are triggered after your character enters the scene.
1649
+ * @public
1650
+ * @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.
1651
+ */
1652
+ declare const onEnterSceneObservable: Observable<{
1653
+ userId: string;
1654
+ }>;
1655
+
1656
+ /**
1657
+ * This event is triggered when you change your camera between 1st and 3rd person
1658
+ * @public
1659
+ * @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.
1660
+ */
1661
+ declare const onIdleStateChangedObservable: Observable<{
1662
+ isIdle: boolean;
1663
+ }>;
1664
+
1665
+ /** @public
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.
1667
+ * @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. */
1668
+ declare const onLeaveScene: Observable<{
1669
+ userId: string;
1670
+ }>;
1671
+
1672
+ /**
1673
+ * These events are triggered after your character leaves the scene.
1674
+ * @public
1675
+ * @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.
1676
+ */
1677
+ declare const onLeaveSceneObservable: Observable<{
1678
+ userId: string;
1679
+ }>;
1680
+
1437
1681
  declare type OnlyNonUndefinedTypes<T> = {
1438
1682
  [K in ExcludeUndefined<T>]: T[K];
1439
1683
  };
@@ -1442,18 +1686,102 @@ declare type OnlyOptionalUndefinedTypes<T> = {
1442
1686
  [K in IncludeUndefined<T>]?: T[K];
1443
1687
  };
1444
1688
 
1689
+ /**
1690
+ * @public
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.
1692
+ */
1693
+ declare const onPlayerClickedObservable: Observable<{
1694
+ userId: string;
1695
+ ray: {
1696
+ origin: ReadOnlyVector3;
1697
+ direction: ReadOnlyVector3;
1698
+ distance: number;
1699
+ };
1700
+ }>;
1701
+
1702
+ /**
1703
+ * @public
1704
+ * @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.
1705
+ */
1706
+ declare const onPlayerConnectedObservable: Observable<{
1707
+ userId: string;
1708
+ }>;
1709
+
1710
+ /**
1711
+ * @public
1712
+ * @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.
1713
+ */
1714
+ declare const onPlayerDisconnectedObservable: Observable<{
1715
+ userId: string;
1716
+ }>;
1717
+
1718
+ /**
1719
+ * @public
1720
+ * @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.
1721
+ */
1722
+ declare const onPlayerExpressionObservable: Observable<{
1723
+ expressionId: string;
1724
+ }>;
1725
+
1445
1726
  /** @public */
1446
1727
  declare const OnPointerDown: ComponentDefinition<ISchema<PBOnPointerDown>, PBOnPointerDown>;
1447
1728
 
1448
1729
  /** @public */
1449
1730
  declare const OnPointerDownResult: ComponentDefinition<ISchema<PBOnPointerDownResult>, PBOnPointerDownResult>;
1450
1731
 
1732
+ /**
1733
+ * @public
1734
+ * @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.
1735
+ */
1736
+ declare const onPointerLockedStateChange: Observable<{
1737
+ locked?: boolean | undefined;
1738
+ }>;
1739
+
1451
1740
  /** @public */
1452
1741
  declare const OnPointerUp: ComponentDefinition<ISchema<PBOnPointerUp>, PBOnPointerUp>;
1453
1742
 
1454
1743
  /** @public */
1455
1744
  declare const OnPointerUpResult: ComponentDefinition<ISchema<PBOnPointerUpResult>, PBOnPointerUpResult>;
1456
1745
 
1746
+ /**
1747
+ * @public
1748
+ * @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.
1749
+ */
1750
+ declare const onProfileChanged: Observable<{
1751
+ ethAddress: string;
1752
+ version: number;
1753
+ }>;
1754
+
1755
+ /**
1756
+ * @public
1757
+ * @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.
1758
+ */
1759
+ declare const onRealmChangedObservable: Observable<{
1760
+ domain: string;
1761
+ room: string;
1762
+ serverName: string;
1763
+ displayName: string;
1764
+ }>;
1765
+
1766
+ /**
1767
+ * This event is triggered after all the resources of the scene were loaded (models, textures, etc...)
1768
+ * @public
1769
+ * @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.
1770
+ */
1771
+ declare const onSceneReadyObservable: Observable<{}>;
1772
+
1773
+ /**
1774
+ * @public
1775
+ * @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.
1776
+ */
1777
+ declare const onVideoEvent: Observable<{
1778
+ componentId: string;
1779
+ videoClipId: string;
1780
+ videoStatus: number;
1781
+ currentOffset: number;
1782
+ totalVideoLength: number;
1783
+ }>;
1784
+
1457
1785
  /**
1458
1786
  * Defines potential orientation for back face culling
1459
1787
  * @public
@@ -0,0 +1,14 @@
1
+ declare module "~system/CommunicationsController" {
2
+
3
+ export interface RealSendRequest {
4
+ message: string;
5
+ }
6
+ export interface RealSendResponse {
7
+ }
8
+
9
+ // ########### BLOCK
10
+
11
+ // importtype { RealSendRequest, RealSendResponse } from "proto/CommunicationsController.gen";
12
+ export function send(body: RealSendRequest): Promise<RealSendResponse>;
13
+
14
+ }
@@ -0,0 +1,15 @@
1
+ declare module "~system/DevTools" {
2
+
3
+ export interface DevToolsBody {
4
+ type: string;
5
+ jsonPayload: string;
6
+ }
7
+ export interface EventResponse {
8
+ }
9
+
10
+ // ########### BLOCK
11
+
12
+ // importtype { DevToolsBody, EventResponse } from "proto/DevTools.gen";
13
+ export function event(body: DevToolsBody): Promise<EventResponse>;
14
+
15
+ }
@@ -0,0 +1,160 @@
1
+ declare module "~system/EngineAPI" {
2
+
3
+ export enum QueryType {
4
+ InvalidQueryType = 0,
5
+ HitFirst = 1,
6
+ HitAll = 2,
7
+ HitFirstAvatar = 3,
8
+ HitAllAvatars = 4,
9
+ UNRECOGNIZED = -1
10
+ }
11
+ export enum EAType {
12
+ InvalidEAType = 0,
13
+ OpenExternalUrl = 1,
14
+ OpenNFTDialog = 2,
15
+ CreateEntity = 3,
16
+ RemoveEntity = 4,
17
+ UpdateEntityComponent = 5,
18
+ AttachEntityComponent = 6,
19
+ ComponentRemoved = 7,
20
+ SetEntityParent = 8,
21
+ Query = 9,
22
+ ComponentCreated = 10,
23
+ ComponentDisposed = 11,
24
+ ComponentUpdated = 12,
25
+ InitMessagesFinished = 13,
26
+ UNRECOGNIZED = -1
27
+ }
28
+ /** Events */
29
+ export enum EventDataType {
30
+ Generic = 0,
31
+ PositionChanged = 1,
32
+ RotationChanged = 2,
33
+ UNRECOGNIZED = -1
34
+ }
35
+ export interface OpenExternalUrlBody {
36
+ url: string;
37
+ }
38
+ export interface OpenNFTDialogBody {
39
+ assetContractAddress: string;
40
+ tokenId: string;
41
+ comment?: string | undefined;
42
+ }
43
+ export interface CreateEntityBody {
44
+ id: string;
45
+ }
46
+ export interface RemoveEntityBody {
47
+ id: string;
48
+ }
49
+ export interface UpdateEntityComponentBody {
50
+ entityId: string;
51
+ classId: number;
52
+ name: string;
53
+ json: string;
54
+ }
55
+ export interface AttachEntityComponentBody {
56
+ entityId: string;
57
+ name: string;
58
+ id: string;
59
+ }
60
+ export interface ComponentRemovedBody {
61
+ entityId: string;
62
+ name: string;
63
+ }
64
+ export interface SetEntityParentBody {
65
+ entityId: string;
66
+ parentId: string;
67
+ }
68
+ export interface QueryBody {
69
+ queryId: QueryType;
70
+ payload: string;
71
+ }
72
+ export interface ComponentCreatedBody {
73
+ id: string;
74
+ classId: number;
75
+ name: string;
76
+ }
77
+ export interface ComponentDisposedBody {
78
+ id: string;
79
+ }
80
+ export interface ComponentUpdatedBody {
81
+ id: string;
82
+ json: string;
83
+ }
84
+ export interface InitMessagesFinishedBody {
85
+ }
86
+ export interface Payload {
87
+ openExternalUrl?: OpenExternalUrlBody | undefined;
88
+ openNftDialog?: OpenNFTDialogBody | undefined;
89
+ createEntity?: CreateEntityBody | undefined;
90
+ removeEntity?: RemoveEntityBody | undefined;
91
+ updateEntityComponent?: UpdateEntityComponentBody | undefined;
92
+ attachEntityComponent?: AttachEntityComponentBody | undefined;
93
+ componentRemoved?: ComponentRemovedBody | undefined;
94
+ setEntityParent?: SetEntityParentBody | undefined;
95
+ query?: QueryBody | undefined;
96
+ componentCreated?: ComponentCreatedBody | undefined;
97
+ componentDisposed?: ComponentDisposedBody | undefined;
98
+ componentUpdated?: ComponentUpdatedBody | undefined;
99
+ initMessagesFinished?: InitMessagesFinishedBody | undefined;
100
+ }
101
+ export interface EntityAction {
102
+ type: EAType;
103
+ tag?: string | undefined;
104
+ payload: Payload | undefined;
105
+ }
106
+ export interface ManyEntityAction {
107
+ actions: EntityAction[];
108
+ }
109
+ export interface SendBatchResponse {
110
+ events: EventData[];
111
+ }
112
+ export interface UnsubscribeRequest {
113
+ eventId: string;
114
+ }
115
+ export interface SubscribeRequest {
116
+ eventId: string;
117
+ }
118
+ export interface SubscribeResponse {
119
+ }
120
+ export interface UnsubscribeResponse {
121
+ }
122
+ export interface GenericPayload {
123
+ eventId: string;
124
+ eventData: string;
125
+ }
126
+ export interface ReadOnlyVector3 {
127
+ x: number;
128
+ y: number;
129
+ z: number;
130
+ }
131
+ export interface ReadOnlyQuaternion {
132
+ x: number;
133
+ y: number;
134
+ z: number;
135
+ w: number;
136
+ }
137
+ export interface PositionChangedPayload {
138
+ position: ReadOnlyVector3 | undefined;
139
+ cameraPosition: ReadOnlyVector3 | undefined;
140
+ playerHeight: number;
141
+ }
142
+ export interface RotationChangedPayload {
143
+ rotation: ReadOnlyVector3 | undefined;
144
+ quaternion: ReadOnlyQuaternion | undefined;
145
+ }
146
+ export interface EventData {
147
+ type: EventDataType;
148
+ generic?: GenericPayload | undefined;
149
+ positionChanged?: PositionChangedPayload | undefined;
150
+ rotationChanged?: RotationChangedPayload | undefined;
151
+ }
152
+
153
+ // ########### BLOCK
154
+
155
+ // importtype { ManyEntityAction, SendBatchResponse, SubscribeRequest, SubscribeResponse, UnsubscribeRequest, UnsubscribeResponse } from "proto/EngineAPI.gen";
156
+ export function sendBatch(body: ManyEntityAction): Promise<SendBatchResponse>;
157
+ export function subscribe(body: SubscribeRequest): Promise<SubscribeResponse>;
158
+ export function unsubscribe(body: UnsubscribeRequest): Promise<UnsubscribeResponse>;
159
+
160
+ }
@@ -0,0 +1,81 @@
1
+ declare module "~system/EnvironmentAPI" {
2
+
3
+
4
+ export interface ContentMapping {
5
+ file: string;
6
+ hash: string;
7
+ }
8
+
9
+ // ########### BLOCK
10
+
11
+ // importtype { ContentMapping } from "proto/common/ContentMapping.gen";
12
+ export interface MinimalRunnableEntity {
13
+ content: ContentMapping[];
14
+ metadataJson: string;
15
+ }
16
+ export interface BootstrapDataResponse {
17
+ id: string;
18
+ baseUrl: string;
19
+ entity: MinimalRunnableEntity | undefined;
20
+ useFPSThrottling: boolean;
21
+ }
22
+ export interface PreviewModeResponse {
23
+ isPreview: boolean;
24
+ }
25
+ export interface AreUnsafeRequestAllowedResponse {
26
+ status: boolean;
27
+ }
28
+ export interface GetPlatformResponse {
29
+ platform: string;
30
+ }
31
+ export interface EnvironmentRealm {
32
+ domain: string;
33
+ layer: string;
34
+ room: string;
35
+ serverName: string;
36
+ displayName: string;
37
+ protocol: string;
38
+ }
39
+ export interface GetCurrentRealmResponse {
40
+ currentRealm?: EnvironmentRealm | undefined;
41
+ }
42
+ export interface GetExplorerConfigurationResponse {
43
+ clientUri: string;
44
+ configurations: {
45
+ [key: string]: string;
46
+ };
47
+ }
48
+ export interface GetExplorerConfigurationResponse_ConfigurationsEntry {
49
+ key: string;
50
+ value: string;
51
+ }
52
+ export interface GetDecentralandTimeResponse {
53
+ seconds: number;
54
+ }
55
+ export interface GetBootstrapDataRequest {
56
+ }
57
+ export interface IsPreviewModeRequest {
58
+ }
59
+ export interface GetPlatformRequest {
60
+ }
61
+ export interface AreUnsafeRequestAllowedRequest {
62
+ }
63
+ export interface GetCurrentRealmRequest {
64
+ }
65
+ export interface GetExplorerConfigurationRequest {
66
+ }
67
+ export interface GetDecentralandTimeRequest {
68
+ }
69
+
70
+ // ########### BLOCK
71
+
72
+ // importtype { GetBootstrapDataRequest, BootstrapDataResponse, IsPreviewModeRequest, PreviewModeResponse, GetPlatformRequest, GetPlatformResponse, AreUnsafeRequestAllowedRequest, AreUnsafeRequestAllowedResponse, GetCurrentRealmRequest, GetCurrentRealmResponse, GetExplorerConfigurationRequest, GetExplorerConfigurationResponse, GetDecentralandTimeRequest, GetDecentralandTimeResponse } from "proto/EnvironmentAPI.gen";
73
+ export function getBootstrapData(body: GetBootstrapDataRequest): Promise<BootstrapDataResponse>;
74
+ export function isPreviewMode(body: IsPreviewModeRequest): Promise<PreviewModeResponse>;
75
+ export function getPlatform(body: GetPlatformRequest): Promise<GetPlatformResponse>;
76
+ export function areUnsafeRequestAllowed(body: AreUnsafeRequestAllowedRequest): Promise<AreUnsafeRequestAllowedResponse>;
77
+ export function getCurrentRealm(body: GetCurrentRealmRequest): Promise<GetCurrentRealmResponse>;
78
+ export function getExplorerConfiguration(body: GetExplorerConfigurationRequest): Promise<GetExplorerConfigurationResponse>;
79
+ export function getDecentralandTime(body: GetDecentralandTimeRequest): Promise<GetDecentralandTimeResponse>;
80
+
81
+ }