@nejs/basic-extensions 2.6.0 → 2.8.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 (271) hide show
  1. package/.vscode/settings.json +5 -0
  2. package/README.md +6129 -1574
  3. package/dist/@nejs/basic-extensions.bundle.2.7.0.js +19 -0
  4. package/dist/@nejs/basic-extensions.bundle.2.7.0.js.map +7 -0
  5. package/dist/cjs/array.extensions.d.ts +39 -0
  6. package/dist/cjs/array.extensions.js +303 -0
  7. package/dist/cjs/array.extensions.js.map +1 -0
  8. package/dist/cjs/big.int.extension.d.ts +31 -0
  9. package/dist/cjs/big.int.extension.js +164 -0
  10. package/dist/cjs/big.int.extension.js.map +1 -0
  11. package/dist/cjs/{newClasses → classes}/asyncIterable.js +32 -44
  12. package/dist/cjs/classes/asyncIterable.js.map +1 -0
  13. package/dist/cjs/{newClasses → classes}/deferred.js +66 -138
  14. package/dist/cjs/classes/deferred.js.map +1 -0
  15. package/dist/cjs/{newClasses → classes}/descriptor.js +56 -90
  16. package/dist/cjs/classes/descriptor.js.map +1 -0
  17. package/dist/cjs/classes/index.d.ts +13 -0
  18. package/dist/cjs/classes/index.js +57 -0
  19. package/dist/cjs/classes/index.js.map +1 -0
  20. package/dist/cjs/classes/introspector.d.ts +20 -0
  21. package/dist/cjs/classes/introspector.js +130 -0
  22. package/dist/cjs/classes/introspector.js.map +1 -0
  23. package/dist/cjs/{newClasses → classes}/iterable.js +42 -63
  24. package/dist/cjs/classes/iterable.js.map +1 -0
  25. package/dist/cjs/classes/param.parser.d.ts +227 -0
  26. package/dist/cjs/classes/param.parser.js +242 -0
  27. package/dist/cjs/classes/param.parser.js.map +1 -0
  28. package/dist/cjs/classes/pluggable.proxy.d.ts +152 -0
  29. package/dist/cjs/classes/pluggable.proxy.js +444 -0
  30. package/dist/cjs/classes/pluggable.proxy.js.map +1 -0
  31. package/dist/cjs/{newClasses → classes}/refmap.js +18 -30
  32. package/dist/cjs/classes/refmap.js.map +1 -0
  33. package/dist/cjs/{newClasses → classes}/refset.js +28 -47
  34. package/dist/cjs/classes/refset.js.map +1 -0
  35. package/dist/cjs/classes/symkeys.d.ts +292 -0
  36. package/dist/cjs/classes/symkeys.js +424 -0
  37. package/dist/cjs/classes/symkeys.js.map +1 -0
  38. package/dist/cjs/classes/type.d.ts +56 -0
  39. package/dist/cjs/classes/type.js +405 -0
  40. package/dist/cjs/classes/type.js.map +1 -0
  41. package/dist/cjs/function.extensions.js +757 -0
  42. package/dist/cjs/function.extensions.js.map +1 -0
  43. package/dist/cjs/global.this.js +261 -0
  44. package/dist/cjs/global.this.js.map +1 -0
  45. package/dist/cjs/index.d.ts +4 -3
  46. package/dist/cjs/index.js +62 -32
  47. package/dist/cjs/index.js.map +1 -1
  48. package/dist/cjs/json.extensions.d.ts +2 -0
  49. package/dist/cjs/json.extensions.js +107 -0
  50. package/dist/cjs/json.extensions.js.map +1 -0
  51. package/dist/{mjs/mapextensions.d.ts → cjs/map.extensions.d.ts} +1 -0
  52. package/dist/cjs/map.extensions.js +142 -0
  53. package/dist/cjs/map.extensions.js.map +1 -0
  54. package/dist/cjs/number.extension.d.ts +44 -0
  55. package/dist/cjs/number.extension.js +260 -0
  56. package/dist/cjs/number.extension.js.map +1 -0
  57. package/dist/cjs/object.extensions.d.ts +62 -0
  58. package/dist/cjs/object.extensions.js +1116 -0
  59. package/dist/cjs/object.extensions.js.map +1 -0
  60. package/dist/cjs/proxy.extensions.d.ts +2 -0
  61. package/dist/cjs/proxy.extensions.js +207 -0
  62. package/dist/cjs/proxy.extensions.js.map +1 -0
  63. package/dist/cjs/reflect.extensions.js +316 -0
  64. package/dist/cjs/reflect.extensions.js.map +1 -0
  65. package/dist/cjs/regular.expression.extensions.d.ts +2 -0
  66. package/dist/cjs/regular.expression.extensions.js +423 -0
  67. package/dist/cjs/regular.expression.extensions.js.map +1 -0
  68. package/dist/cjs/set.extensions.d.ts +40 -0
  69. package/dist/cjs/{setextensions.js → set.extensions.js} +150 -2
  70. package/dist/cjs/set.extensions.js.map +1 -0
  71. package/dist/cjs/string.extensions.js +471 -0
  72. package/dist/cjs/string.extensions.js.map +1 -0
  73. package/dist/{mjs/symbolextensions.d.ts → cjs/symbol.extensions.d.ts} +1 -0
  74. package/dist/cjs/symbol.extensions.js +259 -0
  75. package/dist/cjs/symbol.extensions.js.map +1 -0
  76. package/dist/cjs/{weakrefextensions.js → weakref.extensions.js} +1 -1
  77. package/dist/cjs/weakref.extensions.js.map +1 -0
  78. package/dist/mjs/array.extensions.d.ts +39 -0
  79. package/dist/mjs/array.extensions.js +300 -0
  80. package/dist/mjs/array.extensions.js.map +1 -0
  81. package/dist/mjs/big.int.extension.d.ts +31 -0
  82. package/dist/mjs/big.int.extension.js +161 -0
  83. package/dist/mjs/big.int.extension.js.map +1 -0
  84. package/dist/mjs/classes/asyncIterable.js.map +1 -0
  85. package/dist/mjs/classes/deferred.js.map +1 -0
  86. package/dist/mjs/{newClasses → classes}/descriptor.js +7 -4
  87. package/dist/mjs/classes/descriptor.js.map +1 -0
  88. package/dist/mjs/classes/index.d.ts +13 -0
  89. package/dist/mjs/classes/index.js +40 -0
  90. package/dist/mjs/classes/index.js.map +1 -0
  91. package/dist/mjs/classes/introspector.d.ts +20 -0
  92. package/dist/mjs/classes/introspector.js +126 -0
  93. package/dist/mjs/classes/introspector.js.map +1 -0
  94. package/dist/mjs/classes/iterable.js.map +1 -0
  95. package/dist/mjs/classes/param.parser.d.ts +227 -0
  96. package/dist/mjs/classes/param.parser.js +238 -0
  97. package/dist/mjs/classes/param.parser.js.map +1 -0
  98. package/dist/mjs/classes/pluggable.proxy.d.ts +152 -0
  99. package/dist/mjs/classes/pluggable.proxy.js +438 -0
  100. package/dist/mjs/classes/pluggable.proxy.js.map +1 -0
  101. package/dist/mjs/{newClasses → classes}/refmap.js +3 -3
  102. package/dist/mjs/classes/refmap.js.map +1 -0
  103. package/dist/mjs/classes/refset.js.map +1 -0
  104. package/dist/mjs/classes/symkeys.d.ts +292 -0
  105. package/dist/mjs/classes/symkeys.js +420 -0
  106. package/dist/mjs/classes/symkeys.js.map +1 -0
  107. package/dist/mjs/classes/type.d.ts +56 -0
  108. package/dist/mjs/classes/type.js +401 -0
  109. package/dist/mjs/classes/type.js.map +1 -0
  110. package/dist/mjs/function.extensions.js +754 -0
  111. package/dist/mjs/function.extensions.js.map +1 -0
  112. package/dist/mjs/global.this.js +258 -0
  113. package/dist/mjs/global.this.js.map +1 -0
  114. package/dist/mjs/index.d.ts +4 -3
  115. package/dist/mjs/index.js +49 -19
  116. package/dist/mjs/index.js.map +1 -1
  117. package/dist/mjs/json.extensions.d.ts +2 -0
  118. package/dist/mjs/json.extensions.js +104 -0
  119. package/dist/mjs/json.extensions.js.map +1 -0
  120. package/dist/{cjs/mapextensions.d.ts → mjs/map.extensions.d.ts} +1 -0
  121. package/dist/mjs/map.extensions.js +139 -0
  122. package/dist/mjs/map.extensions.js.map +1 -0
  123. package/dist/mjs/number.extension.d.ts +44 -0
  124. package/dist/mjs/number.extension.js +257 -0
  125. package/dist/mjs/number.extension.js.map +1 -0
  126. package/dist/mjs/object.extensions.d.ts +62 -0
  127. package/dist/mjs/object.extensions.js +1112 -0
  128. package/dist/mjs/object.extensions.js.map +1 -0
  129. package/dist/mjs/proxy.extensions.d.ts +2 -0
  130. package/dist/mjs/proxy.extensions.js +204 -0
  131. package/dist/mjs/proxy.extensions.js.map +1 -0
  132. package/dist/mjs/reflect.extensions.js +313 -0
  133. package/dist/mjs/reflect.extensions.js.map +1 -0
  134. package/dist/mjs/regular.expression.extensions.d.ts +2 -0
  135. package/dist/mjs/regular.expression.extensions.js +420 -0
  136. package/dist/mjs/regular.expression.extensions.js.map +1 -0
  137. package/dist/mjs/set.extensions.d.ts +40 -0
  138. package/dist/mjs/{setextensions.js → set.extensions.js} +149 -1
  139. package/dist/mjs/set.extensions.js.map +1 -0
  140. package/dist/mjs/string.extensions.js +468 -0
  141. package/dist/mjs/string.extensions.js.map +1 -0
  142. package/dist/{cjs/symbolextensions.d.ts → mjs/symbol.extensions.d.ts} +1 -0
  143. package/dist/mjs/symbol.extensions.js +256 -0
  144. package/dist/mjs/symbol.extensions.js.map +1 -0
  145. package/dist/mjs/{weakrefextensions.js → weakref.extensions.js} +1 -1
  146. package/dist/mjs/weakref.extensions.js.map +1 -0
  147. package/docs/index.html +24045 -5805
  148. package/package.json +6 -4
  149. package/repl.bootstrap.js +21 -0
  150. package/src/array.extensions.js +322 -0
  151. package/src/big.int.extension.js +163 -0
  152. package/src/{newClasses → classes}/descriptor.js +16 -12
  153. package/src/classes/index.js +51 -0
  154. package/src/classes/introspector.js +167 -0
  155. package/src/classes/param.parser.js +253 -0
  156. package/src/classes/pluggable.proxy.js +485 -0
  157. package/src/{newClasses → classes}/refmap.js +5 -3
  158. package/src/classes/symkeys.js +464 -0
  159. package/src/classes/type.js +427 -0
  160. package/src/function.extensions.js +818 -0
  161. package/src/global.this.js +304 -0
  162. package/src/index.js +56 -23
  163. package/src/json.extensions.js +108 -0
  164. package/src/map.extensions.js +144 -0
  165. package/src/number.extension.js +273 -0
  166. package/src/object.extensions.js +1222 -0
  167. package/src/proxy.extensions.js +229 -0
  168. package/src/reflect.extensions.js +346 -0
  169. package/src/regular.expression.extensions.js +451 -0
  170. package/src/{setextensions.js → set.extensions.js} +151 -2
  171. package/src/string.extensions.js +515 -0
  172. package/src/symbol.extensions.js +268 -0
  173. package/tests/newClasses/refmap.test.js +3 -2
  174. package/tsconfig.base.json +5 -3
  175. package/tsconfig.cjs.json +2 -2
  176. package/tsconfig.esm.json +2 -2
  177. package/dist/@nejs/basic-extensions.bundle.2.5.0.js +0 -8
  178. package/dist/@nejs/basic-extensions.bundle.2.5.0.js.map +0 -7
  179. package/dist/cjs/arrayextensions.d.ts +0 -10
  180. package/dist/cjs/arrayextensions.js +0 -73
  181. package/dist/cjs/arrayextensions.js.map +0 -1
  182. package/dist/cjs/functionextensions.js +0 -202
  183. package/dist/cjs/functionextensions.js.map +0 -1
  184. package/dist/cjs/globals.js +0 -166
  185. package/dist/cjs/globals.js.map +0 -1
  186. package/dist/cjs/mapextensions.js +0 -32
  187. package/dist/cjs/mapextensions.js.map +0 -1
  188. package/dist/cjs/newClasses/asyncIterable.js.map +0 -1
  189. package/dist/cjs/newClasses/deferred.js.map +0 -1
  190. package/dist/cjs/newClasses/descriptor.js.map +0 -1
  191. package/dist/cjs/newClasses/iterable.js.map +0 -1
  192. package/dist/cjs/newClasses/refmap.js.map +0 -1
  193. package/dist/cjs/newClasses/refset.js.map +0 -1
  194. package/dist/cjs/objectextensions.d.ts +0 -11
  195. package/dist/cjs/objectextensions.js +0 -232
  196. package/dist/cjs/objectextensions.js.map +0 -1
  197. package/dist/cjs/reflectextensions.js +0 -111
  198. package/dist/cjs/reflectextensions.js.map +0 -1
  199. package/dist/cjs/setextensions.d.ts +0 -2
  200. package/dist/cjs/setextensions.js.map +0 -1
  201. package/dist/cjs/stringextensions.js +0 -158
  202. package/dist/cjs/stringextensions.js.map +0 -1
  203. package/dist/cjs/symbolextensions.js +0 -69
  204. package/dist/cjs/symbolextensions.js.map +0 -1
  205. package/dist/cjs/weakrefextensions.js.map +0 -1
  206. package/dist/mjs/arrayextensions.d.ts +0 -10
  207. package/dist/mjs/arrayextensions.js +0 -70
  208. package/dist/mjs/arrayextensions.js.map +0 -1
  209. package/dist/mjs/functionextensions.js +0 -199
  210. package/dist/mjs/functionextensions.js.map +0 -1
  211. package/dist/mjs/globals.js +0 -163
  212. package/dist/mjs/globals.js.map +0 -1
  213. package/dist/mjs/mapextensions.js +0 -29
  214. package/dist/mjs/mapextensions.js.map +0 -1
  215. package/dist/mjs/newClasses/asyncIterable.js.map +0 -1
  216. package/dist/mjs/newClasses/deferred.js.map +0 -1
  217. package/dist/mjs/newClasses/descriptor.js.map +0 -1
  218. package/dist/mjs/newClasses/iterable.js.map +0 -1
  219. package/dist/mjs/newClasses/refmap.js.map +0 -1
  220. package/dist/mjs/newClasses/refset.js.map +0 -1
  221. package/dist/mjs/objectextensions.d.ts +0 -11
  222. package/dist/mjs/objectextensions.js +0 -229
  223. package/dist/mjs/objectextensions.js.map +0 -1
  224. package/dist/mjs/reflectextensions.js +0 -108
  225. package/dist/mjs/reflectextensions.js.map +0 -1
  226. package/dist/mjs/setextensions.d.ts +0 -2
  227. package/dist/mjs/setextensions.js.map +0 -1
  228. package/dist/mjs/stringextensions.js +0 -155
  229. package/dist/mjs/stringextensions.js.map +0 -1
  230. package/dist/mjs/symbolextensions.js +0 -66
  231. package/dist/mjs/symbolextensions.js.map +0 -1
  232. package/dist/mjs/weakrefextensions.js.map +0 -1
  233. package/src/arrayextensions.js +0 -75
  234. package/src/functionextensions.js +0 -225
  235. package/src/globals.js +0 -196
  236. package/src/mapextensions.js +0 -32
  237. package/src/objectextensions.js +0 -256
  238. package/src/reflectextensions.js +0 -118
  239. package/src/stringextensions.js +0 -166
  240. package/src/symbolextensions.js +0 -69
  241. /package/dist/cjs/{newClasses → classes}/asyncIterable.d.ts +0 -0
  242. /package/dist/cjs/{newClasses → classes}/deferred.d.ts +0 -0
  243. /package/dist/cjs/{newClasses → classes}/descriptor.d.ts +0 -0
  244. /package/dist/cjs/{newClasses → classes}/iterable.d.ts +0 -0
  245. /package/dist/cjs/{newClasses → classes}/refmap.d.ts +0 -0
  246. /package/dist/cjs/{newClasses → classes}/refset.d.ts +0 -0
  247. /package/dist/cjs/{functionextensions.d.ts → function.extensions.d.ts} +0 -0
  248. /package/dist/cjs/{globals.d.ts → global.this.d.ts} +0 -0
  249. /package/dist/cjs/{reflectextensions.d.ts → reflect.extensions.d.ts} +0 -0
  250. /package/dist/cjs/{stringextensions.d.ts → string.extensions.d.ts} +0 -0
  251. /package/dist/cjs/{weakrefextensions.d.ts → weakref.extensions.d.ts} +0 -0
  252. /package/dist/mjs/{newClasses → classes}/asyncIterable.d.ts +0 -0
  253. /package/dist/mjs/{newClasses → classes}/asyncIterable.js +0 -0
  254. /package/dist/mjs/{newClasses → classes}/deferred.d.ts +0 -0
  255. /package/dist/mjs/{newClasses → classes}/deferred.js +0 -0
  256. /package/dist/mjs/{newClasses → classes}/descriptor.d.ts +0 -0
  257. /package/dist/mjs/{newClasses → classes}/iterable.d.ts +0 -0
  258. /package/dist/mjs/{newClasses → classes}/iterable.js +0 -0
  259. /package/dist/mjs/{newClasses → classes}/refmap.d.ts +0 -0
  260. /package/dist/mjs/{newClasses → classes}/refset.d.ts +0 -0
  261. /package/dist/mjs/{newClasses → classes}/refset.js +0 -0
  262. /package/dist/mjs/{functionextensions.d.ts → function.extensions.d.ts} +0 -0
  263. /package/dist/mjs/{globals.d.ts → global.this.d.ts} +0 -0
  264. /package/dist/mjs/{reflectextensions.d.ts → reflect.extensions.d.ts} +0 -0
  265. /package/dist/mjs/{stringextensions.d.ts → string.extensions.d.ts} +0 -0
  266. /package/dist/mjs/{weakrefextensions.d.ts → weakref.extensions.d.ts} +0 -0
  267. /package/src/{newClasses → classes}/asyncIterable.js +0 -0
  268. /package/src/{newClasses → classes}/deferred.js +0 -0
  269. /package/src/{newClasses → classes}/iterable.js +0 -0
  270. /package/src/{newClasses → classes}/refset.js +0 -0
  271. /package/src/{weakrefextensions.js → weakref.extensions.js} +0 -0
