@dcl/playground-assets 7.20.1 → 7.20.2-22102228700.commit-61000fc

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.
@@ -94,6 +94,29 @@ export interface AudioStreamComponentDefinitionExtended extends LastWriteWinElem
94
94
  getAudioState(entity: Entity): PBAudioEvent | undefined;
95
95
  }
96
96
 
97
+ // @public (undocumented)
98
+ export type AuthoritativePutComponentMessage = CrdtMessageHeader & AuthoritativePutComponentMessageBody;
99
+
100
+ // Warning: (tsdoc-escape-greater-than) The ">" character should be escaped using a backslash to avoid confusion with an HTML tag
101
+ //
102
+ // @public
103
+ export type AuthoritativePutComponentMessageBody = {
104
+ type: CrdtMessageType.AUTHORITATIVE_PUT_COMPONENT;
105
+ entityId: Entity;
106
+ componentId: number;
107
+ timestamp: number;
108
+ data: Uint8Array;
109
+ };
110
+
111
+ // @public (undocumented)
112
+ export namespace AuthoritativePutComponentOperation {
113
+ const // (undocumented)
114
+ MESSAGE_HEADER_LENGTH = 16;
115
+ // (undocumented)
116
+ export function read(buf: ByteBuffer): AuthoritativePutComponentMessage | null;
117
+ export function write(entity: Entity, timestamp: number, componentId: number, data: Uint8Array, buf: ByteBuffer): void;
118
+ }
119
+
97
120
  // @public (undocumented)
