@tutorialkit-rb/types 0.1.4

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.
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ import { baseSchema } from './common.js';
3
+ export const lessonSchema = baseSchema.extend({
4
+ type: z.literal('lesson'),
5
+ scope: z.string().optional().describe('A prefix that all file paths must match to be visible in the file tree.'),
6
+ hideRoot: z
7
+ .boolean()
8
+ .optional()
9
+ .describe('If set to false, `/` is shown at the top of the file tree. Defaults to true.'),
10
+ });
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ export declare const metaTagsSchema: z.ZodObject<{
3
+ image: z.ZodOptional<z.ZodString>;
4
+ description: z.ZodOptional<z.ZodString>;
5
+ title: z.ZodOptional<z.ZodString>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ image?: string | undefined;
8
+ description?: string | undefined;
9
+ title?: string | undefined;
10
+ }, {
11
+ image?: string | undefined;
12
+ description?: string | undefined;
13
+ title?: string | undefined;
14
+ }>;
15
+ export type MetaTagsSchema = z.infer<typeof metaTagsSchema>;
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export const metaTagsSchema = z.object({
3
+ image: z
4
+ .string()
5
+ .optional()
6
+ /**
7
+ * Ideally we would want to use `image` from:
8
+ * https://docs.astro.build/en/guides/images/#images-in-content-collections .
9
+ */
10
+ .describe('Image to show on social previews. A relative path is resolved to the public folder.'),
11
+ description: z.string().optional().describe('A description for metadata'),
12
+ title: z.string().optional().describe('A title to use specifically for metadata'),
13
+ });
@@ -0,0 +1,382 @@
1
+ import { z } from 'zod';
2
+ export declare const partSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
3
+ mainCommand: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>, z.ZodObject<{
4
+ command: z.ZodString;
5
+ title: z.ZodString;
6
+ }, "strict", z.ZodTypeAny, {
7
+ title: string;
8
+ command: string;
9
+ }, {
10
+ title: string;
11
+ command: string;
12
+ }>]>>;
13
+ prepareCommands: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>, z.ZodObject<{
14
+ command: z.ZodString;
15
+ title: z.ZodString;
16
+ }, "strict", z.ZodTypeAny, {
17
+ title: string;
18
+ command: string;
19
+ }, {
20
+ title: string;
21
+ command: string;
22
+ }>]>, "many">>;
23
+ }, {
24
+ meta: z.ZodOptional<z.ZodObject<{
25
+ image: z.ZodOptional<z.ZodString>;
26
+ description: z.ZodOptional<z.ZodString>;
27
+ title: z.ZodOptional<z.ZodString>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ image?: string | undefined;
30
+ description?: string | undefined;
31
+ title?: string | undefined;
32
+ }, {
33
+ image?: string | undefined;
34
+ description?: string | undefined;
35
+ title?: string | undefined;
36
+ }>>;
37
+ custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
38
+ previews: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodString], null>, z.ZodTuple<[z.ZodNumber, z.ZodString, z.ZodString], null>, z.ZodObject<{
39
+ port: z.ZodNumber;
40
+ title: z.ZodString;
41
+ pathname: z.ZodOptional<z.ZodString>;
42
+ }, "strict", z.ZodTypeAny, {
43
+ title: string;
44
+ port: number;
45
+ pathname?: string | undefined;
46
+ }, {
47
+ title: string;
48
+ port: number;
49
+ pathname?: string | undefined;
50
+ }>]>, "many">]>>;
51
+ autoReload: z.ZodOptional<z.ZodBoolean>;
52
+ filesystem: z.ZodOptional<z.ZodObject<{
53
+ watch: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodString, "many">]>>;
54
+ }, "strip", z.ZodTypeAny, {
55
+ watch?: boolean | string[] | undefined;
56
+ }, {
57
+ watch?: boolean | string[] | undefined;
58
+ }>>;
59
+ template: z.ZodOptional<z.ZodString>;
60
+ terminal: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
61
+ open: z.ZodOptional<z.ZodBoolean>;
62
+ panels: z.ZodUnion<[z.ZodLiteral<"output">, z.ZodLiteral<"terminal">, z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"output">, z.ZodLiteral<"terminal">]>, z.ZodTuple<[z.ZodUnion<[z.ZodLiteral<"output">, z.ZodLiteral<"terminal">]>, z.ZodString], null>, z.ZodObject<{
63
+ type: z.ZodUnion<[z.ZodLiteral<"output">, z.ZodLiteral<"terminal">]>;
64
+ id: z.ZodOptional<z.ZodString>;
65
+ title: z.ZodOptional<z.ZodString>;
66
+ allowRedirects: z.ZodOptional<z.ZodBoolean>;
67
+ allowCommands: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
68
+ }, "strict", z.ZodTypeAny, {
69
+ type: "output" | "terminal";
70
+ title?: string | undefined;
71
+ id?: string | undefined;
72
+ allowRedirects?: boolean | undefined;
73
+ allowCommands?: string[] | undefined;
74
+ }, {
75
+ type: "output" | "terminal";
76
+ title?: string | undefined;
77
+ id?: string | undefined;
78
+ allowRedirects?: boolean | undefined;
79
+ allowCommands?: string[] | undefined;
80
+ }>]>, "many">, ("output" | "terminal" | ["output" | "terminal", string] | {
81
+ type: "output" | "terminal";
82
+ title?: string | undefined;
83
+ id?: string | undefined;
84
+ allowRedirects?: boolean | undefined;
85
+ allowCommands?: string[] | undefined;
86
+ })[], ("output" | "terminal" | ["output" | "terminal", string] | {
87
+ type: "output" | "terminal";
88
+ title?: string | undefined;
89
+ id?: string | undefined;
90
+ allowRedirects?: boolean | undefined;
91
+ allowCommands?: string[] | undefined;
92
+ })[]>]>;
93
+ activePanel: z.ZodOptional<z.ZodNumber>;
94
+ allowRedirects: z.ZodOptional<z.ZodBoolean>;
95
+ allowCommands: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
96
+ }, "strict", z.ZodTypeAny, {
97
+ panels: "output" | "terminal" | ("output" | "terminal" | ["output" | "terminal", string] | {
98
+ type: "output" | "terminal";
99
+ title?: string | undefined;
100
+ id?: string | undefined;
101
+ allowRedirects?: boolean | undefined;
102
+ allowCommands?: string[] | undefined;
103
+ })[];
104
+ open?: boolean | undefined;
105
+ allowRedirects?: boolean | undefined;
106
+ allowCommands?: string[] | undefined;
107
+ activePanel?: number | undefined;
108
+ }, {
109
+ panels: "output" | "terminal" | ("output" | "terminal" | ["output" | "terminal", string] | {
110
+ type: "output" | "terminal";
111
+ title?: string | undefined;
112
+ id?: string | undefined;
113
+ allowRedirects?: boolean | undefined;
114
+ allowCommands?: string[] | undefined;
115
+ })[];
116
+ open?: boolean | undefined;
117
+ allowRedirects?: boolean | undefined;
118
+ allowCommands?: string[] | undefined;
119
+ activePanel?: number | undefined;
120
+ }>]>>;
121
+ focus: z.ZodOptional<z.ZodString>;
122
+ editor: z.ZodOptional<z.ZodUnion<[z.ZodOptional<z.ZodBoolean>, z.ZodObject<{
123
+ fileTree: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
124
+ allowEdits: z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString, "many">]>;
125
+ }, "strict", z.ZodTypeAny, {
126
+ allowEdits: string | boolean | string[];
127
+ }, {
128
+ allowEdits: string | boolean | string[];
129
+ }>]>>;
130
+ }, "strict", z.ZodTypeAny, {
131
+ fileTree?: boolean | {
132
+ allowEdits: string | boolean | string[];
133
+ } | undefined;
134
+ }, {
135
+ fileTree?: boolean | {
136
+ allowEdits: string | boolean | string[];
137
+ } | undefined;
138
+ }>]>>;
139
+ i18n: z.ZodOptional<z.ZodObject<{
140
+ partTemplate: z.ZodOptional<z.ZodString>;
141
+ editPageText: z.ZodOptional<z.ZodString>;
142
+ webcontainerLinkText: z.ZodOptional<z.ZodString>;
143
+ startWebContainerText: z.ZodOptional<z.ZodString>;
144
+ noPreviewNorStepsText: z.ZodOptional<z.ZodString>;
145
+ filesTitleText: z.ZodOptional<z.ZodString>;
146
+ fileTreeCreateFileText: z.ZodOptional<z.ZodString>;
147
+ fileTreeCreateFolderText: z.ZodOptional<z.ZodString>;
148
+ fileTreeActionNotAllowedText: z.ZodOptional<z.ZodString>;
149
+ fileTreeFileExistsAlreadyText: z.ZodOptional<z.ZodString>;
150
+ fileTreeAllowedPatternsText: z.ZodOptional<z.ZodString>;
151
+ confirmationText: z.ZodOptional<z.ZodString>;
152
+ prepareEnvironmentTitleText: z.ZodOptional<z.ZodString>;
153
+ defaultPreviewTitleText: z.ZodOptional<z.ZodString>;
154
+ reloadPreviewTitle: z.ZodOptional<z.ZodString>;
155
+ toggleTerminalButtonText: z.ZodOptional<z.ZodString>;
156
+ solveButtonText: z.ZodOptional<z.ZodString>;
157
+ resetButtonText: z.ZodOptional<z.ZodString>;
158
+ }, "strip", z.ZodTypeAny, {
159
+ partTemplate?: string | undefined;
160
+ editPageText?: string | undefined;
161
+ webcontainerLinkText?: string | undefined;
162
+ startWebContainerText?: string | undefined;
163
+ noPreviewNorStepsText?: string | undefined;
164
+ filesTitleText?: string | undefined;
165
+ fileTreeCreateFileText?: string | undefined;
166
+ fileTreeCreateFolderText?: string | undefined;
167
+ fileTreeActionNotAllowedText?: string | undefined;
168
+ fileTreeFileExistsAlreadyText?: string | undefined;
169
+ fileTreeAllowedPatternsText?: string | undefined;
170
+ confirmationText?: string | undefined;
171
+ prepareEnvironmentTitleText?: string | undefined;
172
+ defaultPreviewTitleText?: string | undefined;
173
+ reloadPreviewTitle?: string | undefined;
174
+ toggleTerminalButtonText?: string | undefined;
175
+ solveButtonText?: string | undefined;
176
+ resetButtonText?: string | undefined;
177
+ }, {
178
+ partTemplate?: string | undefined;
179
+ editPageText?: string | undefined;
180
+ webcontainerLinkText?: string | undefined;
181
+ startWebContainerText?: string | undefined;
182
+ noPreviewNorStepsText?: string | undefined;
183
+ filesTitleText?: string | undefined;
184
+ fileTreeCreateFileText?: string | undefined;
185
+ fileTreeCreateFolderText?: string | undefined;
186
+ fileTreeActionNotAllowedText?: string | undefined;
187
+ fileTreeFileExistsAlreadyText?: string | undefined;
188
+ fileTreeAllowedPatternsText?: string | undefined;
189
+ confirmationText?: string | undefined;
190
+ prepareEnvironmentTitleText?: string | undefined;
191
+ defaultPreviewTitleText?: string | undefined;
192
+ reloadPreviewTitle?: string | undefined;
193
+ toggleTerminalButtonText?: string | undefined;
194
+ solveButtonText?: string | undefined;
195
+ resetButtonText?: string | undefined;
196
+ }>>;
197
+ editPageLink: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
198
+ openInStackBlitz: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
199
+ projectTitle: z.ZodOptional<z.ZodString>;
200
+ projectDescription: z.ZodOptional<z.ZodString>;
201
+ projectTemplate: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"html">, z.ZodLiteral<"node">, z.ZodLiteral<"angular-cli">, z.ZodLiteral<"create-react-app">, z.ZodLiteral<"javascript">, z.ZodLiteral<"polymer">, z.ZodLiteral<"typescript">, z.ZodLiteral<"vue">]>>;
202
+ }, "strict", z.ZodTypeAny, {
203
+ projectTitle?: string | undefined;
204
+ projectDescription?: string | undefined;
205
+ projectTemplate?: "html" | "node" | "angular-cli" | "create-react-app" | "javascript" | "polymer" | "typescript" | "vue" | undefined;
206
+ }, {
207
+ projectTitle?: string | undefined;
208
+ projectDescription?: string | undefined;
209
+ projectTemplate?: "html" | "node" | "angular-cli" | "create-react-app" | "javascript" | "polymer" | "typescript" | "vue" | undefined;
210
+ }>]>>;
211
+ downloadAsZip: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
212
+ filename: z.ZodString;
213
+ }, "strict", z.ZodTypeAny, {
214
+ filename: string;
215
+ }, {
216
+ filename: string;
217
+ }>]>>;
218
+ }>, {
219
+ title: z.ZodString;
220
+ slug: z.ZodOptional<z.ZodString>;
221
+ }>, {
222
+ type: z.ZodLiteral<"part">;
223
+ chapters: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
224
+ lessons: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
225
+ }>, "strip", z.ZodTypeAny, {
226
+ type: "part";
227
+ title: string;
228
+ custom?: Record<string, any> | undefined;
229
+ mainCommand?: string | [string, string] | {
230
+ title: string;
231
+ command: string;
232
+ } | undefined;
233
+ prepareCommands?: (string | [string, string] | {
234
+ title: string;
235
+ command: string;
236
+ })[] | undefined;
237
+ terminal?: boolean | {
238
+ panels: "output" | "terminal" | ("output" | "terminal" | ["output" | "terminal", string] | {
239
+ type: "output" | "terminal";
240
+ title?: string | undefined;
241
+ id?: string | undefined;
242
+ allowRedirects?: boolean | undefined;
243
+ allowCommands?: string[] | undefined;
244
+ })[];
245
+ open?: boolean | undefined;
246
+ allowRedirects?: boolean | undefined;
247
+ allowCommands?: string[] | undefined;
248
+ activePanel?: number | undefined;
249
+ } | undefined;
250
+ meta?: {
251
+ image?: string | undefined;
252
+ description?: string | undefined;
253
+ title?: string | undefined;
254
+ } | undefined;
255
+ previews?: boolean | (string | number | [number, string] | [number, string, string] | {
256
+ title: string;
257
+ port: number;
258
+ pathname?: string | undefined;
259
+ })[] | undefined;
260
+ autoReload?: boolean | undefined;
261
+ filesystem?: {
262
+ watch?: boolean | string[] | undefined;
263
+ } | undefined;
264
+ template?: string | undefined;
265
+ focus?: string | undefined;
266
+ editor?: boolean | {
267
+ fileTree?: boolean | {
268
+ allowEdits: string | boolean | string[];
269
+ } | undefined;
270
+ } | undefined;
271
+ i18n?: {
272
+ partTemplate?: string | undefined;
273
+ editPageText?: string | undefined;
274
+ webcontainerLinkText?: string | undefined;
275
+ startWebContainerText?: string | undefined;
276
+ noPreviewNorStepsText?: string | undefined;
277
+ filesTitleText?: string | undefined;
278
+ fileTreeCreateFileText?: string | undefined;
279
+ fileTreeCreateFolderText?: string | undefined;
280
+ fileTreeActionNotAllowedText?: string | undefined;
281
+ fileTreeFileExistsAlreadyText?: string | undefined;
282
+ fileTreeAllowedPatternsText?: string | undefined;
283
+ confirmationText?: string | undefined;
284
+ prepareEnvironmentTitleText?: string | undefined;
285
+ defaultPreviewTitleText?: string | undefined;
286
+ reloadPreviewTitle?: string | undefined;
287
+ toggleTerminalButtonText?: string | undefined;
288
+ solveButtonText?: string | undefined;
289
+ resetButtonText?: string | undefined;
290
+ } | undefined;
291
+ editPageLink?: string | boolean | undefined;
292
+ openInStackBlitz?: boolean | {
293
+ projectTitle?: string | undefined;
294
+ projectDescription?: string | undefined;
295
+ projectTemplate?: "html" | "node" | "angular-cli" | "create-react-app" | "javascript" | "polymer" | "typescript" | "vue" | undefined;
296
+ } | undefined;
297
+ downloadAsZip?: boolean | {
298
+ filename: string;
299
+ } | undefined;
300
+ slug?: string | undefined;
301
+ lessons?: string[] | undefined;
302
+ chapters?: string[] | undefined;
303
+ }, {
304
+ type: "part";
305
+ title: string;
306
+ custom?: Record<string, any> | undefined;
307
+ mainCommand?: string | [string, string] | {
308
+ title: string;
309
+ command: string;
310
+ } | undefined;
311
+ prepareCommands?: (string | [string, string] | {
312
+ title: string;
313
+ command: string;
314
+ })[] | undefined;
315
+ terminal?: boolean | {
316
+ panels: "output" | "terminal" | ("output" | "terminal" | ["output" | "terminal", string] | {
317
+ type: "output" | "terminal";
318
+ title?: string | undefined;
319
+ id?: string | undefined;
320
+ allowRedirects?: boolean | undefined;
321
+ allowCommands?: string[] | undefined;
322
+ })[];
323
+ open?: boolean | undefined;
324
+ allowRedirects?: boolean | undefined;
325
+ allowCommands?: string[] | undefined;
326
+ activePanel?: number | undefined;
327
+ } | undefined;
328
+ meta?: {
329
+ image?: string | undefined;
330
+ description?: string | undefined;
331
+ title?: string | undefined;
332
+ } | undefined;
333
+ previews?: boolean | (string | number | [number, string] | [number, string, string] | {
334
+ title: string;
335
+ port: number;
336
+ pathname?: string | undefined;
337
+ })[] | undefined;
338
+ autoReload?: boolean | undefined;
339
+ filesystem?: {
340
+ watch?: boolean | string[] | undefined;
341
+ } | undefined;
342
+ template?: string | undefined;
343
+ focus?: string | undefined;
344
+ editor?: boolean | {
345
+ fileTree?: boolean | {
346
+ allowEdits: string | boolean | string[];
347
+ } | undefined;
348
+ } | undefined;
349
+ i18n?: {
350
+ partTemplate?: string | undefined;
351
+ editPageText?: string | undefined;
352
+ webcontainerLinkText?: string | undefined;
353
+ startWebContainerText?: string | undefined;
354
+ noPreviewNorStepsText?: string | undefined;
355
+ filesTitleText?: string | undefined;
356
+ fileTreeCreateFileText?: string | undefined;
357
+ fileTreeCreateFolderText?: string | undefined;
358
+ fileTreeActionNotAllowedText?: string | undefined;
359
+ fileTreeFileExistsAlreadyText?: string | undefined;
360
+ fileTreeAllowedPatternsText?: string | undefined;
361
+ confirmationText?: string | undefined;
362
+ prepareEnvironmentTitleText?: string | undefined;
363
+ defaultPreviewTitleText?: string | undefined;
364
+ reloadPreviewTitle?: string | undefined;
365
+ toggleTerminalButtonText?: string | undefined;
366
+ solveButtonText?: string | undefined;
367
+ resetButtonText?: string | undefined;
368
+ } | undefined;
369
+ editPageLink?: string | boolean | undefined;
370
+ openInStackBlitz?: boolean | {
371
+ projectTitle?: string | undefined;
372
+ projectDescription?: string | undefined;
373
+ projectTemplate?: "html" | "node" | "angular-cli" | "create-react-app" | "javascript" | "polymer" | "typescript" | "vue" | undefined;
374
+ } | undefined;
375
+ downloadAsZip?: boolean | {
376
+ filename: string;
377
+ } | undefined;
378
+ slug?: string | undefined;
379
+ lessons?: string[] | undefined;
380
+ chapters?: string[] | undefined;
381
+ }>;
382
+ export type PartSchema = z.infer<typeof partSchema>;
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ import { baseSchema } from './common.js';
3
+ export const partSchema = baseSchema.extend({
4
+ type: z.literal('part'),
5
+ chapters: z
6
+ .array(z.string())
7
+ .optional()
8
+ .describe('The list of chapters in this part. The order of this array defines the order of the chapters. If not specified a folder-based numbering system is used instead.'),
9
+ lessons: z
10
+ .array(z.string())
11
+ .optional()
12
+ .describe('The list of lessons in this part. The order of this array defines the order of the lessons. If not specified a folder-based numbering system is used instead.'),
13
+ });