puzzle-lib 1.3.0 → 1.6.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 (180) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +38 -39
  3. package/build/src/Braille/BrailleCharacter.d.ts +15 -15
  4. package/build/src/Braille/BrailleCharacter.js +38 -37
  5. package/build/src/Braille/BrailleCharacter.js.map +1 -1
  6. package/build/src/Braille/BrailleData.d.ts +6 -6
  7. package/build/src/Braille/BrailleData.js +65 -64
  8. package/build/src/Braille/BrailleData.js.map +1 -1
  9. package/build/src/Braille/BrailleDot.d.ts +9 -9
  10. package/build/src/Braille/BrailleDot.js +13 -12
  11. package/build/src/Braille/BrailleDot.js.map +1 -1
  12. package/build/src/Braille/BrailleEncoding.d.ts +54 -54
  13. package/build/src/Braille/BrailleEncoding.js +65 -64
  14. package/build/src/Braille/BrailleEncoding.js.map +1 -1
  15. package/build/src/Braille/BrailleStream.d.ts +18 -18
  16. package/build/src/Braille/BrailleStream.js +75 -74
  17. package/build/src/Braille/BrailleStream.js.map +1 -1
  18. package/build/src/Cipher/AutoKeyString.d.ts +4 -4
  19. package/build/src/Cipher/AutoKeyString.js +34 -33
  20. package/build/src/Cipher/AutoKeyString.js.map +1 -1
  21. package/build/src/Cipher/CaesarString.d.ts +8 -8
  22. package/build/src/Cipher/CaesarString.js +31 -30
  23. package/build/src/Cipher/CaesarString.js.map +1 -1
  24. package/build/src/Cipher/CaesarUtils.d.ts +13 -13
  25. package/build/src/Cipher/CaesarUtils.js +57 -56
  26. package/build/src/Cipher/CaesarUtils.js.map +1 -1
  27. package/build/src/Cipher/KeyedCipherStringBase.d.ts +12 -12
  28. package/build/src/Cipher/KeyedCipherStringBase.js +28 -27
  29. package/build/src/Cipher/KeyedCipherStringBase.js.map +1 -1
  30. package/build/src/Cipher/VigenereString.d.ts +4 -4
  31. package/build/src/Cipher/VigenereString.js +21 -20
  32. package/build/src/Cipher/VigenereString.js.map +1 -1
  33. package/build/src/Common/CharacterImage.d.ts +6 -6
  34. package/build/src/Common/CharacterImage.js +10 -9
  35. package/build/src/Common/CharacterImage.js.map +1 -1
  36. package/build/src/Common/EncodingCategory.d.ts +8 -8
  37. package/build/src/Common/EncodingCategory.js +12 -11
  38. package/build/src/Common/EncodingCategory.js.map +1 -1
  39. package/build/src/Common/EncodingCharacterBase.d.ts +23 -23
  40. package/build/src/Common/EncodingCharacterBase.js +52 -51
  41. package/build/src/Common/EncodingCharacterBase.js.map +1 -1
  42. package/build/src/Common/EncodingDataBase.d.ts +7 -7
  43. package/build/src/Common/EncodingDataBase.js +29 -28
  44. package/build/src/Common/EncodingDataBase.js.map +1 -1
  45. package/build/src/Common/EncodingEntry.d.ts +8 -8
  46. package/build/src/Common/EncodingEntry.js +14 -13
  47. package/build/src/Common/EncodingEntry.js.map +1 -1
  48. package/build/src/Common/EncodingLookupResult.d.ts +6 -6
  49. package/build/src/Common/EncodingLookupResult.js +13 -12
  50. package/build/src/Common/EncodingLookupResult.js.map +1 -1
  51. package/build/src/Common/Helpers.d.ts +4 -4
  52. package/build/src/Common/Helpers.js +16 -15
  53. package/build/src/Common/Helpers.js.map +1 -1
  54. package/build/src/Common/InlineSvg.d.ts +7 -7
  55. package/build/src/Common/InlineSvg.js +14 -13
  56. package/build/src/Common/InlineSvg.js.map +1 -1
  57. package/build/src/Conversion/CharacterAutoConvert.d.ts +10 -7
  58. package/build/src/Conversion/CharacterAutoConvert.js +88 -80
  59. package/build/src/Conversion/CharacterAutoConvert.js.map +1 -1
  60. package/build/src/Conversion/CharacterConversion.d.ts +8 -8
  61. package/build/src/Conversion/CharacterConversion.js +50 -49
  62. package/build/src/Conversion/CharacterConversion.js.map +1 -1
  63. package/build/src/Conversion/CharacterEncoding.d.ts +9 -8
  64. package/build/src/Conversion/CharacterEncoding.js +13 -11
  65. package/build/src/Conversion/CharacterEncoding.js.map +1 -1
  66. package/build/src/Conversion/CharacterTableEntry.d.ts +10 -10
  67. package/build/src/Conversion/CharacterTableEntry.js +19 -18
  68. package/build/src/Conversion/CharacterTableEntry.js.map +1 -1
  69. package/build/src/Conversion/SignificantFigures.d.ts +7 -7
  70. package/build/src/Conversion/SignificantFigures.js +50 -49
  71. package/build/src/Conversion/SignificantFigures.js.map +1 -1
  72. package/build/src/Conversion/StringAutoConvert.d.ts +6 -6
  73. package/build/src/Conversion/StringAutoConvert.js +46 -45
  74. package/build/src/Conversion/StringAutoConvert.js.map +1 -1
  75. package/build/src/Morse/MorseCharacter.d.ts +22 -22
  76. package/build/src/Morse/MorseCharacter.js +96 -95
  77. package/build/src/Morse/MorseCharacter.js.map +1 -1
  78. package/build/src/Morse/MorseData.d.ts +6 -6
  79. package/build/src/Morse/MorseData.js +70 -69
  80. package/build/src/Morse/MorseData.js.map +1 -1
  81. package/build/src/Morse/MorseEncoding.d.ts +59 -59
  82. package/build/src/Morse/MorseEncoding.js +94 -93
  83. package/build/src/Morse/MorseEncoding.js.map +1 -1
  84. package/build/src/Morse/MorseString.d.ts +10 -10
  85. package/build/src/Morse/MorseString.js +66 -65
  86. package/build/src/Morse/MorseString.js.map +1 -1
  87. package/build/src/Nato/NatoCharacter.d.ts +5 -5
  88. package/build/src/Nato/NatoCharacter.js +10 -9
  89. package/build/src/Nato/NatoCharacter.js.map +1 -1
  90. package/build/src/Nato/NatoData.d.ts +7 -7
  91. package/build/src/Nato/NatoData.js +51 -50
  92. package/build/src/Nato/NatoData.js.map +1 -1
  93. package/build/src/NavalFlags/NavalFlags.d.ts +7 -7
  94. package/build/src/NavalFlags/NavalFlags.js +52 -50
  95. package/build/src/NavalFlags/NavalFlags.js.map +1 -1
  96. package/build/src/Resistor/Resistor.d.ts +24 -24
  97. package/build/src/Resistor/Resistor.js +86 -85
  98. package/build/src/Resistor/Resistor.js.map +1 -1
  99. package/build/src/Resistor/ResistorColorEntry.d.ts +12 -12
  100. package/build/src/Resistor/ResistorColorEntry.js +31 -30
  101. package/build/src/Resistor/ResistorColorEntry.js.map +1 -1
  102. package/build/src/Semaphore/SemaphoreCharacter.d.ts +20 -20
  103. package/build/src/Semaphore/SemaphoreCharacter.js +75 -74
  104. package/build/src/Semaphore/SemaphoreCharacter.js.map +1 -1
  105. package/build/src/Semaphore/SemaphoreData.d.ts +6 -6
  106. package/build/src/Semaphore/SemaphoreData.js +53 -52
  107. package/build/src/Semaphore/SemaphoreData.js.map +1 -1
  108. package/build/src/Semaphore/SemaphoreDegrees.d.ts +5 -5
  109. package/build/src/Semaphore/SemaphoreDegrees.js +26 -25
  110. package/build/src/Semaphore/SemaphoreDegrees.js.map +1 -1
  111. package/build/src/Semaphore/SemaphoreDirection.d.ts +11 -11
  112. package/build/src/Semaphore/SemaphoreDirection.js +15 -14
  113. package/build/src/Semaphore/SemaphoreDirection.js.map +1 -1
  114. package/build/src/Semaphore/SemaphoreEncoding.d.ts +40 -40
  115. package/build/src/Semaphore/SemaphoreEncoding.js +47 -46
  116. package/build/src/Semaphore/SemaphoreEncoding.js.map +1 -1
  117. package/build/src/Semaphore/SemaphoreStream.d.ts +17 -17
  118. package/build/src/Semaphore/SemaphoreStream.js +72 -71
  119. package/build/src/Semaphore/SemaphoreStream.js.map +1 -1
  120. package/build/src/WordSearch/Point.d.ts +4 -4
  121. package/build/src/WordSearch/Point.js +2 -2
  122. package/build/src/WordSearch/Result.d.ts +6 -6
  123. package/build/src/WordSearch/Result.js +10 -9
  124. package/build/src/WordSearch/Result.js.map +1 -1
  125. package/build/src/WordSearch/WordSearchDirection.d.ts +6 -6
  126. package/build/src/WordSearch/WordSearchDirection.js +10 -9
  127. package/build/src/WordSearch/WordSearchDirection.js.map +1 -1
  128. package/build/src/WordSearch/WordSearchSolver.d.ts +27 -18
  129. package/build/src/WordSearch/WordSearchSolver.js +222 -171
  130. package/build/src/WordSearch/WordSearchSolver.js.map +1 -1
  131. package/build/src/index.d.ts +35 -35
  132. package/build/src/index.js +72 -70
  133. package/build/src/index.js.map +1 -1
  134. package/package.json +40 -39
  135. package/src/Braille/BrailleCharacter.ts +49 -0
  136. package/src/Braille/BrailleData.ts +131 -0
  137. package/src/Braille/BrailleDot.ts +9 -0
  138. package/src/Braille/BrailleEncoding.ts +144 -0
  139. package/src/Braille/BrailleStream.ts +87 -0
  140. package/src/Cipher/AutoKeyString.ts +35 -0
  141. package/src/Cipher/CaesarString.ts +38 -0
  142. package/src/Cipher/CaesarUtils.ts +69 -0
  143. package/src/Cipher/KeyedCipherStringBase.ts +35 -0
  144. package/src/Cipher/VigenereString.ts +21 -0
  145. package/src/Common/CharacterImage.ts +11 -0
  146. package/src/Common/EncodingCategory.ts +10 -0
  147. package/src/Common/EncodingCharacterBase.ts +72 -0
  148. package/src/Common/EncodingDataBase.ts +31 -0
  149. package/src/Common/EncodingEntry.ts +17 -0
  150. package/src/Common/EncodingLookupResult.ts +10 -0
  151. package/src/Common/Helpers.ts +13 -0
  152. package/src/Common/InlineSvg.ts +15 -0
  153. package/src/Conversion/CharacterAutoConvert.ts +108 -0
  154. package/src/Conversion/CharacterConversion.ts +89 -0
  155. package/src/Conversion/CharacterEncoding.ts +9 -0
  156. package/src/Conversion/CharacterTableEntry.ts +23 -0
  157. package/src/Conversion/SignificantFigures.ts +55 -0
  158. package/src/Conversion/StringAutoConvert.ts +56 -0
  159. package/src/Morse/MorseCharacter.ts +112 -0
  160. package/src/Morse/MorseData.ts +143 -0
  161. package/src/Morse/MorseEncoding.ts +98 -0
  162. package/src/Morse/MorseString.ts +106 -0
  163. package/src/Nato/NatoCharacter.ts +9 -0
  164. package/src/Nato/NatoData.ts +49 -0
  165. package/src/NavalFlags/LICENSE +7 -0
  166. package/src/NavalFlags/NavalFlags.ts +293 -0
  167. package/src/Resistor/Resistor.ts +135 -0
  168. package/src/Resistor/ResistorColorEntry.ts +43 -0
  169. package/src/Semaphore/SemaphoreCharacter.ts +107 -0
  170. package/src/Semaphore/SemaphoreData.ts +58 -0
  171. package/src/Semaphore/SemaphoreDegrees.ts +26 -0
  172. package/src/Semaphore/SemaphoreDirection.ts +11 -0
  173. package/src/Semaphore/SemaphoreEncoding.ts +48 -0
  174. package/src/Semaphore/SemaphoreStream.ts +89 -0
  175. package/src/WordSearch/Point.ts +4 -0
  176. package/src/WordSearch/Result.ts +10 -0
  177. package/src/WordSearch/WordSearchDirection.ts +6 -0
  178. package/src/WordSearch/WordSearchSolver.ts +271 -0
  179. package/src/index.ts +38 -0
  180. package/src/trie-prefix-tree.d.ts +70 -0