@@ -0,0 +1,292 @@
1
+ /**
2
+ * Represents a secure container for storing and retrieving unique symbols
3
+ * associated with data. This class provides methods to add new symbols to
4
+ * the Symkeys and to retrieve data associated with a particular symbol.
5
+ *
6
+ * @example
7
+ * // Create a new Symkeys instance
8
+ * const symkeys = new Symkeys();
9
+ *
10
+ * // Add a symbol with associated data to the Symkeys
11
+ * const mySymbol = Symkeys.add('myIdentifier', { foo: 'bar' });
12
+ *
13
+ * // Retrieve the data using the symbol
14
+ * const myData = Symkeys.dataFor(mySymbol);
15
+ * console.log(myData); // Output: { foo: 'bar' }
16
+ */
17
+ export class Symkeys {
18
+ /**
19
+ * Checks if a given value is a Symkey.
20
+ *
21
+ * This method checks if the provided value is a Symkey. A Symkey is a
22
+ * symbol that matches a specific pattern. The pattern is defined as a
23
+ * symbol that starts with '@', followed by any characters, a space, a '#',
24
+ * and ends with one or more word characters.
25
+ *
26
+ * @param {Symbol} value - The value to check.
27
+ * @returns {boolean} Returns true if the value is a Symkey, false otherwise.
28
+ *
29
+ * @example
30
+ * // Check if a symbol is a Symkey:
31
+ * const sym = Symbol('@nejs.prototype #rwiy2o905d');
32
+ * console.log(Symkeys.isSymkey(sym)); // Outputs: true
33
+ */
34
+ static isSymkey(value: Symbol): boolean;
35
+ /**
36
+ * Generates a random token string.
37
+ *
38
+ * This method creates a pseudo-random token that can be used for various
39
+ * purposes within the library, such as generating unique identifiers or
40
+ * keys. The token is generated using a base 36 encoding, which includes
41
+ * numbers and lowercase letters.
42
+ *
43
+ * @returns A random token string.
44
+ *
45
+ * @example
46
+ * // Example of getting a random token:
47
+ * const token = MyClass.token;
48
+ * console.log(token); // Outputs a string like 'qg6k1zr0is'
49
+ */
50
+ static get token(): string;
51
+ /**
52
+ * Reusable publicly static key for identifying where data is stored.
53
+ */
54
+ static get kDataKey(): symbol;
55
+ /**
56
+ * Reusable publicly static key for identifying where data is stored.
57
+ */
58
+ static get kPrototype(): symbol;
59
+ /**
60
+ * A static getter that returns a unique, reusable symbol for 'symkeys.domain'.
61
+ *
62
+ * This getter is used to create a unique symbol that can be used as a key
63
+ * for storing and retrieving domain-specific data in the Symkeys. The symbol
64
+ * is created using the `Symbol.for` method, which ensures that the same
65
+ * symbol is returned for a given key, in this case 'symkeys.domain'.
66
+ *
67
+ * @returns {Symbol} A unique symbol for 'symkeys.domain'.
68
+ *
69
+ * @example
70
+ * // Retrieve the 'symkeys.domain' symbol
71
+ * const domainSymbol = Symkeys.kDomain;
72
+ * console.log(domainSymbol); // Outputs: Symbol(symkeys.domain)
73
+ */
74
+ static get kDomain(): Symbol;
75
+ /**
76
+ * A static getter that returns a unique, reusable symbol for 'symkeys.separator'.
77
+ *
78
+ * This getter is used to create a unique symbol that can be used as a key
79
+ * for storing and retrieving separator-specific data in the Symkeys. The symbol
80
+ * is created using the `Symbol.for` method, which ensures that the same
81
+ * symbol is returned for a given key, in this case 'symkeys.separator'.
82
+ *
83
+ * @returns {Symbol} A unique symbol for 'symkeys.separator'.
84
+ *
85
+ * @example
86
+ * // Retrieve the 'symkeys.separator' symbol
87
+ * const separatorSymbol = Symkeys.kSeparator;
88
+ * console.log(separatorSymbol); // Outputs: Symbol(symkeys.separator)
89
+ */
90
+ static get kSeparator(): Symbol;
91
+ /**
92
+ * Constructs a new instance of the Symkeys, setting up a proxy to
93
+ * intercept and manage access to properties.
94
+ *
95
+ * This constructor initializes the Symkeys with a proxy that
96
+ * overrides the default behavior for property access, checking, and
97
+ * enumeration. It allows the Symkeys to behave like a map for its
98
+ * own properties, while also maintaining the prototype chain.
99
+ *
100
+ * @param {string} domain an optional prefix string, to which the
101
+ * `separator` parameter value will be guaranteed to have in between
102
+ * the domain (if truthy) and the name of the added key.
103
+ * @param {string} separator defaults to a period. So if your domain
104
+ * is 'symkeys.internal' then calling {@link add()} with a name of
105
+ * `"feature"` will result in the full name being
106
+ * `"symkeys.internal.feature"`
107
+ *
108
+ * @example
109
+ * const Symkeys = new Symkeys();
110
+ * Symkeys[Symbol.for('myProperty')] = 'myValue';
111
+ * console.log(Symkeys[Symbol.for('myProperty')]); // 'myValue'
112
+ */
113
+ constructor(domain?: string, separator?: string);
114
+ /**
115
+ * Adds a new entry to the Symkeys with a unique symbol based on the provided
116
+ * name and associates it with the given data.
117
+ *
118
+ * @param named - The base name for the symbol to be created.
119
+ * @param [associatedData={}] - The data to associate with the symbol.
120
+ * @returns The unique symbol created for the entry.
121
+ *
122
+ * @example
123
+ * // Add an entry with associated data
124
+ * const symbol = Symkeys.add('myEntry', { foo: 'bar' });
125
+ * // Retrieve the associated data using the symbol
126
+ * const data = Symkeys.dataFor(symbol);
127
+ * console.log(data); // Output: { foo: 'bar' }
128
+ */
129
+ add(named: any, associatedData?: {} | undefined): symbol;
130
+ /**
131
+ * Retrieves the data associated with a given symbol from the Symkeys.
132
+ *
133
+ * This method allows access to the data that has been associated with a
134
+ * particular symbol in the Symkeys. It is useful for retrieving stored
135
+ * information when only the symbol is known.
136
+ *
137
+ * @param symbol - The symbol whose associated data is to be
138
+ * retrieved.
139
+ * @returns The data associated with the symbol, or undefined if
140
+ * the symbol is not found in the Symkeys.
141
+ *
142
+ * @example
143
+ * // Assuming 'mySymbol' is a symbol that has been added to the Symkeys
144
+ * // with associated data
145
+ * const data = Symkeys.dataFor(mySymbol);
146
+ * console.log(data); // Output: The data associated with 'mySymbol'
147
+ */
148
+ data(forSymbol: any): any;
149
+ /**
150
+ * Deletes the data associated with a given symbol from the Symkeys.
151
+ *
152
+ * This method allows removal of the data that has been associated with a
153
+ * particular symbol in the Symkeys. It is useful when you want to clean up
154
+ * or remove stored information associated with a symbol.
155
+ *
156
+ * @param {Symbol} forSymbol - The symbol whose associated data is to be
157
+ * deleted.
158
+ * @param {*} replaceWith - Optionally, if `replaceWith` is not `undefined`,
159
+ * a new value can be set after the original is deleted
160
+ * @returns {boolean} - Returns true if an element in the Symkeys existed and
161
+ * has been removed, or false if the element does not exist
162
+ *
163
+ * @example
164
+ * // Assuming 'mySymbol' is a symbol that has been added to the Symkeys
165
+ * // with associated data
166
+ * const isDeleted = Symkeys.deleteData(mySymbol);
167
+ * console.log(isDeleted); // Output: true if data was deleted, false otherwise
168
+ */
169
+ deleteData(forSymbol: Symbol, replaceWith?: any): boolean;
170
+ /**
171
+ * Checks if the Symkeys instance has data associated with a given symbol.
172
+ *
173
+ * This method checks if the Symkeys instance has any data associated with
174
+ * the provided symbol. It is useful when you need to verify if data exists
175
+ * for a particular symbol before attempting to retrieve or manipulate it.
176
+ *
177
+ * @param {Symbol} forSymbol - The symbol to check for associated data.
178
+ * @returns {boolean} Returns true if data exists for the symbol, false otherwise.
179
+ *
180
+ * @example
181
+ * // Assuming 'mySymbol' is a symbol that has been added to the Symkeys
182
+ * // with associated data
183
+ * const hasData = Symkeys.hasData(mySymbol);
184
+ * console.log(hasData); // Output: true if data exists, false otherwise
185
+ */
186
+ hasData(forSymbol: Symbol): boolean;
187
+ /**
188
+ * Sets the data associated with a given symbol in the Symkeys.
189
+ *
190
+ * This method allows you to associate data with a particular symbol in the
191
+ * Symkeys. It is useful when you want to store information that can be
192
+ * retrieved later using the symbol.
193
+ *
194
+ * Note that setting only succeeds if the Symkey symbol has already been
195
+ * added via {@link Symkeys.add}
196
+ *
197
+ * @param {Symbol} forSymbol - The symbol with which the data is to be
198
+ * associated.
199
+ * @param {*} value - The data to be associated with the symbol.
200
+ * @returns {boolean} true if the value has been set, false if the key
201
+ * has not yet been added via {@link Symkeys.add}
202
+ *
203
+ * @example
204
+ * // Assuming 'mySymbol' is a symbol that has been added to the Symkeys
205
+ * // and 'myData' is the data to be associated with 'mySymbol'
206
+ * Symkeys.setData(mySymbol, myData);
207
+ */
208
+ setData(forSymbol: Symbol, value: any): boolean;
209
+ /**
210
+ * Extracts the token part from a symbol created by the `add` method.
211
+ *
212
+ * This method parses the string representation of a symbol to retrieve
213
+ * the unique token that was appended to the symbol's name upon creation.
214
+ * It is useful for debugging or for operations that require knowledge of
215
+ * the token associated with a symbol.
216
+ *
217
+ * @param symbol - The symbol whose token is to be extracted.
218
+ * @returns The extracted token or undefined if the
219
+ * token cannot be extracted.
220
+ *
221
+ * @example
222
+ * // Assuming 'mySymbol' is a symbol created with the name 'myEntry'
223
+ * // and a token 'agftofxob6f'
224
+ * const token = Symkeys.tokenFor(mySymbol);
225
+ * console.log(token); // Output: 'agftofxob6f'
226
+ */
227
+ token(forSymbol: any): any;
228
+ /**
229
+ * Retrieves the separator used in the Symkeys instance.
230
+ *
231
+ * This getter method allows access to the separator that is used to
232
+ * distinguish between different parts of a symbol in the Symkeys instance.
233
+ * It is useful when you need to know the separator for parsing symbols or
234
+ * constructing new ones.
235
+ *
236
+ * @returns {string} The separator used in the Symkeys instance.
237
+ *
238
+ * @example
239
+ * // Assuming the Symkeys instance has a separator '.'
240
+ * const separator = Symkeys.separator;
241
+ * console.log(separator); // Output: '.'
242
+ */
243
+ get separator(): string;
244
+ /**
245
+ * Retrieves an iterator for the symbols stored in the Symkeys.
246
+ *
247
+ * This method provides access to the symbols that have been stored in
248
+ * the Symkeys. It returns an iterator which can be used to loop over
249
+ * all the symbols. This is particularly useful for iterating through
250
+ * all stored data without knowing the individual symbols in advance.
251
+ *
252
+ * @returns An iterator that yields all the symbols
253
+ * stored in the Symkeys.
254
+ *
255
+ * @example
256
+ * // Assuming the Symkeys has symbols stored
257
+ * for (const symbol of Symkeys.symbols()) {
258
+ * console.log(symbol);
259
+ * }
260
+ */
261
+ symbols(): any;
262
+ /**
263
+ * Calculates a name by combining a provided name, domain, and separator.
264
+ *
265
+ * This method takes a provided name, domain, and separator as input and
266
+ * constructs a new name by combining these elements. If the domain or
267
+ * separator are not provided, it uses the default domain and separator
268
+ * stored in the Symkeys instance. If the provided name starts with the
269
+ * separator, it removes the leading separator from the name.
270
+ *
271
+ * If the domain ends with the separator, it removes the trailing separator
272
+ * from the domain. If the domain is empty, it sets the separator to an
273
+ * empty string.
274
+ *
275
+ * @param {string} providedName - The name to be used in the calculation.
276
+ * @param {string} [useDomain] - The domain to be used in the calculation.
277
+ * If not provided, the default domain of the Symkeys instance is used.
278
+ * @param {string} [useSeparator] - The separator to be used in the
279
+ * calculation. If not provided, the default separator of the Symkeys
280
+ * instance is used.
281
+ * @returns {string} The calculated name.
282
+ *
283
+ * @example
284
+ * // Assuming the Symkeys instance has a domain 'symkeys.internal'
285
+ * // and a separator '.'
286
+ * const name = Symkeys.calculateName('feature', 'symkeys.public', '/');
287
+ * console.log(name); // Output: 'symkeys.public/feature'
288
+ */
289
+ calculateName(providedName: string, useDomain?: string | undefined, useSeparator?: string | undefined): string;
290
+ }
291
+ export const SymkeysExtension: Extension;
292
+ import { Extension } from '@nejs/extension';