@likec4/config 1.48.0 → 1.50.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.
- package/README.md +5 -0
- package/dist/THIRD-PARTY-LICENSES.md +41 -0
- package/dist/_chunks/libs/defu.mjs +39 -0
- package/dist/_chunks/libs/remeda.mjs +32 -19
- package/dist/index.d.mts +233 -148
- package/dist/index.mjs +106 -136
- package/dist/node/index.d.mts +234 -149
- package/dist/node/index.mjs +208 -194
- package/package.json +11 -9
- package/schema.json +169 -141
- package/src/filenames.ts +33 -22
- package/src/index.ts +6 -5
- package/src/node/index.ts +1 -38
- package/src/node/load-config.ts +121 -51
- package/src/schema.image-alias.ts +10 -46
- package/src/schema.include.ts +36 -74
- package/src/schema.theme.ts +87 -83
- package/src/schema.ts +76 -35
package/dist/node/index.d.mts
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import z from "zod/v4";
|
|
2
2
|
import { LikeC4ProjectStylesConfig, LikeC4ProjectTheme, ProjectId, ThemeColorValues as ThemeColorValues$1, aux } from "@likec4/core/types";
|
|
3
3
|
import { DeploymentElementModel, DeploymentRelationModel, ElementModel, LikeC4Model, LikeC4ViewModel, RelationshipModel } from "@likec4/core/model";
|
|
4
|
-
import { SimplifyDeep } from "type-fest";
|
|
5
4
|
|
|
5
|
+
//#region src/schema.include.d.ts
|
|
6
|
+
declare const IncludeSchema: z.ZodObject<{
|
|
7
|
+
paths: z.ZodArray<z.ZodString>;
|
|
8
|
+
maxDepth: z.ZodDefault<z.ZodNumber>;
|
|
9
|
+
fileThreshold: z.ZodDefault<z.ZodNumber>;
|
|
10
|
+
}, z.core.$strict>;
|
|
11
|
+
type IncludeConfig = z.infer<typeof IncludeSchema>;
|
|
12
|
+
//#endregion
|
|
6
13
|
//#region src/schema.d.ts
|
|
7
14
|
interface VscodeURI {
|
|
8
15
|
readonly scheme: string;
|
|
@@ -13,64 +20,92 @@ interface VscodeURI {
|
|
|
13
20
|
readonly fragment: string;
|
|
14
21
|
toString(): string;
|
|
15
22
|
}
|
|
16
|
-
declare const ManualLayoutsConfigSchema: z.ZodObject<{
|
|
17
|
-
outDir: z.ZodDefault<z.ZodString>;
|
|
18
|
-
}, z.core.$strict>;
|
|
19
23
|
declare const LikeC4ProjectJsonConfigSchema: z.ZodObject<{
|
|
20
24
|
name: z.ZodString;
|
|
25
|
+
extends: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
21
26
|
title: z.ZodOptional<z.ZodString>;
|
|
22
27
|
contactPerson: z.ZodOptional<z.ZodString>;
|
|
23
|
-
|
|
24
|
-
include: z.ZodOptional<z.ZodObject<{
|
|
25
|
-
paths: z.ZodArray<z.ZodString>;
|
|
26
|
-
maxDepth: z.ZodDefault<z.ZodNumber>;
|
|
27
|
-
fileThreshold: z.ZodDefault<z.ZodNumber>;
|
|
28
|
-
}, z.core.$strict>>;
|
|
28
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
29
29
|
styles: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
30
30
|
theme: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
31
|
-
colors: z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodPipe<z.ZodUnion<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
colors: z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
32
|
+
[x: string]: any;
|
|
33
|
+
}>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>> & z.core.$partial, z.ZodPipe<z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
34
|
+
elements: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
35
|
+
fill: z.ZodString;
|
|
36
|
+
stroke: z.ZodString;
|
|
37
|
+
hiContrast: z.ZodString;
|
|
38
|
+
loContrast: z.ZodString;
|
|
37
39
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
38
|
-
fill:
|
|
39
|
-
stroke:
|
|
40
|
-
hiContrast:
|
|
41
|
-
loContrast:
|
|
42
|
-
}
|
|
43
|
-
relationships: z.
|
|
44
|
-
line: z.
|
|
45
|
-
label: z.
|
|
46
|
-
labelBg: z.ZodDefault<z.ZodOptional<z.
|
|
40
|
+
fill: string;
|
|
41
|
+
stroke: string;
|
|
42
|
+
hiContrast: string;
|
|
43
|
+
loContrast: string;
|
|
44
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
45
|
+
relationships: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
46
|
+
line: z.ZodString;
|
|
47
|
+
label: z.ZodString;
|
|
48
|
+
labelBg: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
47
49
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
48
|
-
line:
|
|
49
|
-
label:
|
|
50
|
-
labelBg:
|
|
51
|
-
}
|
|
52
|
-
}, z.core.$strict
|
|
53
|
-
|
|
50
|
+
line: string;
|
|
51
|
+
label: string;
|
|
52
|
+
labelBg: string;
|
|
53
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
54
|
+
}, z.core.$strict>, z.ZodTransform<any, {
|
|
55
|
+
elements: any;
|
|
56
|
+
relationships: any;
|
|
57
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>, z.ZodTransform<any, any>>>, z.ZodTransform<Record<ThemeColor, ThemeColorValues>, Partial<Record<any, any>>>>>;
|
|
58
|
+
sizes: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
59
|
+
[x: string]: any;
|
|
60
|
+
}> & z.core.$partial, z.ZodObject<{
|
|
61
|
+
width: z.ZodNumber;
|
|
62
|
+
height: z.ZodNumber;
|
|
63
|
+
}, z.core.$strict>>>;
|
|
54
64
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
55
65
|
colors?: Record<ThemeColor, ThemeColorValues> | undefined;
|
|
56
|
-
sizes?: any
|
|
66
|
+
sizes?: Partial<Record<any, {
|
|
67
|
+
width: number;
|
|
68
|
+
height: number;
|
|
69
|
+
}>> | undefined;
|
|
57
70
|
}>>>;
|
|
58
71
|
defaults: z.ZodOptional<z.ZodObject<{
|
|
59
|
-
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<
|
|
72
|
+
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
73
|
+
[x: string]: any;
|
|
74
|
+
}>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>>>;
|
|
60
75
|
opacity: z.ZodOptional<z.ZodInt>;
|
|
61
|
-
border: z.ZodOptional<z.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
76
|
+
border: z.ZodOptional<z.ZodEnum<{
|
|
77
|
+
[x: string]: any;
|
|
78
|
+
}>>;
|
|
79
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
80
|
+
[x: string]: any;
|
|
81
|
+
}>>;
|
|
82
|
+
shape: z.ZodOptional<z.ZodEnum<{
|
|
83
|
+
[x: string]: any;
|
|
84
|
+
}>>;
|
|
85
|
+
iconPosition: z.ZodOptional<z.ZodEnum<{
|
|
86
|
+
[x: string]: any;
|
|
87
|
+
}>>;
|
|
65
88
|
group: z.ZodOptional<z.ZodObject<{
|
|
66
|
-
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<
|
|
89
|
+
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
90
|
+
[x: string]: any;
|
|
91
|
+
}>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>>>;
|
|
67
92
|
opacity: z.ZodOptional<z.ZodInt>;
|
|
68
|
-
border: z.ZodOptional<z.
|
|
93
|
+
border: z.ZodOptional<z.ZodEnum<{
|
|
94
|
+
[x: string]: any;
|
|
95
|
+
}>>;
|
|
69
96
|
}, z.core.$strict>>;
|
|
70
97
|
relationship: z.ZodOptional<z.ZodObject<{
|
|
71
|
-
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<
|
|
72
|
-
|
|
73
|
-
|
|
98
|
+
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
99
|
+
[x: string]: any;
|
|
100
|
+
}>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>>>;
|
|
101
|
+
line: z.ZodOptional<z.ZodEnum<{
|
|
102
|
+
dashed: "dashed";
|
|
103
|
+
solid: "solid";
|
|
104
|
+
dotted: "dotted";
|
|
105
|
+
}>>;
|
|
106
|
+
arrow: z.ZodOptional<z.ZodEnum<{
|
|
107
|
+
[x: string]: any;
|
|
108
|
+
}>>;
|
|
74
109
|
}, z.core.$strict>>;
|
|
75
110
|
}, z.core.$strict>>;
|
|
76
111
|
customCss: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
@@ -96,12 +131,20 @@ declare const LikeC4ProjectJsonConfigSchema: z.ZodObject<{
|
|
|
96
131
|
} | undefined;
|
|
97
132
|
customCss?: string | string[] | undefined;
|
|
98
133
|
}>>>;
|
|
134
|
+
imageAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
135
|
+
include: z.ZodOptional<z.ZodObject<{
|
|
136
|
+
paths: z.ZodArray<z.ZodString>;
|
|
137
|
+
maxDepth: z.ZodDefault<z.ZodNumber>;
|
|
138
|
+
fileThreshold: z.ZodDefault<z.ZodNumber>;
|
|
139
|
+
}, z.core.$strict>>;
|
|
99
140
|
exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
100
141
|
manualLayouts: z.ZodOptional<z.ZodObject<{
|
|
101
142
|
outDir: z.ZodDefault<z.ZodString>;
|
|
102
143
|
}, z.core.$strict>>;
|
|
144
|
+
inferTechnologyFromIcon: z.ZodOptional<z.ZodBoolean>;
|
|
145
|
+
implicitViews: z.ZodOptional<z.ZodBoolean>;
|
|
103
146
|
}, z.core.$strip>;
|
|
104
|
-
type LikeC4ProjectJsonConfig =
|
|
147
|
+
type LikeC4ProjectJsonConfig = z.input<typeof LikeC4ProjectJsonConfigSchema>;
|
|
105
148
|
/**
|
|
106
149
|
* Result of the {@link GeneratorFnContext.locate} function
|
|
107
150
|
*/
|
|
@@ -224,128 +267,173 @@ type LikeC4ProjectConfig = z.infer<typeof LikeC4ProjectJsonConfigSchema> & {
|
|
|
224
267
|
*/
|
|
225
268
|
generators?: Record<string, GeneratorFn> | undefined;
|
|
226
269
|
};
|
|
227
|
-
type LikeC4ProjectConfigInput =
|
|
270
|
+
type LikeC4ProjectConfigInput = LikeC4ProjectJsonConfig & {
|
|
228
271
|
generators?: Record<string, GeneratorFn> | undefined;
|
|
229
|
-
}
|
|
272
|
+
};
|
|
230
273
|
/**
|
|
231
|
-
* Validates
|
|
274
|
+
* Validates Object into a LikeC4ProjectConfig object.
|
|
232
275
|
*/
|
|
233
|
-
declare function validateProjectConfig<C extends
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
maxDepth: z.ZodDefault<z.ZodNumber>;
|
|
245
|
-
fileThreshold: z.ZodDefault<z.ZodNumber>;
|
|
246
|
-
}, z.core.$strict>>;
|
|
247
|
-
type LikeC4IncludeConfig = z.infer<typeof IncludeSchema>;
|
|
248
|
-
declare function normalizeIncludeConfig(include?: LikeC4IncludeConfig): IncludeConfig;
|
|
249
|
-
declare function validateIncludePaths(include?: LikeC4IncludeConfig): void;
|
|
276
|
+
declare function validateProjectConfig<C extends Record<string, unknown>>(config: C): LikeC4ProjectConfig;
|
|
277
|
+
/**
|
|
278
|
+
* Parses JSON string into a LikeC4ProjectConfig object.
|
|
279
|
+
* Does not process "extends" - use `loadConfig` function instead
|
|
280
|
+
*/
|
|
281
|
+
declare function parseProjectConfigJSON(config: string): LikeC4ProjectConfig;
|
|
282
|
+
declare const LikeC4ProjectConfigOps: {
|
|
283
|
+
parse: typeof parseProjectConfigJSON;
|
|
284
|
+
validate: typeof validateProjectConfig;
|
|
285
|
+
normalizeInclude: (include: z.input<typeof IncludeSchema> | undefined) => IncludeConfig;
|
|
286
|
+
};
|
|
250
287
|
//#endregion
|
|
251
288
|
//#region src/schema.theme.d.ts
|
|
252
|
-
declare const ThemeColorValuesSchema: z.ZodPipe<z.ZodUnion<
|
|
253
|
-
elements: z.
|
|
254
|
-
fill: z.
|
|
255
|
-
stroke: z.
|
|
256
|
-
hiContrast: z.
|
|
257
|
-
loContrast: z.
|
|
289
|
+
declare const ThemeColorValuesSchema: z.ZodPipe<z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
290
|
+
elements: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
291
|
+
fill: z.ZodString;
|
|
292
|
+
stroke: z.ZodString;
|
|
293
|
+
hiContrast: z.ZodString;
|
|
294
|
+
loContrast: z.ZodString;
|
|
258
295
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
259
|
-
fill:
|
|
260
|
-
stroke:
|
|
261
|
-
hiContrast:
|
|
262
|
-
loContrast:
|
|
263
|
-
}
|
|
264
|
-
relationships: z.
|
|
265
|
-
line: z.
|
|
266
|
-
label: z.
|
|
267
|
-
labelBg: z.ZodDefault<z.ZodOptional<z.
|
|
296
|
+
fill: string;
|
|
297
|
+
stroke: string;
|
|
298
|
+
hiContrast: string;
|
|
299
|
+
loContrast: string;
|
|
300
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
301
|
+
relationships: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
302
|
+
line: z.ZodString;
|
|
303
|
+
label: z.ZodString;
|
|
304
|
+
labelBg: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
268
305
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
269
|
-
line:
|
|
270
|
-
label:
|
|
271
|
-
labelBg:
|
|
272
|
-
}
|
|
273
|
-
}, z.core.$strict
|
|
306
|
+
line: string;
|
|
307
|
+
label: string;
|
|
308
|
+
labelBg: string;
|
|
309
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
310
|
+
}, z.core.$strict>, z.ZodTransform<any, {
|
|
311
|
+
elements: any;
|
|
312
|
+
relationships: any;
|
|
313
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>, z.ZodTransform<any, any>>;
|
|
274
314
|
type ThemeColorValuesInput = z.input<typeof ThemeColorValuesSchema>;
|
|
275
315
|
declare const LikeC4Config_Styles_Theme: z.ZodPipe<z.ZodObject<{
|
|
276
|
-
colors: z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodPipe<z.ZodUnion<
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
316
|
+
colors: z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
317
|
+
[x: string]: any;
|
|
318
|
+
}>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>> & z.core.$partial, z.ZodPipe<z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
319
|
+
elements: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
320
|
+
fill: z.ZodString;
|
|
321
|
+
stroke: z.ZodString;
|
|
322
|
+
hiContrast: z.ZodString;
|
|
323
|
+
loContrast: z.ZodString;
|
|
282
324
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
283
|
-
fill:
|
|
284
|
-
stroke:
|
|
285
|
-
hiContrast:
|
|
286
|
-
loContrast:
|
|
287
|
-
}
|
|
288
|
-
relationships: z.
|
|
289
|
-
line: z.
|
|
290
|
-
label: z.
|
|
291
|
-
labelBg: z.ZodDefault<z.ZodOptional<z.
|
|
325
|
+
fill: string;
|
|
326
|
+
stroke: string;
|
|
327
|
+
hiContrast: string;
|
|
328
|
+
loContrast: string;
|
|
329
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
330
|
+
relationships: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
331
|
+
line: z.ZodString;
|
|
332
|
+
label: z.ZodString;
|
|
333
|
+
labelBg: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
292
334
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
293
|
-
line:
|
|
294
|
-
label:
|
|
295
|
-
labelBg:
|
|
296
|
-
}
|
|
297
|
-
}, z.core.$strict
|
|
298
|
-
|
|
335
|
+
line: string;
|
|
336
|
+
label: string;
|
|
337
|
+
labelBg: string;
|
|
338
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
339
|
+
}, z.core.$strict>, z.ZodTransform<any, {
|
|
340
|
+
elements: any;
|
|
341
|
+
relationships: any;
|
|
342
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>, z.ZodTransform<any, any>>>, z.ZodTransform<Record<ThemeColor, ThemeColorValues>, Partial<Record<any, any>>>>>;
|
|
343
|
+
sizes: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
344
|
+
[x: string]: any;
|
|
345
|
+
}> & z.core.$partial, z.ZodObject<{
|
|
346
|
+
width: z.ZodNumber;
|
|
347
|
+
height: z.ZodNumber;
|
|
348
|
+
}, z.core.$strict>>>;
|
|
299
349
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
300
350
|
colors?: Record<ThemeColor, ThemeColorValues> | undefined;
|
|
301
|
-
sizes?: any
|
|
351
|
+
sizes?: Partial<Record<any, {
|
|
352
|
+
width: number;
|
|
353
|
+
height: number;
|
|
354
|
+
}>> | undefined;
|
|
302
355
|
}>>;
|
|
303
356
|
type LikeC4ConfigThemeInput = z.input<typeof LikeC4Config_Styles_Theme>;
|
|
304
357
|
declare const LikeC4StylesConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
305
358
|
theme: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
306
|
-
colors: z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodPipe<z.ZodUnion<
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
359
|
+
colors: z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
360
|
+
[x: string]: any;
|
|
361
|
+
}>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>> & z.core.$partial, z.ZodPipe<z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
362
|
+
elements: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
363
|
+
fill: z.ZodString;
|
|
364
|
+
stroke: z.ZodString;
|
|
365
|
+
hiContrast: z.ZodString;
|
|
366
|
+
loContrast: z.ZodString;
|
|
312
367
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
313
|
-
fill:
|
|
314
|
-
stroke:
|
|
315
|
-
hiContrast:
|
|
316
|
-
loContrast:
|
|
317
|
-
}
|
|
318
|
-
relationships: z.
|
|
319
|
-
line: z.
|
|
320
|
-
label: z.
|
|
321
|
-
labelBg: z.ZodDefault<z.ZodOptional<z.
|
|
368
|
+
fill: string;
|
|
369
|
+
stroke: string;
|
|
370
|
+
hiContrast: string;
|
|
371
|
+
loContrast: string;
|
|
372
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
373
|
+
relationships: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
374
|
+
line: z.ZodString;
|
|
375
|
+
label: z.ZodString;
|
|
376
|
+
labelBg: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
322
377
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
323
|
-
line:
|
|
324
|
-
label:
|
|
325
|
-
labelBg:
|
|
326
|
-
}
|
|
327
|
-
}, z.core.$strict
|
|
328
|
-
|
|
378
|
+
line: string;
|
|
379
|
+
label: string;
|
|
380
|
+
labelBg: string;
|
|
381
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
382
|
+
}, z.core.$strict>, z.ZodTransform<any, {
|
|
383
|
+
elements: any;
|
|
384
|
+
relationships: any;
|
|
385
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>, z.ZodTransform<any, any>>>, z.ZodTransform<Record<ThemeColor, ThemeColorValues>, Partial<Record<any, any>>>>>;
|
|
386
|
+
sizes: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
387
|
+
[x: string]: any;
|
|
388
|
+
}> & z.core.$partial, z.ZodObject<{
|
|
389
|
+
width: z.ZodNumber;
|
|
390
|
+
height: z.ZodNumber;
|
|
391
|
+
}, z.core.$strict>>>;
|
|
329
392
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
330
393
|
colors?: Record<ThemeColor, ThemeColorValues> | undefined;
|
|
331
|
-
sizes?: any
|
|
394
|
+
sizes?: Partial<Record<any, {
|
|
395
|
+
width: number;
|
|
396
|
+
height: number;
|
|
397
|
+
}>> | undefined;
|
|
332
398
|
}>>>;
|
|
333
399
|
defaults: z.ZodOptional<z.ZodObject<{
|
|
334
|
-
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<
|
|
400
|
+
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
401
|
+
[x: string]: any;
|
|
402
|
+
}>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>>>;
|
|
335
403
|
opacity: z.ZodOptional<z.ZodInt>;
|
|
336
|
-
border: z.ZodOptional<z.
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
404
|
+
border: z.ZodOptional<z.ZodEnum<{
|
|
405
|
+
[x: string]: any;
|
|
406
|
+
}>>;
|
|
407
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
408
|
+
[x: string]: any;
|
|
409
|
+
}>>;
|
|
410
|
+
shape: z.ZodOptional<z.ZodEnum<{
|
|
411
|
+
[x: string]: any;
|
|
412
|
+
}>>;
|
|
413
|
+
iconPosition: z.ZodOptional<z.ZodEnum<{
|
|
414
|
+
[x: string]: any;
|
|
415
|
+
}>>;
|
|
340
416
|
group: z.ZodOptional<z.ZodObject<{
|
|
341
|
-
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<
|
|
417
|
+
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
418
|
+
[x: string]: any;
|
|
419
|
+
}>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>>>;
|
|
342
420
|
opacity: z.ZodOptional<z.ZodInt>;
|
|
343
|
-
border: z.ZodOptional<z.
|
|
421
|
+
border: z.ZodOptional<z.ZodEnum<{
|
|
422
|
+
[x: string]: any;
|
|
423
|
+
}>>;
|
|
344
424
|
}, z.core.$strict>>;
|
|
345
425
|
relationship: z.ZodOptional<z.ZodObject<{
|
|
346
|
-
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<
|
|
347
|
-
|
|
348
|
-
|
|
426
|
+
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
427
|
+
[x: string]: any;
|
|
428
|
+
}>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>>>;
|
|
429
|
+
line: z.ZodOptional<z.ZodEnum<{
|
|
430
|
+
dashed: "dashed";
|
|
431
|
+
solid: "solid";
|
|
432
|
+
dotted: "dotted";
|
|
433
|
+
}>>;
|
|
434
|
+
arrow: z.ZodOptional<z.ZodEnum<{
|
|
435
|
+
[x: string]: any;
|
|
436
|
+
}>>;
|
|
349
437
|
}, z.core.$strict>>;
|
|
350
438
|
}, z.core.$strict>>;
|
|
351
439
|
customCss: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
@@ -375,21 +463,18 @@ interface LikeC4StylesConfig extends z.infer<typeof LikeC4StylesConfigSchema> {}
|
|
|
375
463
|
type LikeC4StylesConfigInput = z.input<typeof LikeC4StylesConfigSchema>;
|
|
376
464
|
//#endregion
|
|
377
465
|
//#region src/filenames.d.ts
|
|
378
|
-
|
|
379
|
-
declare const configNonJsonFilenames: readonly ["likec4.config.js", "likec4.config.cjs", "likec4.config.mjs", "likec4.config.ts", "likec4.config.cts", "likec4.config.mts"];
|
|
466
|
+
/** All known LikeC4 config filenames (JSON and non-JSON). */
|
|
380
467
|
declare const ConfigFilenames: readonly [".likec4rc", ".likec4.config.json", "likec4.config.json", "likec4.config.js", "likec4.config.cjs", "likec4.config.mjs", "likec4.config.ts", "likec4.config.cts", "likec4.config.mts"];
|
|
468
|
+
/** Returns true if the **basename** of the given path matches a known config filename. */
|
|
469
|
+
declare function isLikeC4JsonConfig(filename: string): boolean;
|
|
381
470
|
/**
|
|
382
|
-
*
|
|
383
|
-
*/
|
|
384
|
-
declare function isLikeC4JsonConfig(filename: string): filename is typeof configJsonFilenames[number];
|
|
385
|
-
/**
|
|
386
|
-
* Checks if the given filename is a LikeC4 non-JSON config file (JS, MJS, TS, MTS)
|
|
471
|
+
* Returns true if the **basename** of the given path matches a known non-JSON config filename (JS, MJS, TS, MTS).
|
|
387
472
|
*/
|
|
388
|
-
declare function isLikeC4NonJsonConfig(filename: string):
|
|
473
|
+
declare function isLikeC4NonJsonConfig(filename: string): boolean;
|
|
389
474
|
/**
|
|
390
|
-
*
|
|
475
|
+
* Returns true if the **basename** of the given path matches a known LikeC4 config file (JSON or non-JSON).
|
|
391
476
|
*/
|
|
392
|
-
declare function isLikeC4Config(filename: string):
|
|
477
|
+
declare function isLikeC4Config(filename: string): boolean;
|
|
393
478
|
//#endregion
|
|
394
479
|
//#region src/define-config.d.ts
|
|
395
480
|
/**
|
|
@@ -504,6 +589,6 @@ declare function defineStyle<const S extends LikeC4StylesConfigInput>(styles: S)
|
|
|
504
589
|
* Load LikeC4 Project config file.
|
|
505
590
|
* If filepath is a non-JSON file, it will be bundled and required
|
|
506
591
|
*/
|
|
507
|
-
declare function loadConfig(filepath: VscodeURI): Promise<LikeC4ProjectConfig>;
|
|
592
|
+
declare function loadConfig(filepath: VscodeURI | string): Promise<LikeC4ProjectConfig>;
|
|
508
593
|
//#endregion
|
|
509
|
-
export { ConfigFilenames, type GeneratorFn, type GeneratorFnContext, type GeneratorFnParams, type IncludeConfig, type LikeC4ProjectConfig, type LikeC4ProjectConfigInput, type LikeC4ProjectJsonConfig, type LikeC4StylesConfig, type LikeC4StylesConfigInput, type LocateResult, type
|
|
594
|
+
export { ConfigFilenames, type GeneratorFn, type GeneratorFnContext, type GeneratorFnParams, type IncludeConfig, type LikeC4ConfigThemeInput, type LikeC4ProjectConfig, type LikeC4ProjectConfigInput, LikeC4ProjectConfigOps, type LikeC4ProjectJsonConfig, type LikeC4StylesConfig, type LikeC4StylesConfigInput, type LocateResult, type ThemeColorValuesInput, defineConfig, defineGenerators, defineStyle, defineTheme, defineThemeColor, isLikeC4Config, isLikeC4JsonConfig, isLikeC4NonJsonConfig, loadConfig };
|