@dcl/sdk 7.0.0-2536021667.commit-17c845c → 7.0.0-2536579928.commit-004d2e1
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/ecs7/index.d.ts +168 -3
- package/dist/ecs7/index.js +699 -56
- package/dist/ecs7/index.min.js +1 -1
- package/dist/ecs7/index.min.js.map +1 -1
- package/dist/ecs7/proto-definitions/BoxShape.proto +2 -1
- package/dist/ecs7/proto-definitions/CylinderShape.proto +2 -1
- package/dist/ecs7/proto-definitions/NFTShape.proto +1 -0
- package/dist/ecs7/proto-definitions/PlaneShape.proto +3 -1
- package/dist/ecs7/proto-definitions/SphereShape.proto +1 -1
- package/dist/ecs7/proto-definitions/TextShape.proto +7 -5
- package/dist/ecs7/proto-definitions/UiTransform.proto +159 -0
- package/package.json +6 -6
- package/types/@decentraland/Identity/index.d.ts +2 -0
- package/types/@decentraland/Players/index.d.ts +2 -0
- package/types/ecs7/index.d.ts +168 -3
- package/types/tsconfig.ecs7.json +12 -2
package/dist/ecs7/index.d.ts
CHANGED
@@ -22,9 +22,9 @@ export declare type ComponentDefinition<T extends EcsType = EcsType<any>> = {
|
|
22
22
|
has(entity: Entity): boolean;
|
23
23
|
getFrom(entity: Entity): DeepReadonly<ComponentType<T>>;
|
24
24
|
getOrNull(entity: Entity): DeepReadonly<ComponentType<T>> | null;
|
25
|
-
create(entity: Entity, val
|
25
|
+
create(entity: Entity, val?: ComponentType<T>): ComponentType<T>;
|
26
26
|
mutable(entity: Entity): ComponentType<T>;
|
27
|
-
createOrReplace(entity: Entity, val
|
27
|
+
createOrReplace(entity: Entity, val?: ComponentType<T>): ComponentType<T>;
|
28
28
|
deleteFrom(entity: Entity): ComponentType<T> | null;
|
29
29
|
upsertFromBinary(entity: Entity, data: ByteBuffer): ComponentType<T> | null;
|
30
30
|
updateFromBinary(entity: Entity, data: ByteBuffer): ComponentType<T> | null;
|
@@ -193,6 +193,7 @@ declare function defineSdkComponents(engine: Pick<IEngine, 'defineComponent'>):
|
|
193
193
|
PlaneShape: ComponentDefinition<EcsType<PBPlaneShape>>;
|
194
194
|
SphereShape: ComponentDefinition<EcsType<PBSphereShape>>;
|
195
195
|
TextShape: ComponentDefinition<EcsType<PBTextShape>>;
|
196
|
+
UiTransform: ComponentDefinition<EcsType<PBUiTransform>>;
|
196
197
|
Transform: ComponentDefinition<EcsType<Transform>>;
|
197
198
|
};
|
198
199
|
|
@@ -226,12 +227,21 @@ export declare const EcsString: EcsType<string>;
|
|
226
227
|
export declare type EcsType<T = any> = {
|
227
228
|
serialize(value: T, builder: ByteBuffer): void;
|
228
229
|
deserialize(reader: ByteBuffer): T;
|
230
|
+
create(): T;
|
229
231
|
};
|
230
232
|
|
231
233
|
/**
|
232
234
|
* @public
|
233
235
|
*/
|
234
|
-
export declare function Engine(
|
236
|
+
export declare function Engine({ transports }?: {
|
237
|
+
transports?: Transport[];
|
238
|
+
}): IEngine;
|
239
|
+
|
240
|
+
/**
|
241
|
+
* @alpha * This file initialization is an alpha one. This is based on the old-ecs
|
242
|
+
* init and it'll be changing.
|
243
|
+
*/
|
244
|
+
export declare const engine: IEngine;
|
235
245
|
|
236
246
|
/**
|
237
247
|
* @public
|
@@ -1106,6 +1116,7 @@ declare interface PBAudioStream {
|
|
1106
1116
|
declare interface PBBoxShape {
|
1107
1117
|
withCollisions: boolean;
|
1108
1118
|
isPointerBlocker: boolean;
|
1119
|
+
/** TODO: should visible be another component? that maybe affects all the entities */
|
1109
1120
|
visible: boolean;
|
1110
1121
|
uvs: number[];
|
1111
1122
|
}
|
@@ -1113,6 +1124,7 @@ declare interface PBBoxShape {
|
|
1113
1124
|
declare interface PBCylinderShape {
|
1114
1125
|
withCollisions: boolean;
|
1115
1126
|
isPointerBlocker: boolean;
|
1127
|
+
/** TODO: should visible be another component? that maybe affects all the entities */
|
1116
1128
|
visible: boolean;
|
1117
1129
|
radiusTop: number;
|
1118
1130
|
radiusBottom: number;
|
@@ -1121,6 +1133,7 @@ declare interface PBCylinderShape {
|
|
1121
1133
|
declare interface PBNFTShape {
|
1122
1134
|
withCollisions: boolean;
|
1123
1135
|
isPointerBlocker: boolean;
|
1136
|
+
/** TODO: should visible be another component? that maybe affects all the entities */
|
1124
1137
|
visible: boolean;
|
1125
1138
|
src: string;
|
1126
1139
|
assetId: string;
|
@@ -1131,7 +1144,9 @@ declare interface PBNFTShape {
|
|
1131
1144
|
declare interface PBPlaneShape {
|
1132
1145
|
withCollisions: boolean;
|
1133
1146
|
isPointerBlocker: boolean;
|
1147
|
+
/** TODO: should visible be another component? that maybe affects all the entities */
|
1134
1148
|
visible: boolean;
|
1149
|
+
/** TODO: this could be better serialized as u00 v00 u01 v01 u10 v10 u11 v11 for speed */
|
1135
1150
|
uvs: number[];
|
1136
1151
|
}
|
1137
1152
|
|
@@ -1143,6 +1158,7 @@ declare interface PBSphereShape {
|
|
1143
1158
|
|
1144
1159
|
declare interface PBTextShape {
|
1145
1160
|
text: string;
|
1161
|
+
/** this should be removed */
|
1146
1162
|
visible: boolean;
|
1147
1163
|
font: string;
|
1148
1164
|
opacity: number;
|
@@ -1168,6 +1184,65 @@ declare interface PBTextShape {
|
|
1168
1184
|
textColor: Color3 | undefined;
|
1169
1185
|
}
|
1170
1186
|
|
1187
|
+
declare interface PBUiTransform {
|
1188
|
+
positionType: YGPositionType;
|
1189
|
+
alignContent: YGAlign;
|
1190
|
+
alignItems: YGAlign;
|
1191
|
+
alignSelf: YGAlign;
|
1192
|
+
flexDirection: YGFlexDirection;
|
1193
|
+
flexWrap: YGWrap;
|
1194
|
+
justifyContent: YGJustify;
|
1195
|
+
overflow: YGOverflow;
|
1196
|
+
display: YGDisplay;
|
1197
|
+
direction: YGDirection;
|
1198
|
+
flex: number;
|
1199
|
+
flexBasisUnit: YGUnit;
|
1200
|
+
flexBasis: number;
|
1201
|
+
flexGrow: number;
|
1202
|
+
flexShrink: number;
|
1203
|
+
widthUnit: YGUnit;
|
1204
|
+
width: number;
|
1205
|
+
heightUnit: YGUnit;
|
1206
|
+
height: number;
|
1207
|
+
minWidthUnit: YGUnit;
|
1208
|
+
minWidth: number;
|
1209
|
+
minHeightUnit: YGUnit;
|
1210
|
+
minHeight: number;
|
1211
|
+
maxWidthUnit: YGUnit;
|
1212
|
+
maxWidth: number;
|
1213
|
+
maxHeightUnit: YGUnit;
|
1214
|
+
maxHeight: number;
|
1215
|
+
positionLeftUnit: YGUnit;
|
1216
|
+
positionLeft: number;
|
1217
|
+
positionTopUnit: YGUnit;
|
1218
|
+
positionTop: number;
|
1219
|
+
positionRightUnit: YGUnit;
|
1220
|
+
positionRight: number;
|
1221
|
+
positionBottomUnit: YGUnit;
|
1222
|
+
positionBottom: number;
|
1223
|
+
/** margin */
|
1224
|
+
marginLeftUnit: YGUnit;
|
1225
|
+
marginLeft: number;
|
1226
|
+
marginTopUnit: YGUnit;
|
1227
|
+
marginTop: number;
|
1228
|
+
marginRightUnit: YGUnit;
|
1229
|
+
marginRight: number;
|
1230
|
+
marginBottomUnit: YGUnit;
|
1231
|
+
marginBottom: number;
|
1232
|
+
paddingLeftUnit: YGUnit;
|
1233
|
+
paddingLeft: number;
|
1234
|
+
paddingTopUnit: YGUnit;
|
1235
|
+
paddingTop: number;
|
1236
|
+
paddingRightUnit: YGUnit;
|
1237
|
+
paddingRight: number;
|
1238
|
+
paddingBottomUnit: YGUnit;
|
1239
|
+
paddingBottom: number;
|
1240
|
+
borderLeft: number;
|
1241
|
+
borderTop: number;
|
1242
|
+
borderRight: number;
|
1243
|
+
borderBottom: number;
|
1244
|
+
}
|
1245
|
+
|
1171
1246
|
/**
|
1172
1247
|
* Represens a plane by the equation ax + by + cz + d = 0
|
1173
1248
|
* @public
|
@@ -1447,6 +1522,15 @@ export declare namespace Quaternion {
|
|
1447
1522
|
*/
|
1448
1523
|
export declare const RAD2DEG: number;
|
1449
1524
|
|
1525
|
+
declare type ReceiveMessage = {
|
1526
|
+
entity: Entity;
|
1527
|
+
componentId: number;
|
1528
|
+
timestamp: number;
|
1529
|
+
transportType?: string;
|
1530
|
+
data: Uint8Array;
|
1531
|
+
messageBuffer: Uint8Array;
|
1532
|
+
};
|
1533
|
+
|
1450
1534
|
/**
|
1451
1535
|
* @public
|
1452
1536
|
*/
|
@@ -1505,6 +1589,15 @@ declare type Transform = {
|
|
1505
1589
|
|
1506
1590
|
declare const Transform: EcsType<Transform>;
|
1507
1591
|
|
1592
|
+
declare type Transport = {
|
1593
|
+
type: string;
|
1594
|
+
send(message: Uint8Array): void;
|
1595
|
+
onmessage?(message: Uint8Array): void;
|
1596
|
+
filter(message: TransportMessage): boolean;
|
1597
|
+
};
|
1598
|
+
|
1599
|
+
declare type TransportMessage = Omit<ReceiveMessage, 'data'>;
|
1600
|
+
|
1508
1601
|
/**
|
1509
1602
|
* @public
|
1510
1603
|
*/
|
@@ -1718,4 +1811,76 @@ export declare namespace Vector3 {
|
|
1718
1811
|
export function Left(): MutableVector3;
|
1719
1812
|
}
|
1720
1813
|
|
1814
|
+
declare enum YGAlign {
|
1815
|
+
YGAlignAuto = 0,
|
1816
|
+
YGAlignFlexStart = 1,
|
1817
|
+
YGAlignCenter = 2,
|
1818
|
+
YGAlignFlexEnd = 3,
|
1819
|
+
YGAlignStretch = 4,
|
1820
|
+
YGAlignBaseline = 5,
|
1821
|
+
YGAlignSpaceBetween = 6,
|
1822
|
+
YGAlignSpaceAround = 7,
|
1823
|
+
UNRECOGNIZED = -1
|
1824
|
+
}
|
1825
|
+
|
1826
|
+
declare enum YGDirection {
|
1827
|
+
YGDirectionInherit = 0,
|
1828
|
+
YGDirectionLTR = 1,
|
1829
|
+
YGDirectionRTL = 2,
|
1830
|
+
UNRECOGNIZED = -1
|
1831
|
+
}
|
1832
|
+
|
1833
|
+
declare enum YGDisplay {
|
1834
|
+
YGDisplayFlex = 0,
|
1835
|
+
YGDisplayNone = 1,
|
1836
|
+
UNRECOGNIZED = -1
|
1837
|
+
}
|
1838
|
+
|
1839
|
+
declare enum YGFlexDirection {
|
1840
|
+
YGFlexDirectionColumn = 0,
|
1841
|
+
YGFlexDirectionColumnReverse = 1,
|
1842
|
+
YGFlexDirectionRow = 2,
|
1843
|
+
YGFlexDirectionRowReverse = 3,
|
1844
|
+
UNRECOGNIZED = -1
|
1845
|
+
}
|
1846
|
+
|
1847
|
+
declare enum YGJustify {
|
1848
|
+
YGJustifyFlexStart = 0,
|
1849
|
+
YGJustifyCenter = 1,
|
1850
|
+
YGJustifyFlexEnd = 2,
|
1851
|
+
YGJustifySpaceBetween = 3,
|
1852
|
+
YGJustifySpaceAround = 4,
|
1853
|
+
YGJustifySpaceEvenly = 5,
|
1854
|
+
UNRECOGNIZED = -1
|
1855
|
+
}
|
1856
|
+
|
1857
|
+
declare enum YGOverflow {
|
1858
|
+
YGOverflowVisible = 0,
|
1859
|
+
YGOverflowHidden = 1,
|
1860
|
+
YGOverflowScroll = 2,
|
1861
|
+
UNRECOGNIZED = -1
|
1862
|
+
}
|
1863
|
+
|
1864
|
+
declare enum YGPositionType {
|
1865
|
+
YGPositionTypeStatic = 0,
|
1866
|
+
YGPositionTypeRelative = 1,
|
1867
|
+
YGPositionTypeAbsolute = 2,
|
1868
|
+
UNRECOGNIZED = -1
|
1869
|
+
}
|
1870
|
+
|
1871
|
+
declare enum YGUnit {
|
1872
|
+
YGUnitUndefined = 0,
|
1873
|
+
YGUnitPoint = 1,
|
1874
|
+
YGUnitPercent = 2,
|
1875
|
+
YGUnitAuto = 3,
|
1876
|
+
UNRECOGNIZED = -1
|
1877
|
+
}
|
1878
|
+
|
1879
|
+
declare enum YGWrap {
|
1880
|
+
YGWrapNoWrap = 0,
|
1881
|
+
YGWrapWrap = 1,
|
1882
|
+
YGWrapWrapReverse = 2,
|
1883
|
+
UNRECOGNIZED = -1
|
1884
|
+
}
|
1885
|
+
|
1721
1886
|
export { }
|