bc-minecraft-bedrock-types 1.3.6 → 1.3.8

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,4 @@
1
+ /**
2
+ *
3
+ */
4
+ export declare type DomainType = "any" | "armor" | "feet" | "hand" | "head" | "leg" | "torso";
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Domain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Domain.js","sourceRoot":"","sources":["../../../../src/Minecraft/Filter/Domain.ts"],"names":[],"mappings":""}
@@ -0,0 +1,54 @@
1
+ import { DomainType } from "./Domain";
2
+ import { TestType } from "./TestType";
3
+ import { OperatorType } from "./Operator";
4
+ import { SubjectType } from "./Subject";
5
+ /**
6
+ *
7
+ */
8
+ export interface Filter {
9
+ /**
10
+ *
11
+ */
12
+ test: TestType;
13
+ /**
14
+ *
15
+ */
16
+ subject?: SubjectType;
17
+ /**
18
+ *
19
+ */
20
+ operator?: OperatorType;
21
+ /**
22
+ *
23
+ */
24
+ domain?: DomainType;
25
+ /**
26
+ *
27
+ */
28
+ value?: string | boolean | number;
29
+ }
30
+ export interface FilterContainerType {
31
+ any_of?: FilterItemType;
32
+ all_of?: FilterItemType;
33
+ none_of?: FilterItemType;
34
+ }
35
+ export declare type FilterType = FilterItemType | FilterItemType[];
36
+ export declare type FilterItemType = FilterContainerType | Filter;
37
+ /**
38
+ *
39
+ */
40
+ export declare namespace Filter {
41
+ /**
42
+ *
43
+ * @param value
44
+ * @returns
45
+ */
46
+ function is(value: any): value is Filter;
47
+ /**
48
+ *
49
+ * @param item
50
+ * @param callback
51
+ * @returns
52
+ */
53
+ function forEach(item: FilterType, callback: (item: Filter) => void): void;
54
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Filter = void 0;
4
+ /**
5
+ *
6
+ */
7
+ var Filter;
8
+ (function (Filter) {
9
+ /**
10
+ *
11
+ * @param value
12
+ * @returns
13
+ */
14
+ function is(value) {
15
+ if (typeof value === "object") {
16
+ return typeof value.test === "string";
17
+ }
18
+ return false;
19
+ }
20
+ Filter.is = is;
21
+ /**
22
+ *
23
+ * @param item
24
+ * @param callback
25
+ * @returns
26
+ */
27
+ function forEach(item, callback) {
28
+ if (Array.isArray(item)) {
29
+ item.forEach((i) => forEach(i, callback));
30
+ return;
31
+ }
32
+ if (typeof item !== "object")
33
+ return;
34
+ if (Filter.is(item)) {
35
+ callback(item);
36
+ }
37
+ item = item;
38
+ if (item.any_of)
39
+ forEach(item.any_of, callback);
40
+ if (item.all_of)
41
+ forEach(item.all_of, callback);
42
+ if (item.none_of)
43
+ forEach(item.none_of, callback);
44
+ }
45
+ Filter.forEach = forEach;
46
+ })(Filter = exports.Filter || (exports.Filter = {}));
47
+ //# sourceMappingURL=Filter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Filter.js","sourceRoot":"","sources":["../../../../src/Minecraft/Filter/Filter.ts"],"names":[],"mappings":";;;AAwCA;;GAEG;AACH,IAAiB,MAAM,CAqCtB;AArCD,WAAiB,MAAM;IACrB;;;;OAIG;IACH,SAAgB,EAAE,CAAC,KAAU;QAC3B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,OAAO,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC;SACvC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IANe,SAAE,KAMjB,CAAA;IAED;;;;;OAKG;IACH,SAAgB,OAAO,CAAC,IAAgB,EAAE,QAAgC;QACxE,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACvB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;YAC1C,OAAO;SACR;QAED,IAAI,OAAO,IAAI,KAAK,QAAQ;YAAE,OAAO;QAErC,IAAI,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE;YACnB,QAAQ,CAAC,IAAI,CAAC,CAAC;SAChB;QAED,IAAI,GAAG,IAA2B,CAAC;QACnC,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAChD,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAChD,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACpD,CAAC;IAhBe,cAAO,UAgBtB,CAAA;AACH,CAAC,EArCgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAqCtB"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ *
3
+ */
4
+ export declare type OperatorType = "!=" | "<" | "<=" | "<>" | "=" | "==" | ">" | ">=" | "equals" | "not";
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Operator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Operator.js","sourceRoot":"","sources":["../../../../src/Minecraft/Filter/Operator.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ /**
2
+ *
3
+ */
4
+ export declare type SubjectType = "block" | "damager" | "other" | "parent" | "player" | "self" | "target";
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Subject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Subject.js","sourceRoot":"","sources":["../../../../src/Minecraft/Filter/Subject.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ /**
2
+ *
3
+ */
4
+ export declare type TestType = "clock_time" | "distance_to_nearest_player" | "has_ability" | "has_biome_tag" | "has_component" | "has_container_open" | "has_damage" | "has_equipment" | "has_mob_effect" | "has_nametag" | "has_ranged_weapon" | "has_silk_touch" | "has_tag" | "has_target" | "has_trade_supply" | "hourly_clock_time" | "in_block" | "in_caravan" | "in_clouds" | "in_contact_with_water" | "in_lava" | "in_nether" | "in_water" | "in_water_or_rain" | "inactivity_timer" | "is_altitude" | "is_avoiding_mobs" | "is_biome" | "is_block" | "is_brightness" | "is_climbing" | "is_color" | "is_daytime" | "is_difficulty" | "is_family" | "is_game_rule" | "is_humid" | "is_immobile" | "is_in_village" | "is_leashed" | "is_leashed_to" | "is_mark_variant" | "is_missing_health" | "is_moving" | "is_owner" | "is_persistent" | "is_riding" | "is_skin_id" | "is_sleeping" | "is_sneaking" | "is_snow_covered" | "is_target" | "is_temperature_type" | "is_temperature_value" | "is_underground" | "is_underwater" | "is_variant" | "is_visible" | "is_waterlogged" | "is_weather" | "light_level" | "moon_intensity" | "moon_phase" | "on_ground" | "on_ladder" | "random_chance" | "rider_count" | "surface_mob" | "trusts" | "weather" | "weather_at_position";
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=TestType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestType.js","sourceRoot":"","sources":["../../../../src/Minecraft/Filter/TestType.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export * from "./Domain";
2
+ export * from "./Filter";
3
+ export * from "./Operator";
4
+ export * from "./Subject";
5
+ export * from "./TestType";
@@ -0,0 +1,23 @@
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("./Domain"), exports);
19
+ __exportStar(require("./Filter"), exports);
20
+ __exportStar(require("./Operator"), exports);
21
+ __exportStar(require("./Subject"), exports);
22
+ __exportStar(require("./TestType"), exports);
23
+ //# sourceMappingURL=include.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"include.js","sourceRoot":"","sources":["../../../../src/Minecraft/Filter/include.ts"],"names":[],"mappings":";AAAA,oBAAoB;;;;;;;;;;;;;;;;AAEpB,2CAAyB;AACzB,2CAAyB;AACzB,6CAA2B;AAC3B,4CAA0B;AAC1B,6CAA2B"}
@@ -1,3 +1,4 @@
1
+ export * as Filter from "./Filter/include";
1
2
  export * as Selector from "./Selector/include";
