@start9labs/start-sdk 0.4.0-beta.3 → 0.4.0-beta.31

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 (224) hide show
  1. package/base/lib/Effects.d.ts +8 -34
  2. package/base/lib/actions/index.d.ts +13 -14
  3. package/base/lib/actions/index.js +4 -4
  4. package/base/lib/actions/index.js.map +1 -1
  5. package/base/lib/actions/input/builder/inputSpec.d.ts +15 -26
  6. package/base/lib/actions/input/builder/inputSpec.js +10 -27
  7. package/base/lib/actions/input/builder/inputSpec.js.map +1 -1
  8. package/base/lib/actions/input/builder/list.d.ts +12 -24
  9. package/base/lib/actions/input/builder/list.js +19 -33
  10. package/base/lib/actions/input/builder/list.js.map +1 -1
  11. package/base/lib/actions/input/builder/value.d.ts +331 -70
  12. package/base/lib/actions/input/builder/value.js +505 -188
  13. package/base/lib/actions/input/builder/value.js.map +1 -1
  14. package/base/lib/actions/input/builder/variants.d.ts +11 -23
  15. package/base/lib/actions/input/builder/variants.js +16 -26
  16. package/base/lib/actions/input/builder/variants.js.map +1 -1
  17. package/base/lib/actions/input/inputSpecConstants.d.ts +6 -6
  18. package/base/lib/actions/input/inputSpecConstants.js +29 -26
  19. package/base/lib/actions/input/inputSpecConstants.js.map +1 -1
  20. package/base/lib/actions/setupActions.d.ts +19 -15
  21. package/base/lib/actions/setupActions.js +37 -14
  22. package/base/lib/actions/setupActions.js.map +1 -1
  23. package/base/lib/dependencies/dependencies.d.ts +2 -2
  24. package/base/lib/dependencies/dependencies.js +23 -15
  25. package/base/lib/dependencies/dependencies.js.map +1 -1
  26. package/base/lib/dependencies/setupDependencies.d.ts +1 -3
  27. package/base/lib/dependencies/setupDependencies.js +3 -12
  28. package/base/lib/dependencies/setupDependencies.js.map +1 -1
  29. package/base/lib/index.d.ts +1 -0
  30. package/base/lib/index.js +2 -1
  31. package/base/lib/index.js.map +1 -1
  32. package/base/lib/inits/index.d.ts +2 -0
  33. package/base/lib/inits/index.js +19 -0
  34. package/base/lib/inits/index.js.map +1 -0
  35. package/base/lib/inits/setupInit.d.ts +9 -0
  36. package/base/lib/inits/setupInit.js +40 -0
  37. package/base/lib/inits/setupInit.js.map +1 -0
  38. package/base/lib/inits/setupUninit.d.ts +25 -0
  39. package/base/lib/inits/setupUninit.js +24 -0
  40. package/base/lib/inits/setupUninit.js.map +1 -0
  41. package/base/lib/interfaces/Host.js +18 -6
  42. package/base/lib/interfaces/Host.js.map +1 -1
  43. package/base/lib/interfaces/Origin.d.ts +2 -2
  44. package/base/lib/interfaces/Origin.js +3 -3
  45. package/base/lib/interfaces/Origin.js.map +1 -1
  46. package/base/lib/interfaces/ServiceInterfaceBuilder.d.ts +2 -2
  47. package/base/lib/interfaces/setupInterfaces.d.ts +2 -4
  48. package/base/lib/interfaces/setupInterfaces.js +8 -19
  49. package/base/lib/interfaces/setupInterfaces.js.map +1 -1
  50. package/base/lib/osBindings/AddCategoryParams.d.ts +0 -2
  51. package/base/lib/osBindings/AddPackageToCategoryParams.d.ts +5 -0
  52. package/base/lib/osBindings/AddPackageToCategoryParams.js +3 -0
  53. package/base/lib/osBindings/AddPackageToCategoryParams.js.map +1 -0
  54. package/base/lib/osBindings/AttachParams.d.ts +1 -0
  55. package/base/lib/osBindings/Category.d.ts +0 -2
  56. package/base/lib/osBindings/Category.js +1 -0
  57. package/base/lib/osBindings/Category.js.map +1 -1
  58. package/base/lib/osBindings/CheckDependenciesResult.d.ts +3 -3
  59. package/base/lib/osBindings/ClearTasksParams.d.ts +5 -0
  60. package/base/lib/osBindings/{UnsetPublicParams.js → ClearTasksParams.js} +1 -1
  61. package/base/lib/osBindings/ClearTasksParams.js.map +1 -0
  62. package/base/lib/osBindings/CreateTaskParams.d.ts +15 -0
  63. package/base/lib/osBindings/CreateTaskParams.js +3 -0
  64. package/base/lib/osBindings/CreateTaskParams.js.map +1 -0
  65. package/base/lib/osBindings/FileType.d.ts +1 -0
  66. package/base/lib/osBindings/{NetworkInterfaceSetPublicParams.js → FileType.js} +1 -1
  67. package/base/lib/osBindings/FileType.js.map +1 -0
  68. package/base/lib/osBindings/GetOsVersionParams.d.ts +3 -3
  69. package/base/lib/osBindings/GetPackageParams.d.ts +1 -1
  70. package/base/lib/osBindings/MainStatus.d.ts +0 -2
  71. package/base/lib/osBindings/Manifest.d.ts +1 -0
  72. package/base/lib/osBindings/MountTarget.d.ts +2 -0
  73. package/base/lib/osBindings/PackageDataEntry.d.ts +4 -5
  74. package/base/lib/osBindings/Progress.d.ts +2 -0
  75. package/base/lib/osBindings/Progress.js +0 -1
  76. package/base/lib/osBindings/Progress.js.map +1 -1
  77. package/base/lib/osBindings/ProgressUnits.d.ts +1 -0
  78. package/base/lib/osBindings/ProgressUnits.js +4 -0
  79. package/base/lib/osBindings/ProgressUnits.js.map +1 -0
  80. package/base/lib/osBindings/Proxies.d.ts +4 -0
  81. package/base/lib/osBindings/Proxies.js +3 -0
  82. package/base/lib/osBindings/Proxies.js.map +1 -0
  83. package/base/lib/osBindings/ProxyInfo.d.ts +4 -0
  84. package/base/lib/osBindings/ProxyInfo.js +4 -0
  85. package/base/lib/osBindings/ProxyInfo.js.map +1 -0
  86. package/base/lib/osBindings/RemoveAdminParams.d.ts +4 -0
  87. package/base/lib/osBindings/RemoveAdminParams.js +3 -0
  88. package/base/lib/osBindings/RemoveAdminParams.js.map +1 -0
  89. package/base/lib/osBindings/RemoveAssetParams.d.ts +4 -0
  90. package/base/lib/osBindings/RemoveAssetParams.js +4 -0
  91. package/base/lib/osBindings/RemoveAssetParams.js.map +1 -0
  92. package/base/lib/osBindings/RemovePackageFromCategoryParams.d.ts +5 -0
  93. package/base/lib/osBindings/RemovePackageFromCategoryParams.js +3 -0
  94. package/base/lib/osBindings/RemovePackageFromCategoryParams.js.map +1 -0
  95. package/base/lib/osBindings/RemovePackageParams.d.ts +6 -0
  96. package/base/lib/osBindings/RemovePackageParams.js +3 -0
  97. package/base/lib/osBindings/RemovePackageParams.js.map +1 -0
  98. package/base/lib/osBindings/ServerInfo.d.ts +1 -0
  99. package/base/lib/osBindings/SetupExecuteParams.d.ts +1 -0
  100. package/base/lib/osBindings/Task.d.ts +13 -0
  101. package/base/lib/osBindings/Task.js +3 -0
  102. package/base/lib/osBindings/Task.js.map +1 -0
  103. package/base/lib/osBindings/TaskCondition.d.ts +1 -0
  104. package/base/lib/osBindings/TaskCondition.js +4 -0
  105. package/base/lib/osBindings/TaskCondition.js.map +1 -0
  106. package/base/lib/osBindings/TaskEntry.d.ts +5 -0
  107. package/base/lib/osBindings/TaskEntry.js +3 -0
  108. package/base/lib/osBindings/TaskEntry.js.map +1 -0
  109. package/base/lib/osBindings/TaskInput.d.ts +4 -0
  110. package/base/lib/osBindings/TaskInput.js +4 -0
  111. package/base/lib/osBindings/TaskInput.js.map +1 -0
  112. package/base/lib/osBindings/TaskSeverity.d.ts +1 -0
  113. package/base/lib/osBindings/TaskSeverity.js +4 -0
  114. package/base/lib/osBindings/TaskSeverity.js.map +1 -0
  115. package/base/lib/osBindings/TaskTrigger.d.ts +5 -0
  116. package/base/lib/osBindings/TaskTrigger.js +3 -0
  117. package/base/lib/osBindings/TaskTrigger.js.map +1 -0
  118. package/base/lib/osBindings/index.d.ts +15 -11
  119. package/base/lib/s9pk/index.js +5 -7
  120. package/base/lib/s9pk/index.js.map +1 -1
  121. package/base/lib/types.d.ts +22 -33
  122. package/base/lib/types.js +13 -0
  123. package/base/lib/types.js.map +1 -1
  124. package/base/lib/util/GetSystemSmtp.d.ts +4 -0
  125. package/base/lib/util/GetSystemSmtp.js +32 -2
  126. package/base/lib/util/GetSystemSmtp.js.map +1 -1
  127. package/base/lib/util/getServiceInterface.d.ts +14 -0
  128. package/base/lib/util/getServiceInterface.js +70 -1
  129. package/base/lib/util/getServiceInterface.js.map +1 -1
  130. package/base/lib/util/getServiceInterfaces.d.ts +4 -0
  131. package/base/lib/util/getServiceInterfaces.js +34 -1
  132. package/base/lib/util/getServiceInterfaces.js.map +1 -1
  133. package/base/lib/util/index.d.ts +0 -1
  134. package/base/lib/util/index.js +1 -3
  135. package/base/lib/util/index.js.map +1 -1
  136. package/package/lib/StartSdk.d.ts +108 -570
  137. package/package/lib/StartSdk.js +112 -428
  138. package/package/lib/StartSdk.js.map +1 -1
  139. package/package/lib/backup/Backups.d.ts +15 -3
  140. package/package/lib/backup/Backups.js +44 -28
  141. package/package/lib/backup/Backups.js.map +1 -1
  142. package/package/lib/backup/setupBackups.d.ts +5 -2
  143. package/package/lib/backup/setupBackups.js +7 -5
  144. package/package/lib/backup/setupBackups.js.map +1 -1
  145. package/package/lib/health/HealthCheck.d.ts +0 -1
  146. package/package/lib/health/HealthCheck.js +1 -7
  147. package/package/lib/health/HealthCheck.js.map +1 -1
  148. package/package/lib/health/checkFns/runHealthScript.d.ts +2 -1
  149. package/package/lib/health/checkFns/runHealthScript.js +1 -1
  150. package/package/lib/health/checkFns/runHealthScript.js.map +1 -1
  151. package/package/lib/index.d.ts +0 -3
  152. package/package/lib/index.js +1 -8
  153. package/package/lib/index.js.map +1 -1
  154. package/package/lib/inits/index.d.ts +2 -3
  155. package/package/lib/inits/index.js +16 -3
  156. package/package/lib/inits/index.js.map +1 -1
  157. package/package/lib/inits/setupInit.d.ts +7 -13
  158. package/package/lib/inits/setupInit.js +22 -48
  159. package/package/lib/inits/setupInit.js.map +1 -1
  160. package/package/lib/inits/setupInstall.d.ts +10 -10
  161. package/package/lib/inits/setupInstall.js.map +1 -1
  162. package/package/lib/inits/setupUninit.d.ts +7 -0
  163. package/package/lib/inits/setupUninit.js +14 -0
  164. package/package/lib/inits/setupUninit.js.map +1 -0
  165. package/package/lib/inits/setupUninstall.d.ts +5 -5
  166. package/package/lib/inits/setupUninstall.js.map +1 -1
  167. package/package/lib/mainFn/CommandController.d.ts +6 -24
  168. package/package/lib/mainFn/CommandController.js +72 -48
  169. package/package/lib/mainFn/CommandController.js.map +1 -1
  170. package/package/lib/mainFn/Daemon.d.ts +15 -22
  171. package/package/lib/mainFn/Daemon.js +56 -13
  172. package/package/lib/mainFn/Daemon.js.map +1 -1
  173. package/package/lib/mainFn/Daemons.d.ts +72 -49
  174. package/package/lib/mainFn/Daemons.js +87 -23
  175. package/package/lib/mainFn/Daemons.js.map +1 -1
  176. package/package/lib/mainFn/HealthDaemon.d.ts +8 -7
  177. package/package/lib/mainFn/HealthDaemon.js +79 -38
  178. package/package/lib/mainFn/HealthDaemon.js.map +1 -1
  179. package/package/lib/mainFn/Mounts.d.ts +38 -43
  180. package/package/lib/mainFn/Mounts.js +19 -48
  181. package/package/lib/mainFn/Mounts.js.map +1 -1
  182. package/package/lib/mainFn/Oneshot.d.ts +12 -0
  183. package/package/lib/mainFn/Oneshot.js +23 -0
  184. package/package/lib/mainFn/Oneshot.js.map +1 -0
  185. package/package/lib/mainFn/index.d.ts +1 -1
  186. package/package/lib/manifest/setupManifest.js +2 -0
  187. package/package/lib/manifest/setupManifest.js.map +1 -1
  188. package/package/lib/store/getStore.js +7 -2
  189. package/package/lib/store/getStore.js.map +1 -1
  190. package/package/lib/test/host.test.js +1 -1
  191. package/package/lib/test/host.test.js.map +1 -1
  192. package/package/lib/test/inputSpecBuilder.test.js +152 -156
  193. package/package/lib/test/inputSpecBuilder.test.js.map +1 -1
  194. package/package/lib/test/output.d.ts +2 -113
  195. package/package/lib/test/output.js +41 -40
  196. package/package/lib/test/output.js.map +1 -1
  197. package/package/lib/test/output.sdk.d.ts +235 -901
  198. package/package/lib/test/output.sdk.js +0 -1
  199. package/package/lib/test/output.sdk.js.map +1 -1
  200. package/package/lib/test/output.test.js +12 -8
  201. package/package/lib/test/output.test.js.map +1 -1
  202. package/package/lib/util/Drop.d.ts +4 -2
  203. package/package/lib/util/Drop.js +32 -8
  204. package/package/lib/util/Drop.js.map +1 -1
  205. package/package/lib/util/GetSslCertificate.d.ts +4 -0
  206. package/package/lib/util/GetSslCertificate.js +34 -2
  207. package/package/lib/util/GetSslCertificate.js.map +1 -1
  208. package/package/lib/util/SubContainer.d.ts +164 -45
  209. package/package/lib/util/SubContainer.js +223 -100
  210. package/package/lib/util/SubContainer.js.map +1 -1
  211. package/package/lib/util/fileHelper.d.ts +46 -17
  212. package/package/lib/util/fileHelper.js +112 -41
  213. package/package/lib/util/fileHelper.js.map +1 -1
  214. package/package/lib/version/VersionGraph.d.ts +26 -5
  215. package/package/lib/version/VersionGraph.js +88 -22
  216. package/package/lib/version/VersionGraph.js.map +1 -1
  217. package/package/package.json +63 -0
  218. package/package/scripts/oldSpecToBuilder.js +5 -4
  219. package/package/scripts/oldSpecToBuilder.js.map +1 -1
  220. package/package.json +7 -8
  221. package/base/lib/osBindings/NetworkInterfaceSetPublicParams.d.ts +0 -4
  222. package/base/lib/osBindings/NetworkInterfaceSetPublicParams.js.map +0 -1
  223. package/base/lib/osBindings/UnsetPublicParams.d.ts +0 -3
  224. package/base/lib/osBindings/UnsetPublicParams.js.map +0 -1
