@dcl/playground-assets 7.0.6-4177592674.commit-39cdc99 → 7.0.6-4183962432.commit-2fbe270
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 +250 -142
- package/dist/beta.d.ts +250 -142
- package/dist/index.bundled.d.ts +250 -142
- package/dist/index.js +648 -142
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/playground/sdk/dcl-sdk.package.json +3 -3
- package/dist/playground-assets.d.ts +250 -142
- package/etc/playground-assets.api.json +3716 -3202
- package/etc/playground-assets.api.md +141 -87
- package/package.json +3 -3
package/dist/alpha.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare const Animator: AnimatorComponentDefinitionExtended;
|
|
|
8
8
|
/**
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
|
-
export declare interface AnimatorComponentDefinitionExtended extends
|
|
11
|
+
export declare interface AnimatorComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition<PBAnimator> {
|
|
12
12
|
/**
|
|
13
13
|
* @public
|
|
14
14
|
*
|
|
@@ -48,11 +48,33 @@ export declare interface AnimatorComponentDefinitionExtended extends ComponentDe
|
|
|
48
48
|
stopAllAnimations(entity: Entity, resetCursor?: boolean): boolean;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
/**
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
export declare type AppendValueMessage = CrdtMessageHeader & AppendValueMessageBody;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Min. length = header (8 bytes) + 16 bytes = 24 bytes
|
|
58
|
+
*
|
|
59
|
+
* @param entity - Uint32 number of the entity
|
|
60
|
+
* @param componentId - Uint32 number of id
|
|
61
|
+
* @param timestamp - Uint32 timestamp
|
|
62
|
+
* @param data - Uint8[] data of component => length(4 bytes) + block of bytes[0..length-1]
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
export declare type AppendValueMessageBody = {
|
|
66
|
+
type: CrdtMessageType.APPEND_VALUE;
|
|
67
|
+
entityId: Entity;
|
|
68
|
+
componentId: number;
|
|
69
|
+
timestamp: number;
|
|
70
|
+
data: Uint8Array;
|
|
71
|
+
};
|
|
72
|
+
|
|
51
73
|
/** @public */
|
|
52
|
-
export declare const AudioSource:
|
|
74
|
+
export declare const AudioSource: LastWriteWinElementSetComponentDefinition<PBAudioSource>;
|
|
53
75
|
|
|
54
76
|
/** @public */
|
|
55
|
-
export declare const AudioStream:
|
|
77
|
+
export declare const AudioStream: LastWriteWinElementSetComponentDefinition<PBAudioStream>;
|
|
56
78
|
|
|
57
79
|
/**
|
|
58
80
|
* @public
|
|
@@ -65,10 +87,10 @@ export declare const enum AvatarAnchorPointType {
|
|
|
65
87
|
}
|
|
66
88
|
|
|
67
89
|
/** @public */
|
|
68
|
-
export declare const AvatarAttach:
|
|
90
|
+
export declare const AvatarAttach: LastWriteWinElementSetComponentDefinition<PBAvatarAttach>;
|
|
69
91
|
|
|
70
92
|
/** @public */
|
|
71
|
-
export declare const AvatarModifierArea:
|
|
93
|
+
export declare const AvatarModifierArea: LastWriteWinElementSetComponentDefinition<PBAvatarModifierArea>;
|
|
72
94
|
|
|
73
95
|
/**
|
|
74
96
|
* @public
|
|
@@ -79,7 +101,7 @@ export declare const enum AvatarModifierType {
|
|
|
79
101
|
}
|
|
80
102
|
|
|
81
103
|
/** @public */
|
|
82
|
-
export declare const AvatarShape:
|
|
104
|
+
export declare const AvatarShape: LastWriteWinElementSetComponentDefinition<PBAvatarShape>;
|
|
83
105
|
|
|
84
106
|
/**
|
|
85
107
|
* @public
|
|
@@ -116,8 +138,52 @@ export declare const enum BackgroundTextureMode {
|
|
|
116
138
|
STRETCH = 2
|
|
117
139
|
}
|
|
118
140
|
|
|
141
|
+
/**
|
|
142
|
+
* @public
|
|
143
|
+
*/
|
|
144
|
+
export declare interface BaseComponent<T> {
|
|
145
|
+
readonly componentId: number;
|
|
146
|
+
readonly componentName: string;
|
|
147
|
+
readonly componentType: ComponentType;
|
|
148
|
+
readonly schema: ISchema<T>;
|
|
149
|
+
/**
|
|
150
|
+
* This function receives a CRDT update and returns a touple with a "conflict
|
|
151
|
+
* resoluton" message, in case of the sender being updated or null in case of noop/accepted
|
|
152
|
+
* change. The second element of the touple is the modified/changed/deleted value.
|
|
153
|
+
* @public
|
|
154
|
+
*/
|
|
155
|
+
updateFromCrdt(body: CrdtMessageBody): [null | ConflictResolutionMessage, T | undefined];
|
|
156
|
+
/**
|
|
157
|
+
* This function returns an iterable with all the CRDT updates that need to be
|
|
158
|
+
* broadcasted to other actors in the system. After returning, this function
|
|
159
|
+
* clears the internal dirty state. Updates are produced only once.
|
|
160
|
+
* @public
|
|
161
|
+
*/
|
|
162
|
+
getCrdtUpdates(): Iterable<CrdtMessageBody>;
|
|
163
|
+
/**
|
|
164
|
+
* @public
|
|
165
|
+
* Marks the entity as deleted and signals it cannot be used ever again. It must
|
|
166
|
+
* clear the component internal state, produces a synchronization message to remove
|
|
167
|
+
* the component from the entity.
|
|
168
|
+
* @param entity - Entity ID that was deleted.
|
|
169
|
+
*/
|
|
170
|
+
entityDeleted(entity: Entity, markAsDirty: boolean): void;
|
|
171
|
+
/**
|
|
172
|
+
* Get if the entity has this component
|
|
173
|
+
* @param entity - entity to test
|
|
174
|
+
*/
|
|
175
|
+
has(entity: Entity): boolean;
|
|
176
|
+
/**
|
|
177
|
+
* Get the readonly component of the entity (to mutate it, use getMutable instead),
|
|
178
|
+
* throws an error if the entity doesn't have the component.
|
|
179
|
+
* @param entity - Entity that will be used to get the component
|
|
180
|
+
* @returns
|
|
181
|
+
*/
|
|
182
|
+
get(entity: Entity): any;
|
|
183
|
+
}
|
|
184
|
+
|
|
119
185
|
/** @public */
|
|
120
|
-
export declare const Billboard:
|
|
186
|
+
export declare const Billboard: LastWriteWinElementSetComponentDefinition<PBBillboard>;
|
|
121
187
|
|
|
122
188
|
/**
|
|
123
189
|
* @public
|
|
@@ -267,10 +333,10 @@ export declare interface ByteBuffer {
|
|
|
267
333
|
export declare type Callback = () => void;
|
|
268
334
|
|
|
269
335
|
/** @public */
|
|
270
|
-
export declare const CameraMode:
|
|
336
|
+
export declare const CameraMode: LastWriteWinElementSetComponentDefinition<PBCameraMode>;
|
|
271
337
|
|
|
272
338
|
/** @public */
|
|
273
|
-
export declare const CameraModeArea:
|
|
339
|
+
export declare const CameraModeArea: LastWriteWinElementSetComponentDefinition<PBCameraModeArea>;
|
|
274
340
|
|
|
275
341
|
/**
|
|
276
342
|
* @public
|
|
@@ -999,94 +1065,23 @@ export declare type Color4Type = {
|
|
|
999
1065
|
/**
|
|
1000
1066
|
* @public
|
|
1001
1067
|
*/
|
|
1002
|
-
export declare
|
|
1003
|
-
readonly componentId: number;
|
|
1004
|
-
readonly componentName: string;
|
|
1005
|
-
/**
|
|
1006
|
-
* Return the default value of the current component
|
|
1007
|
-
*/
|
|
1008
|
-
default(): DeepReadonly<T>;
|
|
1009
|
-
/**
|
|
1010
|
-
* Get if the entity has this component
|
|
1011
|
-
* @param entity - entity to test
|
|
1012
|
-
*/
|
|
1013
|
-
has(entity: Entity): boolean;
|
|
1014
|
-
/**
|
|
1015
|
-
* Get the readonly component of the entity (to mutate it, use getMutable instead), throw an error if the entity doesn't have the component.
|
|
1016
|
-
* @param entity - Entity that will be used to get the component
|
|
1017
|
-
* @returns
|
|
1018
|
-
*/
|
|
1019
|
-
get(entity: Entity): DeepReadonly<T>;
|
|
1020
|
-
/**
|
|
1021
|
-
* Get the readonly component of the entity (to mutate it, use getMutable instead), or null if the entity doesn't have the component.
|
|
1022
|
-
* @param entity - Entity that will be used to try to get the component
|
|
1023
|
-
*/
|
|
1024
|
-
getOrNull(entity: Entity): DeepReadonly<T> | null;
|
|
1025
|
-
/**
|
|
1026
|
-
* Add the current component to an entity, throw an error if the component already exists (use `createOrReplace` instead).
|
|
1027
|
-
* - Internal comment: This method adds the <entity,component> to the list to be reviewed next frame
|
|
1028
|
-
* @param entity - Entity that will be used to create the component
|
|
1029
|
-
* @param val - The initial value
|
|
1030
|
-
*/
|
|
1031
|
-
create(entity: Entity, val?: T): T;
|
|
1032
|
-
/**
|
|
1033
|
-
* Add the current component to an entity or replace the content if the entity already has the component
|
|
1034
|
-
* - Internal comment: This method adds the <entity,component> to the list to be reviewed next frame
|
|
1035
|
-
* @param entity - Entity that will be used to create or replace the component
|
|
1036
|
-
* @param val - The initial or new value
|
|
1037
|
-
*/
|
|
1038
|
-
createOrReplace(entity: Entity, val?: T): T;
|
|
1039
|
-
/**
|
|
1040
|
-
* @public
|
|
1041
|
-
* Delete the current component to an entity, return null if the entity doesn't have the current component.
|
|
1042
|
-
* - Internal comment: This method adds the <entity,component> to the list to be reviewed next frame
|
|
1043
|
-
* @param entity - Entity to delete the component from
|
|
1044
|
-
*/
|
|
1045
|
-
deleteFrom(entity: Entity): T | null;
|
|
1046
|
-
/**
|
|
1047
|
-
* @public
|
|
1048
|
-
* Marks the entity as deleted and signals it cannot be used ever again. It must
|
|
1049
|
-
* clear the component internal state, produces a synchronization message to remove
|
|
1050
|
-
* the component from the entity.
|
|
1051
|
-
* @param entity - Entity to delete the component from
|
|
1052
|
-
*/
|
|
1053
|
-
entityDeleted(entity: Entity, markAsDirty: boolean): void;
|
|
1054
|
-
/**
|
|
1055
|
-
* Get the mutable component of the entity, throw an error if the entity doesn't have the component.
|
|
1056
|
-
* - Internal comment: This method adds the <entity,component> to the list to be reviewed next frame
|
|
1057
|
-
* @param entity - Entity to get the component from
|
|
1058
|
-
*/
|
|
1059
|
-
getMutable(entity: Entity): T;
|
|
1060
|
-
/**
|
|
1061
|
-
* Get the mutable component of the entity, return null if the entity doesn't have the component.
|
|
1062
|
-
* - Internal comment: This method adds the <entity,component> to the list to be reviewed next frame
|
|
1063
|
-
* @param entity - Entity to get the component from
|
|
1064
|
-
*/
|
|
1065
|
-
getMutableOrNull(entity: Entity): T | null;
|
|
1066
|
-
/**
|
|
1067
|
-
* This function receives a CRDT update and returns a touple with a "conflict
|
|
1068
|
-
* resoluton" message, in case of the sender being updated or null in case of noop/accepted
|
|
1069
|
-
* change. The second element of the touple is the modified/changed/deleted value.
|
|
1070
|
-
* @public
|
|
1071
|
-
*/
|
|
1072
|
-
updateFromCrdt(body: CrdtMessageBody): [null | PutComponentMessageBody | DeleteComponentMessageBody, T | null];
|
|
1073
|
-
/**
|
|
1074
|
-
* This function returns an iterable with all the CRDT updates that need to be
|
|
1075
|
-
* broadcasted to other actors in the system. After returning, this function
|
|
1076
|
-
* clears the internal dirty state. Updates are produced only once.
|
|
1077
|
-
* @public
|
|
1078
|
-
*/
|
|
1079
|
-
getCrdtUpdates(): Iterable<CrdtMessageBody>;
|
|
1080
|
-
}
|
|
1068
|
+
export declare type ComponentDefinition<T> = LastWriteWinElementSetComponentDefinition<T> | GrowOnlyValueSetComponentDefinition<T>;
|
|
1081
1069
|
|
|
1082
|
-
|
|
1070
|
+
/**
|
|
1071
|
+
* Component types are used to pick the wire protocol and the conflict resolution algorithm
|
|
1072
|
+
* @public
|
|
1073
|
+
*/
|
|
1074
|
+
export declare const enum ComponentType {
|
|
1075
|
+
LastWriteWinElementSet = 0,
|
|
1076
|
+
GrowOnlyValueSet = 1
|
|
1077
|
+
}
|
|
1083
1078
|
|
|
1084
1079
|
/**
|
|
1080
|
+
* A conflict resolution message is the response to an outdated or invalid state
|
|
1081
|
+
* in the CRDT.
|
|
1085
1082
|
* @public
|
|
1086
1083
|
*/
|
|
1087
|
-
export declare type
|
|
1088
|
-
[K in keyof T]: T[K] extends ComponentDefinition<any> ? ReturnType<T[K]['getMutable']> : never;
|
|
1089
|
-
};
|
|
1084
|
+
export declare type ConflictResolutionMessage = PutComponentMessageBody | DeleteComponentMessageBody;
|
|
1090
1085
|
|
|
1091
1086
|
/**
|
|
1092
1087
|
* @public
|
|
@@ -1096,12 +1091,12 @@ export declare const CRDT_MESSAGE_HEADER_LENGTH = 8;
|
|
|
1096
1091
|
/**
|
|
1097
1092
|
* @public
|
|
1098
1093
|
*/
|
|
1099
|
-
export declare type CrdtMessage = PutComponentMessage | DeleteComponentMessage | DeleteEntityMessage;
|
|
1094
|
+
export declare type CrdtMessage = PutComponentMessage | DeleteComponentMessage | DeleteEntityMessage | AppendValueMessage;
|
|
1100
1095
|
|
|
1101
1096
|
/**
|
|
1102
1097
|
* @public
|
|
1103
1098
|
*/
|
|
1104
|
-
export declare type CrdtMessageBody = PutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessageBody;
|
|
1099
|
+
export declare type CrdtMessageBody = PutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessageBody | AppendValueMessageBody;
|
|
1105
1100
|
|
|
1106
1101
|
/**
|
|
1107
1102
|
* Min length = 8 bytes
|
|
@@ -1123,7 +1118,8 @@ export declare enum CrdtMessageType {
|
|
|
1123
1118
|
PUT_COMPONENT = 1,
|
|
1124
1119
|
DELETE_COMPONENT = 2,
|
|
1125
1120
|
DELETE_ENTITY = 3,
|
|
1126
|
-
|
|
1121
|
+
APPEND_VALUE = 4,
|
|
1122
|
+
MAX_MESSAGE_TYPE = 5
|
|
1127
1123
|
}
|
|
1128
1124
|
|
|
1129
1125
|
export declare function createEthereumProvider(): {
|
|
@@ -1131,10 +1127,6 @@ export declare function createEthereumProvider(): {
|
|
|
1131
1127
|
sendAsync(message: RPCSendableMessage, callback: (error: Error | null, result?: any) => void): void;
|
|
1132
1128
|
};
|
|
1133
1129
|
|
|
1134
|
-
export declare function createGetCrdtMessages(componentId: number, timestamps: Map<Entity, number>, dirtyIterator: Set<Entity>, schema: Pick<ISchema<any>, 'serialize'>, data: Map<Entity, unknown>): () => Generator<PutComponentMessageBody | DeleteComponentMessageBody, void, unknown>;
|
|
1135
|
-
|
|
1136
|
-
export declare function createUpdateFromCrdt(componentId: number, timestamps: Map<Entity, number>, schema: Pick<ISchema<any>, 'serialize' | 'deserialize'>, data: Map<Entity, unknown>): (msg: CrdtMessageBody) => [null | PutComponentMessageBody | DeleteComponentMessageBody, any];
|
|
1137
|
-
|
|
1138
1130
|
/**
|
|
1139
1131
|
* Transform parenting: cyclic dependency checker
|
|
1140
1132
|
* It checks only in modified Transforms
|
|
@@ -1155,12 +1147,12 @@ export declare function cyclicParentingChecker(engine: IEngine): () => void;
|
|
|
1155
1147
|
/**
|
|
1156
1148
|
* @public
|
|
1157
1149
|
*/
|
|
1158
|
-
export declare type DeepReadonly<T> = T extends ReadonlyPrimitive ? T : T extends Map<infer K, infer V> ? DeepReadonlyMap<K, V> : T extends Set<infer M> ? DeepReadonlySet<M> : DeepReadonlyObject<T>;
|
|
1150
|
+
export declare type DeepReadonly<T> = T extends ReadonlyPrimitive ? T : T extends Array<infer K> ? ReadonlyArray<DeepReadonly<K>> : T extends Map<infer K, infer V> ? DeepReadonlyMap<K, V> : T extends Set<infer M> ? DeepReadonlySet<M> : DeepReadonlyObject<T>;
|
|
1159
1151
|
|
|
1160
1152
|
/**
|
|
1161
1153
|
* @public
|
|
1162
1154
|
*/
|
|
1163
|
-
export declare type DeepReadonlyMap<K, V> = ReadonlyMap<
|
|
1155
|
+
export declare type DeepReadonlyMap<K, V> = ReadonlyMap<K, DeepReadonly<V>>;
|
|
1164
1156
|
|
|
1165
1157
|
/**
|
|
1166
1158
|
* @public
|
|
@@ -1349,7 +1341,7 @@ export declare const Epsilon = 0.000001;
|
|
|
1349
1341
|
/**
|
|
1350
1342
|
* @public
|
|
1351
1343
|
*/
|
|
1352
|
-
export declare type EventSystemCallback = (event:
|
|
1344
|
+
export declare type EventSystemCallback = (event: PBPointerEventsResult) => void;
|
|
1353
1345
|
|
|
1354
1346
|
/**
|
|
1355
1347
|
* @public
|
|
@@ -1418,7 +1410,30 @@ export declare type GlobalInputEventResult = InputEventResult & {
|
|
|
1418
1410
|
};
|
|
1419
1411
|
|
|
1420
1412
|
/** @public */
|
|
1421
|
-
export declare const GltfContainer:
|
|
1413
|
+
export declare const GltfContainer: LastWriteWinElementSetComponentDefinition<PBGltfContainer>;
|
|
1414
|
+
|
|
1415
|
+
/**
|
|
1416
|
+
* @public
|
|
1417
|
+
*/
|
|
1418
|
+
export declare interface GrowOnlyValueSetComponentDefinition<T> extends BaseComponent<T> {
|
|
1419
|
+
readonly componentType: ComponentType.GrowOnlyValueSet;
|
|
1420
|
+
/**
|
|
1421
|
+
* Appends an element to the set.
|
|
1422
|
+
* @param entity - Entity that will host the value
|
|
1423
|
+
* @param val - The final value. The Set will freeze the value, it won't be editable from
|
|
1424
|
+
* the script.
|
|
1425
|
+
*/
|
|
1426
|
+
addValue(entity: Entity, val: DeepReadonly<T>): DeepReadonlySet<T>;
|
|
1427
|
+
/**
|
|
1428
|
+
* Get the readonly component of the entity (to mutate it, use getMutable instead),
|
|
1429
|
+
* throws an error if the entity doesn't have the component.
|
|
1430
|
+
* @param entity - Entity that will be used to get the component
|
|
1431
|
+
* @returns
|
|
1432
|
+
*/
|
|
1433
|
+
get(entity: Entity): DeepReadonlySet<T>;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
export declare type GSetComponentGetter<T extends GrowOnlyValueSetComponentDefinition<any>> = (engine: Pick<IEngine, 'defineValueSetComponentFromSchema'>) => T;
|
|
1422
1437
|
|
|
1423
1438
|
/**
|
|
1424
1439
|
* @public
|
|
@@ -1513,7 +1528,21 @@ export declare interface IEngine {
|
|
|
1513
1528
|
* const StateComponent = engine.defineComponentFromSchema("my-lib::VisibleComponent", Schemas.Bool)
|
|
1514
1529
|
* ```
|
|
1515
1530
|
*/
|
|
1516
|
-
defineComponentFromSchema<T>(componentName: string, spec: ISchema<T>):
|
|
1531
|
+
defineComponentFromSchema<T>(componentName: string, spec: ISchema<T>): LastWriteWinElementSetComponentDefinition<T>;
|
|
1532
|
+
/**
|
|
1533
|
+
* @public
|
|
1534
|
+
* Defines a value set component.
|
|
1535
|
+
* @param componentName - unique name to identify the component, a hash is calculated for it, it will fail if the hash has collisions.
|
|
1536
|
+
* @param spec - An object with schema fields
|
|
1537
|
+
* @returns The component definition
|
|
1538
|
+
*
|
|
1539
|
+
* @example
|
|
1540
|
+
* ```ts
|
|
1541
|
+
* const StateComponentId = 10023
|
|
1542
|
+
* const StateComponent = engine.defineValueSetComponentFromSchema("my-lib::VisibleComponent", Schemas.Int)
|
|
1543
|
+
* ```
|
|
1544
|
+
*/
|
|
1545
|
+
defineValueSetComponentFromSchema<T>(componentName: string, spec: ISchema<T>, options: ValueSetOptions<T>): GrowOnlyValueSetComponentDefinition<T>;
|
|
1517
1546
|
/**
|
|
1518
1547
|
* @public
|
|
1519
1548
|
* Get the component definition from the component id.
|
|
@@ -1733,7 +1762,7 @@ export declare type IInputSystem = {
|
|
|
1733
1762
|
* @param entity - the entity to query, ignore for global
|
|
1734
1763
|
* @returns boolean
|
|
1735
1764
|
*/
|
|
1736
|
-
isTriggered: (inputAction: InputAction, pointerEventType: PointerEventType, entity
|
|
1765
|
+
isTriggered: (inputAction: InputAction, pointerEventType: PointerEventType, entity: Entity) => boolean;
|
|
1737
1766
|
/**
|
|
1738
1767
|
* @public
|
|
1739
1768
|
* Check if an input action is currently being pressed.
|
|
@@ -1749,7 +1778,7 @@ export declare type IInputSystem = {
|
|
|
1749
1778
|
* @param entity - the entity to query, ignore for global
|
|
1750
1779
|
* @returns the input command info or undefined if there is no command in the last tick-update
|
|
1751
1780
|
*/
|
|
1752
|
-
getInputCommand: (inputAction: InputAction, pointerEventType: PointerEventType, entity
|
|
1781
|
+
getInputCommand: (inputAction: InputAction, pointerEventType: PointerEventType, entity: Entity) => PBPointerEventsResult | null;
|
|
1753
1782
|
};
|
|
1754
1783
|
|
|
1755
1784
|
/**
|
|
@@ -1760,8 +1789,6 @@ export declare type IncludeUndefined<T> = {
|
|
|
1760
1789
|
[P in keyof T]: undefined extends T[P] ? P : never;
|
|
1761
1790
|
}[keyof T];
|
|
1762
1791
|
|
|
1763
|
-
export declare function incrementTimestamp(entity: Entity, timestamps: Map<Entity, number>): number;
|
|
1764
|
-
|
|
1765
1792
|
/**
|
|
1766
1793
|
* @public
|
|
1767
1794
|
* Input component
|
|
@@ -1829,12 +1856,40 @@ export declare const inputSystem: IInputSystem;
|
|
|
1829
1856
|
* @public
|
|
1830
1857
|
*/
|
|
1831
1858
|
export declare interface ISchema<T = any> {
|
|
1832
|
-
serialize(value: T
|
|
1859
|
+
serialize(value: DeepReadonly<T>, builder: ByteBuffer): void;
|
|
1833
1860
|
deserialize(reader: ByteBuffer): T;
|
|
1834
1861
|
create(): T;
|
|
1835
|
-
extend?: (base
|
|
1862
|
+
extend?: (base: Partial<DeepReadonly<T>> | undefined) => T;
|
|
1863
|
+
jsonSchema: JsonSchemaExtended;
|
|
1836
1864
|
}
|
|
1837
1865
|
|
|
1866
|
+
/**
|
|
1867
|
+
* @public
|
|
1868
|
+
*/
|
|
1869
|
+
export declare type JsonArray = Array<JsonPrimitive | JsonMap | JsonArray>;
|
|
1870
|
+
|
|
1871
|
+
/**
|
|
1872
|
+
* @public
|
|
1873
|
+
*/
|
|
1874
|
+
export declare type JsonMap = {
|
|
1875
|
+
[key: string]: JsonPrimitive | JsonMap | JsonArray;
|
|
1876
|
+
};
|
|
1877
|
+
|
|
1878
|
+
/**
|
|
1879
|
+
* @public
|
|
1880
|
+
*/
|
|
1881
|
+
export declare type JsonPrimitive = string | number | boolean | null;
|
|
1882
|
+
|
|
1883
|
+
/**
|
|
1884
|
+
* JsonSchemaExtended must specify the type, and it can has more primitives params.
|
|
1885
|
+
* Functions are not allowed.
|
|
1886
|
+
* @public
|
|
1887
|
+
*/
|
|
1888
|
+
export declare type JsonSchemaExtended = {
|
|
1889
|
+
type: 'object' | 'number' | 'integer' | 'string' | 'array' | 'boolean';
|
|
1890
|
+
serializationType: 'boolean' | 'enum-int' | 'enum-string' | 'int8' | 'int16' | 'int32' | 'int64' | 'float32' | 'float64' | 'vector3' | 'color3' | 'quaternion' | 'color4' | 'map' | 'optional' | 'entity' | 'array' | 'utf8-string' | 'protocol-buffer' | 'transform' | 'unknown';
|
|
1891
|
+
} & JsonMap;
|
|
1892
|
+
|
|
1838
1893
|
/**
|
|
1839
1894
|
* @hidden
|
|
1840
1895
|
*/
|
|
@@ -1871,6 +1926,58 @@ export declare type Key = number | string;
|
|
|
1871
1926
|
*/
|
|
1872
1927
|
export declare function Label(props: EntityPropTypes & UiLabelProps): ReactEcs.JSX.Element;
|
|
1873
1928
|
|
|
1929
|
+
/**
|
|
1930
|
+
* @public
|
|
1931
|
+
*/
|
|
1932
|
+
export declare interface LastWriteWinElementSetComponentDefinition<T> extends BaseComponent<T> {
|
|
1933
|
+
readonly componentType: ComponentType.LastWriteWinElementSet;
|
|
1934
|
+
/**
|
|
1935
|
+
* Get the readonly component of the entity (to mutate it, use getMutable instead),
|
|
1936
|
+
* throws an error if the entity doesn't have the component.
|
|
1937
|
+
* @param entity - Entity that will be used to get the component
|
|
1938
|
+
* @returns
|
|
1939
|
+
*/
|
|
1940
|
+
get(entity: Entity): DeepReadonly<T>;
|
|
1941
|
+
/**
|
|
1942
|
+
* Get the readonly component of the entity (to mutate it, use getMutable instead), or null if the entity doesn't have the component.
|
|
1943
|
+
* @param entity - Entity that will be used to try to get the component
|
|
1944
|
+
*/
|
|
1945
|
+
getOrNull(entity: Entity): DeepReadonly<T> | null;
|
|
1946
|
+
/**
|
|
1947
|
+
* Add the current component to an entity, throw an error if the component already exists (use `createOrReplace` instead).
|
|
1948
|
+
* - Internal comment: This method adds the <entity,component> to the list to be reviewed next frame
|
|
1949
|
+
* @param entity - Entity that will be used to create the component
|
|
1950
|
+
* @param val - The initial value
|
|
1951
|
+
*/
|
|
1952
|
+
create(entity: Entity, val?: T): T;
|
|
1953
|
+
/**
|
|
1954
|
+
* Add the current component to an entity or replace the content if the entity already has the component
|
|
1955
|
+
* - Internal comment: This method adds the <entity,component> to the list to be reviewed next frame
|
|
1956
|
+
* @param entity - Entity that will be used to create or replace the component
|
|
1957
|
+
* @param val - The initial or new value
|
|
1958
|
+
*/
|
|
1959
|
+
createOrReplace(entity: Entity, val?: T): T;
|
|
1960
|
+
/**
|
|
1961
|
+
* @public
|
|
1962
|
+
* Delete the current component to an entity, return null if the entity doesn't have the current component.
|
|
1963
|
+
* - Internal comment: This method adds the <entity,component> to the list to be reviewed next frame
|
|
1964
|
+
* @param entity - Entity to delete the component from
|
|
1965
|
+
*/
|
|
1966
|
+
deleteFrom(entity: Entity): T | null;
|
|
1967
|
+
/**
|
|
1968
|
+
* Get the mutable component of the entity, throw an error if the entity doesn't have the component.
|
|
1969
|
+
* - Internal comment: This method adds the <entity,component> to the list to be reviewed next frame
|
|
1970
|
+
* @param entity - Entity to get the component from
|
|
1971
|
+
*/
|
|
1972
|
+
getMutable(entity: Entity): T;
|
|
1973
|
+
/**
|
|
1974
|
+
* Get the mutable component of the entity, return null if the entity doesn't have the component.
|
|
1975
|
+
* - Internal comment: This method adds the <entity,component> to the list to be reviewed next frame
|
|
1976
|
+
* @param entity - Entity to get the component from
|
|
1977
|
+
*/
|
|
1978
|
+
getMutableOrNull(entity: Entity): T | null;
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1874
1981
|
/**
|
|
1875
1982
|
* User key event Listeners
|
|
1876
1983
|
* @public
|
|
@@ -1882,11 +1989,13 @@ export declare type Listeners = {
|
|
|
1882
1989
|
onMouseUp?: Callback;
|
|
1883
1990
|
};
|
|
1884
1991
|
|
|
1992
|
+
export declare type LwwComponentGetter<T extends LastWriteWinElementSetComponentDefinition<any>> = (engine: Pick<IEngine, 'defineComponentFromSchema'>) => T;
|
|
1993
|
+
|
|
1885
1994
|
/**
|
|
1886
1995
|
* @public
|
|
1887
1996
|
* Overrides component definition to support partial default values
|
|
1888
1997
|
*/
|
|
1889
|
-
export declare interface MapComponentDefinition<T> extends
|
|
1998
|
+
export declare interface MapComponentDefinition<T> extends LastWriteWinElementSetComponentDefinition<T> {
|
|
1890
1999
|
/**
|
|
1891
2000
|
* Add the current component to an entity, throw an error if the component already exists (use `createOrReplace` instead).
|
|
1892
2001
|
* - Internal comment: This method adds the <entity,component> to the list to be reviewed next frame
|
|
@@ -1915,7 +2024,7 @@ export declare const Material: MaterialComponentDefinitionExtended;
|
|
|
1915
2024
|
/**
|
|
1916
2025
|
* @public
|
|
1917
2026
|
*/
|
|
1918
|
-
export declare interface MaterialComponentDefinitionExtended extends
|
|
2027
|
+
export declare interface MaterialComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition<PBMaterial> {
|
|
1919
2028
|
/**
|
|
1920
2029
|
* Texture helpers with constructor
|
|
1921
2030
|
*/
|
|
@@ -2681,7 +2790,7 @@ export declare const MeshCollider: MeshColliderComponentDefinitionExtended;
|
|
|
2681
2790
|
/**
|
|
2682
2791
|
* @public
|
|
2683
2792
|
*/
|
|
2684
|
-
export declare interface MeshColliderComponentDefinitionExtended extends
|
|
2793
|
+
export declare interface MeshColliderComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition<PBMeshCollider> {
|
|
2685
2794
|
/**
|
|
2686
2795
|
* @public
|
|
2687
2796
|
* Set a box in the MeshCollider component
|
|
@@ -2719,7 +2828,7 @@ export declare const MeshRenderer: MeshRendererComponentDefinitionExtended;
|
|
|
2719
2828
|
/**
|
|
2720
2829
|
* @public
|
|
2721
2830
|
*/
|
|
2722
|
-
export declare interface MeshRendererComponentDefinitionExtended extends
|
|
2831
|
+
export declare interface MeshRendererComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition<PBMeshRenderer> {
|
|
2723
2832
|
/**
|
|
2724
2833
|
* @public
|
|
2725
2834
|
* Set a box in the MeshRenderer component
|
|
@@ -2789,7 +2898,7 @@ export declare const enum NftFrameType {
|
|
|
2789
2898
|
}
|
|
2790
2899
|
|
|
2791
2900
|
/** @public */
|
|
2792
|
-
export declare const NftShape:
|
|
2901
|
+
export declare const NftShape: LastWriteWinElementSetComponentDefinition<PBNftShape>;
|
|
2793
2902
|
|
|
2794
2903
|
export declare class Observable<T> {
|
|
2795
2904
|
private _observers;
|
|
@@ -2833,7 +2942,7 @@ export declare class ObserverEventState {
|
|
|
2833
2942
|
/**
|
|
2834
2943
|
* @public
|
|
2835
2944
|
*/
|
|
2836
|
-
export declare type OnChangeFunction = (entity: Entity, operation: CrdtMessageType, component?: ComponentDefinition<any
|
|
2945
|
+
export declare type OnChangeFunction = (entity: Entity, operation: CrdtMessageType, component?: ComponentDefinition<any>, componentValue?: any) => void;
|
|
2837
2946
|
|
|
2838
2947
|
export declare const onCommsMessage: Observable<{
|
|
2839
2948
|
sender: string;
|
|
@@ -3271,20 +3380,11 @@ export declare interface PBPointerEvents_Info {
|
|
|
3271
3380
|
showFeedback?: boolean | undefined;
|
|
3272
3381
|
}
|
|
3273
3382
|
|
|
3274
|
-
/**
|
|
3383
|
+
/** renderer append a new object of this in each command, there can be many commands per frames */
|
|
3275
3384
|
/**
|
|
3276
3385
|
* @public
|
|
3277
3386
|
*/
|
|
3278
3387
|
export declare interface PBPointerEventsResult {
|
|
3279
|
-
/** a list of the last N pointer commands (from the engine) */
|
|
3280
|
-
commands: PBPointerEventsResult_PointerCommand[];
|
|
3281
|
-
}
|
|
3282
|
-
|
|
3283
|
-
/** this message represents a pointer event, used both for UP and DOWN actions */
|
|
3284
|
-
/**
|
|
3285
|
-
* @public
|
|
3286
|
-
*/
|
|
3287
|
-
export declare interface PBPointerEventsResult_PointerCommand {
|
|
3288
3388
|
/** identifier of the input */
|
|
3289
3389
|
button: InputAction;
|
|
3290
3390
|
hit: RaycastHit | undefined;
|
|
@@ -3698,10 +3798,10 @@ export declare namespace Plane {
|
|
|
3698
3798
|
}
|
|
3699
3799
|
|
|
3700
3800
|
/** @public */
|
|
3701
|
-
export declare const PointerEvents:
|
|
3801
|
+
export declare const PointerEvents: LastWriteWinElementSetComponentDefinition<PBPointerEvents>;
|
|
3702
3802
|
|
|
3703
3803
|
/** @public */
|
|
3704
|
-
export declare const PointerEventsResult:
|
|
3804
|
+
export declare const PointerEventsResult: GrowOnlyValueSetComponentDefinition<PBPointerEventsResult>;
|
|
3705
3805
|
|
|
3706
3806
|
/**
|
|
3707
3807
|
* @public
|
|
@@ -3754,7 +3854,7 @@ export declare const enum PointerEventType {
|
|
|
3754
3854
|
}
|
|
3755
3855
|
|
|
3756
3856
|
/** @public */
|
|
3757
|
-
export declare const PointerLock:
|
|
3857
|
+
export declare const PointerLock: LastWriteWinElementSetComponentDefinition<PBPointerLock>;
|
|
3758
3858
|
|
|
3759
3859
|
/**
|
|
3760
3860
|
* Type used for defining the position of the element. i.e. margin, padding
|
|
@@ -4124,7 +4224,7 @@ export declare type QuaternionType = {
|
|
|
4124
4224
|
export declare const RAD2DEG: number;
|
|
4125
4225
|
|
|
4126
4226
|
/** @public */
|
|
4127
|
-
export declare const Raycast:
|
|
4227
|
+
export declare const Raycast: LastWriteWinElementSetComponentDefinition<PBRaycast>;
|
|
4128
4228
|
|
|
4129
4229
|
/** Position will be relative to the scene */
|
|
4130
4230
|
/**
|
|
@@ -4155,7 +4255,7 @@ export declare type RaycastResponsePayload<T> = {
|
|
|
4155
4255
|
};
|
|
4156
4256
|
|
|
4157
4257
|
/** @public */
|
|
4158
|
-
export declare const RaycastResult:
|
|
4258
|
+
export declare const RaycastResult: LastWriteWinElementSetComponentDefinition<PBRaycastResult>;
|
|
4159
4259
|
|
|
4160
4260
|
/**
|
|
4161
4261
|
* @public
|
|
@@ -4504,7 +4604,7 @@ export declare const enum TextAlignMode {
|
|
|
4504
4604
|
export declare type TextAlignType = 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'middle-center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
4505
4605
|
|
|
4506
4606
|
/** @public */
|
|
4507
|
-
export declare const TextShape:
|
|
4607
|
+
export declare const TextShape: LastWriteWinElementSetComponentDefinition<PBTextShape>;
|
|
4508
4608
|
|
|
4509
4609
|
/**
|
|
4510
4610
|
* @public
|
|
@@ -4618,7 +4718,7 @@ export declare const Transform: TransformComponentExtended;
|
|
|
4618
4718
|
/**
|
|
4619
4719
|
* @public
|
|
4620
4720
|
*/
|
|
4621
|
-
export declare type TransformComponent =
|
|
4721
|
+
export declare type TransformComponent = LastWriteWinElementSetComponentDefinition<TransformType>;
|
|
4622
4722
|
|
|
4623
4723
|
/**
|
|
4624
4724
|
* @public
|
|
@@ -4681,7 +4781,7 @@ export declare interface UiAvatarTexture {
|
|
|
4681
4781
|
}
|
|
4682
4782
|
|
|
4683
4783
|
/** @public */
|
|
4684
|
-
export declare const UiBackground:
|
|
4784
|
+
export declare const UiBackground: LastWriteWinElementSetComponentDefinition<PBUiBackground>;
|
|
4685
4785
|
|
|
4686
4786
|
/**
|
|
4687
4787
|
* @public
|
|
@@ -4719,7 +4819,7 @@ export declare interface UiButtonProps extends UiLabelProps, EntityPropTypes {
|
|
|
4719
4819
|
export declare type UiComponent = () => ReactEcs.JSX.Element;
|
|
4720
4820
|
|
|
4721
4821
|
/** @public */
|
|
4722
|
-
export declare const UiDropdown:
|
|
4822
|
+
export declare const UiDropdown: LastWriteWinElementSetComponentDefinition<PBUiDropdown>;
|
|
4723
4823
|
|
|
4724
4824
|
/**
|
|
4725
4825
|
* @public
|
|
@@ -4732,7 +4832,7 @@ export declare interface UiDropdownProps extends EntityPropTypes, Omit<Partial<P
|
|
|
4732
4832
|
}
|
|
4733
4833
|
|
|
4734
4834
|
/** @public */
|
|
4735
|
-
export declare const UiDropdownResult:
|
|
4835
|
+
export declare const UiDropdownResult: LastWriteWinElementSetComponentDefinition<PBUiDropdownResult>;
|
|
4736
4836
|
|
|
4737
4837
|
/**
|
|
4738
4838
|
* @public
|
|
@@ -4748,7 +4848,7 @@ export declare function UiEntity(props: EntityPropTypes & {
|
|
|
4748
4848
|
export declare type UiFontType = 'sans-serif' | 'serif' | 'monospace';
|
|
4749
4849
|
|
|
4750
4850
|
/** @public */
|
|
4751
|
-
export declare const UiInput:
|
|
4851
|
+
export declare const UiInput: LastWriteWinElementSetComponentDefinition<PBUiInput>;
|
|
4752
4852
|
|
|
4753
4853
|
/**
|
|
4754
4854
|
* @public
|
|
@@ -4761,7 +4861,7 @@ export declare interface UiInputProps extends Omit<PBUiInput, 'font' | 'textAlig
|
|
|
4761
4861
|
}
|
|
4762
4862
|
|
|
4763
4863
|
/** @public */
|
|
4764
|
-
export declare const UiInputResult:
|
|
4864
|
+
export declare const UiInputResult: LastWriteWinElementSetComponentDefinition<PBUiInputResult>;
|
|
4765
4865
|
|
|
4766
4866
|
/**
|
|
4767
4867
|
* Label component props
|
|
@@ -4786,7 +4886,7 @@ export declare interface UiLabelProps {
|
|
|
4786
4886
|
export declare type uint32 = number;
|
|
4787
4887
|
|
|
4788
4888
|
/** @public */
|
|
4789
|
-
export declare const UiText:
|
|
4889
|
+
export declare const UiText: LastWriteWinElementSetComponentDefinition<PBUiText>;
|
|
4790
4890
|
|
|
4791
4891
|
/**
|
|
4792
4892
|
* Texture
|
|
@@ -4799,7 +4899,7 @@ export declare type UiTexture = {
|
|
|
4799
4899
|
};
|
|
4800
4900
|
|
|
4801
4901
|
/** @public */
|
|
4802
|
-
export declare const UiTransform:
|
|
4902
|
+
export declare const UiTransform: LastWriteWinElementSetComponentDefinition<PBUiTransform>;
|
|
4803
4903
|
|
|
4804
4904
|
/**
|
|
4805
4905
|
* Layout props to position things in the canvas
|
|
@@ -4857,6 +4957,14 @@ export declare interface UiTransformProps {
|
|
|
4857
4957
|
*/
|
|
4858
4958
|
export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
|
|
4859
4959
|
|
|
4960
|
+
/**
|
|
4961
|
+
* @public
|
|
4962
|
+
*/
|
|
4963
|
+
export declare type ValueSetOptions<T> = {
|
|
4964
|
+
timestampFunction: (value: DeepReadonly<T>) => number;
|
|
4965
|
+
maxElements: number;
|
|
4966
|
+
};
|
|
4967
|
+
|
|
4860
4968
|
/**
|
|
4861
4969
|
* @public
|
|
4862
4970
|
* Vector3 is a type and a namespace.
|
|
@@ -5461,7 +5569,7 @@ export declare type Vector3Type = {
|
|
|
5461
5569
|
};
|
|
5462
5570
|
|
|
5463
5571
|
/** @public */
|
|
5464
|
-
export declare const VideoPlayer:
|
|
5572
|
+
export declare const VideoPlayer: LastWriteWinElementSetComponentDefinition<PBVideoPlayer>;
|
|
5465
5573
|
|
|
5466
5574
|
/**
|
|
5467
5575
|
* @public
|
|
@@ -5475,7 +5583,7 @@ export declare interface VideoTexture {
|
|
|
5475
5583
|
}
|
|
5476
5584
|
|
|
5477
5585
|
/** @public */
|
|
5478
|
-
export declare const VisibilityComponent:
|
|
5586
|
+
export declare const VisibilityComponent: LastWriteWinElementSetComponentDefinition<PBVisibilityComponent>;
|
|
5479
5587
|
|
|
5480
5588
|
/**
|
|
5481
5589
|
* @public
|