@dcl/playground-assets 7.0.6-4177592674.commit-39cdc99 → 7.0.6-4180146485.commit-9a7dde9
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 +222 -142
- package/dist/beta.d.ts +222 -142
- package/dist/index.bundled.d.ts +222 -142
- package/dist/index.js +321 -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 +222 -142
- package/etc/playground-assets.api.json +2259 -1941
- package/etc/playground-assets.api.md +122 -87
- package/package.json +3 -3
package/dist/beta.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.
|
|
@@ -1729,7 +1758,7 @@ export declare type IInputSystem = {
|
|
|
1729
1758
|
* @param entity - the entity to query, ignore for global
|
|
1730
1759
|
* @returns boolean
|
|
1731
1760
|
*/
|
|
1732
|
-
isTriggered: (inputAction: InputAction, pointerEventType: PointerEventType, entity
|
|
1761
|
+
isTriggered: (inputAction: InputAction, pointerEventType: PointerEventType, entity: Entity) => boolean;
|
|
1733
1762
|
/**
|
|
1734
1763
|
* @public
|
|
1735
1764
|
* Check if an input action is currently being pressed.
|
|
@@ -1745,7 +1774,7 @@ export declare type IInputSystem = {
|
|
|
1745
1774
|
* @param entity - the entity to query, ignore for global
|
|
1746
1775
|
* @returns the input command info or undefined if there is no command in the last tick-update
|
|
1747
1776
|
*/
|
|
1748
|
-
getInputCommand: (inputAction: InputAction, pointerEventType: PointerEventType, entity
|
|
1777
|
+
getInputCommand: (inputAction: InputAction, pointerEventType: PointerEventType, entity: Entity) => PBPointerEventsResult | null;
|
|
1749
1778
|
};
|
|
1750
1779
|
|
|
1751
1780
|
/**
|
|
@@ -1756,8 +1785,6 @@ export declare type IncludeUndefined<T> = {
|
|
|
1756
1785
|
[P in keyof T]: undefined extends T[P] ? P : never;
|
|
1757
1786
|
}[keyof T];
|
|
1758
1787
|
|
|
1759
|
-
export declare function incrementTimestamp(entity: Entity, timestamps: Map<Entity, number>): number;
|
|
1760
|
-
|
|
1761
1788
|
/**
|
|
1762
1789
|
* @public
|
|
1763
1790
|
* Input component
|
|
@@ -1825,10 +1852,10 @@ export declare const inputSystem: IInputSystem;
|
|
|
1825
1852
|
* @public
|
|
1826
1853
|
*/
|
|
1827
1854
|
export declare interface ISchema<T = any> {
|
|
1828
|
-
serialize(value: T
|
|
1855
|
+
serialize(value: DeepReadonly<T>, builder: ByteBuffer): void;
|
|
1829
1856
|
deserialize(reader: ByteBuffer): T;
|
|
1830
1857
|
create(): T;
|
|
1831
|
-
extend?: (base
|
|
1858
|
+
extend?: (base: Partial<DeepReadonly<T>> | undefined) => T;
|
|
1832
1859
|
}
|
|
1833
1860
|
|
|
1834
1861
|
/**
|
|
@@ -1867,6 +1894,58 @@ export declare type Key = number | string;
|
|
|
1867
1894
|
*/
|
|
1868
1895
|
export declare function Label(props: EntityPropTypes & UiLabelProps): ReactEcs.JSX.Element;
|
|
1869
1896
|
|
|
1897
|
+
/**
|
|
1898
|
+
* @public
|
|
1899
|
+
*/
|
|
1900
|
+
export declare interface LastWriteWinElementSetComponentDefinition<T> extends BaseComponent<T> {
|
|
1901
|
+
readonly componentType: ComponentType.LastWriteWinElementSet;
|
|
1902
|
+
/**
|
|
1903
|
+
* Get the readonly component of the entity (to mutate it, use getMutable instead),
|
|
1904
|
+
* throws an error if the entity doesn't have the component.
|
|
1905
|
+
* @param entity - Entity that will be used to get the component
|
|
1906
|
+
* @returns
|
|
1907
|
+
*/
|
|
1908
|
+
get(entity: Entity): DeepReadonly<T>;
|
|
1909
|
+
/**
|
|
1910
|
+
* Get the readonly component of the entity (to mutate it, use getMutable instead), or null if the entity doesn't have the component.
|
|
1911
|
+
* @param entity - Entity that will be used to try to get the component
|
|
1912
|
+
*/
|
|
1913
|
+
getOrNull(entity: Entity): DeepReadonly<T> | null;
|
|
1914
|
+
/**
|
|
1915
|
+
* Add the current component to an entity, throw an error if the component already exists (use `createOrReplace` instead).
|
|
1916
|
+
* - Internal comment: This method adds the <entity,component> to the list to be reviewed next frame
|
|
1917
|
+
* @param entity - Entity that will be used to create the component
|
|
1918
|
+
* @param val - The initial value
|
|
1919
|
+
*/
|
|
1920
|
+
create(entity: Entity, val?: T): T;
|
|
1921
|
+
/**
|
|
1922
|
+
* Add the current component to an entity or replace the content if the entity already has the component
|
|
1923
|
+
* - Internal comment: This method adds the <entity,component> to the list to be reviewed next frame
|
|
1924
|
+
* @param entity - Entity that will be used to create or replace the component
|
|
1925
|
+
* @param val - The initial or new value
|
|
1926
|
+
*/
|
|
1927
|
+
createOrReplace(entity: Entity, val?: T): T;
|
|
1928
|
+
/**
|
|
1929
|
+
* @public
|
|
1930
|
+
* Delete the current component to an entity, return null if the entity doesn't have the current component.
|
|
1931
|
+
* - Internal comment: This method adds the <entity,component> to the list to be reviewed next frame
|
|
1932
|
+
* @param entity - Entity to delete the component from
|
|
1933
|
+
*/
|
|
1934
|
+
deleteFrom(entity: Entity): T | null;
|
|
1935
|
+
/**
|
|
1936
|
+
* Get the mutable component of the entity, throw an error if the entity doesn't have the component.
|
|
1937
|
+
* - Internal comment: This method adds the <entity,component> to the list to be reviewed next frame
|
|
1938
|
+
* @param entity - Entity to get the component from
|
|
1939
|
+
*/
|
|
1940
|
+
getMutable(entity: Entity): T;
|
|
1941
|
+
/**
|
|
1942
|
+
* Get the mutable component of the entity, return null if the entity doesn't have the component.
|
|
1943
|
+
* - Internal comment: This method adds the <entity,component> to the list to be reviewed next frame
|
|
1944
|
+
* @param entity - Entity to get the component from
|
|
1945
|
+
*/
|
|
1946
|
+
getMutableOrNull(entity: Entity): T | null;
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1870
1949
|
/**
|
|
1871
1950
|
* User key event Listeners
|
|
1872
1951
|
* @public
|
|
@@ -1878,11 +1957,13 @@ export declare type Listeners = {
|
|
|
1878
1957
|
onMouseUp?: Callback;
|
|
1879
1958
|
};
|
|
1880
1959
|
|
|
1960
|
+
export declare type LwwComponentGetter<T extends LastWriteWinElementSetComponentDefinition<any>> = (engine: Pick<IEngine, 'defineComponentFromSchema'>) => T;
|
|
1961
|
+
|
|
1881
1962
|
/**
|
|
1882
1963
|
* @public
|
|
1883
1964
|
* Overrides component definition to support partial default values
|
|
1884
1965
|
*/
|
|
1885
|
-
export declare interface MapComponentDefinition<T> extends
|
|
1966
|
+
export declare interface MapComponentDefinition<T> extends LastWriteWinElementSetComponentDefinition<T> {
|
|
1886
1967
|
/**
|
|
1887
1968
|
* Add the current component to an entity, throw an error if the component already exists (use `createOrReplace` instead).
|
|
1888
1969
|
* - Internal comment: This method adds the <entity,component> to the list to be reviewed next frame
|
|
@@ -1911,7 +1992,7 @@ export declare const Material: MaterialComponentDefinitionExtended;
|
|
|
1911
1992
|
/**
|
|
1912
1993
|
* @public
|
|
1913
1994
|
*/
|
|
1914
|
-
export declare interface MaterialComponentDefinitionExtended extends
|
|
1995
|
+
export declare interface MaterialComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition<PBMaterial> {
|
|
1915
1996
|
/**
|
|
1916
1997
|
* Texture helpers with constructor
|
|
1917
1998
|
*/
|
|
@@ -2677,7 +2758,7 @@ export declare const MeshCollider: MeshColliderComponentDefinitionExtended;
|
|
|
2677
2758
|
/**
|
|
2678
2759
|
* @public
|
|
2679
2760
|
*/
|
|
2680
|
-
export declare interface MeshColliderComponentDefinitionExtended extends
|
|
2761
|
+
export declare interface MeshColliderComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition<PBMeshCollider> {
|
|
2681
2762
|
/**
|
|
2682
2763
|
* @public
|
|
2683
2764
|
* Set a box in the MeshCollider component
|
|
@@ -2715,7 +2796,7 @@ export declare const MeshRenderer: MeshRendererComponentDefinitionExtended;
|
|
|
2715
2796
|
/**
|
|
2716
2797
|
* @public
|
|
2717
2798
|
*/
|
|
2718
|
-
export declare interface MeshRendererComponentDefinitionExtended extends
|
|
2799
|
+
export declare interface MeshRendererComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition<PBMeshRenderer> {
|
|
2719
2800
|
/**
|
|
2720
2801
|
* @public
|
|
2721
2802
|
* Set a box in the MeshRenderer component
|
|
@@ -2785,7 +2866,7 @@ export declare const enum NftFrameType {
|
|
|
2785
2866
|
}
|
|
2786
2867
|
|
|
2787
2868
|
/** @public */
|
|
2788
|
-
export declare const NftShape:
|
|
2869
|
+
export declare const NftShape: LastWriteWinElementSetComponentDefinition<PBNftShape>;
|
|
2789
2870
|
|
|
2790
2871
|
export declare class Observable<T> {
|
|
2791
2872
|
private _observers;
|
|
@@ -2829,7 +2910,7 @@ export declare class ObserverEventState {
|
|
|
2829
2910
|
/**
|
|
2830
2911
|
* @public
|
|
2831
2912
|
*/
|
|
2832
|
-
export declare type OnChangeFunction = (entity: Entity, operation: CrdtMessageType, component?: ComponentDefinition<any
|
|
2913
|
+
export declare type OnChangeFunction = (entity: Entity, operation: CrdtMessageType, component?: ComponentDefinition<any>, componentValue?: any) => void;
|
|
2833
2914
|
|
|
2834
2915
|
export declare const onCommsMessage: Observable<{
|
|
2835
2916
|
sender: string;
|
|
@@ -3267,20 +3348,11 @@ export declare interface PBPointerEvents_Info {
|
|
|
3267
3348
|
showFeedback?: boolean | undefined;
|
|
3268
3349
|
}
|
|
3269
3350
|
|
|
3270
|
-
/**
|
|
3351
|
+
/** renderer append a new object of this in each command, there can be many commands per frames */
|
|
3271
3352
|
/**
|
|
3272
3353
|
* @public
|
|
3273
3354
|
*/
|
|
3274
3355
|
export declare interface PBPointerEventsResult {
|
|
3275
|
-
/** a list of the last N pointer commands (from the engine) */
|
|
3276
|
-
commands: PBPointerEventsResult_PointerCommand[];
|
|
3277
|
-
}
|
|
3278
|
-
|
|
3279
|
-
/** this message represents a pointer event, used both for UP and DOWN actions */
|
|
3280
|
-
/**
|
|
3281
|
-
* @public
|
|
3282
|
-
*/
|
|
3283
|
-
export declare interface PBPointerEventsResult_PointerCommand {
|
|
3284
3356
|
/** identifier of the input */
|
|
3285
3357
|
button: InputAction;
|
|
3286
3358
|
hit: RaycastHit | undefined;
|
|
@@ -3694,10 +3766,10 @@ export declare namespace Plane {
|
|
|
3694
3766
|
}
|
|
3695
3767
|
|
|
3696
3768
|
/** @public */
|
|
3697
|
-
export declare const PointerEvents:
|
|
3769
|
+
export declare const PointerEvents: LastWriteWinElementSetComponentDefinition<PBPointerEvents>;
|
|
3698
3770
|
|
|
3699
3771
|
/** @public */
|
|
3700
|
-
export declare const PointerEventsResult:
|
|
3772
|
+
export declare const PointerEventsResult: GrowOnlyValueSetComponentDefinition<PBPointerEventsResult>;
|
|
3701
3773
|
|
|
3702
3774
|
/**
|
|
3703
3775
|
* @public
|
|
@@ -3750,7 +3822,7 @@ export declare const enum PointerEventType {
|
|
|
3750
3822
|
}
|
|
3751
3823
|
|
|
3752
3824
|
/** @public */
|
|
3753
|
-
export declare const PointerLock:
|
|
3825
|
+
export declare const PointerLock: LastWriteWinElementSetComponentDefinition<PBPointerLock>;
|
|
3754
3826
|
|
|
3755
3827
|
/**
|
|
3756
3828
|
* Type used for defining the position of the element. i.e. margin, padding
|
|
@@ -4120,7 +4192,7 @@ export declare type QuaternionType = {
|
|
|
4120
4192
|
export declare const RAD2DEG: number;
|
|
4121
4193
|
|
|
4122
4194
|
/** @public */
|
|
4123
|
-
export declare const Raycast:
|
|
4195
|
+
export declare const Raycast: LastWriteWinElementSetComponentDefinition<PBRaycast>;
|
|
4124
4196
|
|
|
4125
4197
|
/** Position will be relative to the scene */
|
|
4126
4198
|
/**
|
|
@@ -4151,7 +4223,7 @@ export declare type RaycastResponsePayload<T> = {
|
|
|
4151
4223
|
};
|
|
4152
4224
|
|
|
4153
4225
|
/** @public */
|
|
4154
|
-
export declare const RaycastResult:
|
|
4226
|
+
export declare const RaycastResult: LastWriteWinElementSetComponentDefinition<PBRaycastResult>;
|
|
4155
4227
|
|
|
4156
4228
|
/**
|
|
4157
4229
|
* @public
|
|
@@ -4500,7 +4572,7 @@ export declare const enum TextAlignMode {
|
|
|
4500
4572
|
export declare type TextAlignType = 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'middle-center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
4501
4573
|
|
|
4502
4574
|
/** @public */
|
|
4503
|
-
export declare const TextShape:
|
|
4575
|
+
export declare const TextShape: LastWriteWinElementSetComponentDefinition<PBTextShape>;
|
|
4504
4576
|
|
|
4505
4577
|
/**
|
|
4506
4578
|
* @public
|
|
@@ -4614,7 +4686,7 @@ export declare const Transform: TransformComponentExtended;
|
|
|
4614
4686
|
/**
|
|
4615
4687
|
* @public
|
|
4616
4688
|
*/
|
|
4617
|
-
export declare type TransformComponent =
|
|
4689
|
+
export declare type TransformComponent = LastWriteWinElementSetComponentDefinition<TransformType>;
|
|
4618
4690
|
|
|
4619
4691
|
/**
|
|
4620
4692
|
* @public
|
|
@@ -4677,7 +4749,7 @@ export declare interface UiAvatarTexture {
|
|
|
4677
4749
|
}
|
|
4678
4750
|
|
|
4679
4751
|
/** @public */
|
|
4680
|
-
export declare const UiBackground:
|
|
4752
|
+
export declare const UiBackground: LastWriteWinElementSetComponentDefinition<PBUiBackground>;
|
|
4681
4753
|
|
|
4682
4754
|
/**
|
|
4683
4755
|
* @public
|
|
@@ -4715,7 +4787,7 @@ export declare interface UiButtonProps extends UiLabelProps, EntityPropTypes {
|
|
|
4715
4787
|
export declare type UiComponent = () => ReactEcs.JSX.Element;
|
|
4716
4788
|
|
|
4717
4789
|
/** @public */
|
|
4718
|
-
export declare const UiDropdown:
|
|
4790
|
+
export declare const UiDropdown: LastWriteWinElementSetComponentDefinition<PBUiDropdown>;
|
|
4719
4791
|
|
|
4720
4792
|
/**
|
|
4721
4793
|
* @public
|
|
@@ -4728,7 +4800,7 @@ export declare interface UiDropdownProps extends EntityPropTypes, Omit<Partial<P
|
|
|
4728
4800
|
}
|
|
4729
4801
|
|
|
4730
4802
|
/** @public */
|
|
4731
|
-
export declare const UiDropdownResult:
|
|
4803
|
+
export declare const UiDropdownResult: LastWriteWinElementSetComponentDefinition<PBUiDropdownResult>;
|
|
4732
4804
|
|
|
4733
4805
|
/**
|
|
4734
4806
|
* @public
|
|
@@ -4744,7 +4816,7 @@ export declare function UiEntity(props: EntityPropTypes & {
|
|
|
4744
4816
|
export declare type UiFontType = 'sans-serif' | 'serif' | 'monospace';
|
|
4745
4817
|
|
|
4746
4818
|
/** @public */
|
|
4747
|
-
export declare const UiInput:
|
|
4819
|
+
export declare const UiInput: LastWriteWinElementSetComponentDefinition<PBUiInput>;
|
|
4748
4820
|
|
|
4749
4821
|
/**
|
|
4750
4822
|
* @public
|
|
@@ -4757,7 +4829,7 @@ export declare interface UiInputProps extends Omit<PBUiInput, 'font' | 'textAlig
|
|
|
4757
4829
|
}
|
|
4758
4830
|
|
|
4759
4831
|
/** @public */
|
|
4760
|
-
export declare const UiInputResult:
|
|
4832
|
+
export declare const UiInputResult: LastWriteWinElementSetComponentDefinition<PBUiInputResult>;
|
|
4761
4833
|
|
|
4762
4834
|
/**
|
|
4763
4835
|
* Label component props
|
|
@@ -4782,7 +4854,7 @@ export declare interface UiLabelProps {
|
|
|
4782
4854
|
export declare type uint32 = number;
|
|
4783
4855
|
|
|
4784
4856
|
/** @public */
|
|
4785
|
-
export declare const UiText:
|
|
4857
|
+
export declare const UiText: LastWriteWinElementSetComponentDefinition<PBUiText>;
|
|
4786
4858
|
|
|
4787
4859
|
/**
|
|
4788
4860
|
* Texture
|
|
@@ -4795,7 +4867,7 @@ export declare type UiTexture = {
|
|
|
4795
4867
|
};
|
|
4796
4868
|
|
|
4797
4869
|
/** @public */
|
|
4798
|
-
export declare const UiTransform:
|
|
4870
|
+
export declare const UiTransform: LastWriteWinElementSetComponentDefinition<PBUiTransform>;
|
|
4799
4871
|
|
|
4800
4872
|
/**
|
|
4801
4873
|
* Layout props to position things in the canvas
|
|
@@ -4853,6 +4925,14 @@ export declare interface UiTransformProps {
|
|
|
4853
4925
|
*/
|
|
4854
4926
|
export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
|
|
4855
4927
|
|
|
4928
|
+
/**
|
|
4929
|
+
* @public
|
|
4930
|
+
*/
|
|
4931
|
+
export declare type ValueSetOptions<T> = {
|
|
4932
|
+
timestampFunction: (value: DeepReadonly<T>) => number;
|
|
4933
|
+
maxElements: number;
|
|
4934
|
+
};
|
|
4935
|
+
|
|
4856
4936
|
/**
|
|
4857
4937
|
* @public
|
|
4858
4938
|
* Vector3 is a type and a namespace.
|
|
@@ -5457,7 +5537,7 @@ export declare type Vector3Type = {
|
|
|
5457
5537
|
};
|
|
5458
5538
|
|
|
5459
5539
|
/** @public */
|
|
5460
|
-
export declare const VideoPlayer:
|
|
5540
|
+
export declare const VideoPlayer: LastWriteWinElementSetComponentDefinition<PBVideoPlayer>;
|
|
5461
5541
|
|
|
5462
5542
|
/**
|
|
5463
5543
|
* @public
|
|
@@ -5471,7 +5551,7 @@ export declare interface VideoTexture {
|
|
|
5471
5551
|
}
|
|
5472
5552
|
|
|
5473
5553
|
/** @public */
|
|
5474
|
-
export declare const VisibilityComponent:
|
|
5554
|
+
export declare const VisibilityComponent: LastWriteWinElementSetComponentDefinition<PBVisibilityComponent>;
|
|
5475
5555
|
|
|
5476
5556
|
/**
|
|
5477
5557
|
* @public
|