@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.
@@ -8,7 +8,7 @@ export declare const Animator: AnimatorComponentDefinitionExtended;
8
8
  /**
9
9
  * @public
10
10
  */
11
- export declare interface AnimatorComponentDefinitionExtended extends ComponentDefinition<PBAnimator> {
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: ComponentDefinition<PBAudioSource>;
74
+ export declare const AudioSource: LastWriteWinElementSetComponentDefinition<PBAudioSource>;
53
75
 
54
76
  /** @public */
55
- export declare const AudioStream: ComponentDefinition<PBAudioStream>;
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: ComponentDefinition<PBAvatarAttach>;
90
+ export declare const AvatarAttach: LastWriteWinElementSetComponentDefinition<PBAvatarAttach>;
69
91
 
70
92
  /** @public */
71
- export declare const AvatarModifierArea: ComponentDefinition<PBAvatarModifierArea>;
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: ComponentDefinition<PBAvatarShape>;
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: ComponentDefinition<PBBillboard>;
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: ComponentDefinition<PBCameraMode>;
336
+ export declare const CameraMode: LastWriteWinElementSetComponentDefinition<PBCameraMode>;
271
337
 
272
338
  /** @public */
273
- export declare const CameraModeArea: ComponentDefinition<PBCameraModeArea>;
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 interface ComponentDefinition<T> {
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 &lt;entity,component&gt; 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 &lt;entity,component&gt; 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 &lt;entity,component&gt; 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 &lt;entity,component&gt; 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 &lt;entity,component&gt; 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
- export declare type ComponentGetter<T extends ComponentDefinition<any>> = (engine: Pick<IEngine, 'defineComponentFromSchema'>) => T;
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 ComponentSchema<T extends [ComponentDefinition<any>, ...ComponentDefinition<any>[]]> = {
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
- MAX_MESSAGE_TYPE = 4
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<DeepReadonly<K>, DeepReadonly<V>>;
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: PBPointerEventsResult_PointerCommand) => void;
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: ComponentDefinition<PBGltfContainer>;
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>): ComponentDefinition<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?: Entity) => boolean;
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?: Entity) => PBPointerEventsResult_PointerCommand | null;
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,12 +1852,40 @@ export declare const inputSystem: IInputSystem;
1825
1852
  * @public
1826
1853
  */
1827
1854
  export declare interface ISchema<T = any> {
1828
- serialize(value: T, builder: ByteBuffer): void;
1855
+ serialize(value: DeepReadonly<T>, builder: ByteBuffer): void;
1829
1856
  deserialize(reader: ByteBuffer): T;
1830
1857
  create(): T;
1831
- extend?: (base?: T) => T;
1858
+ extend?: (base: Partial<DeepReadonly<T>> | undefined) => T;
1859
+ jsonSchema: JsonSchemaExtended;
1832
1860
  }
1833
1861
 
1862
+ /**
1863
+ * @public
1864
+ */
1865
+ export declare type JsonArray = Array<JsonPrimitive | JsonMap | JsonArray>;
1866
+
1867
+ /**
1868
+ * @public
1869
+ */
1870
+ export declare type JsonMap = {
1871
+ [key: string]: JsonPrimitive | JsonMap | JsonArray;
1872
+ };
1873
+
1874
+ /**
1875
+ * @public
1876
+ */
1877
+ export declare type JsonPrimitive = string | number | boolean | null;
1878
+
1879
+ /**
1880
+ * JsonSchemaExtended must specify the type, and it can has more primitives params.
1881
+ * Functions are not allowed.
1882
+ * @public
1883
+ */
1884
+ export declare type JsonSchemaExtended = {
1885
+ type: 'object' | 'number' | 'integer' | 'string' | 'array' | 'boolean';
1886
+ 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';
1887
+ } & JsonMap;
1888
+
1834
1889
  /**
1835
1890
  * @hidden
1836
1891
  */
@@ -1867,6 +1922,58 @@ export declare type Key = number | string;
1867
1922
  */
1868
1923
  export declare function Label(props: EntityPropTypes & UiLabelProps): ReactEcs.JSX.Element;
1869
1924
 