@@ -1,86 +1,87 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const ResistorColorEntry_1 = require("./ResistorColorEntry");
4
- class Resistor {
5
- /**
6
- * getValue assumes there is no tolerance band, as tolerance is not part of
7
- * the value calculation
8
- */
9
- static getValue(colors) {
10
- if (colors.length < 3 || colors.length > 4) {
11
- throw new RangeError('Invalid resistor size');
12
- }
13
- // Should we throw an error if the first color is black? In resistors, it's
14
- // technically not allowed, but in puzzle events who knows what they'll do.
15
- // The math works out fine (it's just a leading zero), so for now it's
16
- // allowed.
17
- // Iterate through all but the final band (the multipler) and extract the
18
- // values
19
- let value = 0;
20
- for (let i = 0; i < colors.length - 1; ++i) {
21
- const currentColor = colors[i];
22
- if (currentColor.value === undefined) {
23
- return Resistor.INVALID_RESISTOR;
24
- }
25
- value *= 10;
26
- value += currentColor.value;
27
- }
28
- return Resistor.applyMultiplier(value, colors[colors.length - 1].multiplier);
29
- }
30
- static getDisplayValue(value) {
31
- if (value >= 1000000000) {
32
- return `${value / 1000000000}G`;
33
- }
34
- else if (value >= 1000000) {
35
- return `${value / 1000000}M`;
36
- }
37
- else if (value >= 1000) {
38
- return `${value / 1000}k`;
39
- }
40
- else {
41
- return value.toString();
42
- }
43
- }
44
- static applyMultiplier(value, multipler) {
45
- if (multipler >= 1) {
46
- return value * multipler;
47
- }
48
- else if (multipler > 0) {
49
- // Avoid floating point multiplication issues
50
- return value / (1 / multipler);
51
- }
52
- else {
53
- throw new RangeError('Invalid multiplier');
54
- }
55
- }
56
- }
57
- exports.Resistor = Resistor;
58
- // Name, Color, Multiplier, Value, Tolerance
59
- Resistor.BLACK = new ResistorColorEntry_1.ResistorColorEntry('Black', '#000000', 1, 0);
60
- Resistor.BROWN = new ResistorColorEntry_1.ResistorColorEntry('Brown', '#8B4513', 10, 1, 1);
61
- Resistor.RED = new ResistorColorEntry_1.ResistorColorEntry('Red', '#FF0000', 100, 2, 2);
62
- Resistor.ORANGE = new ResistorColorEntry_1.ResistorColorEntry('Orange', '#EE7420', 1000, 3);
63
- Resistor.YELLOW = new ResistorColorEntry_1.ResistorColorEntry('Yellow', '#FFFF00', 10000, 4);
64
- Resistor.GREEN = new ResistorColorEntry_1.ResistorColorEntry('Green', '#008000', 100000, 5, 0.5);
65
- Resistor.BLUE = new ResistorColorEntry_1.ResistorColorEntry('Blue', '#0000FF', 1000000, 6, 0.25);
66
- Resistor.VIOLET = new ResistorColorEntry_1.ResistorColorEntry('Violet', '#800080', 10000000, 7, 0.1);
67
- Resistor.GREY = new ResistorColorEntry_1.ResistorColorEntry('Grey', '#808080', 100000000, 8);
68
- Resistor.WHITE = new ResistorColorEntry_1.ResistorColorEntry('White', '#FFFFFF', 1000000000, 9);
69
- Resistor.GOLD = new ResistorColorEntry_1.ResistorColorEntry('Gold', '#AB8D3F', 0.1, undefined, 5);
70
- Resistor.SILVER = new ResistorColorEntry_1.ResistorColorEntry('Silver', '#C0C0C0', 0.01, undefined, 10);
71
- Resistor.colorTable = [
72
- Resistor.BLACK,
73
- Resistor.BROWN,
74
- Resistor.RED,
75
- Resistor.ORANGE,
76
- Resistor.YELLOW,
77
- Resistor.GREEN,
78
- Resistor.BLUE,
79
- Resistor.VIOLET,
80
- Resistor.GREY,
81
- Resistor.WHITE,
82
- Resistor.GOLD,
83
- Resistor.SILVER,
84
- ];
85
- Resistor.INVALID_RESISTOR = -1;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Resistor = void 0;
4
+ const ResistorColorEntry_1 = require("./ResistorColorEntry");
5
+ class Resistor {
6
+ /**
7
+ * getValue assumes there is no tolerance band, as tolerance is not part of
8
+ * the value calculation
9
+ */
10
+ static getValue(colors) {
11
+ if (colors.length < 3 || colors.length > 4) {
12
+ throw new RangeError('Invalid resistor size');
13
+ }
14
+ // Should we throw an error if the first color is black? In resistors, it's
15
+ // technically not allowed, but in puzzle events who knows what they'll do.
16
+ // The math works out fine (it's just a leading zero), so for now it's
17
+ // allowed.
18
+ // Iterate through all but the final band (the multipler) and extract the
19
+ // values
20
+ let value = 0;
21
+ for (let i = 0; i < colors.length - 1; ++i) {
22
+ const currentColor = colors[i];
23
+ if (currentColor.value === undefined) {
24
+ return Resistor.INVALID_RESISTOR;
25
+ }
26
+ value *= 10;
27
+ value += currentColor.value;
28
+ }
29
+ return Resistor.applyMultiplier(value, colors[colors.length - 1].multiplier);
30
+ }
31
+ static getDisplayValue(value) {
32
+ if (value >= 1000000000) {
33
+ return `${value / 1000000000}G`;
34
+ }
35
+ else if (value >= 1000000) {
36
+ return `${value / 1000000}M`;
37
+ }
38
+ else if (value >= 1000) {
39
+ return `${value / 1000}k`;
40
+ }
41
+ else {
42
+ return value.toString();
43
+ }
44
+ }
45
+ static applyMultiplier(value, multipler) {
46
+ if (multipler >= 1) {
47
+ return value * multipler;
48
+ }
49
+ else if (multipler > 0) {
50
+ // Avoid floating point multiplication issues
51
+ return value / (1 / multipler);
52
+ }
53
+ else {
54
+ throw new RangeError('Invalid multiplier');
55
+ }
56
+ }
57
+ }
58
+ exports.Resistor = Resistor;
59
+ // Name, Color, Multiplier, Value, Tolerance
60
+ Resistor.BLACK = new ResistorColorEntry_1.ResistorColorEntry('Black', '#000000', 1, 0);
61
+ Resistor.BROWN = new ResistorColorEntry_1.ResistorColorEntry('Brown', '#8B4513', 10, 1, 1);
62
+ Resistor.RED = new ResistorColorEntry_1.ResistorColorEntry('Red', '#FF0000', 100, 2, 2);
63
+ Resistor.ORANGE = new ResistorColorEntry_1.ResistorColorEntry('Orange', '#EE7420', 1000, 3);
64
+ Resistor.YELLOW = new ResistorColorEntry_1.ResistorColorEntry('Yellow', '#FFFF00', 10000, 4);
65
+ Resistor.GREEN = new ResistorColorEntry_1.ResistorColorEntry('Green', '#008000', 100000, 5, 0.5);
66
+ Resistor.BLUE = new ResistorColorEntry_1.ResistorColorEntry('Blue', '#0000FF', 1000000, 6, 0.25);
67
+ Resistor.VIOLET = new ResistorColorEntry_1.ResistorColorEntry('Violet', '#800080', 10000000, 7, 0.1);
68
+ Resistor.GREY = new ResistorColorEntry_1.ResistorColorEntry('Grey', '#808080', 100000000, 8);
69
+ Resistor.WHITE = new ResistorColorEntry_1.ResistorColorEntry('White', '#FFFFFF', 1000000000, 9);
70
+ Resistor.GOLD = new ResistorColorEntry_1.ResistorColorEntry('Gold', '#AB8D3F', 0.1, undefined, 5);
71
+ Resistor.SILVER = new ResistorColorEntry_1.ResistorColorEntry('Silver', '#C0C0C0', 0.01, undefined, 10);
72
+ Resistor.colorTable = [
73
+ Resistor.BLACK,
74
+ Resistor.BROWN,
75
+ Resistor.RED,
76
+ Resistor.ORANGE,
77
+ Resistor.YELLOW,
78
+ Resistor.GREEN,
79
+ Resistor.BLUE,
80
+ Resistor.VIOLET,
81
+ Resistor.GREY,
82
+ Resistor.WHITE,
83
+ Resistor.GOLD,
84
+ Resistor.SILVER,
85
+ ];
86
+ Resistor.INVALID_RESISTOR = -1;
86
87
  //# sourceMappingURL=Resistor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Resistor.js","sourceRoot":"","sources":["../../../src/Resistor/Resistor.ts"],"names":[],"mappings":";;AAAA,6DAAwD;AAExD,MAAa,QAAQ;IA6EnB;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,MAA4B;QAC1C,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YAC1C,MAAM,IAAI,UAAU,CAAC,uBAAuB,CAAC,CAAC;SAC/C;QAED,4EAA4E;QAC5E,2EAA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CACF,CAAC;AACc,cAAK,GAAG,IAAI,uCAAkB,CAC5C,OAAO,EACP,SAAS,EACT,MAAM,EACN,CAAC,EACD,GAAG,CACJ,CAAC;AACc,aAAI,GAAG,IAAI,uCAAkB,CAC3C,MAAM,EACN,SAAS,EACT,OAAO,EACP,CAAC,EACD,IAAI,CACL,CAAC;AACc,eAAM,GAAG,IAAI,uCAAkB,CAC7C,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,CAAC,EACD,GAAG,CACJ,CAAC;AACc,aAAI,GAAG,IAAI,uCAAkB,CAC3C,MAAM,EACN,SAAS,EACT,SAAS,EACT,CAAC,CACF,CAAC;AACc,cAAK,GAAG,IAAI,uCAAkB,CAC5C,OAAO,EACP,SAAS,EACT,UAAU,EACV,CAAC,CACF,CAAC;AACc,aAAI,GAAG,IAAI,uCAAkB,CAC3C,MAAM,EACN,SAAS,EACT,GAAG,EACH,SAAS,EACT,CAAC,CACF,CAAC;AACc,eAAM,GAAG,IAAI,uCAAkB,CAC7C,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,SAAS,EACT,EAAE,CACH,CAAC;AAEc,mBAAU,GAAyB;IACjD,QAAQ,CAAC,KAAK;IACd,QAAQ,CAAC,KAAK;IACd,QAAQ,CAAC,GAAG;IACZ,QAAQ,CAAC,MAAM;IACf,QAAQ,CAAC,MAAM;IACf,QAAQ,CAAC,KAAK;IACd,QAAQ,CAAC,IAAI;IACb,QAAQ,CAAC,MAAM;IACf,QAAQ,CAAC,IAAI;IACb,QAAQ,CAAC,KAAK;IACd,QAAQ,CAAC,IAAI;IACb,QAAQ,CAAC,MAAM;CAChB,CAAC;AAEc,yBAAgB,GAAG,CAAC,CAAC,CAAC"}