@@ -1,17 +1,38 @@
1
1
  import { InputSpec, LazyBuild } from "./inputSpec";
2
2
  import { List } from "./list";
3
- import { Variants } from "./variants";
3
+ import { UnionRes, Variants } from "./variants";
4
4
  import { Pattern, RandomString, ValueSpec, ValueSpecDatetime, ValueSpecText } from "../inputSpecTypes";
5
5
  import { DefaultString } from "../inputSpecTypes";
6
6
  import { Parser } from "ts-matches";
7
7
  import { DeepPartial } from "../../../types";
8
8
  type AsRequired<T, Required extends boolean> = Required extends true ? T : T | null;
9
- export declare class Value<Type, Store> {
10
- build: LazyBuild<Store, ValueSpec>;
11
- validator: Parser<unknown, Type>;
12
- protected constructor(build: LazyBuild<Store, ValueSpec>, validator: Parser<unknown, Type>);
9
+ export declare class Value<Type> {
10
+ build: LazyBuild<{
11
+ spec: ValueSpec;
12
+ validator: Parser<unknown, Type>;
13
+ }>;
14
+ protected constructor(build: LazyBuild<{
15
+ spec: ValueSpec;
16
+ validator: Parser<unknown, Type>;
17
+ }>);
13
18
  _TYPE: Type;
14
19
  _PARTIAL: DeepPartial<Type>;
20
+ /**
21
+ * @description Displays a boolean toggle to enable/disable
22
+ * @example
23
+ * ```
24
+ toggleExample: Value.toggle({
25
+ // required
26
+ name: 'Toggle Example',
27
+ default: true,
28
+
29
+ // optional
30
+ description: null,
31
+ warning: null,
32
+ immutable: false,
33
+ }),
34
+ * ```
35
+ */
15
36
  static toggle(a: {
16
37
  name: string;
17
38
  description?: string | null;
@@ -23,14 +44,38 @@ export declare class Value<Type, Store> {
23
44
  * @default false
24
45
  */
25
46
  immutable?: boolean;
26
- }): Value<boolean, never>;
27
- static dynamicToggle<Store = never>(a: LazyBuild<Store, {
47
+ }): Value<boolean>;
48
+ static dynamicToggle(a: LazyBuild<{
28
49
  name: string;
29
50
  description?: string | null;
30
51
  warning?: string | null;
31
52
  default: boolean;
32
53
  disabled?: false | string;
33
- }>): Value<boolean, Store>;
54
+ }>): Value<boolean>;
55
+ /**
56
+ * @description Displays a text input field
57
+ * @example
58
+ * ```
59
+ textExample: Value.text({
60
+ // required
61
+ name: 'Text Example',
62
+ required: false,
63
+ default: null,
64
+
65
+ // optional
66
+ description: null,
67
+ placeholder: null,
68
+ warning: null,
69
+ generate: null,
70
+ inputmode: 'text',
71
+ masked: false,
72
+ minLength: null,
73
+ maxLength: null,
74
+ patterns: [],
75
+ immutable: false,
76
+ }),
77
+ * ```
78
+ */
34
79
  static text<Required extends boolean>(a: {
35
80
  name: string;
36
81
  description?: string | null;
@@ -81,13 +126,13 @@ export declare class Value<Type, Store> {
81
126
  * @description Displays a button that will generate a random string according to the provided charset and len attributes.
82
127
  */
83
128
  generate?: RandomString | null;
84
- }): Value<AsRequired<string, Required>, never>;
85
- static dynamicText<Store = never>(getA: LazyBuild<Store, {
129
+ }): Value<AsRequired<string, Required>>;
130
+ static dynamicText<Required extends boolean>(getA: LazyBuild<{
86
131
  name: string;
87
132
  description?: string | null;
88
133
  warning?: string | null;
89
134
  default: DefaultString | null;
90
- required: boolean;
135
+ required: Required;
91
136
  masked?: boolean;
92
137
  placeholder?: string | null;
93
138
  minLength?: number | null;
@@ -96,7 +141,27 @@ export declare class Value<Type, Store> {
96
141
  inputmode?: ValueSpecText["inputmode"];
97
142
  disabled?: string | false;
98
143
  generate?: null | RandomString;
99
- }>): Value<string | null, Store>;
144
+ }>): Value<AsRequired<string, Required>>;
145
+ /**
146
+ * @description Displays a large textarea field for long form entry.
147
+ * @example
148
+ * ```
149
+ textareaExample: Value.textarea({
150
+ // required
151
+ name: 'Textarea Example',
152
+ required: false,
153
+ default: null,
154
+
155
+ // optional
156
+ description: null,
157
+ placeholder: null,
158
+ warning: null,
159
+ minLength: null,
160
+ maxLength: null,
161
+ immutable: false,
162
+ }),
163
+ * ```
164
+ */
100
165
  static textarea<Required extends boolean>(a: {
101
166
  name: string;
102
167
  description?: string | null;
@@ -112,18 +177,41 @@ export declare class Value<Type, Store> {
112
177
  * @default false
113
178
  */
114
179
  immutable?: boolean;
115
- }): Value<AsRequired<string, Required>, never>;
116
- static dynamicTextarea<Store = never>(getA: LazyBuild<Store, {
180
+ }): Value<AsRequired<string, Required>>;
181
+ static dynamicTextarea<Required extends boolean>(getA: LazyBuild<{
117
182
  name: string;
118
183
  description?: string | null;
119
184
  warning?: string | null;
120
185
  default: string | null;
121
- required: boolean;
186
+ required: Required;
122
187
  minLength?: number | null;
123
188
  maxLength?: number | null;
124
189
  placeholder?: string | null;
125
190
  disabled?: false | string;
126
- }>): Value<string | null, Store>;
191
+ }>): Value<AsRequired<string, Required>>;
192
+ /**
193
+ * @description Displays a number input field
194
+ * @example
195
+ * ```
196
+ numberExample: Value.number({
197
+ // required
198
+ name: 'Number Example',
199
+ required: false,
200
+ default: null,
201
+ integer: true,
202
+
203
+ // optional
204
+ description: null,
205
+ placeholder: null,
206
+ warning: null,
207
+ min: null,
208
+ max: null,
209
+ immutable: false,
210
+ step: null,
211
+ units: null,
212
+ }),
213
+ * ```
214
+ */
127
215
  static number<Required extends boolean>(a: {
128
216
  name: string;
129
217
  description?: string | null;
@@ -158,13 +246,13 @@ export declare class Value<Type, Store> {
158
246
  * @default false
159
247
  */
160
248
  immutable?: boolean;
161
- }): Value<AsRequired<number, Required>, never>;
162
- static dynamicNumber<Store = never>(getA: LazyBuild<Store, {
249
+ }): Value<AsRequired<number, Required>>;
250
+ static dynamicNumber<Required extends boolean>(getA: LazyBuild<{
163
251
  name: string;
164
252
  description?: string | null;
165
253
  warning?: string | null;
166
254
  default: number | null;
167
- required: boolean;
255
+ required: Required;
168
256
  min?: number | null;
169
257
  max?: number | null;
170
258
  step?: number | null;
@@ -172,7 +260,24 @@ export declare class Value<Type, Store> {
172
260
  units?: string | null;
173
261
  placeholder?: string | null;
174
262
  disabled?: false | string;
175
- }>): Value<number | null, Store>;
263
+ }>): Value<AsRequired<number, Required>>;
264
+ /**
265
+ * @description Displays a browser-native color selector.
266
+ * @example
267
+ * ```
268
+ colorExample: Value.color({
269
+ // required
270
+ name: 'Color Example',
271
+ required: false,
272
+ default: null,
273
+
274
+ // optional
275
+ description: null,
276
+ warning: null,
277
+ immutable: false,
278
+ }),
279
+ * ```
280
+ */
176
281
  static color<Required extends boolean>(a: {
177
282
  name: string;
178
283
  description?: string | null;
@@ -191,15 +296,35 @@ export declare class Value<Type, Store> {
191
296
  * @default false
192
297
  */
193
298
  immutable?: boolean;
194
- }): Value<AsRequired<string, Required>, never>;
195
- static dynamicColor<Store = never>(getA: LazyBuild<Store, {
299
+ }): Value<AsRequired<string, Required>>;
300
+ static dynamicColor<Required extends boolean>(getA: LazyBuild<{
196
301
  name: string;
197
302
  description?: string | null;
198
303
  warning?: string | null;
199
304
  default: string | null;
200
- required: boolean;
305
+ required: Required;
201
306
  disabled?: false | string;
202
- }>): Value<string | null, Store>;
307
+ }>): Value<AsRequired<string, Required>>;
308
+ /**
309
+ * @description Displays a browser-native date/time selector.
310
+ * @example
311
+ * ```
312
+ datetimeExample: Value.datetime({
313
+ // required
314
+ name: 'Datetime Example',
315
+ required: false,
316
+ default: null,
317
+
318
+ // optional
319
+ description: null,
320
+ warning: null,
321
+ immutable: false,
322
+ inputmode: 'datetime-local',
323
+ min: null,
324
+ max: null,
325
+ }),
326
+ * ```
327
+ */
203
328
  static datetime<Required extends boolean>(a: {
204
329
  name: string;
205
330
  description?: string | null;
@@ -225,18 +350,39 @@ export declare class Value<Type, Store> {
225
350
  * @default false
226
351
  */
227
352
  immutable?: boolean;
228
- }): Value<AsRequired<string, Required>, never>;
229
- static dynamicDatetime<Store = never>(getA: LazyBuild<Store, {
353
+ }): Value<AsRequired<string, Required>>;
354
+ static dynamicDatetime<Required extends boolean>(getA: LazyBuild<{
230
355
  name: string;
231
356
  description?: string | null;
232
357
  warning?: string | null;
233
358
  default: string | null;
234
- required: boolean;
359
+ required: Required;
235
360
  inputmode?: ValueSpecDatetime["inputmode"];
236
361
  min?: string | null;
237
362
  max?: string | null;
238
363
  disabled?: false | string;
239
- }>): Value<string | null, Store>;
364
+ }>): Value<AsRequired<string, Required>>;
365
+ /**
366
+ * @description Displays a select modal with radio buttons, allowing for a single selection.
367
+ * @example
368
+ * ```
369
+ selectExample: Value.select({
370
+ // required
371
+ name: 'Select Example',
372
+ default: 'radio1',
373
+ values: {
374
+ radio1: 'Radio 1',
375
+ radio2: 'Radio 2',
376
+ },
377
+
378
+ // optional
379
+ description: null,
380
+ warning: null,
381
+ immutable: false,
382
+ disabled: false,
383
+ }),
384
+ * ```
385
+ */
240
386
  static select<Values extends Record<string, string>>(a: {
241
387
  name: string;
242
388
  description?: string | null;
@@ -266,15 +412,38 @@ export declare class Value<Type, Store> {
266
412
  * @default false
267
413
  */
268
414
  immutable?: boolean;
269
- }): Value<keyof Values & string, never>;
270
- static dynamicSelect<Store = never>(getA: LazyBuild<Store, {
415
+ }): Value<keyof Values & string>;
416
+ static dynamicSelect<Values extends Record<string, string>>(getA: LazyBuild<{
271
417
  name: string;
272
418
  description?: string | null;
273
419
  warning?: string | null;
274
420
  default: string;
275
- values: Record<string, string>;
421
+ values: Values;
276
422
  disabled?: false | string | string[];
277
- }>): Value<string, Store>;
423
+ }>): Value<keyof Values & string>;
424
+ /**
425
+ * @description Displays a select modal with checkboxes, allowing for multiple selections.
426
+ * @example
427
+ * ```
428
+ multiselectExample: Value.multiselect({
429
+ // required
430
+ name: 'Multiselect Example',
431
+ values: {
432
+ option1: 'Option 1',
433
+ option2: 'Option 2',
434
+ },
435
+ default: [],
436
+
437
+ // optional
438
+ description: null,
439
+ warning: null,
440
+ immutable: false,
441
+ disabled: false,
442
+ minlength: null,
443
+ maxLength: null,
444
+ }),
445
+ * ```
446
+ */
278
447
  static multiselect<Values extends Record<string, string>>(a: {
279
448
  name: string;
280
449
  description?: string | null;
@@ -303,31 +472,78 @@ export declare class Value<Type, Store> {
303
472
  * @default false
304
473
  */
305
474
  immutable?: boolean;
306
- }): Value<(keyof Values)[], never>;
307
- static dynamicMultiselect<Store = never>(getA: LazyBuild<Store, {
475
+ }): Value<(keyof Values & string)[]>;
476
+ static dynamicMultiselect<Values extends Record<string, string>>(getA: LazyBuild<{
308
477
  name: string;
309
478
  description?: string | null;
310
479
  warning?: string | null;
311
480
  default: string[];
312
- values: Record<string, string>;
481
+ values: Values;
313
482
  minLength?: number | null;
314
483
  maxLength?: number | null;
315
484
  disabled?: false | string | string[];
316
- }>): Value<string[], Store>;
317
- static object<Type extends Record<string, any>, Store>(a: {
485
+ }>): Value<(keyof Values & string)[]>;
486
+ /**
487
+ * @description Display a collapsable grouping of additional fields, a "sub form". The second value is the inputSpec spec for the sub form.
488
+ * @example
489
+ * ```
490
+ objectExample: Value.object(
491
+ {
492
+ // required
493
+ name: 'Object Example',
494
+
495
+ // optional
496
+ description: null,
497
+ warning: null,
498
+ },
499
+ InputSpec.of({}),
500
+ ),
501
+ * ```
502
+ */
503
+ static object<Type extends Record<string, any>>(a: {
318
504
  name: string;
319
505
  description?: string | null;
320
- }, spec: InputSpec<Type, Store>): Value<Type, Store>;
506
+ }, spec: InputSpec<Type>): Value<Type>;
507
+ /**
508
+ * @description Displays a dropdown, allowing for a single selection. Depending on the selection, a different object ("sub form") is presented.
509
+ * @example
510
+ * ```
511
+ unionExample: Value.union(
512
+ {
513
+ // required
514
+ name: 'Union Example',
515
+ default: 'option1',
516
+
517
+ // optional
518
+ description: null,
519
+ warning: null,
520
+ disabled: false,
521
+ immutable: false,
522
+ },
523
+ Variants.of({
524
+ option1: {
525
+ name: 'Option 1',
526
+ spec: InputSpec.of({}),
527
+ },
528
+ option2: {
529
+ name: 'Option 2',
530
+ spec: InputSpec.of({}),
531
+ },
532
+ }),
533
+ ),
534
+ * ```
535
+ */
321
536
  static union<VariantValues extends {
322
537
  [K in string]: {
323
538
  name: string;
324
- spec: InputSpec<any, Store> | InputSpec<any, never>;
539
+ spec: InputSpec<any>;
325
540
  };
326
- }, Store>(a: {
541
+ }>(a: {
327
542
  name: string;
328
543
  description?: string | null;
329
544
  /** Presents a warning prompt before permitting the value to change. */
330
545
  warning?: string | null;
546
+ variants: Variants<VariantValues>;
331
547
  /**
332
548
  * @description Provide a default value from the list of variants.
333
549
  * @type { string }
@@ -339,47 +555,92 @@ export declare class Value<Type, Store> {
339
555
  * @default false
340
556
  */
341
557
  immutable?: boolean;
342
- }, aVariants: Variants<VariantValues, Store>): Value<import("./variants").UnionRes<Store, VariantValues, keyof VariantValues & string>, Store>;
343
- static filteredUnion<VariantValues extends {
344
- [K in string]: {
345
- name: string;
346
- spec: InputSpec<any, Store> | InputSpec<any, never>;
347
- };
348
- }, Store>(getDisabledFn: LazyBuild<Store, string[] | false | string>, a: {
349
- name: string;
350
- description?: string | null;
351
- warning?: string | null;
352
- default: keyof VariantValues & string;
353
- }, aVariants: Variants<VariantValues, Store> | Variants<VariantValues, never>): Value<import("./variants").UnionRes<Store, VariantValues, keyof VariantValues & string> | import("./variants").UnionRes<never, VariantValues, keyof VariantValues & string>, Store>;
558
+ }): Value<UnionRes<VariantValues, keyof VariantValues & string>>;
354
559
  static dynamicUnion<VariantValues extends {
355
560
  [K in string]: {
356
561
  name: string;
357
- spec: InputSpec<any, Store> | InputSpec<any, never>;
562
+ spec: InputSpec<any>;
358
563
  };
359
- }, Store>(getA: LazyBuild<Store, {
564
+ }>(getA: LazyBuild<{
360
565
  name: string;
361
566
  description?: string | null;
362
567
  warning?: string | null;
568
+ variants: Variants<VariantValues>;
363
569
  default: keyof VariantValues & string;
364
570
  disabled: string[] | false | string;
365
- }>, aVariants: Variants<VariantValues, Store> | Variants<VariantValues, never>): Value<import("./variants").UnionRes<Store, VariantValues, keyof VariantValues & string> | import("./variants").UnionRes<never, VariantValues, keyof VariantValues & string>, Store>;
366
- static list<Type, Store>(a: List<Type, Store>): Value<Type, Store>;
367
- static hidden<T>(parser?: Parser<unknown, T>): Value<T, never>;
368
- map<U>(fn: (value: Type) => U): Value<U, Store>;
571
+ }>): Value<UnionRes<VariantValues>>;
369
572
  /**
370
- * Use this during the times that the input needs a more specific type.
371
- * Used in types that the value/ variant/ list/ inputSpec is constructed somewhere else.
372
- ```ts
373
- const a = InputSpec.text({
374
- name: "a",
375
- required: false,
376
- })
573
+ * @description Presents an interface to add/remove/edit items in a list.
574
+ * @example
575
+ * In this example, we create a list of text inputs.
576
+ *
577
+ * ```
578
+ listExampleText: Value.list(
579
+ List.text(
580
+ {
581
+ // required
582
+ name: 'Text List',
377
583
 
378
- return InputSpec.of<Store>()({
379
- myValue: a.withStore(),
380
- })
381
- ```
584
+ // optional
585
+ description: null,
586
+ warning: null,
587
+ default: [],
588
+ minLength: null,
589
+ maxLength: null,
590
+ },
591
+ {
592
+ // required
593
+ patterns: [],
594
+
595
+ // optional
596
+ placeholder: null,
597
+ generate: null,
598
+ inputmode: 'url',
599
+ masked: false,
600
+ minLength: null,
601
+ maxLength: null,
602
+ },
603
+ ),
604
+ ),
605
+ * ```
606
+ * @example
607
+ * In this example, we create a list of objects.
608
+ *
609
+ * ```
610
+ listExampleObject: Value.list(
611
+ List.obj(
612
+ {
613
+ // required
614
+ name: 'Object List',
615
+
616
+ // optional
617
+ description: null,
618
+ warning: null,
619
+ default: [],
620
+ minLength: null,
621
+ maxLength: null,
622
+ },
623
+ {
624
+ // required
625
+ spec: InputSpec.of({}),
626
+
627
+ // optional
628
+ displayAs: null,
629
+ uniqueBy: null,
630
+ },
631
+ ),
632
+ ),
633
+ * ```
634
+ */
635
+ static list<Type>(a: List<Type>): Value<Type>;
636
+ /**
637
+ * @description Provides a way to define a hidden field with a static value. Useful for tracking
638
+ * @example
639
+ * ```
640
+ hiddenExample: Value.hidden(),
641
+ * ```
382
642
  */
383
- withStore<NewStore extends Store extends never ? any : Store>(): Value<Type, NewStore>;
643
+ static hidden<T>(parser?: Parser<unknown, T>): Value<T>;
644
+ map<U>(fn: (value: Type) => U): Value<U>;
384
645
  }
385
646
  export {};