@dcl/sdk 7.0.0-2536237172.commit-c1aae82 → 7.0.0-2536481688.commit-17d01ea

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.
@@ -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: ComponentType<T>): ComponentType<T>;
25
+ create(entity: Entity, val?: ComponentType<T>): ComponentType<T>;
26
26
  mutable(entity: Entity): ComponentType<T>;
27
- createOrReplace(entity: Entity, val: ComponentType<T>): ComponentType<T>;
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,6 +227,7 @@ 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
  /**
@@ -1114,6 +1116,7 @@ declare interface PBAudioStream {
1114
1116
  declare interface PBBoxShape {
1115
1117
  withCollisions: boolean;
1116
1118
  isPointerBlocker: boolean;
1119
+ /** TODO: should visible be another component? that maybe affects all the entities */
1117
1120
  visible: boolean;
1118
1121
  uvs: number[];
1119
1122
  }
@@ -1121,6 +1124,7 @@ declare interface PBBoxShape {
1121
1124
  declare interface PBCylinderShape {
1122
1125
  withCollisions: boolean;
1123
1126
  isPointerBlocker: boolean;
1127
+ /** TODO: should visible be another component? that maybe affects all the entities */
1124
1128
  visible: boolean;
1125
1129
  radiusTop: number;
1126
1130
  radiusBottom: number;
@@ -1129,6 +1133,7 @@ declare interface PBCylinderShape {
1129
1133
  declare interface PBNFTShape {
1130
1134
  withCollisions: boolean;
1131
1135
  isPointerBlocker: boolean;
1136
+ /** TODO: should visible be another component? that maybe affects all the entities */
1132
1137
  visible: boolean;
1133
1138
  src: string;
1134
1139
  assetId: string;
@@ -1139,7 +1144,9 @@ declare interface PBNFTShape {
1139
1144
  declare interface PBPlaneShape {
1140
1145
  withCollisions: boolean;
1141
1146
  isPointerBlocker: boolean;
1147
+ /** TODO: should visible be another component? that maybe affects all the entities */
1142
1148
  visible: boolean;
1149
+ /** TODO: this could be better serialized as u00 v00 u01 v01 u10 v10 u11 v11 for speed */
1143
1150
  uvs: number[];
1144
1151
  }
1145
1152
 
@@ -1151,6 +1158,7 @@ declare interface PBSphereShape {
1151
1158
 
1152
1159
  declare interface PBTextShape {
1153
1160
  text: string;
1161
+ /** this should be removed */
1154
1162
  visible: boolean;
1155
1163
  font: string;
1156
1164
  opacity: number;
@@ -1176,6 +1184,65 @@ declare interface PBTextShape {
1176
1184
  textColor: Color3 | undefined;
1177
1185
  }
1178
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
+
1179
1246
  /**
1180
1247
  * Represens a plane by the equation ax + by + cz + d = 0
1181
1248
  * @public
@@ -1744,4 +1811,76 @@ export declare namespace Vector3 {
1744
1811
  export function Left(): MutableVector3;
1745
1812
  }
1746
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
+
1747
1886
  export { }