bc-minecraft-bedrock-types 1.2.0

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.
Files changed (144) hide show
  1. package/LICENSE +29 -0
  2. package/README.md +7 -0
  3. package/lib/src/General/Boolean.d.ts +11 -0
  4. package/lib/src/General/Boolean.js +37 -0
  5. package/lib/src/General/Boolean.js.map +1 -0
  6. package/lib/src/General/Float.d.ts +11 -0
  7. package/lib/src/General/Float.js +19 -0
  8. package/lib/src/General/Float.js.map +1 -0
  9. package/lib/src/General/Integer.d.ts +9 -0
  10. package/lib/src/General/Integer.js +17 -0
  11. package/lib/src/General/Integer.js.map +1 -0
  12. package/lib/src/General/Json.d.ts +11 -0
  13. package/lib/src/General/Json.js +26 -0
  14. package/lib/src/General/Json.js.map +1 -0
  15. package/lib/src/General/String.d.ts +7 -0
  16. package/lib/src/General/String.js +20 -0
  17. package/lib/src/General/String.js.map +1 -0
  18. package/lib/src/General/include.d.ts +5 -0
  19. package/lib/src/General/include.js +19 -0
  20. package/lib/src/General/include.js.map +1 -0
  21. package/lib/src/Minecraft/Block.d.ts +70 -0
  22. package/lib/src/Minecraft/Block.js +126 -0
  23. package/lib/src/Minecraft/Block.js.map +1 -0
  24. package/lib/src/Minecraft/Coordinate.d.ts +9 -0
  25. package/lib/src/Minecraft/Coordinate.js +17 -0
  26. package/lib/src/Minecraft/Coordinate.js.map +1 -0
  27. package/lib/src/Minecraft/Selector.d.ts +126 -0
  28. package/lib/src/Minecraft/Selector.js +278 -0
  29. package/lib/src/Minecraft/Selector.js.map +1 -0
  30. package/lib/src/Minecraft/Xp.d.ts +16 -0
  31. package/lib/src/Minecraft/Xp.js +33 -0
  32. package/lib/src/Minecraft/Xp.js.map +1 -0
  33. package/lib/src/Minecraft/include.d.ts +4 -0
  34. package/lib/src/Minecraft/include.js +18 -0
  35. package/lib/src/Minecraft/include.js.map +1 -0
  36. package/lib/src/Modes/CameraShake.d.ts +3 -0
  37. package/lib/src/Modes/CameraShake.js +12 -0
  38. package/lib/src/Modes/CameraShake.js.map +1 -0
  39. package/lib/src/Modes/Clone.d.ts +3 -0
  40. package/lib/src/Modes/Clone.js +16 -0
  41. package/lib/src/Modes/Clone.js.map +1 -0
  42. package/lib/src/Modes/Difficulty.d.ts +3 -0
  43. package/lib/src/Modes/Difficulty.js +22 -0
  44. package/lib/src/Modes/Difficulty.js.map +1 -0
  45. package/lib/src/Modes/Fill.d.ts +3 -0
  46. package/lib/src/Modes/Fill.js +15 -0
  47. package/lib/src/Modes/Fill.js.map +1 -0
  48. package/lib/src/Modes/GameMode.d.ts +3 -0
  49. package/lib/src/Modes/GameMode.js +19 -0
  50. package/lib/src/Modes/GameMode.js.map +1 -0
  51. package/lib/src/Modes/LocateFeature.d.ts +3 -0
  52. package/lib/src/Modes/LocateFeature.js +24 -0
  53. package/lib/src/Modes/LocateFeature.js.map +1 -0
  54. package/lib/src/Modes/Mask.d.ts +3 -0
  55. package/lib/src/Modes/Mask.js +13 -0
  56. package/lib/src/Modes/Mask.js.map +1 -0
  57. package/lib/src/Modes/Mirror.d.ts +3 -0
  58. package/lib/src/Modes/Mirror.js +14 -0
  59. package/lib/src/Modes/Mirror.js.map +1 -0
  60. package/lib/src/Modes/ModeCollection.d.ts +44 -0
  61. package/lib/src/Modes/ModeCollection.js +71 -0
  62. package/lib/src/Modes/ModeCollection.js.map +1 -0
  63. package/lib/src/Modes/ModeHandler.d.ts +30 -0
  64. package/lib/src/Modes/ModeHandler.js +40 -0
  65. package/lib/src/Modes/ModeHandler.js.map +1 -0
  66. package/lib/src/Modes/Modes.d.ts +46 -0
  67. package/lib/src/Modes/Modes.js +72 -0
  68. package/lib/src/Modes/Modes.js.map +1 -0
  69. package/lib/src/Modes/MusicRepeat.d.ts +3 -0
  70. package/lib/src/Modes/MusicRepeat.js +12 -0
  71. package/lib/src/Modes/MusicRepeat.js.map +1 -0
  72. package/lib/src/Modes/OldBlock.d.ts +3 -0
  73. package/lib/src/Modes/OldBlock.js +13 -0
  74. package/lib/src/Modes/OldBlock.js.map +1 -0
  75. package/lib/src/Modes/Operation.d.ts +3 -0
  76. package/lib/src/Modes/Operation.js +19 -0
  77. package/lib/src/Modes/Operation.js.map +1 -0
  78. package/lib/src/Modes/Replace.d.ts +3 -0
  79. package/lib/src/Modes/Replace.js +12 -0
  80. package/lib/src/Modes/Replace.js.map +1 -0
  81. package/lib/src/Modes/RideFill.d.ts +3 -0
  82. package/lib/src/Modes/RideFill.js +12 -0
  83. package/lib/src/Modes/RideFill.js.map +1 -0
  84. package/lib/src/Modes/RideRules.d.ts +3 -0
  85. package/lib/src/Modes/RideRules.js +13 -0
  86. package/lib/src/Modes/RideRules.js.map +1 -0
  87. package/lib/src/Modes/Rotation.d.ts +3 -0
  88. package/lib/src/Modes/Rotation.js +14 -0
  89. package/lib/src/Modes/Rotation.js.map +1 -0
  90. package/lib/src/Modes/Save.d.ts +3 -0
  91. package/lib/src/Modes/Save.js +12 -0
  92. package/lib/src/Modes/Save.js.map +1 -0
  93. package/lib/src/Modes/SelectorAttribute.d.ts +3 -0
  94. package/lib/src/Modes/SelectorAttribute.js +30 -0
  95. package/lib/src/Modes/SelectorAttribute.js.map +1 -0
  96. package/lib/src/Modes/SelectorType.d.ts +3 -0
  97. package/lib/src/Modes/SelectorType.js +18 -0
  98. package/lib/src/Modes/SelectorType.js.map +1 -0
  99. package/lib/src/Modes/SlotType.d.ts +18 -0
  100. package/lib/src/Modes/SlotType.js +22 -0
  101. package/lib/src/Modes/SlotType.js.map +1 -0
  102. package/lib/src/Modes/StructureAnimation.d.ts +3 -0
  103. package/lib/src/Modes/StructureAnimation.js +12 -0
  104. package/lib/src/Modes/StructureAnimation.js.map +1 -0
  105. package/lib/src/Modes/TeleportRules.d.ts +3 -0
  106. package/lib/src/Modes/TeleportRules.js +12 -0
  107. package/lib/src/Modes/TeleportRules.js.map +1 -0
  108. package/lib/src/Types/Conditional.d.ts +28 -0
  109. package/lib/src/Types/Conditional.js +58 -0
  110. package/lib/src/Types/Conditional.js.map +1 -0
  111. package/lib/src/Types/Definition.d.ts +42 -0
  112. package/lib/src/Types/Definition.js +73 -0
  113. package/lib/src/Types/Definition.js.map +1 -0
  114. package/lib/src/Types/DocumentLocation.d.ts +36 -0
  115. package/lib/src/Types/DocumentLocation.js +73 -0
  116. package/lib/src/Types/DocumentLocation.js.map +1 -0
  117. package/lib/src/Types/Documentated.d.ts +16 -0
  118. package/lib/src/Types/Documentated.js +30 -0
  119. package/lib/src/Types/Documentated.js.map +1 -0
  120. package/lib/src/Types/Identifiable.d.ts +34 -0
  121. package/lib/src/Types/Identifiable.js +60 -0
  122. package/lib/src/Types/Identifiable.js.map +1 -0
  123. package/lib/src/Types/JsonPath.d.ts +26 -0
  124. package/lib/src/Types/JsonPath.js +48 -0
  125. package/lib/src/Types/JsonPath.js.map +1 -0
  126. package/lib/src/Types/Locatable.d.ts +20 -0
  127. package/lib/src/Types/Locatable.js +31 -0
  128. package/lib/src/Types/Locatable.js.map +1 -0
  129. package/lib/src/Types/Location.d.ts +29 -0
  130. package/lib/src/Types/Location.js +39 -0
  131. package/lib/src/Types/Location.js.map +1 -0
  132. package/lib/src/Types/Position.d.ts +40 -0
  133. package/lib/src/Types/Position.js +78 -0
  134. package/lib/src/Types/Position.js.map +1 -0
  135. package/lib/src/Types/Range.d.ts +31 -0
  136. package/lib/src/Types/Range.js +40 -0
  137. package/lib/src/Types/Range.js.map +1 -0
  138. package/lib/src/Types/include.d.ts +10 -0
  139. package/lib/src/Types/include.js +24 -0
  140. package/lib/src/Types/include.js.map +1 -0
  141. package/lib/src/main.d.ts +4 -0
  142. package/lib/src/main.js +18 -0
  143. package/lib/src/main.js.map +1 -0
  144. package/package.json +50 -0
