@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 CHANGED
@@ -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.
@@ -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?: Entity) => boolean;
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?: Entity) => PBPointerEventsResult_PointerCommand | null;
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,10 +1856,10 @@ export declare const inputSystem: IInputSystem;
1829
1856
  * @public
1830
1857
  */
1831
1858
  export declare interface ISchema<T = any> {
1832
- serialize(value: T, builder: ByteBuffer): void;
1859
+ serialize(value: DeepReadonly<T>, builder: ByteBuffer): void;
1833
1860
  deserialize(reader: ByteBuffer): T;
1834
1861
  create(): T;
1835
- extend?: (base?: T) => T;
1862
+ extend?: (base: Partial<DeepReadonly<T>> | undefined) => T;
1836
1863
  }
1837
1864
 
1838
1865
  /**
@@ -1871,6 +1898,58 @@ export declare type Key = number | string;
1871
1898
  */
1872
1899
  export declare function Label(props: EntityPropTypes & UiLabelProps): ReactEcs.JSX.Element;
1873
1900
 
1901
+ /**
1902
+ * @public
1903
+ */
1904
+ export declare interface LastWriteWinElementSetComponentDefinition<T> extends BaseComponent<T> {
1905
+ readonly componentType: ComponentType.LastWriteWinElementSet;
1906
+ /**
1907
+ * Get the readonly component of the entity (to mutate it, use getMutable instead),
1908
+ * throws an error if the entity doesn't have the component.
1909
+ * @param entity - Entity that will be used to get the component
1910
+ * @returns
1911
+ */
1912
+ get(entity: Entity): DeepReadonly<T>;
1913
+ /**
1914
+ * Get the readonly component of the entity (to mutate it, use getMutable instead), or null if the entity doesn't have the component.
1915
+ * @param entity - Entity that will be used to try to get the component
1916
+ */
1917
+ getOrNull(entity: Entity): DeepReadonly<T> | null;
1918
+ /**
1919
+ * Add the current component to an entity, throw an error if the component already exists (use `createOrReplace` instead).
1920
+ * - Internal comment: This method adds the &lt;entity,component&gt; to the list to be reviewed next frame
1921
+ * @param entity - Entity that will be used to create the component
1922
+ * @param val - The initial value
1923
+ */
1924
+ create(entity: Entity, val?: T): T;
1925
+ /**
1926
+ * Add the current component to an entity or replace the content if the entity already has the component
1927
+ * - Internal comment: This method adds the &lt;entity,component&gt; to the list to be reviewed next frame
1928
+ * @param entity - Entity that will be used to create or replace the component
1929
+ * @param val - The initial or new value
1930
+ */
1931
+ createOrReplace(entity: Entity, val?: T): T;
1932
+ /**
1933
+ * @public
1934
+ * Delete the current component to an entity, return null if the entity doesn't have the current component.
1935
+ * - Internal comment: This method adds the &lt;entity,component&gt; to the list to be reviewed next frame
1936
+ * @param entity - Entity to delete the component from
1937
+ */
1938
+ deleteFrom(entity: Entity): T | null;
1939
+ /**
1940
+ * Get the mutable component of the entity, throw an error if the entity doesn't have the component.
1941
+ * - Internal comment: This method adds the &lt;entity,component&gt; to the list to be reviewed next frame
1942
+ * @param entity - Entity to get the component from
1943
+ */
1944
+ getMutable(entity: Entity): T;
1945
+ /**
1946
+ * Get the mutable component of the entity, return null if the entity doesn't have the component.
1947
+ * - Internal comment: This method adds the &lt;entity,component&gt; to the list to be reviewed next frame
1948
+ * @param entity - Entity to get the component from
1949
+ */
1950
+ getMutableOrNull(entity: Entity): T | null;
1951
+ }
1952
+
1874
1953
  /**
1875
1954
  * User key event Listeners
1876
1955
  * @public
@@ -1882,11 +1961,13 @@ export declare type Listeners = {
1882
1961
  onMouseUp?: Callback;
1883
1962
  };
1884
1963
 
1964
+ export declare type LwwComponentGetter<T extends LastWriteWinElementSetComponentDefinition<any>> = (engine: Pick<IEngine, 'defineComponentFromSchema'>) => T;
1965
+
1885
1966
  /**
1886
1967
  * @public
1887
1968
  * Overrides component definition to support partial default values
1888
1969
  */
