@mojir/lits 1.1.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 (229) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +146 -0
  3. package/dist/cli/cli/src/cli.d.ts +2 -0
  4. package/dist/cli/cli/src/cliDocumentation/formatCliDescription.d.ts +3 -0
  5. package/dist/cli/cli/src/cliDocumentation/getCliArgumentInfo.d.ts +3 -0
  6. package/dist/cli/cli/src/cliDocumentation/getCliDocumentation.d.ts +2 -0
  7. package/dist/cli/cli/src/cliDocumentation/getCliFunctionExamples.d.ts +3 -0
  8. package/dist/cli/cli/src/cliDocumentation/getCliFunctionSignature.d.ts +3 -0
  9. package/dist/cli/cli/src/cliDocumentation/getCliTitle.d.ts +3 -0
  10. package/dist/cli/cli/src/cliDocumentation/getCliType.d.ts +3 -0
  11. package/dist/cli/cli/src/cliFormatterRules.d.ts +13 -0
  12. package/dist/cli/cli/src/colorizer.d.ts +906 -0
  13. package/dist/cli/cli/src/createReadlineInterface.d.ts +6 -0
  14. package/dist/cli/cli.js +14963 -0
  15. package/dist/cli/common/clojureDocs.d.ts +1 -0
  16. package/dist/cli/common/createFormatter.d.ts +6 -0
  17. package/dist/cli/common/utils.d.ts +3 -0
  18. package/dist/cli/reference/api.d.ts +59 -0
  19. package/dist/cli/reference/categories/array.d.ts +3 -0
  20. package/dist/cli/reference/categories/assert.d.ts +3 -0
  21. package/dist/cli/reference/categories/bitwise.d.ts +3 -0
  22. package/dist/cli/reference/categories/collection.d.ts +3 -0
  23. package/dist/cli/reference/categories/functional.d.ts +3 -0
  24. package/dist/cli/reference/categories/math.d.ts +3 -0
  25. package/dist/cli/reference/categories/misc.d.ts +3 -0
  26. package/dist/cli/reference/categories/object.d.ts +3 -0
  27. package/dist/cli/reference/categories/predicate.d.ts +3 -0
  28. package/dist/cli/reference/categories/regularExpression.d.ts +3 -0
  29. package/dist/cli/reference/categories/sequence.d.ts +3 -0
  30. package/dist/cli/reference/categories/specialExpressions.d.ts +3 -0
  31. package/dist/cli/reference/categories/string.d.ts +3 -0
  32. package/dist/cli/reference/datatype.d.ts +3 -0
  33. package/dist/cli/reference/examples.d.ts +16 -0
  34. package/dist/cli/reference/index.d.ts +50 -0
  35. package/dist/cli/reference/shorthand.d.ts +3 -0
  36. package/dist/cli/src/Lits/Cache.d.ts +16 -0
  37. package/dist/cli/src/Lits/Lits.d.ts +50 -0
  38. package/dist/cli/src/analyze/index.d.ts +2 -0
  39. package/dist/cli/src/analyze/interface.d.ts +12 -0
  40. package/dist/cli/src/analyze/utils.d.ts +3 -0
  41. package/dist/cli/src/builtin/index.d.ts +5 -0
  42. package/dist/cli/src/builtin/interface.d.ts +43 -0
  43. package/dist/cli/src/builtin/normalExpressions/categories/array.d.ts +2 -0
  44. package/dist/cli/src/builtin/normalExpressions/categories/assert.d.ts +2 -0
  45. package/dist/cli/src/builtin/normalExpressions/categories/bitwise.d.ts +2 -0
  46. package/dist/cli/src/builtin/normalExpressions/categories/collection.d.ts +2 -0
  47. package/dist/cli/src/builtin/normalExpressions/categories/functional.d.ts +2 -0
  48. package/dist/cli/src/builtin/normalExpressions/categories/math.d.ts +2 -0
  49. package/dist/cli/src/builtin/normalExpressions/categories/misc.d.ts +2 -0
  50. package/dist/cli/src/builtin/normalExpressions/categories/object.d.ts +2 -0
  51. package/dist/cli/src/builtin/normalExpressions/categories/predicates.d.ts +2 -0
  52. package/dist/cli/src/builtin/normalExpressions/categories/regexp.d.ts +2 -0
  53. package/dist/cli/src/builtin/normalExpressions/categories/sequence.d.ts +4 -0
  54. package/dist/cli/src/builtin/normalExpressions/categories/string.d.ts +2 -0
  55. package/dist/cli/src/builtin/normalExpressions/index.d.ts +2 -0
  56. package/dist/cli/src/builtin/specialExpressions/and.d.ts +3 -0
  57. package/dist/cli/src/builtin/specialExpressions/comment.d.ts +2 -0
  58. package/dist/cli/src/builtin/specialExpressions/cond.d.ts +8 -0
  59. package/dist/cli/src/builtin/specialExpressions/declared.d.ts +2 -0
  60. package/dist/cli/src/builtin/specialExpressions/def.d.ts +3 -0
  61. package/dist/cli/src/builtin/specialExpressions/defs.d.ts +3 -0
  62. package/dist/cli/src/builtin/specialExpressions/do.d.ts +3 -0
  63. package/dist/cli/src/builtin/specialExpressions/functions.d.ts +9 -0
  64. package/dist/cli/src/builtin/specialExpressions/if-let.d.ts +3 -0
  65. package/dist/cli/src/builtin/specialExpressions/if-not.d.ts +3 -0
  66. package/dist/cli/src/builtin/specialExpressions/if.d.ts +3 -0
  67. package/dist/cli/src/builtin/specialExpressions/let.d.ts +3 -0
  68. package/dist/cli/src/builtin/specialExpressions/loop.d.ts +3 -0
  69. package/dist/cli/src/builtin/specialExpressions/loops.d.ts +12 -0
  70. package/dist/cli/src/builtin/specialExpressions/or.d.ts +3 -0
  71. package/dist/cli/src/builtin/specialExpressions/qq.d.ts +3 -0
  72. package/dist/cli/src/builtin/specialExpressions/recur.d.ts +2 -0
  73. package/dist/cli/src/builtin/specialExpressions/throw.d.ts +2 -0
  74. package/dist/cli/src/builtin/specialExpressions/time.d.ts +3 -0
  75. package/dist/cli/src/builtin/specialExpressions/try.d.ts +3 -0
  76. package/dist/cli/src/builtin/specialExpressions/when-first.d.ts +3 -0
  77. package/dist/cli/src/builtin/specialExpressions/when-let.d.ts +3 -0
  78. package/dist/cli/src/builtin/specialExpressions/when-not.d.ts +3 -0
  79. package/dist/cli/src/builtin/specialExpressions/when.d.ts +3 -0
  80. package/dist/cli/src/builtin/utils.d.ts +18 -0
  81. package/dist/cli/src/cli.d.ts +2 -0
  82. package/dist/cli/src/cliDocumentation/formatCliDescription.d.ts +3 -0
  83. package/dist/cli/src/cliDocumentation/getCliArgumentInfo.d.ts +3 -0
  84. package/dist/cli/src/cliDocumentation/getCliDocumentation.d.ts +2 -0
  85. package/dist/cli/src/cliDocumentation/getCliFunctionExamples.d.ts +3 -0
  86. package/dist/cli/src/cliDocumentation/getCliFunctionSignature.d.ts +3 -0
  87. package/dist/cli/src/cliDocumentation/getCliTitle.d.ts +3 -0
  88. package/dist/cli/src/cliDocumentation/getCliType.d.ts +3 -0
  89. package/dist/cli/src/cliFormatterRules.d.ts +13 -0
  90. package/dist/cli/src/colorizer.d.ts +906 -0
  91. package/dist/cli/src/constants/constants.d.ts +42 -0
  92. package/dist/cli/src/createReadlineInterface.d.ts +6 -0
  93. package/dist/cli/src/errors.d.ts +26 -0
  94. package/dist/cli/src/evaluator/ContextStack.d.ts +21 -0
  95. package/dist/cli/src/evaluator/functionExecutors.d.ts +11 -0
  96. package/dist/cli/src/evaluator/index.d.ts +5 -0
  97. package/dist/cli/src/evaluator/interface.d.ts +12 -0
  98. package/dist/cli/src/index.d.ts +12 -0
  99. package/dist/cli/src/interface.d.ts +8 -0
  100. package/dist/cli/src/parser/index.d.ts +3 -0
  101. package/dist/cli/src/parser/interface.d.ts +160 -0
  102. package/dist/cli/src/parser/parsers.d.ts +4 -0
  103. package/dist/cli/src/reservedNames.d.ts +7 -0
  104. package/dist/cli/src/testFramework/index.d.ts +14 -0
  105. package/dist/cli/src/tokenizer/index.d.ts +2 -0
  106. package/dist/cli/src/tokenizer/interface.d.ts +25 -0
  107. package/dist/cli/src/tokenizer/sugar/applyCollectionAccessor.d.ts +2 -0
  108. package/dist/cli/src/tokenizer/sugar/index.d.ts +3 -0
  109. package/dist/cli/src/tokenizer/tokenizers.d.ts +19 -0
  110. package/dist/cli/src/typeGuards/array.d.ts +9 -0
  111. package/dist/cli/src/typeGuards/astNode.d.ts +17 -0
  112. package/dist/cli/src/typeGuards/index.d.ts +15 -0
  113. package/dist/cli/src/typeGuards/lits.d.ts +21 -0
  114. package/dist/cli/src/typeGuards/litsFunction.d.ts +12 -0
  115. package/dist/cli/src/typeGuards/number.d.ts +66 -0
  116. package/dist/cli/src/typeGuards/string.d.ts +15 -0
  117. package/dist/cli/src/typeGuards/token.d.ts +13 -0
  118. package/dist/cli/src/utils/debug/debugTools.d.ts +3 -0
  119. package/dist/cli/src/utils/debug/getSourceCodeInfo.d.ts +2 -0
  120. package/dist/cli/src/utils/getAssertionError.d.ts +3 -0
  121. package/dist/cli/src/utils/index.d.ts +10 -0
  122. package/dist/cli/src/utils/symbols.d.ts +2 -0
  123. package/dist/common/clojureDocs.d.ts +1 -0
  124. package/dist/common/createFormatter.d.ts +6 -0
  125. package/dist/common/utils.d.ts +3 -0
  126. package/dist/index.esm.js +7078 -0
  127. package/dist/index.esm.js.map +1 -0
  128. package/dist/index.js +7095 -0
  129. package/dist/index.js.map +1 -0
  130. package/dist/lits.iife.js +7100 -0
  131. package/dist/lits.iife.js.map +1 -0
  132. package/dist/reference/api.d.ts +59 -0
  133. package/dist/reference/categories/array.d.ts +3 -0
  134. package/dist/reference/categories/assert.d.ts +3 -0
  135. package/dist/reference/categories/bitwise.d.ts +3 -0
  136. package/dist/reference/categories/collection.d.ts +3 -0
  137. package/dist/reference/categories/functional.d.ts +3 -0
  138. package/dist/reference/categories/math.d.ts +3 -0
  139. package/dist/reference/categories/misc.d.ts +3 -0
  140. package/dist/reference/categories/object.d.ts +3 -0
  141. package/dist/reference/categories/predicate.d.ts +3 -0
  142. package/dist/reference/categories/regularExpression.d.ts +3 -0
  143. package/dist/reference/categories/sequence.d.ts +3 -0
  144. package/dist/reference/categories/specialExpressions.d.ts +3 -0
  145. package/dist/reference/categories/string.d.ts +3 -0
  146. package/dist/reference/datatype.d.ts +3 -0
  147. package/dist/reference/index.d.ts +50 -0
  148. package/dist/reference/shorthand.d.ts +3 -0
  149. package/dist/src/Lits/Cache.d.ts +16 -0
  150. package/dist/src/Lits/Lits.d.ts +50 -0
  151. package/dist/src/analyze/index.d.ts +2 -0
  152. package/dist/src/analyze/interface.d.ts +12 -0
  153. package/dist/src/analyze/utils.d.ts +3 -0
  154. package/dist/src/builtin/index.d.ts +5 -0
  155. package/dist/src/builtin/interface.d.ts +43 -0
  156. package/dist/src/builtin/normalExpressions/categories/array.d.ts +2 -0
  157. package/dist/src/builtin/normalExpressions/categories/assert.d.ts +2 -0
  158. package/dist/src/builtin/normalExpressions/categories/bitwise.d.ts +2 -0
  159. package/dist/src/builtin/normalExpressions/categories/collection.d.ts +2 -0
  160. package/dist/src/builtin/normalExpressions/categories/functional.d.ts +2 -0
  161. package/dist/src/builtin/normalExpressions/categories/math.d.ts +2 -0
  162. package/dist/src/builtin/normalExpressions/categories/misc.d.ts +2 -0
  163. package/dist/src/builtin/normalExpressions/categories/object.d.ts +2 -0
  164. package/dist/src/builtin/normalExpressions/categories/predicates.d.ts +2 -0
  165. package/dist/src/builtin/normalExpressions/categories/regexp.d.ts +2 -0
  166. package/dist/src/builtin/normalExpressions/categories/sequence.d.ts +4 -0
  167. package/dist/src/builtin/normalExpressions/categories/string.d.ts +2 -0
  168. package/dist/src/builtin/normalExpressions/index.d.ts +2 -0
  169. package/dist/src/builtin/specialExpressions/and.d.ts +3 -0
  170. package/dist/src/builtin/specialExpressions/comment.d.ts +2 -0
  171. package/dist/src/builtin/specialExpressions/cond.d.ts +8 -0
  172. package/dist/src/builtin/specialExpressions/declared.d.ts +2 -0
  173. package/dist/src/builtin/specialExpressions/def.d.ts +3 -0
  174. package/dist/src/builtin/specialExpressions/defs.d.ts +3 -0
  175. package/dist/src/builtin/specialExpressions/do.d.ts +3 -0
  176. package/dist/src/builtin/specialExpressions/functions.d.ts +9 -0
  177. package/dist/src/builtin/specialExpressions/if-let.d.ts +3 -0
  178. package/dist/src/builtin/specialExpressions/if-not.d.ts +3 -0
  179. package/dist/src/builtin/specialExpressions/if.d.ts +3 -0
  180. package/dist/src/builtin/specialExpressions/let.d.ts +3 -0
  181. package/dist/src/builtin/specialExpressions/loop.d.ts +3 -0
  182. package/dist/src/builtin/specialExpressions/loops.d.ts +12 -0
  183. package/dist/src/builtin/specialExpressions/or.d.ts +3 -0
  184. package/dist/src/builtin/specialExpressions/qq.d.ts +3 -0
  185. package/dist/src/builtin/specialExpressions/recur.d.ts +2 -0
  186. package/dist/src/builtin/specialExpressions/throw.d.ts +2 -0
  187. package/dist/src/builtin/specialExpressions/time.d.ts +3 -0
  188. package/dist/src/builtin/specialExpressions/try.d.ts +3 -0
  189. package/dist/src/builtin/specialExpressions/when-first.d.ts +3 -0
  190. package/dist/src/builtin/specialExpressions/when-let.d.ts +3 -0
  191. package/dist/src/builtin/specialExpressions/when-not.d.ts +3 -0
  192. package/dist/src/builtin/specialExpressions/when.d.ts +3 -0
  193. package/dist/src/builtin/utils.d.ts +18 -0
  194. package/dist/src/constants/constants.d.ts +42 -0
  195. package/dist/src/errors.d.ts +26 -0
  196. package/dist/src/evaluator/ContextStack.d.ts +21 -0
  197. package/dist/src/evaluator/functionExecutors.d.ts +11 -0
  198. package/dist/src/evaluator/index.d.ts +5 -0
  199. package/dist/src/evaluator/interface.d.ts +12 -0
  200. package/dist/src/index.d.ts +12 -0
  201. package/dist/src/interface.d.ts +8 -0
  202. package/dist/src/parser/index.d.ts +3 -0
  203. package/dist/src/parser/interface.d.ts +160 -0
  204. package/dist/src/parser/parsers.d.ts +4 -0
  205. package/dist/src/reservedNames.d.ts +7 -0
  206. package/dist/src/testFramework/index.d.ts +14 -0
  207. package/dist/src/tokenizer/index.d.ts +2 -0
  208. package/dist/src/tokenizer/interface.d.ts +25 -0
  209. package/dist/src/tokenizer/sugar/applyCollectionAccessor.d.ts +2 -0
  210. package/dist/src/tokenizer/sugar/index.d.ts +3 -0
  211. package/dist/src/tokenizer/tokenizers.d.ts +19 -0
  212. package/dist/src/typeGuards/array.d.ts +9 -0
  213. package/dist/src/typeGuards/astNode.d.ts +17 -0
  214. package/dist/src/typeGuards/index.d.ts +15 -0
  215. package/dist/src/typeGuards/lits.d.ts +21 -0
  216. package/dist/src/typeGuards/litsFunction.d.ts +12 -0
  217. package/dist/src/typeGuards/number.d.ts +66 -0
  218. package/dist/src/typeGuards/string.d.ts +15 -0
  219. package/dist/src/typeGuards/token.d.ts +13 -0
  220. package/dist/src/utils/debug/debugTools.d.ts +3 -0
  221. package/dist/src/utils/debug/getSourceCodeInfo.d.ts +2 -0
  222. package/dist/src/utils/getAssertionError.d.ts +3 -0
  223. package/dist/src/utils/index.d.ts +10 -0
  224. package/dist/src/utils/symbols.d.ts +2 -0
  225. package/dist/testFramework.esm.js +7197 -0
  226. package/dist/testFramework.esm.js.map +1 -0
  227. package/dist/testFramework.js +7200 -0
  228. package/dist/testFramework.js.map +1 -0
  229. package/package.json +62 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Albert Mojir
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,146 @@
1
+
2
+
3
+ # Lits
4
+
5
+ Lits is a programming language and REPL (Read-Eval-Print Loop) that allows you to evaluate Lisp expressions. It provides a playground for experimenting with Lits and an API for integrating Lits into your own projects.
6
+
7
+ Lits is a Lisp dialect implemented in TypeScript, drawing heavy inspiration from Clojure. Most core functions have been ported to Lits, ensuring a robust and familiar experience for Clojure users.
8
+
9
+ * **Dependencies**: No third party dependencies.
10
+ * **Immutability**: All datatypes in Lits are immutable.
11
+ * **Pure Functions**: Functions are [pure](https://en.wikipedia.org/wiki/Pure_function) by default. Functions with side effects have names ending in an exclamation mark (!), such as `write!` or `rand!`
12
+ * **Type Mapping**: All datatypes in Lits map directly to JavaScript types.
13
+ * **Evaluation**: Lits does not support lazy evaluation.
14
+ * **Macros**:Macros are not supported in Lits.
15
+ * **Keyword Symbols**: There are no keyword symbols. The notation `:foo` is simply shorthand for the string `"foo"`
16
+ * **Scoping**: Lits uses [dynamic scoping](https://en.wikipedia.org/wiki/Scope_(computer_science)#Dynamic_scope) not [lexical scoping](https://en.wikipedia.org/wiki/Scope_(computer_science)#Lexical_scope)
17
+
18
+ ## Documentation
19
+
20
+ You can find the Lits playground [here](https://mojir.github.io/lits/#index). The playground allows you to interactively write and evaluate Lits expressions.
21
+
22
+ ## Installation
23
+
24
+ To install Lits globally, run the following command:
25
+
26
+ ```
27
+ npm i -g @mojir/lits
28
+ ```
29
+ ## Repl usage
30
+ Initiate the Lits REPL in a terminal by typing `lits`. If Lits hasn't been installed globally, you can use `npx lits` instead.
31
+
32
+ * Tab completion
33
+ * History stored on file
34
+
35
+ ```
36
+ $ lits
37
+ Type "`help" for more information.
38
+ > (+ 7 4)
39
+ 11
40
+ > (let ((day (* 24 60 60 1000))) (* 7 day)) ; Ever wondered how many milliseconds there are in a week?
41
+ 604800000
42
+ ```
43
+ ```
44
+ $ lits --help
45
+ Usage: lits [options]
46
+
47
+ Options:
48
+ -c, --context=... Context as a JSON string
49
+ -C, --context-file=... Context file (.json file)
50
+ -e, --eval=... Evaluate Lits expression
51
+ -f, --file=... Evaluate .lits file
52
+ -p, --test-pattern=... Test name pattern, used together with --test
53
+ -t, --test=... Test .test.lits file
54
+ --help Show this help
55
+ --version Print lits version
56
+ ```
57
+ ```
58
+ $ lits -e "(/ 81 9)"
59
+ 9
60
+ ```
61
+
62
+ # API
63
+ ## Install api
64
+
65
+ ```
66
+ npm i @mojir/lits
67
+ ```
68
+
69
+ ## How to use?
70
+
71
+ ```ts
72
+ import { Lits } from '@mojir/lits'
73
+
74
+ const lits = new Lits()
75
+ lits.run("(+ 1 2 3 4)"); // returns 10
76
+ ```
77
+
78
+ ## Tokenization and Parsing
79
+ Lits provides two important functions for working with Lisp expressions: `lits.tokenize` and `lits.parse`.
80
+
81
+ ### lits.tokenize
82
+ The `lits.tokenize` function takes a string as input and returns a `TokenStream`. Tokens are the individual components of a Lisp expression, such as parentheses, symbols, numbers, and strings. Here's an example usage:
83
+
84
+ ```
85
+ const lits = new Lits()
86
+ const expression = "(+ 1 2)";
87
+ const tokens = lits.tokenize(expression);
88
+ console.log(tokens);
89
+ // Output: {
90
+ "tokens": [
91
+ {
92
+ "t": 101,
93
+ "v": "("
94
+ },
95
+ {
96
+ "t": 103,
97
+ "v": "+"
98
+ },
99
+ {
100
+ "t": 102,
101
+ "v": "1"
102
+ },
103
+ {
104
+ "t": 102,
105
+ "v": "2"
106
+ },
107
+ {
108
+ "t": 101,
109
+ "v": ")"
110
+ }
111
+ ]
112
+ }
113
+ ```
114
+
115
+ ### Lits.parse
116
+ The `lits.parse` function accepts a `TokenStream` as an argument and returns an Abstract Syntax Tree (AST). By compiling Lits expressions into an AST, you can significantly enhance the evaluation speed, achieving approximately a tenfold improvement.
117
+
118
+ The AST is represented as a JSON document, which facilitates straightforward serialization.
119
+
120
+ To evaluate an AST, utilize the `lits.evaluate` function.
121
+
122
+ ```
123
+ const lits = new Lits()
124
+ const expression = "(+ 1 2)";
125
+ const tokens = lits.tokenize(expression);
126
+ const ast = lits.parse(tokens)
127
+ console.log(tokens);
128
+ // Output: {
129
+ "b": [
130
+ {
131
+ "t": 203,
132
+ "n": "+",
133
+ "p": [
134
+ {
135
+ "t": 201,
136
+ "v": 1
137
+ },
138
+ {
139
+ "t": 201,
140
+ "v": 2
141
+ }
142
+ ]
143
+ }
144
+ ]
145
+ }
146
+ ```
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,3 @@
1
+ import { type Reference } from '../../../reference';
2
+ import type { Colorizer } from '../colorizer';
3
+ export declare function formatCliDescription(fmt: Colorizer, description: string, reference: Reference): string;
@@ -0,0 +1,3 @@
1
+ import type { FunctionReference } from '../../../reference';
2
+ import type { Colorizer } from '../colorizer';
3
+ export declare function getArgumentInfo(fmt: Colorizer, reference: FunctionReference): string;
@@ -0,0 +1,2 @@
1
+ import type { Colorizer } from '../colorizer';
2
+ export declare function getCliDocumentation(fmt: Colorizer, name: string): string;
@@ -0,0 +1,3 @@
1
+ import type { Reference } from '../../../reference';
2
+ import type { Colorizer } from '../colorizer';
3
+ export declare function getCliFunctionExamples(fmt: Colorizer, reference: Reference): string;
@@ -0,0 +1,3 @@
1
+ import type { FunctionReference } from '../../../reference';
2
+ import type { Colorizer } from '../colorizer';
3
+ export declare function getCliFunctionSignature(fmt: Colorizer, { title: name, variants, args, returns }: FunctionReference): string;
@@ -0,0 +1,3 @@
1
+ import type { Colorizer } from '../colorizer';
2
+ import type { Reference } from '../../../reference';
3
+ export declare function getCliTitle(fmt: Colorizer, reference: Reference): string;
@@ -0,0 +1,3 @@
1
+ import type { Colorizer } from '../colorizer';
2
+ import { type Argument, type TypedValue } from '../../../reference';
3
+ export declare function getCliType(fmt: Colorizer, arg: Argument | TypedValue): string;
@@ -0,0 +1,13 @@
1
+ import { type TextFormatter } from '../../common/createFormatter';
2
+ import { type Colorizer } from './colorizer';
3
+ export type FormatterRule = (text: string, index: number, formatter: TextFormatter) => {
4
+ count: number;
5
+ formattedText: string;
6
+ };
7
+ export declare const variableRegExp: RegExp;
8
+ export declare function createVariableRule(formatVariableName: TextFormatter, variableNamePredicate: (variableName: string) => boolean): FormatterRule;
9
+ export declare const getNumberRule: (cli: Colorizer) => FormatterRule;
10
+ export declare function getInlineCodeFormatter(cli: Colorizer): TextFormatter;
11
+ export declare function getLitsExpressionRules(cli: Colorizer): FormatterRule[];
12
+ export declare function getLitsFormatter(fmt: Colorizer): TextFormatter;
13
+ export declare function getMdRules(fmt: Colorizer): FormatterRule[];