@@ -1,12 +1,12 @@
1
- export declare class ResistorColorEntry {
2
- readonly name: string;
3
- readonly colorCode: string;
4
- readonly multiplier: number;
5
- readonly value?: number;
6
- readonly toleranceInPercent?: number;
7
- constructor(name: string, colorCode: string, multiplier: number, value?: number, toleranceInPercent?: number);
8
- hasValue(): boolean;
9
- getDisplayValue(): string;
10
- hasTolerance(): boolean;
11
- getDisplayTolerance(): string;
12
- }
1
+ export declare class ResistorColorEntry {
2
+ readonly name: string;
3
+ readonly colorCode: string;
4
+ readonly multiplier: number;
5
+ readonly value?: number;
6
+ readonly toleranceInPercent?: number;
7
+ constructor(name: string, colorCode: string, multiplier: number, value?: number, toleranceInPercent?: number);
8
+ hasValue(): boolean;
9
+ getDisplayValue(): string;
10
+ hasTolerance(): boolean;
11
+ getDisplayTolerance(): string;
12
+ }
@@ -1,31 +1,32 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class ResistorColorEntry {
4
- constructor(name, colorCode, multiplier, value, toleranceInPercent) {
5
- this.name = name;
6
- this.value = value;
7
- this.colorCode = colorCode;
8
- this.multiplier = multiplier;
9
- this.toleranceInPercent = toleranceInPercent;
10
- }
11
- hasValue() {
12
- return this.value !== undefined;
13
- }
14
- getDisplayValue() {
15
- if (this.value === undefined) {
16
- return '';
17
- }
18
- return this.value.toString();
19
- }
20
- hasTolerance() {
21
- return this.toleranceInPercent !== undefined;
22
- }
23
- getDisplayTolerance() {
24
- if (this.toleranceInPercent === undefined) {
25
- return '';
26
- }
27
- return `${this.toleranceInPercent}%`;
28
- }
29
- }
30
- exports.ResistorColorEntry = ResistorColorEntry;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResistorColorEntry = void 0;
4
+ class ResistorColorEntry {
5
+ constructor(name, colorCode, multiplier, value, toleranceInPercent) {
6
+ this.name = name;
7
+ this.value = value;
8
+ this.colorCode = colorCode;
9
+ this.multiplier = multiplier;
10
+ this.toleranceInPercent = toleranceInPercent;
11
+ }
12
+ hasValue() {
13
+ return this.value !== undefined;
14
+ }
15
+ getDisplayValue() {
16
+ if (this.value === undefined) {
17
+ return '';
18
+ }
19
+ return this.value.toString();
20
+ }
21
+ hasTolerance() {
22
+ return this.toleranceInPercent !== undefined;
23
+ }
24
+ getDisplayTolerance() {
25
+ if (this.toleranceInPercent === undefined) {
26
+ return '';
27
+ }
28
+ return `${this.toleranceInPercent}%`;
29
+ }
30
+ }
31
+ exports.ResistorColorEntry = ResistorColorEntry;
31
32
  //# sourceMappingURL=ResistorColorEntry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResistorColorEntry.js","sourceRoot":"","sources":["../../../src/Resistor/ResistorColorEntry.ts"],"names":[],"mappings":";;AAAA,MAAa,kBAAkB;IAO7B,YACE,IAAY,EACZ,SAAiB,EACjB,UAAkB,EAClB,KAAc,EACd,kBAA2B;QAE3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IAC/C,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC;IAClC,CAAC;IAED,eAAe;QACb,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;YAC5B,OAAO,EAAE,CAAC;SACX;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC/B,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,kBAAkB,KAAK,SAAS,CAAC;IAC/C,CAAC;IAED,mBAAmB;QACjB,IAAI,IAAI,CAAC,kBAAkB,KAAK,SAAS,EAAE;YACzC,OAAO,EAAE,CAAC;SACX;QACD,OAAO,GAAG,IAAI,CAAC,kBAAkB,GAAG,CAAC;IACvC,CAAC;CACF;AA1CD,gDA0CC"}