package/LICENSE ADDED
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2020, Blockception Ltd
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # BC-Minecraft-Bedrock-Types
2
+
3
+ [![tagged-release](https://github.com/Blockception/BC-Minecraft-Bedrock-Types/actions/workflows/tagged-release.yml/badge.svg)](https://github.com/Blockception/BC-Minecraft-Bedrock-Types/actions/workflows/tagged-release.yml)
4
+ [![Npm Test](https://github.com/Blockception/BC-Minecraft-Bedrock-Types/actions/workflows/npm-test.yml/badge.svg)](https://github.com/Blockception/BC-Minecraft-Bedrock-Types/actions/workflows/npm-test.yml)
5
+ [![Npm Package & Publish](https://github.com/Blockception/BC-Minecraft-Bedrock-Types/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/Blockception/BC-Minecraft-Bedrock-Types/actions/workflows/npm-publish.yml)
6
+
7
+ The typescript library that provides default types for minecraft bedrock.
@@ -0,0 +1,11 @@
1
+ /**The boolean data type, but related to minecraft*/
2
+ export declare namespace Boolean {
3
+ /**Checks if the given text value is a valid boolean
4
+ * @param value The valued to compare to
5
+ * @returns True or false if the text represents a boolean*/
6
+ function is(value: string): boolean;
7
+ /**Parses the text value to a boolean value
8
+ * @param value The text value comparing
9
+ * @returns True or false if the text represents a boolean*/
10
+ function parse(value: string): boolean;
11
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Boolean = void 0;
4
+ /**The boolean data type, but related to minecraft*/
5
+ var Boolean;
6
+ (function (Boolean) {
7
+ /**Checks if the given text value is a valid boolean
8
+ * @param value The valued to compare to
9
+ * @returns True or false if the text represents a boolean*/
10
+ function is(value) {
11
+ switch (value) {
12
+ case "True":
13
+ case "true":
14
+ case "False":
15
+ case "false":
16
+ return true;
17
+ default:
18
+ return false;
19
+ }
20
+ }
21
+ Boolean.is = is;
22
+ /**Parses the text value to a boolean value
23
+ * @param value The text value comparing
24
+ * @returns True or false if the text represents a boolean*/
25
+ function parse(value) {
26
+ switch (value) {
27
+ case "True":
28
+ case "true":
29
+ case "1":
30
+ return true;
31
+ default:
32
+ return false;
33
+ }
34
+ }
35
+ Boolean.parse = parse;
36
+ })(Boolean = exports.Boolean || (exports.Boolean = {}));
37
+ //# sourceMappingURL=Boolean.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Boolean.js","sourceRoot":"","sources":["../../../src/General/Boolean.ts"],"names":[],"mappings":";;;AAAA,oDAAoD;AACpD,IAAiB,OAAO,CA+BvB;AA/BD,WAAiB,OAAO;IACtB;;gEAE4D;IAC5D,SAAgB,EAAE,CAAC,KAAa;QAC9B,QAAQ,KAAK,EAAE;YACb,KAAK,MAAM,CAAC;YACZ,KAAK,MAAM,CAAC;YACZ,KAAK,OAAO,CAAC;YACb,KAAK,OAAO;gBACV,OAAO,IAAI,CAAC;YAEd;gBACE,OAAO,KAAK,CAAC;SAChB;IACH,CAAC;IAXe,UAAE,KAWjB,CAAA;IAED;;gEAE4D;IAC5D,SAAgB,KAAK,CAAC,KAAa;QACjC,QAAQ,KAAK,EAAE;YACb,KAAK,MAAM,CAAC;YACZ,KAAK,MAAM,CAAC;YACZ,KAAK,GAAG;gBACN,OAAO,IAAI,CAAC;YAEd;gBACE,OAAO,KAAK,CAAC;SAChB;IACH,CAAC;IAVe,aAAK,QAUpB,CAAA;AACH,CAAC,EA/BgB,OAAO,GAAP,eAAO,KAAP,eAAO,QA+BvB"}
@@ -0,0 +1,11 @@
1
+ /**TODO add documentation
2
+ *
3
+ */
4
+ export declare namespace Float {
5
+ /**The regex pattern that matches a float */
6
+ const pattern: RegExp;
7
+ /**Checks if the given text value is a valid float
8
+ * @param value The valued to compare to
9
+ * @returns True or false if the text represents a float*/
10
+ function is(text: string): boolean;
11
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Float = void 0;
4
+ /**TODO add documentation
5
+ *
6
+ */
7
+ var Float;
8
+ (function (Float) {
9
+ /**The regex pattern that matches a float */
10
+ Float.pattern = /^[\-\.\d]*$/;
11
+ /**Checks if the given text value is a valid float
12
+ * @param value The valued to compare to
13
+ * @returns True or false if the text represents a float*/
14
+ function is(text) {
15
+ return Float.pattern.test(text);
16
+ }
17
+ Float.is = is;
18
+ })(Float = exports.Float || (exports.Float = {}));
19
+ //# sourceMappingURL=Float.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Float.js","sourceRoot":"","sources":["../../../src/General/Float.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAiB,KAAK,CAUrB;AAVD,WAAiB,KAAK;IACpB,4CAA4C;IAC/B,aAAO,GAAW,aAAa,CAAC;IAE7C;;8DAE0D;IAC1D,SAAgB,EAAE,CAAC,IAAY;QAC7B,OAAO,MAAA,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAFe,QAAE,KAEjB,CAAA;AACH,CAAC,EAVgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAUrB"}
@@ -0,0 +1,9 @@
1
+ /** */
2
+ export declare namespace Integer {
3
+ /**The regex pattern that matches a integer */
4
+ const pattern: RegExp;
5
+ /**Checks if the given text value is a valid integer
6
+ * @param value The valued to compare to
7
+ * @returns True or false if the text represents a integer*/
8
+ function is(text: string): boolean;
9
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Integer = void 0;
4
+ /** */
5
+ var Integer;
6
+ (function (Integer) {
7
+ /**The regex pattern that matches a integer */
8
+ Integer.pattern = /^[\-\d]*$/;
9
+ /**Checks if the given text value is a valid integer
10
+ * @param value The valued to compare to
11
+ * @returns True or false if the text represents a integer*/
12
+ function is(text) {
13
+ return Integer.pattern.test(text);
14
+ }
15
+ Integer.is = is;
16
+ })(Integer = exports.Integer || (exports.Integer = {}));
17
+ //# sourceMappingURL=Integer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Integer.js","sourceRoot":"","sources":["../../../src/General/Integer.ts"],"names":[],"mappings":";;;AAAA,MAAM;AACN,IAAiB,OAAO,CAUvB;AAVD,WAAiB,OAAO;IACtB,8CAA8C;IACjC,eAAO,GAAW,WAAW,CAAC;IAE3C;;gEAE4D;IAC5D,SAAgB,EAAE,CAAC,IAAY;QAC7B,OAAO,QAAA,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAFe,UAAE,KAEjB,CAAA;AACH,CAAC,EAVgB,OAAO,GAAP,eAAO,KAAP,eAAO,QAUvB"}
@@ -0,0 +1,11 @@
1
+ /** */
2
+ export declare namespace Json {
3
+ /**Checks if the given text value is a valid json object
4
+ * @param value The valued to compare to
5
+ * @returns True or false if the text represents an json obect*/
6
+ function isObject(value: string): boolean;
7
+ /**Checks if the given text value is a valid jsob array
8
+ * @param value The valued to compare to
9
+ * @returns True or false if the text represents an json array*/
10
+ function isArray(value: string): boolean;
11
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Json = void 0;
4
+ /** */
5
+ var Json;
6
+ (function (Json) {
7
+ /**Checks if the given text value is a valid json object
8
+ * @param value The valued to compare to
9
+ * @returns True or false if the text represents an json obect*/
10
+ function isObject(value) {
11
+ if (value.startsWith("{") && value.endsWith("}"))
12
+ return true;
13
+ return false;
14
+ }
15
+ Json.isObject = isObject;
16
+ /**Checks if the given text value is a valid jsob array
17
+ * @param value The valued to compare to
18
+ * @returns True or false if the text represents an json array*/
19
+ function isArray(value) {
20
+ if (value.startsWith("[") && value.endsWith("]"))
21
+ return true;
22
+ return false;
23
+ }
24
+ Json.isArray = isArray;
25
+ })(Json = exports.Json || (exports.Json = {}));
26
+ //# sourceMappingURL=Json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Json.js","sourceRoot":"","sources":["../../../src/General/Json.ts"],"names":[],"mappings":";;;AAAA,MAAM;AACN,IAAiB,IAAI,CAkBpB;AAlBD,WAAiB,IAAI;IACnB;;oEAEgE;IAChE,SAAgB,QAAQ,CAAC,KAAa;QACpC,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC;QAE9D,OAAO,KAAK,CAAC;IACf,CAAC;IAJe,aAAQ,WAIvB,CAAA;IAED;;oEAEgE;IAChE,SAAgB,OAAO,CAAC,KAAa;QACnC,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC;QAE9D,OAAO,KAAK,CAAC;IACf,CAAC;IAJe,YAAO,UAItB,CAAA;AACH,CAAC,EAlBgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAkBpB"}
@@ -0,0 +1,7 @@
1
+ /** */
2
+ export declare namespace String {
3
+ /**Checks if the given text value is a valid string
4
+ * @param value The valued to compare to
5
+ * @returns True or false if the text represents an string*/
6
+ function is(value: string): boolean;
7
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.String = void 0;
4
+ /** */
5
+ var String;
6
+ (function (String) {
7
+ /**Checks if the given text value is a valid string
8
+ * @param value The valued to compare to
9
+ * @returns True or false if the text represents an string*/
10
+ function is(value) {
11
+ if (value.includes(" ")) {
12
+ if (value.startsWith('"') && value.endsWith('"'))
13
+ return true;
14
+ return false;
15
+ }
16
+ return true;
17
+ }
18
+ String.is = is;
19
+ })(String = exports.String || (exports.String = {}));
20
+ //# sourceMappingURL=String.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"String.js","sourceRoot":"","sources":["../../../src/General/String.ts"],"names":[],"mappings":";;;AAAA,MAAM;AACN,IAAiB,MAAM,CAatB;AAbD,WAAiB,MAAM;IACrB;;gEAE4D;IAC5D,SAAgB,EAAE,CAAC,KAAa;QAC9B,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACvB,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC;YAE9D,OAAO,KAAK,CAAC;SACd;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IARe,SAAE,KAQjB,CAAA;AACH,CAAC,EAbgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAatB"}
@@ -0,0 +1,5 @@
1
+ export * from "./Boolean";
2
+ export * from "./Float";
3
+ export * from "./Integer";
4
+ export * from "./Json";
5
+ export * from "./String";
@@ -0,0 +1,19 @@
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
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
6
+ }) : (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ o[k2] = m[k];
9
+ }));
10
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ __exportStar(require("./Boolean"), exports);
15
+ __exportStar(require("./Float"), exports);
16
+ __exportStar(require("./Integer"), exports);
17
+ __exportStar(require("./Json"), exports);
18
+ __exportStar(require("./String"), exports);
19
+ //# sourceMappingURL=include.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"include.js","sourceRoot":"","sources":["../../../src/General/include.ts"],"names":[],"mappings":";AAAA,oBAAoB;;;;;;;;;;;;AAEpB,4CAA0B;AAC1B,0CAAwB;AACxB,4CAA0B;AAC1B,yCAAuB;AACvB,2CAAyB"}
@@ -0,0 +1,70 @@
1
+ import { Documentated } from "../Types/Documentated";
2
+ import { Identifiable } from "../Types/Identifiable";
3
+ import { Locatable } from "../Types/Locatable";
4
+ import { Location } from "../Types/Location";
5
+ /**TODO add documentation
6
+ *
7
+ */
8
+ export interface BlockState {
9
+ /** */
10
+ property: string;
11
+ /** */
12
+ value: string;
13
+ }
14
+ /**TODO add documentation
15
+ *
16
+ */
17
+ export declare namespace BlockState {
18
+ /**TODO add documentation
19
+ *
20
+ * @param data
21
+ * @returns
22
+ */
23
+ function parse(data: string): BlockState | undefined;
24
+ /**TODO add documentation
25
+ *
26
+ * @param property
27
+ * @param value
28
+ * @returns
29
+ */
30
+ function create(property: string, value: string): {
31
+ property: string;
32
+ value: string;
33
+ };
34
+ }
35
+ /**TODO add documentation
36
+ *
37
+ */
38
+ export interface Block extends Locatable, Documentated, Identifiable {
39
+ /** */
40
+ states: BlockState[];
41
+ }
42
+ /**TODO add documentation
43
+ *
44
+ */
45
+ export declare namespace Block {
46
+ /**TODO add documentation
47
+ *
48
+ * @param id
49
+ * @param Location
50
+ * @returns
51
+ */
52
+ function create(id: string, Location: Location): Block;
53
+ /**TODO add documentation
54
+ *
55
+ * @param blockDescription
56
+ * @returns
57
+ */
58
+ function getId(blockDescription: string): string;
59
+ /**TODO add documentation
60
+ *
61
+ * @param blockDescription
62
+ * @returns
63
+ */
64
+ function getStates(blockDescription: string): BlockState[];
65
+ /**TODO add documentation
66
+ *
67
+ * @param blockDescription
68
+ */
69
+ function fromBlockDescriptor(blockDescription: string, Loc?: Location | undefined): Block;
70
+ }
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Block = exports.BlockState = void 0;
4
+ const Location_1 = require("../Types/Location");
5
+ /**TODO add documentation
6
+ *
7
+ */
8
+ var BlockState;
9
+ (function (BlockState) {
10
+ /**TODO add documentation
11
+ *
12
+ * @param data
13
+ * @returns
14
+ */
15
+ function parse(data) {
16
+ const index = data.indexOf("=");
17
+ if (index > -1) {
18
+ const k = data.slice(0, index);
19
+ const v = data.slice(index + 1);
20
+ return { property: k, value: v };
21
+ }
22
+ return undefined;
23
+ }
24
+ BlockState.parse = parse;
25
+ /**TODO add documentation
26
+ *
27
+ * @param property
28
+ * @param value
29
+ * @returns
30
+ */
31
+ function create(property, value) {
32
+ return {
33
+ property: property,
34
+ value: value,
35
+ };
36
+ }
37
+ BlockState.create = create;
38
+ })(BlockState = exports.BlockState || (exports.BlockState = {}));
39
+ /**TODO add documentation
40
+ *
41
+ */
42
+ var Block;
43
+ (function (Block) {
44
+ /**TODO add documentation
45
+ *
46
+ * @param id
47
+ * @param Location
48
+ * @returns
49
+ */
50
+ function create(id, Location) {
51
+ return {
52
+ id: id,
53
+ states: [],
54
+ location: Location,
55
+ };
56
+ }
57
+ Block.create = create;
58
+ /**TODO add documentation
59
+ *
60
+ * @param blockDescription
61
+ * @returns
62
+ */
63
+ function getId(blockDescription) {
64
+ const index = blockDescription.indexOf("[");
65
+ if (index > -1) {
66
+ return blockDescription.slice(0, index);
67
+ }
68
+ return blockDescription;
69
+ }
70
+ Block.getId = getId;
71
+ /**TODO add documentation
72
+ *
73
+ * @param blockDescription
74
+ * @returns
75
+ */
76
+ function getStates(blockDescription) {
77
+ const out = [];
78
+ let startindex = blockDescription.indexOf("[");
79
+ if (startindex > -1) {
80
+ startindex++;
81
+ let endindex = blockDescription.indexOf("]", startindex + 1);
82
+ if (endindex < startindex)
83
+ endindex = blockDescription.length;
84
+ const parts = blockDescription.slice(startindex, endindex).split(",");
85
+ for (var I = 0; I < parts.length; I++) {
86
+ const b = BlockState.parse(parts[I]);
87
+ if (b)
88
+ out.push(b);
89
+ }
90
+ }
91
+ return out;
92
+ }
93
+ Block.getStates = getStates;
94
+ /**TODO add documentation
95
+ *
96
+ * @param blockDescription
97
+ */
98
+ function fromBlockDescriptor(blockDescription, Loc = undefined) {
99
+ if (!Loc)
100
+ Loc = Location_1.Location.empty();
101
+ const out = [];
102
+ let id;
103
+ let startindex = blockDescription.indexOf("[");
104
+ if (startindex > -1) {
105
+ id = blockDescription.slice(0, startindex);
106
+ startindex++;
107
+ let endindex = blockDescription.indexOf("]", startindex + 1);
108
+ if (endindex < startindex)
109
+ endindex = blockDescription.length;
110
+ const parts = blockDescription.slice(startindex, endindex).split(",");
111
+ for (var I = 0; I < parts.length; I++) {
112
+ const b = BlockState.parse(parts[I]);
113
+ if (b)
114
+ out.push(b);
115
+ }
116
+ }
117
+ else {
118
+ id = blockDescription;
119
+ }
120
+ const block = Block.create(id, Loc);
121
+ block.states = out;
122
+ return block;
123
+ }
124
+ Block.fromBlockDescriptor = fromBlockDescriptor;
125
+ })(Block = exports.Block || (exports.Block = {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QACf,IAAI,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAE/C,IAAI,UAAU,GAAG,CAAC,CAAC,EAAE;YACnB,EAAE,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;YAC3C,UAAU,EAAE,CAAC;YACb,IAAI,QAAQ,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;YAE7D,IAAI,QAAQ,GAAG,UAAU;gBAAE,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC;YAE9D,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAEtE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACrC,MAAM,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gBACrC,IAAI,CAAC;oBAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACpB;SACF;aAAM;YACL,EAAE,GAAG,gBAAgB,CAAC;SACvB;QAED,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;QACpC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC;QAEnB,OAAO,KAAK,CAAC;IACf,CAAC;IA5Be,yBAAmB,sBA4BlC,CAAA;AACH,CAAC,EAzFgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAyFrB"}
@@ -0,0 +1,9 @@
1
+ /** */
2
+ export declare namespace Coordinate {
3
+ /**The regex pattern that matches a coordinate */
4
+ const pattern: RegExp;
5
+ /**Checks if the given text value is a valid coordinate
6
+ * @param value The valued to compare to
7
+ * @returns True or false if the text represents a coordinate*/
8
+ function is(text: string): boolean;
9
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Coordinate = void 0;
4
+ /** */
5
+ var Coordinate;
6
+ (function (Coordinate) {
7
+ /**The regex pattern that matches a coordinate */
8
+ Coordinate.pattern = /^[\~\^\+\-\d][\+\-\.\d]*$/;
9
+ /**Checks if the given text value is a valid coordinate
10
+ * @param value The valued to compare to
11
+ * @returns True or false if the text represents a coordinate*/
12
+ function is(text) {
13
+ return Coordinate.pattern.test(text);
14
+ }
15
+ Coordinate.is = is;
16
+ })(Coordinate = exports.Coordinate || (exports.Coordinate = {}));
17
+ //# sourceMappingURL=Coordinate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Coordinate.js","sourceRoot":"","sources":["../../../src/Minecraft/Coordinate.ts"],"names":[],"mappings":";;;AAAA,MAAM;AACN,IAAiB,UAAU,CAU1B;AAVD,WAAiB,UAAU;IACzB,iDAAiD;IACpC,kBAAO,GAAW,2BAA2B,CAAC;IAE3D;;mEAE+D;IAC/D,SAAgB,EAAE,CAAC,IAAY;QAC7B,OAAO,WAAA,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAFe,aAAE,KAEjB,CAAA;AACH,CAAC,EAVgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAU1B"}
@@ -0,0 +1,126 @@
1
+ /**An object that represents a selector*/
2
+ export declare class Selector {
3
+ /**The offset in the document where this selector starts*/
4
+ offset: number;
5
+ /**The selector type such as @a | @e*/
6
+ type: string;
7
+ /**The attribute assigned to the selector*/
8
+ attributes: SelectorAttribute[];
9
+ /**The scores assigned to the selector*/
10
+ scores: SelectorAttribute[];
11
+ /**Creates a new instance of a selector
12
+ * @param type The type of the selector such as @a | @e
13
+ * @param offset The offset the selector starts in the document*/
14
+ constructor(type: string, offset?: number);
15
+ /**TODO add documentation
16
+ *
17
+ * @returns
18
+ */
19
+ toString(): string;
20
+ /**TODO add documentation
21
+ *
22
+ * @param parameter
23
+ * @returns
24
+ */
25
+ contains(parameter: string): boolean;
26
+ /**TODO add documentation
27
+ *
28
+ * @param parameter
29
+ * @returns
30
+ */
31
+ count(parameter: string): number;
32
+ /**TODO add documentation
33
+ *
34
+ * @param parameter
35
+ * @returns
36
+ */
37
+ get(parameter: string): SelectorAttribute[];
38
+ /**TODO add documentation
39
+ *
40
+ * @param cursor
41
+ * @returns
42
+ */
43
+ isInScore(cursor: number): boolean;
44
+ }
45
+ /**TODO add documentation
46
+ *
47
+ */
48
+ export declare class SelectorAttribute {
49
+ /** */
50
+ offset: number;
51
+ /** */
52
+ name: string;
53
+ /** */
54
+ value: string;
55
+ /**TODO add documentation
56
+ *
57
+ * @param name
58
+ * @param value
59
+ * @param offset
60
+ */
61
+ constructor(name: string, value: string, offset?: number);
62
+ /**TODO add documentation
63
+ *
64
+ * @returns
65
+ */
66
+ toString(): string;
67
+ }
68
+ /**TODO add documentation
69
+ *
70
+ */
71
+ export declare namespace Selector {
72
+ /**TODO add documentation
73
+ *
74
+ * @param type
75
+ * @returns
76
+ */
77
+ function isValidType(type: string | Selector): boolean;
78
+ /**TODO add documentation
79
+ *
80
+ * @param text
81
+ * @returns
82
+ */
83
+ function getType(text: string): string;
84
+ /**TODO add documentation
85
+ *
86
+ * @param text
87
+ * @param offset
88
+ * @returns
89
+ */
90
+ function parse(text: string, offset?: number): Selector;
91
+ function isSelector(value: string, wildcard?: boolean, allowFakePlayers?: boolean): boolean;
92
+ }
93
+ /**TODO add documentation
94
+ *
95
+ */
96
+ export declare namespace SelectorAttribute {
97
+ /**TODO add documentation
98
+ *
99
+ * @param text
100
+ * @param offset
101
+ * @param selector
102
+ * @param receiver
103
+ */
104
+ function parseParameters(text: string, offset: number, selector: Selector, receiver: SelectorAttribute[]): void;
105
+ /**TODO add documentation
106
+ *
107
+ * @param text
108
+ * @param offset
109
+ * @param selector
110
+ * @param receiver
111
+ */
112
+ function parse(text: string, offset: number, selector: Selector, receiver: SelectorAttribute[]): void;
113
+ /**TODO add documentation
114
+ *
115
+ * @param p
116
+ * @param cursor
117
+ * @returns
118
+ */
119
+ function isCursor(p: SelectorAttribute, cursor: number): boolean;
120
+ /**TODO add documentation
121
+ *
122
+ * @param p
123
+ * @returns
124
+ */
125
+ function getEndOffset(p: SelectorAttribute): number;
126
+ }