1889
- export declare interface MapComponentDefinition<T> extends ComponentDefinition<T> {
1970
+ export declare interface MapComponentDefinition<T> extends LastWriteWinElementSetComponentDefinition<T> {
1890
1971
  /**
1891
1972
  * Add the current component to an entity, throw an error if the component already exists (use `createOrReplace` instead).
1892
1973
  * - Internal comment: This method adds the &lt;entity,component&gt; to the list to be reviewed next frame
@@ -1915,7 +1996,7 @@ export declare const Material: MaterialComponentDefinitionExtended;
1915
1996
  /**
1916
1997
  * @public
1917
1998
  */
1918
- export declare interface MaterialComponentDefinitionExtended extends ComponentDefinition<PBMaterial> {
1999
+ export declare interface MaterialComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition<PBMaterial> {
1919
2000
  /**
1920
2001
  * Texture helpers with constructor
1921
2002
  */
@@ -2681,7 +2762,7 @@ export declare const MeshCollider: MeshColliderComponentDefinitionExtended;
2681
2762
  /**
2682
2763
  * @public
2683
2764
  */
2684
- export declare interface MeshColliderComponentDefinitionExtended extends ComponentDefinition<PBMeshCollider> {
2765
+ export declare interface MeshColliderComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition<PBMeshCollider> {
2685
2766
  /**
2686
2767
  * @public
2687
2768
  * Set a box in the MeshCollider component
@@ -2719,7 +2800,7 @@ export declare const MeshRenderer: MeshRendererComponentDefinitionExtended;
2719
2800
  /**
2720
2801
  * @public
2721
2802
  */
2722
- export declare interface MeshRendererComponentDefinitionExtended extends ComponentDefinition<PBMeshRenderer> {
2803
+ export declare interface MeshRendererComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition<PBMeshRenderer> {
2723
2804
  /**
2724
2805
  * @public
2725
2806
  * Set a box in the MeshRenderer component
@@ -2789,7 +2870,7 @@ export declare const enum NftFrameType {
2789
2870
  }
2790
2871
 
2791
2872
  /** @public */
2792
- export declare const NftShape: ComponentDefinition<PBNftShape>;
2873
+ export declare const NftShape: LastWriteWinElementSetComponentDefinition<PBNftShape>;
2793
2874
 
2794
2875
  export declare class Observable<T> {
2795
2876
  private _observers;
@@ -2833,7 +2914,7 @@ export declare class ObserverEventState {
2833
2914
  /**
2834
2915
  * @public
2835
2916
  */
2836
- export declare type OnChangeFunction = (entity: Entity, operation: CrdtMessageType, component?: ComponentDefinition<any>) => void;
2917
+ export declare type OnChangeFunction = (entity: Entity, operation: CrdtMessageType, component?: ComponentDefinition<any>, componentValue?: any) => void;
2837
2918
 
2838
2919
  export declare const onCommsMessage: Observable<{
2839
2920
  sender: string;
@@ -3271,20 +3352,11 @@ export declare interface PBPointerEvents_Info {
3271
3352
  showFeedback?: boolean | undefined;
3272
3353
  }
3273
3354
 
3274
- /** the renderer will set this component to the root entity once per frame with all the events */
3355
+ /** renderer append a new object of this in each command, there can be many commands per frames */
3275
3356
  /**
3276
3357
  * @public
3277
3358
  */
3278
3359
  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
3360
  /** identifier of the input */
3289
3361
  button: InputAction;
3290
3362
  hit: RaycastHit | undefined;
@@ -3698,10 +3770,10 @@ export declare namespace Plane {
3698
3770
  }
3699
3771
 
3700
3772
  /** @public */
3701
- export declare const PointerEvents: ComponentDefinition<PBPointerEvents>;
3773
+ export declare const PointerEvents: LastWriteWinElementSetComponentDefinition<PBPointerEvents>;
3702
3774
 
3703
3775
  /** @public */
3704
- export declare const PointerEventsResult: ComponentDefinition<PBPointerEventsResult>;
3776
+ export declare const PointerEventsResult: GrowOnlyValueSetComponentDefinition<PBPointerEventsResult>;
3705
3777
 
3706
3778
  /**
3707
3779
  * @public
@@ -3754,7 +3826,7 @@ export declare const enum PointerEventType {
3754
3826
  }
3755
3827
 
3756
3828
  /** @public */
3757
- export declare const PointerLock: ComponentDefinition<PBPointerLock>;
3829
+ export declare const PointerLock: LastWriteWinElementSetComponentDefinition<PBPointerLock>;
3758
3830
 
3759
3831
  /**
3760
3832
  * Type used for defining the position of the element. i.e. margin, padding
@@ -4124,7 +4196,7 @@ export declare type QuaternionType = {
4124
4196
  export declare const RAD2DEG: number;
4125
4197
 
4126
4198
  /** @public */
4127
- export declare const Raycast: ComponentDefinition<PBRaycast>;
4199
+ export declare const Raycast: LastWriteWinElementSetComponentDefinition<PBRaycast>;
4128
4200
 
4129
4201
  /** Position will be relative to the scene */
4130
4202
  /**
@@ -4155,7 +4227,7 @@ export declare type RaycastResponsePayload<T> = {
4155
4227
  };
4156
4228
 
4157
4229
  /** @public */
4158
- export declare const RaycastResult: ComponentDefinition<PBRaycastResult>;
4230
+ export declare const RaycastResult: LastWriteWinElementSetComponentDefinition<PBRaycastResult>;
4159
4231
 
4160
4232
  /**
4161
4233
  * @public
@@ -4504,7 +4576,7 @@ export declare const enum TextAlignMode {
4504
4576
  export declare type TextAlignType = 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'middle-center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
4505
4577
 
4506
4578
  /** @public */
4507
- export declare const TextShape: ComponentDefinition<PBTextShape>;
4579
+ export declare const TextShape: LastWriteWinElementSetComponentDefinition<PBTextShape>;
4508
4580
 
4509
4581
  /**
4510
4582
  * @public
@@ -4618,7 +4690,7 @@ export declare const Transform: TransformComponentExtended;
4618
4690
  /**
4619
4691
  * @public
4620
4692
  */
4621
- export declare type TransformComponent = ComponentDefinition<TransformType>;
4693
+ export declare type TransformComponent = LastWriteWinElementSetComponentDefinition<TransformType>;
4622
4694
 
4623
4695
  /**
4624
4696
  * @public
@@ -4681,7 +4753,7 @@ export declare interface UiAvatarTexture {
4681
4753
  }
4682
4754
 
4683
4755
  /** @public */
4684
- export declare const UiBackground: ComponentDefinition<PBUiBackground>;
4756
+ export declare const UiBackground: LastWriteWinElementSetComponentDefinition<PBUiBackground>;
4685
4757
 
4686
4758
  /**
4687
4759
  * @public
@@ -4719,7 +4791,7 @@ export declare interface UiButtonProps extends UiLabelProps, EntityPropTypes {
4719
4791
  export declare type UiComponent = () => ReactEcs.JSX.Element;
4720
4792
 
4721
4793
  /** @public */
4722
- export declare const UiDropdown: ComponentDefinition<PBUiDropdown>;
4794
+ export declare const UiDropdown: LastWriteWinElementSetComponentDefinition<PBUiDropdown>;
4723
4795
 
4724
4796
  /**
4725
4797
  * @public
@@ -4732,7 +4804,7 @@ export declare interface UiDropdownProps extends EntityPropTypes, Omit<Partial<P
4732
4804
  }
4733
4805
 
4734
4806
  /** @public */
4735
- export declare const UiDropdownResult: ComponentDefinition<PBUiDropdownResult>;
4807
+ export declare const UiDropdownResult: LastWriteWinElementSetComponentDefinition<PBUiDropdownResult>;
4736
4808
 
4737
4809
  /**
4738
4810
  * @public
@@ -4748,7 +4820,7 @@ export declare function UiEntity(props: EntityPropTypes & {
4748
4820
  export declare type UiFontType = 'sans-serif' | 'serif' | 'monospace';
4749
4821
 
4750
4822
  /** @public */
4751
- export declare const UiInput: ComponentDefinition<PBUiInput>;
4823
+ export declare const UiInput: LastWriteWinElementSetComponentDefinition<PBUiInput>;
4752
4824
 
4753
4825
  /**
4754
4826
  * @public
@@ -4761,7 +4833,7 @@ export declare interface UiInputProps extends Omit<PBUiInput, 'font' | 'textAlig
4761
4833
  }
4762
4834
 
4763
4835
  /** @public */
4764
- export declare const UiInputResult: ComponentDefinition<PBUiInputResult>;
4836
+ export declare const UiInputResult: LastWriteWinElementSetComponentDefinition<PBUiInputResult>;
4765
4837
 
4766
4838
  /**
4767
4839
  * Label component props
@@ -4786,7 +4858,7 @@ export declare interface UiLabelProps {
4786
4858
  export declare type uint32 = number;
4787
4859
 
4788
4860
  /** @public */
4789
- export declare const UiText: ComponentDefinition<PBUiText>;
4861
+ export declare const UiText: LastWriteWinElementSetComponentDefinition<PBUiText>;
4790
4862
 
4791
4863
  /**
4792
4864
  * Texture
@@ -4799,7 +4871,7 @@ export declare type UiTexture = {
4799
4871
  };
4800
4872
 
4801
4873
  /** @public */
4802
- export declare const UiTransform: ComponentDefinition<PBUiTransform>;
4874
+ export declare const UiTransform: LastWriteWinElementSetComponentDefinition<PBUiTransform>;
4803
4875
 
4804
4876
  /**
4805
4877
  * Layout props to position things in the canvas
@@ -4857,6 +4929,14 @@ export declare interface UiTransformProps {
4857
4929
  */
4858
4930
  export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
4859
4931
 
4932
+ /**
4933
+ * @public
4934
+ */
4935
+ export declare type ValueSetOptions<T> = {
4936
+ timestampFunction: (value: DeepReadonly<T>) => number;
4937
+ maxElements: number;
4938
+ };
4939
+
4860
4940
  /**
4861
4941
  * @public
4862
4942
  * Vector3 is a type and a namespace.
@@ -5461,7 +5541,7 @@ export declare type Vector3Type = {
5461
5541
  };
5462
5542
 
5463
5543
  /** @public */
5464
- export declare const VideoPlayer: ComponentDefinition<PBVideoPlayer>;
5544
+ export declare const VideoPlayer: LastWriteWinElementSetComponentDefinition<PBVideoPlayer>;
5465
5545
 
5466
5546
  /**
5467
5547
  * @public
@@ -5475,7 +5555,7 @@ export declare interface VideoTexture {
5475
5555
  }
5476
5556
 
5477
5557
  /** @public */
5478
- export declare const VisibilityComponent: ComponentDefinition<PBVisibilityComponent>;
5558
+ export declare const VisibilityComponent: LastWriteWinElementSetComponentDefinition<PBVisibilityComponent>;
5479
5559
 
5480
5560
  /**
5481
5561
  * @public