1925
+ /**
1926
+ * @public
1927
+ */
1928
+ export declare interface LastWriteWinElementSetComponentDefinition<T> extends BaseComponent<T> {
1929
+ readonly componentType: ComponentType.LastWriteWinElementSet;
1930
+ /**
1931
+ * Get the readonly component of the entity (to mutate it, use getMutable instead),
1932
+ * throws an error if the entity doesn't have the component.
1933
+ * @param entity - Entity that will be used to get the component
1934
+ * @returns
1935
+ */
1936
+ get(entity: Entity): DeepReadonly<T>;
1937
+ /**
1938
+ * Get the readonly component of the entity (to mutate it, use getMutable instead), or null if the entity doesn't have the component.
1939
+ * @param entity - Entity that will be used to try to get the component
1940
+ */
1941
+ getOrNull(entity: Entity): DeepReadonly<T> | null;
1942
+ /**
1943
+ * Add the current component to an entity, throw an error if the component already exists (use `createOrReplace` instead).
1944
+ * - Internal comment: This method adds the &lt;entity,component&gt; to the list to be reviewed next frame
1945
+ * @param entity - Entity that will be used to create the component
1946
+ * @param val - The initial value
1947
+ */
1948
+ create(entity: Entity, val?: T): T;
1949
+ /**
1950
+ * Add the current component to an entity or replace the content if the entity already has the component
1951
+ * - Internal comment: This method adds the &lt;entity,component&gt; to the list to be reviewed next frame
1952
+ * @param entity - Entity that will be used to create or replace the component
1953
+ * @param val - The initial or new value
1954
+ */
1955
+ createOrReplace(entity: Entity, val?: T): T;
1956
+ /**
1957
+ * @public
1958
+ * Delete the current component to an entity, return null if the entity doesn't have the current component.
1959
+ * - Internal comment: This method adds the &lt;entity,component&gt; to the list to be reviewed next frame
1960
+ * @param entity - Entity to delete the component from
1961
+ */
1962
+ deleteFrom(entity: Entity): T | null;
1963
+ /**
1964
+ * Get the mutable component of the entity, throw an error if the entity doesn't have the component.
1965
+ * - Internal comment: This method adds the &lt;entity,component&gt; to the list to be reviewed next frame
1966
+ * @param entity - Entity to get the component from
1967
+ */
1968
+ getMutable(entity: Entity): T;
1969
+ /**
1970
+ * Get the mutable component of the entity, return null if the entity doesn't have the component.
1971
+ * - Internal comment: This method adds the &lt;entity,component&gt; to the list to be reviewed next frame
1972
+ * @param entity - Entity to get the component from
1973
+ */
1974
+ getMutableOrNull(entity: Entity): T | null;
1975
+ }
1976
+
1870
1977
  /**
1871
1978
  * User key event Listeners
1872
1979
  * @public
@@ -1878,11 +1985,13 @@ export declare type Listeners = {
1878
1985
  onMouseUp?: Callback;
1879
1986
  };
1880
1987
 
1988
+ export declare type LwwComponentGetter<T extends LastWriteWinElementSetComponentDefinition<any>> = (engine: Pick<IEngine, 'defineComponentFromSchema'>) => T;
1989
+
1881
1990
  /**
1882
1991
  * @public
1883
1992
  * Overrides component definition to support partial default values
1884
1993
  */