1
+ {"version":3,"file":"ResistorColorEntry.js","sourceRoot":"","sources":["../../../src/Resistor/ResistorColorEntry.ts"],"names":[],"mappings":";;;AAAA,MAAa,kBAAkB;IAO7B,YACE,IAAY,EACZ,SAAiB,EACjB,UAAkB,EAClB,KAAc,EACd,kBAA2B;QAE3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IAC/C,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC;IAClC,CAAC;IAED,eAAe;QACb,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;YAC5B,OAAO,EAAE,CAAC;SACX;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC/B,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,kBAAkB,KAAK,SAAS,CAAC;IAC/C,CAAC;IAED,mBAAmB;QACjB,IAAI,IAAI,CAAC,kBAAkB,KAAK,SAAS,EAAE;YACzC,OAAO,EAAE,CAAC;SACX;QACD,OAAO,GAAG,IAAI,CAAC,kBAAkB,GAAG,CAAC;IACvC,CAAC;CACF;AA1CD,gDA0CC"}
@@ -1,20 +1,20 @@
1
- import { EncodingCategory } from '../Common/EncodingCategory';
2
- import { EncodingCharacterBase } from '../Common/EncodingCharacterBase';
3
- import { EncodingEntry } from '../Common/EncodingEntry';
4
- import { SemaphoreDirection } from './SemaphoreDirection';
5
- import { SemaphoreEncoding } from './SemaphoreEncoding';
6
- export declare class SemaphoreCharacter extends EncodingCharacterBase<SemaphoreEncoding> {
7
- private static parseEncoding;
8
- private _directions;
9
- constructor(encoding?: SemaphoreEncoding, category?: EncodingCategory);
10
- get directions(): SemaphoreDirection[];
11
- set directions(value: SemaphoreDirection[]);
12
- addDirection(direction: SemaphoreDirection | SemaphoreEncoding): void;
13
- removeDirection(direction: SemaphoreDirection | SemaphoreEncoding): void;
14
- hasDirection(direction: SemaphoreDirection): boolean;
15
- getDegrees(): number[];
16
- getPotentialMatch(other: SemaphoreDirection): EncodingEntry<SemaphoreEncoding> | null;
17
- protected onClear(): void;
18
- protected onEmpty(): boolean;
19
- protected getEncoding(): SemaphoreEncoding;
20
- }
1
+ import { EncodingCategory } from '../Common/EncodingCategory';
2
+ import { EncodingCharacterBase } from '../Common/EncodingCharacterBase';
3
+ import { EncodingEntry } from '../Common/EncodingEntry';
4
+ import { SemaphoreDirection } from './SemaphoreDirection';
5
+ import { SemaphoreEncoding } from './SemaphoreEncoding';
6
+ export declare class SemaphoreCharacter extends EncodingCharacterBase<SemaphoreEncoding> {
7
+ private static parseEncoding;
8
+ private _directions;
9
+ constructor(encoding?: SemaphoreEncoding, category?: EncodingCategory);
10
+ get directions(): SemaphoreDirection[];
11
+ set directions(value: SemaphoreDirection[]);
12
+ addDirection(direction: SemaphoreDirection | SemaphoreEncoding): void;
13
+ removeDirection(direction: SemaphoreDirection | SemaphoreEncoding): void;
14
+ hasDirection(direction: SemaphoreDirection): boolean;
15
+ getDegrees(): number[];
16
+ getPotentialMatch(other: SemaphoreDirection): EncodingEntry<SemaphoreEncoding> | null;
17
+ protected onClear(): void;
18
+ protected onEmpty(): boolean;
19
+ protected getEncoding(): SemaphoreEncoding;
20
+ }
@@ -1,75 +1,76 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const EncodingCategory_1 = require("../Common/EncodingCategory");
4
- const EncodingCharacterBase_1 = require("../Common/EncodingCharacterBase");
5
- const SemaphoreData_1 = require("./SemaphoreData");
6
- const SemaphoreDegrees_1 = require("./SemaphoreDegrees");
7
- const SemaphoreEncoding_1 = require("./SemaphoreEncoding");
8
- class SemaphoreCharacter extends EncodingCharacterBase_1.EncodingCharacterBase {
9
- constructor(encoding = SemaphoreEncoding_1.SemaphoreEncoding.None, category = EncodingCategory_1.EncodingCategory.All) {
10
- super(SemaphoreData_1.SemaphoreData.instance, category);
11
- this._directions = [];
12
- this.addDirection(encoding);
13
- }
14
- static parseEncoding(encoding) {
15
- const directions = [];
16
- for (let i = 1; i <= 8; i++) {
17
- const direction = (1 << i);
18
- if ((encoding & direction) === direction) {
19
- directions.push(direction);
20
- }
21
- }
22
- return directions;
23
- }
24
- get directions() {
25
- return this._directions;
26
- }
27
- set directions(value) {
28
- this._directions = value.slice(0, 2);
29
- this.invalidateLookup();
30
- }
31
- addDirection(direction) {
32
- for (const dir of SemaphoreCharacter.parseEncoding(direction)) {
33
- this._directions.push(dir);
34
- }
35
- if (this._directions.length > 2) {
36
- this._directions.splice(0, this._directions.length - 2);
37
- }
38
- this.invalidateLookup();
39
- }
40
- removeDirection(direction) {
41
- for (const dir of SemaphoreCharacter.parseEncoding(direction)) {
42
- const index = this._directions.indexOf(dir);
43
- if (index >= 0) {
44
- this._directions.splice(index, 1);
45
- }
46
- }
47
- this.invalidateLookup();
48
- }
49
- hasDirection(direction) {
50
- return this._directions.indexOf(direction) >= 0;
51
- }
52
- getDegrees() {
53
- return this._directions
54
- .map(value => SemaphoreDegrees_1.SemaphoreDegrees.ToDegrees(value))
55
- .sort((a, b) => a - b);
56
- }
57
- getPotentialMatch(other) {
58
- if (this.directions.length !== 1 || this.directions[0] === other) {
59
- return null;
60
- }
61
- const potentialMatch = this.getPotentialMatches().filter(value => (value.encoding & other) === other)[0];
62
- return potentialMatch || null;
63
- }
64
- onClear() {
65
- this._directions.length = 0;
66
- }
67
- onEmpty() {
68
- return this._directions.length === 0;
69
- }
70
- getEncoding() {
71
- return this._directions.reduce((previousValue, currentValue) => (previousValue |= currentValue), SemaphoreEncoding_1.SemaphoreEncoding.None);
72
- }
73
- }
74
- exports.SemaphoreCharacter = SemaphoreCharacter;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SemaphoreCharacter = void 0;
4
+ const EncodingCategory_1 = require("../Common/EncodingCategory");
5
+ const EncodingCharacterBase_1 = require("../Common/EncodingCharacterBase");
6
+ const SemaphoreData_1 = require("./SemaphoreData");
7
+ const SemaphoreDegrees_1 = require("./SemaphoreDegrees");
8
+ const SemaphoreEncoding_1 = require("./SemaphoreEncoding");
9
+ class SemaphoreCharacter extends EncodingCharacterBase_1.EncodingCharacterBase {
10
+ constructor(encoding = SemaphoreEncoding_1.SemaphoreEncoding.None, category = EncodingCategory_1.EncodingCategory.All) {
11
+ super(SemaphoreData_1.SemaphoreData.instance, category);
12
+ this._directions = [];
13
+ this.addDirection(encoding);
14
+ }
15
+ static parseEncoding(encoding) {
16
+ const directions = [];
17
+ for (let i = 1; i <= 8; i++) {
18
+ const direction = (1 << i);
19
+ if ((encoding & direction) === direction) {
20
+ directions.push(direction);
21
+ }
22
+ }
23
+ return directions;
24
+ }
25
+ get directions() {
26
+ return this._directions;
27
+ }
28
+ set directions(value) {
29
+ this._directions = value.slice(0, 2);
30
+ this.invalidateLookup();
31
+ }
32
+ addDirection(direction) {
33
+ for (const dir of SemaphoreCharacter.parseEncoding(direction)) {
34
+ this._directions.push(dir);
35
+ }
36
+ if (this._directions.length > 2) {
37
+ this._directions.splice(0, this._directions.length - 2);
38
+ }
39
+ this.invalidateLookup();
40
+ }
41
+ removeDirection(direction) {
42
+ for (const dir of SemaphoreCharacter.parseEncoding(direction)) {
43
+ const index = this._directions.indexOf(dir);
44
+ if (index >= 0) {
45
+ this._directions.splice(index, 1);
46
+ }
47
+ }
48
+ this.invalidateLookup();
49
+ }
50
+ hasDirection(direction) {
51
+ return this._directions.indexOf(direction) >= 0;
52
+ }
53
+ getDegrees() {
54
+ return this._directions
55
+ .map(value => SemaphoreDegrees_1.SemaphoreDegrees.ToDegrees(value))
56
+ .sort((a, b) => a - b);
57
+ }
58
+ getPotentialMatch(other) {
59
+ if (this.directions.length !== 1 || this.directions[0] === other) {
60
+ return null;
61
+ }
62
+ const potentialMatch = this.getPotentialMatches().filter(value => (value.encoding & other) === other)[0];
63
+ return potentialMatch || null;
64
+ }
65
+ onClear() {
66
+ this._directions.length = 0;
67
+ }
68
+ onEmpty() {
69
+ return this._directions.length === 0;
70
+ }
71
+ getEncoding() {
72
+ return this._directions.reduce((previousValue, currentValue) => (previousValue |= currentValue), SemaphoreEncoding_1.SemaphoreEncoding.None);
73
+ }
74
+ }
75
+ exports.SemaphoreCharacter = SemaphoreCharacter;
75
76
  //# sourceMappingURL=SemaphoreCharacter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SemaphoreCharacter.js","sourceRoot":"","sources":["../../../src/Semaphore/SemaphoreCharacter.ts"],"names":[],"mappings":";;AAAA,iEAA4D;AAC5D,2EAAsE;AAGtE,mDAA8C;AAC9C,yDAAoD;AAEpD,2DAAsD;AAEtD,MAAa,kBAAmB,SAAQ,6CAEvC;IAkBC,YACE,WAA8B,qCAAiB,CAAC,IAAI,EACpD,WAA6B,mCAAgB,CAAC,GAAG;QAEjD,KAAK,CAAC,6BAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QANlC,gBAAW,GAAyB,EAAE,CAAC;QAQ7C,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAxBO,MAAM,CAAC,aAAa,CAC1B,QAAgD;QAEhD,MAAM,UAAU,GAAyB,EAAE,CAAC;QAE5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;YAC3B,MAAM,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,CAAuB,CAAC;YACjD,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC,KAAK,SAAS,EAAE;gBACxC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAC5B;SACF;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;IAaD,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAI,UAAU,CAAC,KAA2B;QACxC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACrC,IAAI,CAAC,gBAAgB,EAAE,CAA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QACxC,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,WAAW;aACpB,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,mCAAgB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;aAC/C,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED,iBAAiB,CACf,KAAyB;QAEzB,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE;YAChE,OAAO,IAAI,CAAC;SACb;QAED,MAAM,cAAc,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC,MAAM,CACtD,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,KAAK,KAAK,CAC5C,CAAC,CAAC,CAAC,CAAC;QAEL,OAAO,cAAc,IAAI,IAAI,CAAC;IAChC,CAAC;IAES,OAAO;QACf,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC;IAC9B,CAAC;IAES,OAAO;QACf,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC;IACvC,CAAC;IAES,WAAW;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAC5B,CAAC,aAAa,EAAE,YAAY,EAAE,EAAE,CAAC,CAAC,aAAa,IAAI,YAAY,CAAC,EAChE,qCAAiB,CAAC,IAAI,CACvB,CAAC;IACJ,CAAC;CACF;AAjGD,gDAiGC"}
@@ -1,6 +1,6 @@
1
- import { EncodingDataBase } from '../Common/EncodingDataBase';
2
- import { SemaphoreEncoding } from './SemaphoreEncoding';
3
- export declare class SemaphoreData extends EncodingDataBase<SemaphoreEncoding> {
4
- static readonly instance: SemaphoreData;
5
- constructor();
6
- }
1
+ import { EncodingDataBase } from '../Common/EncodingDataBase';
2
+ import { SemaphoreEncoding } from './SemaphoreEncoding';
3
+ export declare class SemaphoreData extends EncodingDataBase<SemaphoreEncoding> {
4
+ static readonly instance: SemaphoreData;
5
+ constructor();
6
+ }