@dcl/ecs 7.0.6-4057700455.commit-453395e → 7.0.6-4076330908.commit-cd40e5f
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/components/extended/Animator.d.ts +1 -5
- package/dist/components/extended/Material.d.ts +3 -7
- package/dist/components/extended/MeshCollider.d.ts +1 -5
- package/dist/components/extended/MeshRenderer.d.ts +1 -5
- package/dist/components/generated/Animator.gen.d.ts +1 -8
- package/dist/components/generated/Animator.gen.js +1 -1
- package/dist/components/generated/AudioSource.gen.d.ts +1 -8
- package/dist/components/generated/AudioSource.gen.js +1 -1
- package/dist/components/generated/AudioStream.gen.d.ts +1 -8
- package/dist/components/generated/AudioStream.gen.js +1 -1
- package/dist/components/generated/AvatarAttach.gen.d.ts +1 -8
- package/dist/components/generated/AvatarAttach.gen.js +1 -1
- package/dist/components/generated/AvatarModifierArea.gen.d.ts +1 -8
- package/dist/components/generated/AvatarModifierArea.gen.js +1 -1
- package/dist/components/generated/AvatarShape.gen.d.ts +1 -8
- package/dist/components/generated/AvatarShape.gen.js +1 -1
- package/dist/components/generated/Billboard.gen.d.ts +1 -8
- package/dist/components/generated/Billboard.gen.js +1 -1
- package/dist/components/generated/CameraMode.gen.d.ts +1 -8
- package/dist/components/generated/CameraMode.gen.js +1 -1
- package/dist/components/generated/CameraModeArea.gen.d.ts +1 -8
- package/dist/components/generated/CameraModeArea.gen.js +1 -1
- package/dist/components/generated/GltfContainer.gen.d.ts +1 -8
- package/dist/components/generated/GltfContainer.gen.js +1 -1
- package/dist/components/generated/Material.gen.d.ts +1 -8
- package/dist/components/generated/Material.gen.js +1 -1
- package/dist/components/generated/MeshCollider.gen.d.ts +1 -8
- package/dist/components/generated/MeshCollider.gen.js +1 -1
- package/dist/components/generated/MeshRenderer.gen.d.ts +1 -8
- package/dist/components/generated/MeshRenderer.gen.js +1 -1
- package/dist/components/generated/NftShape.gen.d.ts +1 -8
- package/dist/components/generated/NftShape.gen.js +1 -1
- package/dist/components/generated/PointerEvents.gen.d.ts +1 -8
- package/dist/components/generated/PointerEvents.gen.js +1 -1
- package/dist/components/generated/PointerEventsResult.gen.d.ts +1 -8
- package/dist/components/generated/PointerEventsResult.gen.js +1 -1
- package/dist/components/generated/PointerLock.gen.d.ts +1 -8
- package/dist/components/generated/PointerLock.gen.js +1 -1
- package/dist/components/generated/Raycast.gen.d.ts +1 -8
- package/dist/components/generated/Raycast.gen.js +1 -1
- package/dist/components/generated/RaycastResult.gen.d.ts +1 -8
- package/dist/components/generated/RaycastResult.gen.js +1 -1
- package/dist/components/generated/TextShape.gen.d.ts +1 -8
- package/dist/components/generated/TextShape.gen.js +1 -1
- package/dist/components/generated/UiBackground.gen.d.ts +1 -8
- package/dist/components/generated/UiBackground.gen.js +1 -1
- package/dist/components/generated/UiDropdown.gen.d.ts +1 -8
- package/dist/components/generated/UiDropdown.gen.js +1 -1
- package/dist/components/generated/UiDropdownResult.gen.d.ts +1 -8
- package/dist/components/generated/UiDropdownResult.gen.js +1 -1
- package/dist/components/generated/UiInput.gen.d.ts +1 -8
- package/dist/components/generated/UiInput.gen.js +1 -1
- package/dist/components/generated/UiInputResult.gen.d.ts +1 -8
- package/dist/components/generated/UiInputResult.gen.js +1 -1
- package/dist/components/generated/UiText.gen.d.ts +1 -8
- package/dist/components/generated/UiText.gen.js +1 -1
- package/dist/components/generated/UiTransform.gen.d.ts +1 -8
- package/dist/components/generated/UiTransform.gen.js +1 -1
- package/dist/components/generated/VisibilityComponent.gen.d.ts +1 -8
- package/dist/components/generated/VisibilityComponent.gen.js +1 -1
- package/dist/components/generated/pb/decentraland/common/border_rect.gen.d.ts +3 -8
- package/dist/components/generated/pb/decentraland/common/border_rect.gen.js +5 -2
- package/dist/components/generated/pb/decentraland/common/colors.gen.d.ts +6 -15
- package/dist/components/generated/pb/decentraland/common/colors.gen.js +9 -3
- package/dist/components/generated/pb/decentraland/common/texture.gen.d.ts +15 -22
- package/dist/components/generated/pb/decentraland/common/texture.gen.js +19 -4
- package/dist/components/generated/pb/decentraland/common/vectors.gen.d.ts +9 -22
- package/dist/components/generated/pb/decentraland/common/vectors.gen.js +13 -4
- package/dist/components/generated/pb/decentraland/sdk/components/animator.gen.d.ts +6 -15
- package/dist/components/generated/pb/decentraland/sdk/components/animator.gen.js +9 -3
- package/dist/components/generated/pb/decentraland/sdk/components/audio_source.gen.d.ts +3 -8
- package/dist/components/generated/pb/decentraland/sdk/components/audio_source.gen.js +5 -2
- package/dist/components/generated/pb/decentraland/sdk/components/audio_stream.gen.d.ts +3 -8
- package/dist/components/generated/pb/decentraland/sdk/components/audio_stream.gen.js +5 -2
- package/dist/components/generated/pb/decentraland/sdk/components/avatar_attach.gen.d.ts +6 -8
- package/dist/components/generated/pb/decentraland/sdk/components/avatar_attach.gen.js +8 -2
- package/dist/components/generated/pb/decentraland/sdk/components/avatar_modifier_area.gen.d.ts +6 -8
- package/dist/components/generated/pb/decentraland/sdk/components/avatar_modifier_area.gen.js +8 -2
- package/dist/components/generated/pb/decentraland/sdk/components/avatar_shape.gen.d.ts +3 -8
- package/dist/components/generated/pb/decentraland/sdk/components/avatar_shape.gen.js +5 -2
- package/dist/components/generated/pb/decentraland/sdk/components/billboard.gen.d.ts +6 -8
- package/dist/components/generated/pb/decentraland/sdk/components/billboard.gen.js +8 -2
- package/dist/components/generated/pb/decentraland/sdk/components/camera_mode.gen.d.ts +3 -8
- package/dist/components/generated/pb/decentraland/sdk/components/camera_mode.gen.js +5 -2
- package/dist/components/generated/pb/decentraland/sdk/components/camera_mode_area.gen.d.ts +3 -8
- package/dist/components/generated/pb/decentraland/sdk/components/camera_mode_area.gen.js +5 -2
- package/dist/components/generated/pb/decentraland/sdk/components/common/camera_type.gen.d.ts +3 -0
- package/dist/components/generated/pb/decentraland/sdk/components/common/camera_type.gen.js +4 -1
- package/dist/components/generated/pb/decentraland/sdk/components/common/id.gen.d.ts +1 -1
- package/dist/components/generated/pb/decentraland/sdk/components/common/id.gen.js +1 -1
- package/dist/components/generated/pb/decentraland/sdk/components/common/input_action.gen.d.ts +3 -0
- package/dist/components/generated/pb/decentraland/sdk/components/common/input_action.gen.js +4 -1
- package/dist/components/generated/pb/decentraland/sdk/components/common/texts.gen.d.ts +6 -0
- package/dist/components/generated/pb/decentraland/sdk/components/common/texts.gen.js +7 -1
- package/dist/components/generated/pb/decentraland/sdk/components/gltf_container.gen.d.ts +3 -8
- package/dist/components/generated/pb/decentraland/sdk/components/gltf_container.gen.js +5 -2
- package/dist/components/generated/pb/decentraland/sdk/components/material.gen.d.ts +12 -22
- package/dist/components/generated/pb/decentraland/sdk/components/material.gen.js +16 -4
- package/dist/components/generated/pb/decentraland/sdk/components/mesh_collider.gen.d.ts +18 -36
- package/dist/components/generated/pb/decentraland/sdk/components/mesh_collider.gen.js +24 -6
- package/dist/components/generated/pb/decentraland/sdk/components/mesh_renderer.gen.d.ts +15 -36
- package/dist/components/generated/pb/decentraland/sdk/components/mesh_renderer.gen.js +21 -6
- package/dist/components/generated/pb/decentraland/sdk/components/nft_shape.gen.d.ts +6 -8
- package/dist/components/generated/pb/decentraland/sdk/components/nft_shape.gen.js +8 -2
- package/dist/components/generated/pb/decentraland/sdk/components/pointer_events.gen.d.ts +12 -22
- package/dist/components/generated/pb/decentraland/sdk/components/pointer_events.gen.js +16 -4
- package/dist/components/generated/pb/decentraland/sdk/components/pointer_events_result.gen.d.ts +6 -15
- package/dist/components/generated/pb/decentraland/sdk/components/pointer_events_result.gen.js +9 -3
- package/dist/components/generated/pb/decentraland/sdk/components/pointer_lock.gen.d.ts +3 -8
- package/dist/components/generated/pb/decentraland/sdk/components/pointer_lock.gen.js +5 -2
- package/dist/components/generated/pb/decentraland/sdk/components/raycast.gen.d.ts +6 -8
- package/dist/components/generated/pb/decentraland/sdk/components/raycast.gen.js +8 -2
- package/dist/components/generated/pb/decentraland/sdk/components/raycast_result.gen.d.ts +6 -15
- package/dist/components/generated/pb/decentraland/sdk/components/raycast_result.gen.js +9 -3
- package/dist/components/generated/pb/decentraland/sdk/components/text_shape.gen.d.ts +3 -8
- package/dist/components/generated/pb/decentraland/sdk/components/text_shape.gen.js +5 -2
- package/dist/components/generated/pb/decentraland/sdk/components/ui_background.gen.d.ts +6 -8
- package/dist/components/generated/pb/decentraland/sdk/components/ui_background.gen.js +8 -2
- package/dist/components/generated/pb/decentraland/sdk/components/ui_dropdown.gen.d.ts +3 -8
- package/dist/components/generated/pb/decentraland/sdk/components/ui_dropdown.gen.js +5 -2
- package/dist/components/generated/pb/decentraland/sdk/components/ui_dropdown_result.gen.d.ts +3 -8
- package/dist/components/generated/pb/decentraland/sdk/components/ui_dropdown_result.gen.js +5 -2
- package/dist/components/generated/pb/decentraland/sdk/components/ui_input.gen.d.ts +3 -8
- package/dist/components/generated/pb/decentraland/sdk/components/ui_input.gen.js +5 -2
- package/dist/components/generated/pb/decentraland/sdk/components/ui_input_result.gen.d.ts +3 -8
- package/dist/components/generated/pb/decentraland/sdk/components/ui_input_result.gen.js +5 -2
- package/dist/components/generated/pb/decentraland/sdk/components/ui_text.gen.d.ts +3 -8
- package/dist/components/generated/pb/decentraland/sdk/components/ui_text.gen.js +5 -2
- package/dist/components/generated/pb/decentraland/sdk/components/ui_transform.gen.d.ts +30 -8
- package/dist/components/generated/pb/decentraland/sdk/components/ui_transform.gen.js +32 -2
- package/dist/components/generated/pb/decentraland/sdk/components/visibility_component.gen.d.ts +3 -8
- package/dist/components/generated/pb/decentraland/sdk/components/visibility_component.gen.js +5 -2
- package/dist/components/generated/pb/google/protobuf/descriptor.gen.d.ts +90 -176
- package/dist/components/generated/pb/google/protobuf/descriptor.gen.js +116 -26
- package/dist/components/index.d.ts +1 -2
- package/dist/components/types.d.ts +4 -4
- package/dist/engine/component.d.ts +2 -4
- package/dist/engine/component.js +3 -0
- package/dist/engine/entity.d.ts +3 -22
- package/dist/engine/entity.js +16 -3
- package/dist/engine/index.d.ts +0 -11
- package/dist/engine/index.js +22 -22
- package/dist/engine/input.d.ts +0 -2
- package/dist/engine/input.js +3 -0
- package/dist/engine/types.d.ts +27 -12
- package/dist/index.d.ts +6 -5
- package/dist/runtime/initialization/index.d.ts +34 -9
- package/dist/runtime/initialization/index.js +25 -1
- package/dist/runtime/types.d.ts +0 -1
- package/dist/runtime/types.js +0 -1
- package/dist/schemas/Array.d.ts +1 -5
- package/dist/schemas/Array.js +3 -3
- package/dist/schemas/ISchema.d.ts +2 -2
- package/dist/schemas/Map.d.ts +0 -4
- package/dist/schemas/Map.js +3 -3
- package/dist/schemas/Optional.d.ts +1 -5
- package/dist/schemas/Optional.js +3 -3
- package/dist/schemas/basic/Boolean.d.ts +1 -5
- package/dist/schemas/basic/Boolean.js +1 -1
- package/dist/schemas/basic/Enum.d.ts +1 -5
- package/dist/schemas/basic/Enum.js +3 -3
- package/dist/schemas/basic/Float.d.ts +1 -9
- package/dist/schemas/basic/Float.js +2 -2
- package/dist/schemas/basic/Integer.d.ts +0 -8
- package/dist/schemas/basic/Integer.js +2 -2
- package/dist/schemas/basic/String.d.ts +1 -9
- package/dist/schemas/basic/String.js +2 -2
- package/dist/schemas/custom/Color3.d.ts +0 -5
- package/dist/schemas/custom/Color3.js +1 -1
- package/dist/schemas/custom/Color4.d.ts +0 -5
- package/dist/schemas/custom/Color4.js +1 -1
- package/dist/schemas/custom/Entity.d.ts +1 -6
- package/dist/schemas/custom/Entity.js +1 -1
- package/dist/schemas/custom/Quaternion.d.ts +0 -5
- package/dist/schemas/custom/Quaternion.js +1 -1
- package/dist/schemas/custom/Vector3.d.ts +0 -5
- package/dist/schemas/custom/Vector3.js +1 -1
- package/dist/schemas/index.d.ts +24 -16
- package/dist/schemas/index.js +18 -0
- package/dist/schemas/typing.d.ts +17 -2
- package/dist/serialization/ByteBuffer/index.d.ts +2 -2
- package/dist/serialization/crdt/deleteComponent.d.ts +1 -11
- package/dist/serialization/crdt/deleteComponent.js +4 -1
- package/dist/serialization/crdt/deleteEntity.d.ts +1 -8
- package/dist/serialization/crdt/deleteEntity.js +4 -1
- package/dist/serialization/crdt/index.d.ts +0 -28
- package/dist/serialization/crdt/index.js +3 -1
- package/dist/serialization/crdt/message.js +1 -1
- package/dist/serialization/crdt/putComponent.d.ts +1 -13
- package/dist/serialization/crdt/putComponent.js +4 -1
- package/dist/serialization/crdt/types.d.ts +15 -20
- package/dist/serialization/crdt/types.js +6 -0
- package/dist/systems/async-task.d.ts +0 -4
- package/dist/systems/async-task.js +3 -0
- package/dist/systems/crdt/index.d.ts +1 -9
- package/dist/systems/crdt/index.js +4 -1
- package/dist/systems/crdt/types.d.ts +9 -0
- package/dist/systems/events.d.ts +11 -19
- package/dist/systems/events.js +3 -36
- package/package.json +3 -3
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,42 +1,50 @@
|
|
|
1
1
|
import { Entity } from '../engine';
|
|
2
|
-
import { IArray } from './Array';
|
|
3
|
-
import { IEnum } from './basic/Enum';
|
|
4
2
|
import { Color3Type } from './custom/Color3';
|
|
5
3
|
import { Color4Type } from './custom/Color4';
|
|
6
4
|
import { QuaternionType } from './custom/Quaternion';
|
|
7
5
|
import { Vector3Type } from './custom/Vector3';
|
|
8
6
|
import { ISchema } from './ISchema';
|
|
9
|
-
|
|
10
|
-
import { IOptional } from './Optional';
|
|
11
|
-
export type { IOptional } from './Optional';
|
|
12
|
-
export type { IMap } from './Map';
|
|
13
|
-
export type { IArray } from './Array';
|
|
14
|
-
export type { IEnum } from './basic/Enum';
|
|
15
|
-
export type { Vector3Type } from './custom/Vector3';
|
|
16
|
-
export type { QuaternionType } from './custom/Quaternion';
|
|
17
|
-
export type { Color3Type } from './custom/Color3';
|
|
18
|
-
export type { Color4Type } from './custom/Color4';
|
|
7
|
+
export { QuaternionType, Vector3Type, ISchema, Color3Type, Color4Type };
|
|
19
8
|
/**
|
|
20
9
|
* @public
|
|
21
10
|
*/
|
|
22
11
|
export declare namespace Schemas {
|
|
12
|
+
/** @public */
|
|
23
13
|
type SchemaType = ISchema;
|
|
14
|
+
/** @public */
|
|
24
15
|
const Boolean: ISchema<boolean>;
|
|
16
|
+
/** @public */
|
|
25
17
|
const String: ISchema<string>;
|
|
18
|
+
/** @public */
|
|
26
19
|
const Float: ISchema<number>;
|
|
20
|
+
/** @public */
|
|
27
21
|
const Double: ISchema<number>;
|
|
22
|
+
/** @public */
|
|
28
23
|
const Byte: ISchema<number>;
|
|
24
|
+
/** @public */
|
|
29
25
|
const Short: ISchema<number>;
|
|
26
|
+
/** @public */
|
|
30
27
|
const Int: ISchema<number>;
|
|
28
|
+
/** @public */
|
|
31
29
|
const Int64: ISchema<number>;
|
|
30
|
+
/** @public */
|
|
32
31
|
const Number: ISchema<number>;
|
|
32
|
+
/** @public */
|
|
33
33
|
const Vector3: ISchema<Vector3Type>;
|
|
34
|
+
/** @public */
|
|
34
35
|
const Quaternion: ISchema<QuaternionType>;
|
|
36
|
+
/** @public */
|
|
35
37
|
const Color3: ISchema<Color3Type>;
|
|
38
|
+
/** @public */
|
|
36
39
|
const Color4: ISchema<Color4Type>;
|
|
40
|
+
/** @public */
|
|
37
41
|
const Entity: ISchema<Entity>;
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
+
/** @public */
|
|
43
|
+
const Enum: <T>(type: ISchema<any>) => ISchema<T>;
|
|
44
|
+
/** @public */
|
|
45
|
+
const Array: <T>(type: ISchema<T>) => ISchema<T[]>;
|
|
46
|
+
/** @public */
|
|
47
|
+
const Map: <T extends import("./Map").Spec>(spec: T, defaultValue?: Partial<import("./Map").MapResult<T>> | undefined) => ISchema<import("./Map").MapResult<T>>;
|
|
48
|
+
/** @public */
|
|
49
|
+
const Optional: <T>(spec: ISchema<T>) => ISchema<T | undefined>;
|
|
42
50
|
}
|
package/dist/schemas/index.js
CHANGED
|
@@ -16,22 +16,40 @@ import { IOptional } from './Optional';
|
|
|
16
16
|
*/
|
|
17
17
|
export var Schemas;
|
|
18
18
|
(function (Schemas) {
|
|
19
|
+
/** @public */
|
|
19
20
|
Schemas.Boolean = Bool;
|
|
21
|
+
/** @public */
|
|
20
22
|
Schemas.String = EcsString;
|
|
23
|
+
/** @public */
|
|
21
24
|
Schemas.Float = Float32;
|
|
25
|
+
/** @public */
|
|
22
26
|
Schemas.Double = Float64;
|
|
27
|
+
/** @public */
|
|
23
28
|
Schemas.Byte = Int8;
|
|
29
|
+
/** @public */
|
|
24
30
|
Schemas.Short = Int16;
|
|
31
|
+
/** @public */
|
|
25
32
|
Schemas.Int = Int32;
|
|
33
|
+
/** @public */
|
|
26
34
|
Schemas.Int64 = iInt64;
|
|
35
|
+
/** @public */
|
|
27
36
|
Schemas.Number = Float32;
|
|
37
|
+
/** @public */
|
|
28
38
|
Schemas.Vector3 = Vector3Schema;
|
|
39
|
+
/** @public */
|
|
29
40
|
Schemas.Quaternion = QuaternionSchema;
|
|
41
|
+
/** @public */
|
|
30
42
|
Schemas.Color3 = Color3Schema;
|
|
43
|
+
/** @public */
|
|
31
44
|
Schemas.Color4 = Color4Schema;
|
|
45
|
+
/** @public */
|
|
32
46
|
Schemas.Entity = EntitySchema;
|
|
47
|
+
/** @public */
|
|
33
48
|
Schemas.Enum = IEnum;
|
|
49
|
+
/** @public */
|
|
34
50
|
Schemas.Array = IArray;
|
|
51
|
+
/** @public */
|
|
35
52
|
Schemas.Map = IMap;
|
|
53
|
+
/** @public */
|
|
36
54
|
Schemas.Optional = IOptional;
|
|
37
55
|
})(Schemas || (Schemas = {}));
|
package/dist/schemas/typing.d.ts
CHANGED
|
@@ -1,15 +1,30 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Include property keys from T where the property is assignable to U
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
2
5
|
export type IncludeUndefined<T> = {
|
|
3
6
|
[P in keyof T]: undefined extends T[P] ? P : never;
|
|
4
7
|
}[keyof T];
|
|
5
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Excludes property keys from T where the property is assignable to U
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
6
12
|
export type ExcludeUndefined<T> = {
|
|
7
13
|
[P in keyof T]: undefined extends T[P] ? never : P;
|
|
8
14
|
}[keyof T];
|
|
15
|
+
/**
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
9
18
|
export type OnlyOptionalUndefinedTypes<T> = {
|
|
10
19
|
[K in IncludeUndefined<T>]?: T[K];
|
|
11
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
12
24
|
export type OnlyNonUndefinedTypes<T> = {
|
|
13
25
|
[K in ExcludeUndefined<T>]: T[K];
|
|
14
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
15
30
|
export type ToOptional<T> = OnlyOptionalUndefinedTypes<T> & OnlyNonUndefinedTypes<T>;
|
|
@@ -75,7 +75,7 @@ export declare class ReadWriteByteBuffer implements ByteBuffer {
|
|
|
75
75
|
/**
|
|
76
76
|
* @public
|
|
77
77
|
*/
|
|
78
|
-
export
|
|
78
|
+
export interface ByteBuffer {
|
|
79
79
|
/**
|
|
80
80
|
* @returns The entire current Uint8Array.
|
|
81
81
|
*
|
|
@@ -175,4 +175,4 @@ export type ByteBuffer = {
|
|
|
175
175
|
setUint16(offset: number, value: number): void;
|
|
176
176
|
setUint32(offset: number, value: number): void;
|
|
177
177
|
setUint64(offset: number, value: bigint): void;
|
|
178
|
-
}
|
|
178
|
+
}
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ByteBuffer } from '../ByteBuffer';
|
|
3
|
-
import { DeleteComponentMessage } from './types';
|
|
4
|
-
export declare namespace DeleteComponent {
|
|
5
|
-
const MESSAGE_HEADER_LENGTH = 20;
|
|
6
|
-
/**
|
|
7
|
-
* Write DeleteComponent message
|
|
8
|
-
*/
|
|
9
|
-
function write(entity: Entity, componentId: number, timestamp: number, buf: ByteBuffer): void;
|
|
10
|
-
function read(buf: ByteBuffer): DeleteComponentMessage | null;
|
|
11
|
-
}
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import CrdtMessageProtocol from '.';
|
|
1
|
+
import { CrdtMessageProtocol } from '.';
|
|
2
2
|
import { CrdtMessageType, CRDT_MESSAGE_HEADER_LENGTH } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
3
6
|
export var DeleteComponent;
|
|
4
7
|
(function (DeleteComponent) {
|
|
5
8
|
// TODO: change timestamp to 32 bit and remove buffer length (-8 bytes)
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ByteBuffer } from '../ByteBuffer';
|
|
3
|
-
import { DeleteEntityMessage } from './types';
|
|
4
|
-
export declare namespace DeleteEntity {
|
|
5
|
-
const MESSAGE_HEADER_LENGTH = 4;
|
|
6
|
-
function write(entity: Entity, buf: ByteBuffer): void;
|
|
7
|
-
function read(buf: ByteBuffer): DeleteEntityMessage | null;
|
|
8
|
-
}
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import CrdtMessageProtocol from '.';
|
|
1
|
+
import { CrdtMessageProtocol } from '.';
|
|
2
2
|
import { CrdtMessageType, CRDT_MESSAGE_HEADER_LENGTH } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
3
6
|
export var DeleteEntity;
|
|
4
7
|
(function (DeleteEntity) {
|
|
5
8
|
DeleteEntity.MESSAGE_HEADER_LENGTH = 4;
|
|
@@ -1,32 +1,4 @@
|
|
|
1
|
-
import { ByteBuffer } from '../ByteBuffer';
|
|
2
|
-
import { CrdtMessageHeader } from './types';
|
|
3
1
|
export * from './types';
|
|
4
2
|
export * from './deleteComponent';
|
|
5
3
|
export * from './putComponent';
|
|
6
4
|
export * from './deleteEntity';
|
|
7
|
-
export declare namespace CrdtMessageProtocol {
|
|
8
|
-
/**
|
|
9
|
-
* Validate if the message incoming is completed
|
|
10
|
-
* @param buf - ByteBuffer
|
|
11
|
-
*/
|
|
12
|
-
function validate(buf: ByteBuffer): boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Get the current header, consuming the bytes involved.
|
|
15
|
-
* @param buf - ByteBuffer
|
|
16
|
-
* @returns header or null if there is no validated message
|
|
17
|
-
*/
|
|
18
|
-
function readHeader(buf: ByteBuffer): CrdtMessageHeader | null;
|
|
19
|
-
/**
|
|
20
|
-
* Get the current header, without consuming the bytes involved.
|
|
21
|
-
* @param buf - ByteBuffer
|
|
22
|
-
* @returns header or null if there is no validated message
|
|
23
|
-
*/
|
|
24
|
-
function getHeader(buf: ByteBuffer): CrdtMessageHeader | null;
|
|
25
|
-
/**
|
|
26
|
-
* Consume the incoming message without processing it.
|
|
27
|
-
* @param buf - ByteBuffer
|
|
28
|
-
* @returns true in case of success or false if there is no valid message.
|
|
29
|
-
*/
|
|
30
|
-
function consumeMessage(buf: ByteBuffer): boolean;
|
|
31
|
-
}
|
|
32
|
-
export default CrdtMessageProtocol;
|
|
@@ -3,6 +3,9 @@ export * from './types';
|
|
|
3
3
|
export * from './deleteComponent';
|
|
4
4
|
export * from './putComponent';
|
|
5
5
|
export * from './deleteEntity';
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
6
9
|
export var CrdtMessageProtocol;
|
|
7
10
|
(function (CrdtMessageProtocol) {
|
|
8
11
|
/**
|
|
@@ -67,4 +70,3 @@ export var CrdtMessageProtocol;
|
|
|
67
70
|
}
|
|
68
71
|
CrdtMessageProtocol.consumeMessage = consumeMessage;
|
|
69
72
|
})(CrdtMessageProtocol || (CrdtMessageProtocol = {}));
|
|
70
|
-
export default CrdtMessageProtocol;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import CrdtMessageProtocol,
|
|
1
|
+
import { CrdtMessageProtocol, DeleteComponent, DeleteEntity, PutComponentOperation } from '.';
|
|
2
2
|
import { CrdtMessageType } from './types';
|
|
3
3
|
export function readMessage(buf) {
|
|
4
4
|
const header = CrdtMessageProtocol.getHeader(buf);
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { Entity } from '../../engine/entity';
|
|
3
|
-
import { ByteBuffer } from '../ByteBuffer';
|
|
4
|
-
import { PutComponentMessage } from './types';
|
|
5
|
-
export declare namespace PutComponentOperation {
|
|
6
|
-
const MESSAGE_HEADER_LENGTH = 20;
|
|
7
|
-
/**
|
|
8
|
-
* Call this function for an optimal writing data passing the ByteBuffer
|
|
9
|
-
* already allocated
|
|
10
|
-
*/
|
|
11
|
-
function write(entity: Entity, timestamp: number, componentDefinition: ComponentDefinition<unknown>, buf: ByteBuffer): void;
|
|
12
|
-
function read(buf: ByteBuffer): PutComponentMessage | null;
|
|
13
|
-
}
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import CrdtMessageProtocol from '.';
|
|
1
|
+
import { CrdtMessageProtocol } from '.';
|
|
2
2
|
import { CrdtMessageType, CRDT_MESSAGE_HEADER_LENGTH } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
3
6
|
export var PutComponentOperation;
|
|
4
7
|
(function (PutComponentOperation) {
|
|
5
8
|
PutComponentOperation.MESSAGE_HEADER_LENGTH = 20;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Entity } from '../../engine/entity';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
3
5
|
export declare enum CrdtMessageType {
|
|
4
6
|
RESERVED = 0,
|
|
5
7
|
PUT_COMPONENT = 1,
|
|
@@ -7,24 +9,14 @@ export declare enum CrdtMessageType {
|
|
|
7
9
|
DELETE_ENTITY = 3,
|
|
8
10
|
MAX_MESSAGE_TYPE = 4
|
|
9
11
|
}
|
|
10
|
-
/**
|
|
11
|
-
* Min length = 8 bytes
|
|
12
|
-
* All message length including
|
|
13
|
-
* @param length - Uint32 the length of all message (including the header)
|
|
14
|
-
* @param type - define the function which handles the data
|
|
15
|
-
*/
|
|
16
|
-
export type CrdtMessageHeader = {
|
|
17
|
-
length: Uint32;
|
|
18
|
-
type: Uint32;
|
|
19
|
-
};
|
|
20
|
-
export declare const CRDT_MESSAGE_HEADER_LENGTH = 8;
|
|
21
12
|
/**
|
|
22
13
|
* Min. length = header (8 bytes) + 20 bytes = 28 bytes
|
|
23
14
|
*
|
|
24
|
-
* @param entity -
|
|
25
|
-
* @param componentId -
|
|
15
|
+
* @param entity - uint32 number of the entity
|
|
16
|
+
* @param componentId - uint32 number of id
|
|
26
17
|
* @param timestamp - Uint64 Lamport timestamp
|
|
27
18
|
* @param data - Uint8[] data of component => length(4 bytes) + block of bytes[0..length-1]
|
|
19
|
+
* @public
|
|
28
20
|
*/
|
|
29
21
|
export type PutComponentMessageBody = {
|
|
30
22
|
type: CrdtMessageType.PUT_COMPONENT;
|
|
@@ -33,6 +25,9 @@ export type PutComponentMessageBody = {
|
|
|
33
25
|
timestamp: number;
|
|
34
26
|
data: Uint8Array;
|
|
35
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
36
31
|
export type DeleteComponentMessageBody = {
|
|
37
32
|
type: CrdtMessageType.DELETE_COMPONENT;
|
|
38
33
|
entityId: Entity;
|
|
@@ -40,14 +35,14 @@ export type DeleteComponentMessageBody = {
|
|
|
40
35
|
timestamp: number;
|
|
41
36
|
};
|
|
42
37
|
/**
|
|
43
|
-
* @param entity -
|
|
38
|
+
* @param entity - uint32 number of the entity
|
|
39
|
+
* @public
|
|
44
40
|
*/
|
|
45
41
|
export type DeleteEntityMessageBody = {
|
|
46
42
|
type: CrdtMessageType.DELETE_ENTITY;
|
|
47
43
|
entityId: Entity;
|
|
48
44
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
export type
|
|
53
|
-
export type CrdtMessageBody = PutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessage;
|
|
45
|
+
/**
|
|
46
|
+
* @public
|
|
47
|
+
*/
|
|
48
|
+
export type CrdtMessageBody = PutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessageBody;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @public
|
|
3
|
+
*/
|
|
1
4
|
export var CrdtMessageType;
|
|
2
5
|
(function (CrdtMessageType) {
|
|
3
6
|
CrdtMessageType[CrdtMessageType["RESERVED"] = 0] = "RESERVED";
|
|
@@ -7,4 +10,7 @@ export var CrdtMessageType;
|
|
|
7
10
|
CrdtMessageType[CrdtMessageType["DELETE_ENTITY"] = 3] = "DELETE_ENTITY";
|
|
8
11
|
CrdtMessageType[CrdtMessageType["MAX_MESSAGE_TYPE"] = 4] = "MAX_MESSAGE_TYPE";
|
|
9
12
|
})(CrdtMessageType || (CrdtMessageType = {}));
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
10
16
|
export const CRDT_MESSAGE_HEADER_LENGTH = 8;
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { Entity } from '../../engine/entity';
|
|
2
|
-
import type { ComponentDefinition
|
|
2
|
+
import type { ComponentDefinition } from '../../engine';
|
|
3
3
|
import { CrdtMessageType } from '../../serialization/crdt/types';
|
|
4
|
-
import { Transport } from './types';
|
|
5
4
|
/**
|
|
6
5
|
* @public
|
|
7
6
|
*/
|
|
8
7
|
export type OnChangeFunction = (entity: Entity, operation: CrdtMessageType, component?: ComponentDefinition<any>) => void;
|
|
9
|
-
export declare function crdtSceneSystem(engine: Pick<IEngine, 'getComponentOrNull' | 'getComponent' | 'entityContainer' | 'componentsIter'>, onProcessEntityComponentChange: OnChangeFunction | null): {
|
|
10
|
-
getCrdt: () => import("@dcl/crdt").State<Uint8Array>;
|
|
11
|
-
sendMessages: (dirtyEntities: Map<ComponentDefinition<unknown>, Array<Entity>>, deletedEntities: Entity[]) => Promise<void>;
|
|
12
|
-
receiveMessages: () => Promise<void>;
|
|
13
|
-
addTransport: (transport: Transport) => void;
|
|
14
|
-
updateState: () => Map<ComponentDefinition<unknown>, Entity[]>;
|
|
15
|
-
};
|
|
@@ -2,11 +2,14 @@ import { crdtProtocol } from '@dcl/crdt';
|
|
|
2
2
|
import { CRDTMessageType, ProcessMessageResultType } from '@dcl/crdt/dist/types';
|
|
3
3
|
import { EntityState, EntityUtils } from '../../engine/entity';
|
|
4
4
|
import { ReadWriteByteBuffer } from '../../serialization/ByteBuffer';
|
|
5
|
-
import CrdtMessageProtocol from '../../serialization/crdt';
|
|
5
|
+
import { CrdtMessageProtocol } from '../../serialization/crdt';
|
|
6
6
|
import { DeleteComponent } from '../../serialization/crdt/deleteComponent';
|
|
7
7
|
import { DeleteEntity } from '../../serialization/crdt/deleteEntity';
|
|
8
8
|
import { PutComponentOperation } from '../../serialization/crdt/putComponent';
|
|
9
9
|
import { CrdtMessageType } from '../../serialization/crdt/types';
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
10
13
|
export function crdtSceneSystem(engine, onProcessEntityComponentChange) {
|
|
11
14
|
const transports = [];
|
|
12
15
|
// CRDT Client
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { CrdtMessageBody } from '../../serialization/crdt/types';
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
2
5
|
export type ReceiveMessage = CrdtMessageBody & {
|
|
3
6
|
transportId?: number;
|
|
4
7
|
messageBuffer: Uint8Array;
|
|
5
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
6
12
|
export type TransportMessage = Omit<ReceiveMessage, 'data'>;
|
|
13
|
+
/**
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
7
16
|
export type Transport = {
|
|
8
17
|
send(message: Uint8Array): Promise<void>;
|
|
9
18
|
onmessage?(message: Uint8Array): void;
|
package/dist/systems/events.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { InputAction } from '../components/generated/pb/decentraland/sdk/components/common/input_action.gen';
|
|
2
2
|
import { PBPointerEventsResult_PointerCommand } from '../components/generated/pb/decentraland/sdk/components/pointer_events_result.gen';
|
|
3
|
-
import { IEngine } from '../engine/types';
|
|
4
3
|
import { Entity } from '../engine/entity';
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
6
7
|
export type EventSystemCallback = (event: PBPointerEventsResult_PointerCommand) => void;
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
7
11
|
export type EventSystemOptions = {
|
|
8
12
|
button: InputAction;
|
|
9
13
|
hoverText?: string;
|
|
10
14
|
maxDistance?: number;
|
|
11
15
|
showFeedback?: boolean;
|
|
12
16
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* Remove the callback for onClick event
|
|
18
|
-
* @param entity - Entity where the callback was attached
|
|
19
|
-
*/
|
|
20
|
-
removeOnClick(entity: Entity): void;
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export interface PointerEventsSystem {
|
|
21
21
|
/**
|
|
22
22
|
* @public
|
|
23
23
|
* Remove the callback for onPointerDown event
|
|
@@ -30,14 +30,6 @@ export declare function createPointerEventSystem(engine: IEngine, inputSystem: I
|
|
|
30
30
|
* @param entity - Entity where the callback was attached
|
|
31
31
|
*/
|
|
32
32
|
removeOnPointerUp(entity: Entity): void;
|
|
33
|
-
/**
|
|
34
|
-
* @internal
|
|
35
|
-
* Execute callback when the user clicks the entity.
|
|
36
|
-
* @param entity - Entity to attach the callback
|
|
37
|
-
* @param cb - Function to execute when onPointerDown fires
|
|
38
|
-
* @param opts - Opts to trigger Feedback and Button
|
|
39
|
-
*/
|
|
40
|
-
onClick(entity: Entity, cb: EventSystemCallback, opts?: Partial<EventSystemOptions>): void;
|
|
41
33
|
/**
|
|
42
34
|
* @public
|
|
43
35
|
* Execute callback when the user press the InputButton pointing at the entity
|
|
@@ -54,4 +46,4 @@ export declare function createPointerEventSystem(engine: IEngine, inputSystem: I
|
|
|
54
46
|
* @param opts - Opts to trigger Feedback and Button
|
|
55
47
|
*/
|
|
56
48
|
onPointerUp(entity: Entity, cb: EventSystemCallback, opts?: Partial<EventSystemOptions>): void;
|
|
57
|
-
}
|
|
49
|
+
}
|
package/dist/systems/events.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as components from '../components';
|
|
2
2
|
import { EntityState } from '../engine/entity';
|
|
3
3
|
import { checkNotThenable } from '../runtime/invariant';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
4
7
|
export function createPointerEventSystem(engine, inputSystem) {
|
|
5
8
|
const PointerEvents = components.PointerEvents(engine);
|
|
6
9
|
let EventType;
|
|
@@ -74,37 +77,15 @@ export function createPointerEventSystem(engine, inputSystem) {
|
|
|
74
77
|
}
|
|
75
78
|
});
|
|
76
79
|
return {
|
|
77
|
-
/**
|
|
78
|
-
* @internal
|
|
79
|
-
* Remove the callback for onClick event
|
|
80
|
-
* @param entity - Entity where the callback was attached
|
|
81
|
-
*/
|
|
82
80
|
removeOnClick(entity) {
|
|
83
81
|
removeEvent(entity, EventType.Click);
|
|
84
82
|
},
|
|
85
|
-
/**
|
|
86
|
-
* @public
|
|
87
|
-
* Remove the callback for onPointerDown event
|
|
88
|
-
* @param entity - Entity where the callback was attached
|
|
89
|
-
*/
|
|
90
83
|
removeOnPointerDown(entity) {
|
|
91
84
|
removeEvent(entity, EventType.Down);
|
|
92
85
|
},
|
|
93
|
-
/**
|
|
94
|
-
* @public
|
|
95
|
-
* Remove the callback for onPointerUp event
|
|
96
|
-
* @param entity - Entity where the callback was attached
|
|
97
|
-
*/
|
|
98
86
|
removeOnPointerUp(entity) {
|
|
99
87
|
removeEvent(entity, EventType.Up);
|
|
100
88
|
},
|
|
101
|
-
/**
|
|
102
|
-
* @internal
|
|
103
|
-
* Execute callback when the user clicks the entity.
|
|
104
|
-
* @param entity - Entity to attach the callback
|
|
105
|
-
* @param cb - Function to execute when onPointerDown fires
|
|
106
|
-
* @param opts - Opts to trigger Feedback and Button
|
|
107
|
-
*/
|
|
108
89
|
onClick(entity, cb, opts) {
|
|
109
90
|
const options = getDefaultOpts(opts);
|
|
110
91
|
// Clear previous event with over feedback included
|
|
@@ -113,26 +94,12 @@ export function createPointerEventSystem(engine, inputSystem) {
|
|
|
113
94
|
getEvent(entity).set(EventType.Click, { cb, opts: options });
|
|
114
95
|
setPointerEvent(entity, 1 /* PointerEventType.PET_DOWN */, options);
|
|
115
96
|
},
|
|
116
|
-
/**
|
|
117
|
-
* @public
|
|
118
|
-
* Execute callback when the user press the InputButton pointing at the entity
|
|
119
|
-
* @param entity - Entity to attach the callback
|
|
120
|
-
* @param cb - Function to execute when click fires
|
|
121
|
-
* @param opts - Opts to trigger Feedback and Button
|
|
122
|
-
*/
|
|
123
97
|
onPointerDown(entity, cb, opts) {
|
|
124
98
|
const options = getDefaultOpts(opts);
|
|
125
99
|
removeEvent(entity, EventType.Down);
|
|
126
100
|
getEvent(entity).set(EventType.Down, { cb, opts: options });
|
|
127
101
|
setPointerEvent(entity, 1 /* PointerEventType.PET_DOWN */, options);
|
|
128
102
|
},
|
|
129
|
-
/**
|
|
130
|
-
* @public
|
|
131
|
-
* Execute callback when the user releases the InputButton pointing at the entity
|
|
132
|
-
* @param entity - Entity to attach the callback
|
|
133
|
-
* @param cb - Function to execute when click fires
|
|
134
|
-
* @param opts - Opts to trigger Feedback and Button
|
|
135
|
-
*/
|
|
136
103
|
onPointerUp(entity, cb, opts) {
|
|
137
104
|
const options = getDefaultOpts(opts);
|
|
138
105
|
removeEvent(entity, EventType.Up);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/ecs",
|
|
3
|
-
"version": "7.0.6-
|
|
3
|
+
"version": "7.0.6-4076330908.commit-cd40e5f",
|
|
4
4
|
"description": "Decentraland ECS",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"typings": "./dist/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"ts-proto": "^1.112.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@dcl/crdt": "7.0.6-
|
|
30
|
+
"@dcl/crdt": "7.0.6-4076330908.commit-cd40e5f",
|
|
31
31
|
"@dcl/js-runtime": "file:../js-runtime",
|
|
32
32
|
"@dcl/protocol": "1.0.0-4009547712.commit-472ea24"
|
|
33
33
|
},
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"displayName": "ECS",
|
|
42
42
|
"tsconfig": "./tsconfig.json"
|
|
43
43
|
},
|
|
44
|
-
"commit": "
|
|
44
|
+
"commit": "cd40e5fe70cbeabc3231fc374729bfd52b1127e2"
|
|
45
45
|
}
|