1885
- export declare interface MapComponentDefinition<T> extends ComponentDefinition<T> {
1994
+ export declare interface MapComponentDefinition<T> extends LastWriteWinElementSetComponentDefinition<T> {
1886
1995
  /**
1887
1996
  * Add the current component to an entity, throw an error if the component already exists (use `createOrReplace` instead).
1888
1997
  * - Internal comment: This method adds the &lt;entity,component&gt; to the list to be reviewed next frame
@@ -1911,7 +2020,7 @@ export declare const Material: MaterialComponentDefinitionExtended;
1911
2020
  /**
1912
2021
  * @public
1913
2022
  */
1914
- export declare interface MaterialComponentDefinitionExtended extends ComponentDefinition<PBMaterial> {
2023
+ export declare interface MaterialComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition<PBMaterial> {
1915
2024
  /**
1916
2025
  * Texture helpers with constructor
1917
2026
  */
@@ -2677,7 +2786,7 @@ export declare const MeshCollider: MeshColliderComponentDefinitionExtended;
2677
2786
  /**
2678
2787
  * @public
2679
2788
  */
2680
- export declare interface MeshColliderComponentDefinitionExtended extends ComponentDefinition<PBMeshCollider> {
2789
+ export declare interface MeshColliderComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition<PBMeshCollider> {
2681
2790
  /**
2682
2791
  * @public
2683
2792
  * Set a box in the MeshCollider component
@@ -2715,7 +2824,7 @@ export declare const MeshRenderer: MeshRendererComponentDefinitionExtended;
2715
2824
  /**
2716
2825
  * @public
2717
2826
  */
2718
- export declare interface MeshRendererComponentDefinitionExtended extends ComponentDefinition<PBMeshRenderer> {
2827
+ export declare interface MeshRendererComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition<PBMeshRenderer> {
2719
2828
  /**
2720
2829
  * @public
2721
2830
  * Set a box in the MeshRenderer component
@@ -2785,7 +2894,7 @@ export declare const enum NftFrameType {
2785
2894
  }
2786
2895
 
2787
2896
  /** @public */
2788
- export declare const NftShape: ComponentDefinition<PBNftShape>;
2897
+ export declare const NftShape: LastWriteWinElementSetComponentDefinition<PBNftShape>;
2789
2898
 
2790
2899
  export declare class Observable<T> {
2791
2900
  private _observers;
@@ -2829,7 +2938,7 @@ export declare class ObserverEventState {
2829
2938
  /**
2830
2939
  * @public
2831
2940
  */
2832
- export declare type OnChangeFunction = (entity: Entity, operation: CrdtMessageType, component?: ComponentDefinition<any>) => void;
2941
+ export declare type OnChangeFunction = (entity: Entity, operation: CrdtMessageType, component?: ComponentDefinition<any>, componentValue?: any) => void;
2833
2942
 
2834
2943
  export declare const onCommsMessage: Observable<{
2835
2944
  sender: string;
@@ -3267,20 +3376,11 @@ export declare interface PBPointerEvents_Info {
3267
3376
  showFeedback?: boolean | undefined;
3268
3377
  }
3269
3378
 
3270
- /** the renderer will set this component to the root entity once per frame with all the events */
3379
+ /** renderer append a new object of this in each command, there can be many commands per frames */
3271
3380
  /**
3272
3381
  * @public
3273
3382
  */
3274
3383
  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
3384
  /** identifier of the input */
3285
3385
  button: InputAction;
3286
3386
  hit: RaycastHit | undefined;
@@ -3694,10 +3794,10 @@ export declare namespace Plane {
3694
3794
  }
3695
3795
 
3696
3796
  /** @public */
3697
- export declare const PointerEvents: ComponentDefinition<PBPointerEvents>;
3797
+ export declare const PointerEvents: LastWriteWinElementSetComponentDefinition<PBPointerEvents>;
3698
3798
 
3699
3799
  /** @public */
3700
- export declare const PointerEventsResult: ComponentDefinition<PBPointerEventsResult>;
3800
+ export declare const PointerEventsResult: GrowOnlyValueSetComponentDefinition<PBPointerEventsResult>;
3701
3801
 
3702
3802
  /**
3703
3803
  * @public
@@ -3750,7 +3850,7 @@ export declare const enum PointerEventType {
3750
3850
  }
3751
3851
 
3752
3852
  /** @public */
3753
- export declare const PointerLock: ComponentDefinition<PBPointerLock>;
3853
+ export declare const PointerLock: LastWriteWinElementSetComponentDefinition<PBPointerLock>;
3754
3854
 
3755
3855
  /**
3756
3856
  * Type used for defining the position of the element. i.e. margin, padding
@@ -4120,7 +4220,7 @@ export declare type QuaternionType = {
4120
4220
  export declare const RAD2DEG: number;
4121
4221
 
4122
4222
  /** @public */
4123
- export declare const Raycast: ComponentDefinition<PBRaycast>;
4223
+ export declare const Raycast: LastWriteWinElementSetComponentDefinition<PBRaycast>;
4124
4224
 
4125
4225
  /** Position will be relative to the scene */
4126
4226
  /**
@@ -4151,7 +4251,7 @@ export declare type RaycastResponsePayload<T> = {
4151
4251
  };
4152
4252
 
4153
4253
  /** @public */
4154
- export declare const RaycastResult: ComponentDefinition<PBRaycastResult>;
4254
+ export declare const RaycastResult: LastWriteWinElementSetComponentDefinition<PBRaycastResult>;
4155
4255
 
4156
4256
  /**
4157
4257
  * @public
@@ -4500,7 +4600,7 @@ export declare const enum TextAlignMode {
4500
4600
  export declare type TextAlignType = 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'middle-center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
4501
4601
 
4502
4602
  /** @public */
4503
- export declare const TextShape: ComponentDefinition<PBTextShape>;
4603
+ export declare const TextShape: LastWriteWinElementSetComponentDefinition<PBTextShape>;
4504
4604
 
4505
4605
  /**
4506
4606
  * @public
@@ -4614,7 +4714,7 @@ export declare const Transform: TransformComponentExtended;
4614
4714
  /**
4615
4715
  * @public
4616
4716
  */
4617
- export declare type TransformComponent = ComponentDefinition<TransformType>;
4717
+ export declare type TransformComponent = LastWriteWinElementSetComponentDefinition<TransformType>;
4618
4718
 
4619
4719
  /**
4620
4720
  * @public
@@ -4677,7 +4777,7 @@ export declare interface UiAvatarTexture {
4677
4777
  }
4678
4778
 
4679
4779
  /** @public */
4680
- export declare const UiBackground: ComponentDefinition<PBUiBackground>;
4780
+ export declare const UiBackground: LastWriteWinElementSetComponentDefinition<PBUiBackground>;
4681
4781
 
4682
4782
  /**
4683
4783
  * @public
@@ -4715,7 +4815,7 @@ export declare interface UiButtonProps extends UiLabelProps, EntityPropTypes {
4715
4815
  export declare type UiComponent = () => ReactEcs.JSX.Element;
4716
4816
 
4717
4817
  /** @public */
4718
- export declare const UiDropdown: ComponentDefinition<PBUiDropdown>;
4818
+ export declare const UiDropdown: LastWriteWinElementSetComponentDefinition<PBUiDropdown>;
4719
4819
 
4720
4820
  /**
4721
4821
  * @public
@@ -4728,7 +4828,7 @@ export declare interface UiDropdownProps extends EntityPropTypes, Omit<Partial<P
4728
4828
  }
4729
4829
 
4730
4830
  /** @public */
4731
- export declare const UiDropdownResult: ComponentDefinition<PBUiDropdownResult>;
4831
+ export declare const UiDropdownResult: LastWriteWinElementSetComponentDefinition<PBUiDropdownResult>;
4732
4832
 
4733
4833
  /**
4734
4834
  * @public
@@ -4744,7 +4844,7 @@ export declare function UiEntity(props: EntityPropTypes & {
4744
4844
  export declare type UiFontType = 'sans-serif' | 'serif' | 'monospace';
4745
4845
 
4746
4846
  /** @public */
4747
- export declare const UiInput: ComponentDefinition<PBUiInput>;
4847
+ export declare const UiInput: LastWriteWinElementSetComponentDefinition<PBUiInput>;
4748
4848
 
4749
4849
  /**
4750
4850
  * @public
@@ -4757,7 +4857,7 @@ export declare interface UiInputProps extends Omit<PBUiInput, 'font' | 'textAlig
4757
4857
  }
4758
4858
 
4759
4859
  /** @public */
4760
- export declare const UiInputResult: ComponentDefinition<PBUiInputResult>;
4860
+ export declare const UiInputResult: LastWriteWinElementSetComponentDefinition<PBUiInputResult>;
4761
4861
 
4762
4862
  /**
4763
4863
  * Label component props
@@ -4782,7 +4882,7 @@ export declare interface UiLabelProps {
4782
4882
  export declare type uint32 = number;
4783
4883
 
4784
4884
  /** @public */
4785
- export declare const UiText: ComponentDefinition<PBUiText>;
4885
+ export declare const UiText: LastWriteWinElementSetComponentDefinition<PBUiText>;
4786
4886
 
4787
4887
  /**
4788
4888
  * Texture
@@ -4795,7 +4895,7 @@ export declare type UiTexture = {
4795
4895
  };
4796
4896
 
4797
4897
  /** @public */
4798
- export declare const UiTransform: ComponentDefinition<PBUiTransform>;
4898
+ export declare const UiTransform: LastWriteWinElementSetComponentDefinition<PBUiTransform>;
4799
4899
 
4800
4900
  /**
4801
4901
  * Layout props to position things in the canvas
@@ -4853,6 +4953,14 @@ export declare interface UiTransformProps {
4853
4953
  */
4854
4954
  export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
4855
4955
 
4956
+ /**
4957
+ * @public
4958
+ */
4959
+ export declare type ValueSetOptions<T> = {
4960
+ timestampFunction: (value: DeepReadonly<T>) => number;
4961
+ maxElements: number;
4962
+ };
4963
+
4856
4964
  /**
4857
4965
  * @public
4858
4966
  * Vector3 is a type and a namespace.
@@ -5457,7 +5565,7 @@ export declare type Vector3Type = {
5457
5565
  };
5458
5566
 
5459
5567
  /** @public */
5460
- export declare const VideoPlayer: ComponentDefinition<PBVideoPlayer>;
5568
+ export declare const VideoPlayer: LastWriteWinElementSetComponentDefinition<PBVideoPlayer>;
5461
5569
 
5462
5570
  /**
5463
5571
  * @public
@@ -5471,7 +5579,7 @@ export declare interface VideoTexture {
5471
5579
  }
5472
5580
 
5473
5581
  /** @public */
5474
- export declare const VisibilityComponent: ComponentDefinition<PBVisibilityComponent>;
5582
+ export declare const VisibilityComponent: LastWriteWinElementSetComponentDefinition<PBVisibilityComponent>;
5475
5583
 
5476
5584
  /**
5477
5585
  * @public