@dcl/ecs 7.0.6-3991588905.commit-2387247 → 7.0.6-4006744889.commit-c6aff5f
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 -1
- package/dist/components/extended/Material.d.ts +2 -2
- package/dist/components/extended/MeshCollider.d.ts +1 -1
- package/dist/components/extended/MeshRenderer.d.ts +1 -1
- package/dist/components/generated/index.gen.d.ts +1 -1
- package/dist/components/legacy/Transform.d.ts +3 -3
- package/dist/engine/component.d.ts +1 -1
- package/dist/engine/entity.d.ts +3 -3
- package/dist/engine/index.d.ts +1 -1
- package/dist/engine/input.d.ts +1 -1
- package/dist/engine/readonly.d.ts +6 -6
- package/dist/engine/systems.d.ts +2 -2
- package/dist/engine/types.d.ts +3 -3
- package/dist/runtime/invariant.d.ts +1 -1
- package/dist/schemas/ISchema.d.ts +1 -1
- package/dist/schemas/Map.d.ts +3 -3
- package/dist/schemas/custom/Color3.d.ts +1 -1
- package/dist/schemas/custom/Color4.d.ts +1 -1
- package/dist/schemas/custom/Quaternion.d.ts +1 -1
- package/dist/schemas/custom/Vector3.d.ts +1 -1
- package/dist/schemas/typing.d.ts +5 -5
- package/dist/serialization/ByteBuffer/index.d.ts +1 -1
- package/dist/serialization/crdt/types.d.ts +10 -10
- package/dist/systems/async-task.d.ts +1 -1
- package/dist/systems/crdt/index.d.ts +1 -1
- package/dist/systems/crdt/types.d.ts +3 -3
- package/dist/systems/events.d.ts +3 -3
- package/package.json +4 -4
|
@@ -3,7 +3,7 @@ import { PBAnimationState, PBAnimator } from '../generated/pb/decentraland/sdk/c
|
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type AnimatorComponentDefinition = ComponentDefinition<PBAnimator>;
|
|
7
7
|
/**
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
@@ -4,11 +4,11 @@ import { AvatarTexture, Texture, TextureUnion } from '../generated/types.gen';
|
|
|
4
4
|
/**
|
|
5
5
|
* @public
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type MaterialComponentDefinition = ComponentDefinition<PBMaterial>;
|
|
8
8
|
/**
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export type TextureHelper = {
|
|
12
12
|
/**
|
|
13
13
|
* @returns a common texture with a source file
|
|
14
14
|
*/
|
|
@@ -3,7 +3,7 @@ import { ColliderLayer, PBMeshCollider } from '../generated/index.gen';
|
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type MeshColliderComponentDefinition = ComponentDefinition<PBMeshCollider>;
|
|
7
7
|
/**
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
@@ -3,7 +3,7 @@ import { PBMeshRenderer } from '../generated/index.gen';
|
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type MeshRendererComponentDefinition = ComponentDefinition<PBMeshRenderer>;
|
|
7
7
|
/**
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
@@ -56,7 +56,7 @@ export * from './pb/decentraland/sdk/components/ui_input_result.gen';
|
|
|
56
56
|
export * from './pb/decentraland/sdk/components/ui_text.gen';
|
|
57
57
|
export * from './pb/decentraland/sdk/components/ui_transform.gen';
|
|
58
58
|
export * from './pb/decentraland/sdk/components/visibility_component.gen';
|
|
59
|
-
export
|
|
59
|
+
export type ComponentGetter<T extends ComponentDefinition<any>> = (engine: Pick<IEngine, 'defineComponentFromSchema'>) => T;
|
|
60
60
|
/** @public */ export declare const Animator: ComponentGetter<ComponentDefinition<PBAnimator>>;
|
|
61
61
|
/** @public */ export declare const AudioSource: ComponentGetter<ComponentDefinition<PBAudioSource>>;
|
|
62
62
|
/** @public */ export declare const AudioStream: ComponentGetter<ComponentDefinition<PBAudioStream>>;
|
|
@@ -3,7 +3,7 @@ import { Entity } from '../../engine/entity';
|
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type TransformComponent = ComponentDefinition<TransformType>;
|
|
7
7
|
/**
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
@@ -14,7 +14,7 @@ export interface TransformComponentExtended extends TransformComponent {
|
|
|
14
14
|
/**
|
|
15
15
|
* @public
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export type TransformType = {
|
|
18
18
|
position: {
|
|
19
19
|
x: number;
|
|
20
20
|
y: number;
|
|
@@ -36,5 +36,5 @@ export declare type TransformType = {
|
|
|
36
36
|
/**
|
|
37
37
|
* @public
|
|
38
38
|
*/
|
|
39
|
-
export
|
|
39
|
+
export type TransformTypeWithOptionals = Partial<TransformType>;
|
|
40
40
|
export declare function defineTransformComponent(engine: Pick<IEngine, 'defineComponentFromSchema'>): TransformComponentExtended;
|
package/dist/engine/entity.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @public It only defines the type explicitly, no effects.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type uint32 = number;
|
|
5
5
|
export declare const MAX_U16 = 65535;
|
|
6
6
|
export declare const MASK_UPPER_16_ON_32 = 4294901760;
|
|
7
7
|
export declare const AMOUNT_VERSION_AVAILABLE: number;
|
|
@@ -17,7 +17,7 @@ export declare const AMOUNT_VERSION_AVAILABLE: number;
|
|
|
17
17
|
* Convertion from its compound numbers to entity:
|
|
18
18
|
* entity = (entityNumber & MAX_U16) | ((entityVersion & MAX_U16) << 16)
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export type Entity = number & {
|
|
21
21
|
__entity_type: '';
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
@@ -56,7 +56,7 @@ export declare enum EntityState {
|
|
|
56
56
|
*/
|
|
57
57
|
Reserved = 3
|
|
58
58
|
}
|
|
59
|
-
export
|
|
59
|
+
export type EntityContainer = {
|
|
60
60
|
generateEntity(): Entity;
|
|
61
61
|
removeEntity(entity: Entity): boolean;
|
|
62
62
|
getEntityState(entity: Entity): EntityState;
|
package/dist/engine/index.d.ts
CHANGED
package/dist/engine/input.d.ts
CHANGED
|
@@ -2,28 +2,28 @@ import { ComponentDefinition } from './component';
|
|
|
2
2
|
/**
|
|
3
3
|
* @public
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type DeepReadonlyMap<K, V> = ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>;
|
|
6
6
|
/**
|
|
7
7
|
* @public
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type DeepReadonlySet<T> = ReadonlySet<DeepReadonly<T>>;
|
|
10
10
|
/**
|
|
11
11
|
* @public
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export type DeepReadonlyObject<T> = {
|
|
14
14
|
readonly [K in keyof T]: DeepReadonly<T[K]>;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* @public
|
|
18
18
|
*/
|
|
19
|
-
export
|
|
19
|
+
export type ReadonlyPrimitive = number | string | number[] | string[] | boolean | boolean[];
|
|
20
20
|
/**
|
|
21
21
|
* @public
|
|
22
22
|
*/
|
|
23
|
-
export
|
|
23
|
+
export type ReadonlyComponentSchema<T extends [ComponentDefinition<unknown>, ...ComponentDefinition<unknown>[]]> = {
|
|
24
24
|
[K in keyof T]: T[K] extends ComponentDefinition<unknown> ? ReturnType<T[K]['get']> : never;
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
27
|
* @public
|
|
28
28
|
*/
|
|
29
|
-
export
|
|
29
|
+
export 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>;
|
package/dist/engine/systems.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @public
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type SystemFn = (dt: number) => void;
|
|
5
5
|
export declare const SYSTEMS_REGULAR_PRIORITY = 100000;
|
|
6
|
-
export
|
|
6
|
+
export type SystemItem = {
|
|
7
7
|
fn: SystemFn;
|
|
8
8
|
priority: number;
|
|
9
9
|
name?: string;
|
package/dist/engine/types.d.ts
CHANGED
|
@@ -9,11 +9,11 @@ export { ISchema } from '../schemas/ISchema';
|
|
|
9
9
|
/**
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type Unpacked<T> = T extends (infer U)[] ? U : T;
|
|
13
13
|
/**
|
|
14
14
|
* @public
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export type ComponentSchema<T extends [ComponentDefinition<any>, ...ComponentDefinition<any>[]]> = {
|
|
17
17
|
[K in keyof T]: T[K] extends ComponentDefinition<any> ? ReturnType<T[K]['getMutable']> : never;
|
|
18
18
|
};
|
|
19
19
|
export interface MapComponentDefinition<T> extends ComponentDefinition<T> {
|
|
@@ -35,7 +35,7 @@ export interface MapComponentDefinition<T> extends ComponentDefinition<T> {
|
|
|
35
35
|
/**
|
|
36
36
|
* @public
|
|
37
37
|
*/
|
|
38
|
-
export
|
|
38
|
+
export type IEngine = {
|
|
39
39
|
/**
|
|
40
40
|
* Increment the used entity counter and return the next one.
|
|
41
41
|
* @param dynamic - whether or no the entity should be considered as Dynamic (vs Static)
|
package/dist/schemas/Map.d.ts
CHANGED
|
@@ -9,16 +9,16 @@ export interface Spec {
|
|
|
9
9
|
/**
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type MapResult<T extends Spec> = ToOptional<{
|
|
13
13
|
[K in keyof T]: T[K] extends ISchema ? ReturnType<T[K]['deserialize']> : T[K] extends Spec ? MapResult<T[K]> : never;
|
|
14
14
|
}>;
|
|
15
15
|
/**
|
|
16
16
|
* @public
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export type MapResultWithOptional<T extends Spec> = ToOptional<{
|
|
19
19
|
[K in keyof T]?: T[K] extends ISchema ? ReturnType<T[K]['deserialize']> : T[K] extends Spec ? MapResult<T[K]> : never;
|
|
20
20
|
}>;
|
|
21
|
-
export
|
|
21
|
+
export type MapSchemaType<T extends Spec> = ISchema<MapResult<T>>;
|
|
22
22
|
/**
|
|
23
23
|
* @public
|
|
24
24
|
*/
|
package/dist/schemas/typing.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/** Include property keys from T where the property is assignable to U */
|
|
2
|
-
export
|
|
2
|
+
export type IncludeUndefined<T> = {
|
|
3
3
|
[P in keyof T]: undefined extends T[P] ? P : never;
|
|
4
4
|
}[keyof T];
|
|
5
5
|
/** Excludes property keys from T where the property is assignable to U */
|
|
6
|
-
export
|
|
6
|
+
export type ExcludeUndefined<T> = {
|
|
7
7
|
[P in keyof T]: undefined extends T[P] ? never : P;
|
|
8
8
|
}[keyof T];
|
|
9
|
-
export
|
|
9
|
+
export type OnlyOptionalUndefinedTypes<T> = {
|
|
10
10
|
[K in IncludeUndefined<T>]?: T[K];
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type OnlyNonUndefinedTypes<T> = {
|
|
13
13
|
[K in ExcludeUndefined<T>]: T[K];
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export type ToOptional<T> = OnlyOptionalUndefinedTypes<T> & OnlyNonUndefinedTypes<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Entity } from '../../engine/entity';
|
|
2
|
-
export
|
|
2
|
+
export type Uint32 = number;
|
|
3
3
|
export declare enum CrdtMessageType {
|
|
4
4
|
RESERVED = 0,
|
|
5
5
|
PUT_COMPONENT = 1,
|
|
@@ -13,7 +13,7 @@ export declare enum CrdtMessageType {
|
|
|
13
13
|
* @param length - Uint32 the length of all message (including the header)
|
|
14
14
|
* @param type - define the function which handles the data
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export type CrdtMessageHeader = {
|
|
17
17
|
length: Uint32;
|
|
18
18
|
type: Uint32;
|
|
19
19
|
};
|
|
@@ -26,14 +26,14 @@ export declare const CRDT_MESSAGE_HEADER_LENGTH = 8;
|
|
|
26
26
|
* @param timestamp - Uint64 Lamport timestamp
|
|
27
27
|
* @param data - Uint8[] data of component => length(4 bytes) + block of bytes[0..length-1]
|
|
28
28
|
*/
|
|
29
|
-
export
|
|
29
|
+
export type PutComponentMessageBody = {
|
|
30
30
|
type: CrdtMessageType.PUT_COMPONENT;
|
|
31
31
|
entityId: Entity;
|
|
32
32
|
componentId: number;
|
|
33
33
|
timestamp: number;
|
|
34
34
|
data: Uint8Array;
|
|
35
35
|
};
|
|
36
|
-
export
|
|
36
|
+
export type DeleteComponentMessageBody = {
|
|
37
37
|
type: CrdtMessageType.DELETE_COMPONENT;
|
|
38
38
|
entityId: Entity;
|
|
39
39
|
componentId: number;
|
|
@@ -42,12 +42,12 @@ export declare type DeleteComponentMessageBody = {
|
|
|
42
42
|
/**
|
|
43
43
|
* @param entity - Uint32 number of the entity
|
|
44
44
|
*/
|
|
45
|
-
export
|
|
45
|
+
export type DeleteEntityMessageBody = {
|
|
46
46
|
type: CrdtMessageType.DELETE_ENTITY;
|
|
47
47
|
entityId: Entity;
|
|
48
48
|
};
|
|
49
|
-
export
|
|
50
|
-
export
|
|
51
|
-
export
|
|
52
|
-
export
|
|
53
|
-
export
|
|
49
|
+
export type PutComponentMessage = CrdtMessageHeader & PutComponentMessageBody;
|
|
50
|
+
export type DeleteComponentMessage = CrdtMessageHeader & DeleteComponentMessageBody;
|
|
51
|
+
export type DeleteEntityMessage = CrdtMessageHeader & DeleteEntityMessageBody;
|
|
52
|
+
export type CrdtMessage = PutComponentMessage | DeleteComponentMessage | DeleteEntityMessage;
|
|
53
|
+
export type CrdtMessageBody = PutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessage;
|
|
@@ -5,7 +5,7 @@ import { Transport } from './types';
|
|
|
5
5
|
/**
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type OnChangeFunction = (entity: Entity, operation: CrdtMessageType, component?: ComponentDefinition<any>) => void;
|
|
9
9
|
export declare function crdtSceneSystem(engine: Pick<IEngine, 'getComponentOrNull' | 'getComponent' | 'entityContainer' | 'componentsIter'>, onProcessEntityComponentChange: OnChangeFunction | null): {
|
|
10
10
|
getCrdt: () => import("@dcl/crdt").State<Uint8Array>;
|
|
11
11
|
sendMessages: (dirtyEntities: Map<ComponentDefinition<unknown>, Array<Entity>>, deletedEntities: Entity[]) => Promise<void>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CrdtMessageBody } from '../../serialization/crdt/types';
|
|
2
|
-
export
|
|
2
|
+
export type ReceiveMessage = CrdtMessageBody & {
|
|
3
3
|
transportId?: number;
|
|
4
4
|
messageBuffer: Uint8Array;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
7
|
-
export
|
|
6
|
+
export type TransportMessage = Omit<ReceiveMessage, 'data'>;
|
|
7
|
+
export type Transport = {
|
|
8
8
|
send(message: Uint8Array): Promise<void>;
|
|
9
9
|
onmessage?(message: Uint8Array): void;
|
|
10
10
|
filter(message: Omit<TransportMessage, 'messageBuffer'>): boolean;
|
package/dist/systems/events.d.ts
CHANGED
|
@@ -3,14 +3,14 @@ import { PBPointerEventsResult_PointerCommand } from '../components/generated/pb
|
|
|
3
3
|
import { IEngine } from '../engine/types';
|
|
4
4
|
import { Entity } from '../engine/entity';
|
|
5
5
|
import { IInputSystem } from '../engine/input';
|
|
6
|
-
export
|
|
7
|
-
export
|
|
6
|
+
export type EventSystemCallback = (event: PBPointerEventsResult_PointerCommand) => void;
|
|
7
|
+
export type EventSystemOptions = {
|
|
8
8
|
button: InputAction;
|
|
9
9
|
hoverText?: string;
|
|
10
10
|
maxDistance?: number;
|
|
11
11
|
showFeedback?: boolean;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type PointerEventsSystem = ReturnType<typeof createPointerEventSystem>;
|
|
14
14
|
export declare function createPointerEventSystem(engine: IEngine, inputSystem: IInputSystem): {
|
|
15
15
|
/**
|
|
16
16
|
* @internal
|
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-4006744889.commit-c6aff5f",
|
|
4
4
|
"description": "Decentraland ECS",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"typings": "./dist/index.d.ts",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"ts-proto": "^1.112.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@dcl/crdt": "7.0.6-
|
|
30
|
+
"@dcl/crdt": "7.0.6-4006744889.commit-c6aff5f",
|
|
31
31
|
"@dcl/js-runtime": "file:../js-runtime",
|
|
32
|
-
"@dcl/protocol": "
|
|
32
|
+
"@dcl/protocol": "1.0.0-3998437165.commit-16d59c3"
|
|
33
33
|
},
|
|
34
34
|
"files": [
|
|
35
35
|
"dist",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"displayName": "ECS",
|
|
42
42
|
"tsconfig": "./tsconfig.json"
|
|
43
43
|
},
|
|
44
|
-
"commit": "
|
|
44
|
+
"commit": "c6aff5f2e439d5af79c1e38d02ff90d3604670f3"
|
|
45
45
|
}
|