98
121
  export const enum AvatarAnchorPointType {
99
122
  // (undocumented)
@@ -208,12 +231,20 @@ export interface BaseComponent<T> {
208
231
  dumpCrdtStateToBuffer(buffer: ByteBuffer, filterEntity?: (entity: Entity) => boolean): void;
209
232
  entityDeleted(entity: Entity, markAsDirty: boolean): void;
210
233
  get(entity: Entity): any;
234
+ getCrdtState(entity: Entity): {
235
+ data: Uint8Array;
236
+ timestamp: number;
237
+ } | null;
211
238
  getCrdtUpdates(): Iterable<CrdtMessageBody>;
212
239
  has(entity: Entity): boolean;
213
240
  onChange(entity: Entity, cb: (value: T | undefined) => void): void;
214
241
  // (undocumented)
215
242
  readonly schema: ISchema<T>;
216
243
  updateFromCrdt(body: CrdtMessageBody): [null | ConflictResolutionMessage, T | undefined];
244
+ // (undocumented)
245
+ validateBeforeChange(entity: Entity, cb: ValidateCallback<T>): void;
246
+ // (undocumented)
247
+ validateBeforeChange(cb: ValidateCallback<T>): void;
217
248
  }
218
249
 
219
250
  // @public (undocumented)
@@ -824,10 +855,10 @@ export type Coords = {
824
855
  export const CRDT_MESSAGE_HEADER_LENGTH = 8;
825
856
 
826
857
  // @public (undocumented)
827
- export type CrdtMessage = PutComponentMessage | DeleteComponentMessage | AppendValueMessage | DeleteEntityMessage | PutNetworkComponentMessage | DeleteComponentNetworkMessage | DeleteEntityNetworkMessage;
858
+ export type CrdtMessage = PutComponentMessage | AuthoritativePutComponentMessage | DeleteComponentMessage | AppendValueMessage | DeleteEntityMessage | PutNetworkComponentMessage | DeleteComponentNetworkMessage | DeleteEntityNetworkMessage;
828
859
 
829
860
  // @public (undocumented)
830
- export type CrdtMessageBody = PutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessageBody | AppendValueMessageBody | CrdtNetworkMessageBody;
861
+ export type CrdtMessageBody = PutComponentMessageBody | AuthoritativePutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessageBody | AppendValueMessageBody | CrdtNetworkMessageBody;
831
862
 
832
863
  // @public
833
864
  export type CrdtMessageHeader = {
@@ -848,6 +879,8 @@ export enum CrdtMessageType {
848
879
  // (undocumented)
849
880
  APPEND_VALUE = 4,
850
881
  // (undocumented)
882
+ AUTHORITATIVE_PUT_COMPONENT = 8,
883
+ // (undocumented)
851
884
  DELETE_COMPONENT = 2,
852
885
  // (undocumented)
853
886
  DELETE_COMPONENT_NETWORK = 6,
@@ -856,7 +889,7 @@ export enum CrdtMessageType {
856
889
  // (undocumented)
857
890
  DELETE_ENTITY_NETWORK = 7,
858
891
  // (undocumented)
859
- MAX_MESSAGE_TYPE = 8,
892
+ MAX_MESSAGE_TYPE = 9,
860
893
  // (undocumented)
861
894
  PUT_COMPONENT = 1,
862
895
  // (undocumented)
@@ -868,6 +901,11 @@ export enum CrdtMessageType {
868
901
  // @public (undocumented)
869
902
  export type CrdtNetworkMessageBody = PutNetworkComponentMessageBody | DeleteComponentNetworkMessageBody | DeleteEntityNetworkMessageBody;
870
903
 
904
+ // Warning: (ae-missing-release-tag) "CreatedBy" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
905
+ //
906
+ // @public (undocumented)
907
+ export const CreatedBy: ICreatedBy;
908
+
871
909
  // @public (undocumented)
872
910
  export function createEntityContainer(opts?: {
873
911
  reservedStaticEntities: number;
@@ -1303,6 +1341,19 @@ export interface GrowOnlyValueSetComponentDefinition<T> extends BaseComponent<T>
1303
1341
  // @public (undocumented)
1304
1342
  export type GSetComponentGetter<T extends GrowOnlyValueSetComponentDefinition<any>> = (engine: Pick<IEngine, 'defineValueSetComponentFromSchema'>) => T;
1305
1343
 
1344
+ // Warning: (ae-missing-release-tag) "ICreatedBy" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
1345
+ //
1346
+ // @public (undocumented)
1347
+ export type ICreatedBy = LastWriteWinElementSetComponentDefinition<ICreatedByType>;
1348
+
1349
+ // Warning: (ae-missing-release-tag) "ICreatedByType" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
1350
+ //
1351
+ // @public (undocumented)
1352
+ export interface ICreatedByType {
1353
+ // (undocumented)
1354
+ address: string;
1355
+ }
1356
+
1306
1357
  // @public (undocumented)
1307
1358
  export interface IEngine {
1308
1359
  addEntity(): Entity;
@@ -1542,6 +1593,20 @@ export type InstanceCompositeOptions = {
1542
1593
  alreadyRequestedSrc?: Set<string>;
1543
1594
  };
1544
1595
 
1596
+ // Warning: (ae-missing-release-tag) "InternalBaseComponent" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
1597
+ //
1598
+ // @public
1599
+ export interface InternalBaseComponent<T> extends BaseComponent<T> {
1600
+ __dry_run_updateFromCrdt(body: CrdtMessageBody): ProcessMessageResultType;
1601
+ // (undocumented)
1602
+ __onChangeCallbacks(entity: Entity, value: T): void;
1603
+ // (undocumented)
1604
+ __run_validateBeforeChange(entity: Entity, newValue: T | undefined, senderAddress: string, createdBy: string): boolean;
1605
+ // (undocumented)
1606
+ dirtyIterator(): Iterable<Entity>;
1607
+ iterator(): Iterable<[Entity, any]>;
1608
+ }
1609
+
1545
1610
  // @public (undocumented)
1546
1611
  export interface ISchema<T = any> {
1547
1612
  // (undocumented)
@@ -4860,6 +4925,17 @@ export interface UiTransformProps {
4860
4925
  // @public (undocumented)
4861
4926
  export type Unpacked<T> = T extends (infer U)[] ? U : T;
4862
4927
 
4928
+ // Warning: (ae-missing-release-tag) "ValidateCallback" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
4929
+ //
4930
+ // @public (undocumented)
4931
+ export type ValidateCallback<T> = (value: {
4932
+ entity: Entity;
4933
+ currentValue: T | undefined;
4934
+ newValue: T | undefined;
4935
+ senderAddress: string;
4936
+ createdBy: string;
4937
+ }) => boolean;
4938
+
4863
4939
  // @public (undocumented)
4864
4940
  export type ValueSetOptions<T> = {
4865
4941
  timestampFunction: (value: DeepReadonly<T>) => number;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@dcl/playground-assets",
3
3
  "description": "",
4
- "version": "7.20.1",
4
+ "version": "7.20.2-22102228700.commit-61000fc",
5
5
  "author": "Decentraland",
6
6
  "dependencies": {
7
- "@dcl/js-runtime": "7.20.1",
8
- "@dcl/sdk": "7.20.1"
7
+ "@dcl/js-runtime": "7.20.2-22102228700.commit-61000fc",
8
+ "@dcl/sdk": "7.20.2-22102228700.commit-61000fc"
9
9
  },
10
10
  "devDependencies": {
11
11
  "@microsoft/api-extractor": "^7.33.8"
@@ -32,5 +32,5 @@
32
32
  },
33
33
  "types": "./dist/index.d.ts",
34
34
  "typings": "./dist/index.d.ts",
35
- "commit": "df99884c92c56bcb52fb835cde5c8dad3b0ac06a"
35
+ "commit": "61000fc3a7e49fbd51463d3a4bbf09cd9626e29f"
36
36
  }