bc-minecraft-bedrock-types 1.4.8 → 1.4.10

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.
@@ -0,0 +1,7 @@
1
+ export declare type Component = any;
2
+ export declare type ComponentContainer = Record<string, Component>;
3
+ export declare type ComponentGroups = Record<string, ComponentContainer>;
4
+ export interface ComponentBehavior {
5
+ component_groups?: ComponentGroups;
6
+ components?: ComponentContainer;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Interfaces.js","sourceRoot":"","sources":["../../../../src/Minecraft/Components/Interfaces.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import { ComponentBehavior } from "./Interfaces";
2
+ export declare function getUsedComponents(data: ComponentBehavior): string[];
3
+ export declare function getUsedGroups(data: ComponentBehavior): string[];
4
+ /**
5
+ *
6
+ * @param entity
7
+ * @param group
8
+ * @returns
9
+ */
10
+ export declare function hasGroup(data: ComponentBehavior, group: string): boolean;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hasGroup = exports.getUsedGroups = exports.getUsedComponents = void 0;
4
+ function getUsedComponents(data) {
5
+ const out = [];
6
+ if (data.components) {
7
+ Object.getOwnPropertyNames(data.components).forEach((c) => {
8
+ if (!out.includes(c))
9
+ out.push(c);
10
+ });
11
+ }
12
+ const groups = data.component_groups;
13
+ if (groups) {
14
+ Object.entries(groups).forEach(([name, group]) => {
15
+ Object.getOwnPropertyNames(group).forEach((c) => {
16
+ if (!out.includes(c))
17
+ out.push(c);
18
+ });
19
+ });
20
+ }
21
+ return out;
22
+ }
23
+ exports.getUsedComponents = getUsedComponents;
24
+ function getUsedGroups(data) {
25
+ const groups = data.component_groups;
26
+ if (groups) {
27
+ return Object.getOwnPropertyNames(groups);
28
+ }
29
+ return [];
30
+ }
31
+ exports.getUsedGroups = getUsedGroups;
32
+ /**
33
+ *
34
+ * @param entity
35
+ * @param group
36
+ * @returns
37
+ */
38
+ function hasGroup(data, group) {
39
+ if (data.component_groups) {
40
+ if (data.component_groups[group]) {
41
+ return true;
42
+ }
43
+ }
44
+ return false;
45
+ }
46
+ exports.hasGroup = hasGroup;
47
+ //# sourceMappingURL=Used.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Used.js","sourceRoot":"","sources":["../../../../src/Minecraft/Components/Used.ts"],"names":[],"mappings":";;;AAEA,SAAgB,iBAAiB,CAAC,IAAuB;IACvD,MAAM,GAAG,GAAa,EAAE,CAAC;IAEzB,IAAI,IAAI,CAAC,UAAU,EAAE;QACnB,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACxD,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;KACJ;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC;IAErC,IAAI,MAAM,EAAE;QACV,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE;YAC/C,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;gBAC9C,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;oBAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACpC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AApBD,8CAoBC;AAED,SAAgB,aAAa,CAAC,IAAuB;IACnD,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC;IAErC,IAAI,MAAM,EAAE;QACV,OAAO,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;KAC3C;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AARD,sCAQC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAuB,EAAE,KAAa;IAC7D,IAAI,IAAI,CAAC,gBAAgB,EAAE;QACzB,IAAI,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAChC,OAAO,IAAI,CAAC;SACb;KACF;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AARD,4BAQC"}
@@ -0,0 +1,2 @@
1
+ export * from "./Interfaces";
2
+ export * from "./Used";
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ /* Auto generated */
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ __exportStar(require("./Interfaces"), exports);
19
+ __exportStar(require("./Used"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Minecraft/Components/index.ts"],"names":[],"mappings":";AAAA,oBAAoB;;;;;;;;;;;;;;;;AAEpB,+CAA6B;AAC7B,yCAAuB"}
@@ -1,3 +1,4 @@
1
+ export * as Components from "./Components/index";
1
2
  export * as Filter from "./Filter/index";
2
3
  export * as Json from "./Json/index";
3
4
  export * as Selector from "./Selector/index";
@@ -14,8 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.Selector = exports.Json = exports.Filter = void 0;
17
+ exports.Selector = exports.Json = exports.Filter = exports.Components = void 0;
18
18
  /* Auto generated */
19
+ exports.Components = require("./Components/index");
19
20
  exports.Filter = require("./Filter/index");
20
21
  exports.Json = require("./Json/index");
21
22
  exports.Selector = require("./Selector/index");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Minecraft/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oBAAoB;AACpB,2CAAyC;AACzC,uCAAqC;AACrC,+CAA6C;AAC7C,0CAAwB;AACxB,+CAA6B;AAC7B,uCAAqB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Minecraft/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oBAAoB;AACpB,mDAAiD;AACjD,2CAAyC;AACzC,uCAAqC;AACrC,+CAA6C;AAC7C,0CAAwB;AACxB,+CAA6B;AAC7B,uCAAqB"}
@@ -23,7 +23,7 @@ var InternalSelectorTypeMode;
23
23
  })(InternalSelectorTypeMode = exports.InternalSelectorTypeMode || (exports.InternalSelectorTypeMode = {}));
24
24
  /** */
25
25
  exports.SelectorTypeMode = {
26
- name: "selector Type",
26
+ name: "Selector Type",
27
27
  modes: [
28
28
  InternalSelectorTypeMode.Agents,
29
29
  InternalSelectorTypeMode.AllAgents,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bc-minecraft-bedrock-types",
3
- "version": "1.4.8",
3
+ "version": "1.4.10",
4
4
  "description": "The typescript library that provides default types for minecraft bedrock",
5
5
  "main": "./lib/src/main.js",
6
6
  "types": "./lib/src/main.d.ts",
@@ -39,7 +39,7 @@
39
39
  "homepage": "https://github.com/Blockception/BC-Minecraft-Bedrock-Command#readme",
40
40
  "devDependencies": {
41
41
  "@types/chai": "^4.3.3",
42
- "@types/mocha": "^9.1.1",
42
+ "@types/mocha": "^10.0.0",
43
43
  "@types/node": "^18.6.5",
44
44
  "chai": "^4.3.6",
45
45
  "mocha": "^10.0.0",