2
3
  export * from "./Block";
3
4
  export * from "./Coordinate";
@@ -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 = void 0;
17
+ exports.Selector = exports.Filter = void 0;
18
18
  /* Auto generated */
19
+ exports.Filter = require("./Filter/include");
19
20
  exports.Selector = require("./Selector/include");
20
21
  __exportStar(require("./Block"), exports);
21
22
  __exportStar(require("./Coordinate"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"include.js","sourceRoot":"","sources":["../../../src/Minecraft/include.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oBAAoB;AACpB,iDAA+C;AAC/C,0CAAwB;AACxB,+CAA6B;AAC7B,uCAAqB"}
1
+ {"version":3,"file":"include.js","sourceRoot":"","sources":["../../../src/Minecraft/include.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oBAAoB;AACpB,6CAA2C;AAC3C,iDAA+C;AAC/C,0CAAwB;AACxB,+CAA6B;AAC7B,uCAAqB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bc-minecraft-bedrock-types",
3
- "version": "1.3.6",
3
+ "version": "1.3.8",
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,12 +39,12 @@
39
39
  "homepage": "https://github.com/Blockception/BC-Minecraft-Bedrock-Command#readme",
40
40
  "devDependencies": {
41
41
  "@types/chai": "^4.3.1",
42
- "@types/mocha": "^9.1.0",
43
- "@types/node": "^17.0.25",
42
+ "@types/mocha": "^9.1.1",
43
+ "@types/node": "^18.0.6",
44
44
  "chai": "^4.3.6",
45
- "mocha": "^9.2.2",
45
+ "mocha": "^10.0.0",
46
46
  "rimraf": "^3.0.2",
47
- "ts-node": "^10.7.0",
48
- "typescript": "^4.6.3"
47
+ "ts-node": "^10.9.1",
48
+ "typescript": "^4.7.4"
49
49
  }
50
50
  }