@likec4/config 1.47.0 → 1.49.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.
@@ -1,17 +1,594 @@
1
- import { URI } from 'vscode-uri';
2
- import { LikeC4ProjectConfig } from '../index.mjs';
3
- export { ConfigFilenames, GeneratorFn, GeneratorFnContext, GeneratorFnParams, IncludeConfig, LikeC4ProjectConfigInput, LikeC4ProjectJsonConfig, LikeC4StylesConfig, LikeC4StylesConfigInput, LocateResult, ManualLayoutsConfigSchema, defineConfig, defineGenerators, defineStyle, defineTheme, defineThemeColor, isLikeC4Config, isLikeC4JsonConfig, isLikeC4NonJsonConfig, normalizeIncludeConfig, validateIncludePaths, validateProjectConfig } from '../index.mjs';
4
- import '@likec4/core';
5
- import '@likec4/core/model';
6
- import '@likec4/core/types';
7
- import 'type-fest';
8
- import 'zod';
9
- import '@likec4/core/styles';
1
+ import z from "zod/v4";
2
+ import { LikeC4ProjectStylesConfig, LikeC4ProjectTheme, ProjectId, ThemeColorValues as ThemeColorValues$1, aux } from "@likec4/core/types";
3
+ import { DeploymentElementModel, DeploymentRelationModel, ElementModel, LikeC4Model, LikeC4ViewModel, RelationshipModel } from "@likec4/core/model";
10
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
13
+ //#region src/schema.d.ts
14
+ interface VscodeURI {
15
+ readonly scheme: string;
16
+ readonly authority: string;
17
+ readonly path: string;
18
+ readonly fsPath: string;
19
+ readonly query: string;
20
+ readonly fragment: string;
21
+ toString(): string;
22
+ }
23
+ declare const LikeC4ProjectJsonConfigSchema: z.ZodObject<{
24
+ name: z.ZodString;
25
+ extends: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
26
+ title: z.ZodOptional<z.ZodString>;
27
+ contactPerson: z.ZodOptional<z.ZodString>;
28
+ styles: z.ZodOptional<z.ZodPipe<z.ZodObject<{
29
+ theme: z.ZodOptional<z.ZodPipe<z.ZodObject<{
30
+ colors: z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
31
+ [x: string]: any;
32
+ }>, 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<{
33
+ elements: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
34
+ fill: z.ZodString;
35
+ stroke: z.ZodString;
36
+ hiContrast: z.ZodString;
37
+ loContrast: z.ZodString;
38
+ }, z.core.$strict>, z.ZodTransform<any, {
39
+ fill: string;
40
+ stroke: string;
41
+ hiContrast: string;
42
+ loContrast: string;
43
+ }>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
44
+ relationships: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
45
+ line: z.ZodString;
46
+ label: z.ZodString;
47
+ labelBg: z.ZodDefault<z.ZodOptional<z.ZodString>>;
48
+ }, z.core.$strict>, z.ZodTransform<any, {
49
+ line: string;
50
+ label: string;
51
+ labelBg: string;
52
+ }>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
53
+ }, z.core.$strict>, z.ZodTransform<any, {
54
+ elements: any;
55
+ relationships: any;
56
+ }>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>, z.ZodTransform<any, any>>>, z.ZodTransform<Record<ThemeColor, ThemeColorValues>, Partial<Record<any, any>>>>>;
57
+ sizes: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
58
+ [x: string]: any;
59
+ }> & z.core.$partial, z.ZodObject<{
60
+ width: z.ZodNumber;
61
+ height: z.ZodNumber;
62
+ }, z.core.$strict>>>;
63
+ }, z.core.$strict>, z.ZodTransform<any, {
64
+ colors?: Record<ThemeColor, ThemeColorValues> | undefined;
65
+ sizes?: Partial<Record<any, {
66
+ width: number;
67
+ height: number;
68
+ }>> | undefined;
69
+ }>>>;
70
+ defaults: z.ZodOptional<z.ZodObject<{
71
+ color: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
72
+ [x: string]: any;
73
+ }>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>>>;
74
+ opacity: z.ZodOptional<z.ZodInt>;
75
+ border: z.ZodOptional<z.ZodEnum<{
76
+ [x: string]: any;
77
+ }>>;
78
+ size: z.ZodOptional<z.ZodEnum<{
79
+ [x: string]: any;
80
+ }>>;
81
+ shape: z.ZodOptional<z.ZodEnum<{
82
+ [x: string]: any;
83
+ }>>;
84
+ iconPosition: z.ZodOptional<z.ZodEnum<{
85
+ [x: string]: any;
86
+ }>>;
87
+ group: z.ZodOptional<z.ZodObject<{
88
+ color: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
89
+ [x: string]: any;
90
+ }>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>>>;
91
+ opacity: z.ZodOptional<z.ZodInt>;
92
+ border: z.ZodOptional<z.ZodEnum<{
93
+ [x: string]: any;
94
+ }>>;
95
+ }, z.core.$strict>>;
96
+ relationship: z.ZodOptional<z.ZodObject<{
97
+ color: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
98
+ [x: string]: any;
99
+ }>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>>>;
100
+ line: z.ZodOptional<z.ZodEnum<{
101
+ dashed: "dashed";
102
+ solid: "solid";
103
+ dotted: "dotted";
104
+ }>>;
105
+ arrow: z.ZodOptional<z.ZodEnum<{
106
+ [x: string]: any;
107
+ }>>;
108
+ }, z.core.$strict>>;
109
+ }, z.core.$strict>>;
110
+ customCss: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
111
+ }, z.core.$strict>, z.ZodTransform<any, {
112
+ theme?: any;
113
+ defaults?: {
114
+ color?: any;
115
+ opacity?: number | undefined;
116
+ border?: any;
117
+ size?: any;
118
+ shape?: any;
119
+ iconPosition?: any;
120
+ group?: {
121
+ color?: any;
122
+ opacity?: number | undefined;
123
+ border?: any;
124
+ } | undefined;
125
+ relationship?: {
126
+ color?: any;
127
+ line?: "dashed" | "solid" | "dotted" | undefined;
128
+ arrow?: any;
129
+ } | undefined;
130
+ } | undefined;
131
+ customCss?: string | string[] | undefined;
132
+ }>>>;
133
+ imageAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
134
+ include: z.ZodOptional<z.ZodObject<{
135
+ paths: z.ZodArray<z.ZodString>;
136
+ maxDepth: z.ZodDefault<z.ZodNumber>;
137
+ fileThreshold: z.ZodDefault<z.ZodNumber>;
138
+ }, z.core.$strict>>;
139
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
140
+ manualLayouts: z.ZodOptional<z.ZodObject<{
141
+ outDir: z.ZodDefault<z.ZodString>;
142
+ }, z.core.$strict>>;
143
+ }, z.core.$strip>;
144
+ type LikeC4ProjectJsonConfig = z.input<typeof LikeC4ProjectJsonConfigSchema>;
145
+ /**
146
+ * Result of the {@link GeneratorFnContext.locate} function
147
+ */
148
+ type LocateResult = {
149
+ /**
150
+ * Range inside the source file
151
+ */
152
+ range: {
153
+ start: {
154
+ line: number;
155
+ character: number;
156
+ };
157
+ end: {
158
+ line: number;
159
+ character: number;
160
+ };
161
+ };
162
+ /**
163
+ * Full path to the source file
164
+ */
165
+ document: VscodeURI;
166
+ /**
167
+ * Document path relative to the project folder
168
+ */
169
+ relativePath: string;
170
+ /**
171
+ * Folder, containing the source file ("dirname" of document)
172
+ */
173
+ folder: string;
174
+ /**
175
+ * Source file name ("basename" of document)
176
+ */
177
+ filename: string;
178
+ };
179
+ interface GeneratorFnContext {
180
+ /**
181
+ * Workspace root directory
182
+ */
183
+ readonly workspace: VscodeURI;
184
+ /**
185
+ * Current project
186
+ */
187
+ readonly project: {
188
+ /**
189
+ * Project name
190
+ */
191
+ readonly id: ProjectId;
192
+ readonly title?: string;
193
+ /**
194
+ * Project folder
195
+ */
196
+ readonly folder: VscodeURI;
197
+ };
198
+ /**
199
+ * Returns the location of the specified element, relation, view or deployment element
200
+ */
201
+ locate(target: ElementModel | RelationshipModel | DeploymentRelationModel | LikeC4ViewModel | DeploymentElementModel): LocateResult;
202
+ /**
203
+ * Write a file
204
+ * @param path - Path to the file, either absolute or relative to the project folder
205
+ * All folders will be created automatically
206
+ * @param content - Content of the file
207
+ */
208
+ write(file: {
209
+ path: string | string[] | VscodeURI;
210
+ content: string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView> | NodeJS.ReadableStream;
211
+ }): Promise<void>;
212
+ /**
213
+ * Abort the process
214
+ */
215
+ abort(reason?: string): never;
216
+ }
217
+ type GeneratorFnParams = {
218
+ /**
219
+ * LikeC4 model
220
+ */
221
+ likec4model: LikeC4Model<aux.UnknownLayouted>;
222
+ /**
223
+ * Generator context
224
+ */
225
+ ctx: GeneratorFnContext;
226
+ };
227
+ interface GeneratorFn {
228
+ (params: GeneratorFnParams): Promise<void> | void;
229
+ }
230
+ /**
231
+ * LikeC4 project configuration
232
+ *
233
+ * @example
234
+ * ```ts
235
+ * export default defineConfig({
236
+ * name: 'my-project',
237
+ * generators: {
238
+ * 'my-generator': async ({ likec4model, ctx }) => {
239
+ * await ctx.write('my-generator.txt', likec4model.project.id)
240
+ * }
241
+ * }
242
+ * })
243
+ * ```
244
+ */
245
+ type LikeC4ProjectConfig = z.infer<typeof LikeC4ProjectJsonConfigSchema> & {
246
+ /**
247
+ * Add custom generators to the project
248
+ * @example
249
+ * ```ts
250
+ * export default defineConfig({
251
+ * name: 'my-project',
252
+ * generators: {
253
+ * 'my-generator': async ({ likec4model, ctx }) => {
254
+ * await ctx.write('my-generator.txt', likec4model.project.id)
255
+ * }
256
+ * }
257
+ * })
258
+ * ```
259
+ *
260
+ * Execute generator:
261
+ * ```bash
262
+ * likec4 gen my-generator
263
+ * ```
264
+ */
265
+ generators?: Record<string, GeneratorFn> | undefined;
266
+ };
267
+ type LikeC4ProjectConfigInput = LikeC4ProjectJsonConfig & {
268
+ generators?: Record<string, GeneratorFn> | undefined;
269
+ };
270
+ /**
271
+ * Validates Object into a LikeC4ProjectConfig object.
272
+ */
273
+ declare function validateProjectConfig<C extends Record<string, unknown>>(config: C): LikeC4ProjectConfig;
274
+ /**
275
+ * Parses JSON string into a LikeC4ProjectConfig object.
276
+ * Does not process "extends" - use `loadConfig` function instead
277
+ */
278
+ declare function parseProjectConfigJSON(config: string): LikeC4ProjectConfig;
279
+ declare const LikeC4ProjectConfigOps: {
280
+ parse: typeof parseProjectConfigJSON;
281
+ validate: typeof validateProjectConfig;
282
+ normalizeInclude: (include: z.input<typeof IncludeSchema> | undefined) => IncludeConfig;
283
+ };
284
+ //#endregion
285
+ //#region src/schema.theme.d.ts
286
+ declare const ThemeColorValuesSchema: z.ZodPipe<z.ZodUnion<[z.ZodPipe<z.ZodObject<{
287
+ elements: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
288
+ fill: z.ZodString;
289
+ stroke: z.ZodString;
290
+ hiContrast: z.ZodString;
291
+ loContrast: z.ZodString;
292
+ }, z.core.$strict>, z.ZodTransform<any, {
293
+ fill: string;
294
+ stroke: string;
295
+ hiContrast: string;
296
+ loContrast: string;
297
+ }>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
298
+ relationships: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
299
+ line: z.ZodString;
300
+ label: z.ZodString;
301
+ labelBg: z.ZodDefault<z.ZodOptional<z.ZodString>>;
302
+ }, z.core.$strict>, z.ZodTransform<any, {
303
+ line: string;
304
+ label: string;
305
+ labelBg: string;
306
+ }>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
307
+ }, z.core.$strict>, z.ZodTransform<any, {
308
+ elements: any;
309
+ relationships: any;
310
+ }>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>, z.ZodTransform<any, any>>;
311
+ type ThemeColorValuesInput = z.input<typeof ThemeColorValuesSchema>;
312
+ declare const LikeC4Config_Styles_Theme: z.ZodPipe<z.ZodObject<{
313
+ colors: z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
314
+ [x: string]: any;
315
+ }>, 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<{
316
+ elements: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
317
+ fill: z.ZodString;
318
+ stroke: z.ZodString;
319
+ hiContrast: z.ZodString;
320
+ loContrast: z.ZodString;
321
+ }, z.core.$strict>, z.ZodTransform<any, {
322
+ fill: string;
323
+ stroke: string;
324
+ hiContrast: string;
325
+ loContrast: string;
326
+ }>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
327
+ relationships: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
328
+ line: z.ZodString;
329
+ label: z.ZodString;
330
+ labelBg: z.ZodDefault<z.ZodOptional<z.ZodString>>;
331
+ }, z.core.$strict>, z.ZodTransform<any, {
332
+ line: string;
333
+ label: string;
334
+ labelBg: string;
335
+ }>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
336
+ }, z.core.$strict>, z.ZodTransform<any, {
337
+ elements: any;
338
+ relationships: any;
339
+ }>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>, z.ZodTransform<any, any>>>, z.ZodTransform<Record<ThemeColor, ThemeColorValues>, Partial<Record<any, any>>>>>;
340
+ sizes: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
341
+ [x: string]: any;
342
+ }> & z.core.$partial, z.ZodObject<{
343
+ width: z.ZodNumber;
344
+ height: z.ZodNumber;
345
+ }, z.core.$strict>>>;
346
+ }, z.core.$strict>, z.ZodTransform<any, {
347
+ colors?: Record<ThemeColor, ThemeColorValues> | undefined;
348
+ sizes?: Partial<Record<any, {
349
+ width: number;
350
+ height: number;
351
+ }>> | undefined;
352
+ }>>;
353
+ type LikeC4ConfigThemeInput = z.input<typeof LikeC4Config_Styles_Theme>;
354
+ declare const LikeC4StylesConfigSchema: z.ZodPipe<z.ZodObject<{
355
+ theme: z.ZodOptional<z.ZodPipe<z.ZodObject<{
356
+ colors: z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
357
+ [x: string]: any;
358
+ }>, 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<{
359
+ elements: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
360
+ fill: z.ZodString;
361
+ stroke: z.ZodString;
362
+ hiContrast: z.ZodString;
363
+ loContrast: z.ZodString;
364
+ }, z.core.$strict>, z.ZodTransform<any, {
365
+ fill: string;
366
+ stroke: string;
367
+ hiContrast: string;
368
+ loContrast: string;
369
+ }>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
370
+ relationships: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
371
+ line: z.ZodString;
372
+ label: z.ZodString;
373
+ labelBg: z.ZodDefault<z.ZodOptional<z.ZodString>>;
374
+ }, z.core.$strict>, z.ZodTransform<any, {
375
+ line: string;
376
+ label: string;
377
+ labelBg: string;
378
+ }>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
379
+ }, z.core.$strict>, z.ZodTransform<any, {
380
+ elements: any;
381
+ relationships: any;
382
+ }>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>, z.ZodTransform<any, any>>>, z.ZodTransform<Record<ThemeColor, ThemeColorValues>, Partial<Record<any, any>>>>>;
383
+ sizes: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
384
+ [x: string]: any;
385
+ }> & z.core.$partial, z.ZodObject<{
386
+ width: z.ZodNumber;
387
+ height: z.ZodNumber;
388
+ }, z.core.$strict>>>;
389
+ }, z.core.$strict>, z.ZodTransform<any, {
390
+ colors?: Record<ThemeColor, ThemeColorValues> | undefined;
391
+ sizes?: Partial<Record<any, {
392
+ width: number;
393
+ height: number;
394
+ }>> | undefined;
395
+ }>>>;
396
+ defaults: z.ZodOptional<z.ZodObject<{
397
+ color: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
398
+ [x: string]: any;
399
+ }>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>>>;
400
+ opacity: z.ZodOptional<z.ZodInt>;
401
+ border: z.ZodOptional<z.ZodEnum<{
402
+ [x: string]: any;
403
+ }>>;
404
+ size: z.ZodOptional<z.ZodEnum<{
405
+ [x: string]: any;
406
+ }>>;
407
+ shape: z.ZodOptional<z.ZodEnum<{
408
+ [x: string]: any;
409
+ }>>;
410
+ iconPosition: z.ZodOptional<z.ZodEnum<{
411
+ [x: string]: any;
412
+ }>>;
413
+ group: z.ZodOptional<z.ZodObject<{
414
+ color: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
415
+ [x: string]: any;
416
+ }>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>>>;
417
+ opacity: z.ZodOptional<z.ZodInt>;
418
+ border: z.ZodOptional<z.ZodEnum<{
419
+ [x: string]: any;
420
+ }>>;
421
+ }, z.core.$strict>>;
422
+ relationship: z.ZodOptional<z.ZodObject<{
423
+ color: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
424
+ [x: string]: any;
425
+ }>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>>>;
426
+ line: z.ZodOptional<z.ZodEnum<{
427
+ dashed: "dashed";
428
+ solid: "solid";
429
+ dotted: "dotted";
430
+ }>>;
431
+ arrow: z.ZodOptional<z.ZodEnum<{
432
+ [x: string]: any;
433
+ }>>;
434
+ }, z.core.$strict>>;
435
+ }, z.core.$strict>>;
436
+ customCss: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
437
+ }, z.core.$strict>, z.ZodTransform<any, {
438
+ theme?: any;
439
+ defaults?: {
440
+ color?: any;
441
+ opacity?: number | undefined;
442
+ border?: any;
443
+ size?: any;
444
+ shape?: any;
445
+ iconPosition?: any;
446
+ group?: {
447
+ color?: any;
448
+ opacity?: number | undefined;
449
+ border?: any;
450
+ } | undefined;
451
+ relationship?: {
452
+ color?: any;
453
+ line?: "dashed" | "solid" | "dotted" | undefined;
454
+ arrow?: any;
455
+ } | undefined;
456
+ } | undefined;
457
+ customCss?: string | string[] | undefined;
458
+ }>>;
459
+ interface LikeC4StylesConfig extends z.infer<typeof LikeC4StylesConfigSchema> {}
460
+ type LikeC4StylesConfigInput = z.input<typeof LikeC4StylesConfigSchema>;
461
+ //#endregion
462
+ //#region src/filenames.d.ts
463
+ declare const configJsonFilenames: readonly [".likec4rc", ".likec4.config.json", "likec4.config.json"];
464
+ declare const configNonJsonFilenames: readonly ["likec4.config.js", "likec4.config.cjs", "likec4.config.mjs", "likec4.config.ts", "likec4.config.cts", "likec4.config.mts"];
465
+ 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"];
466
+ /**
467
+ * Checks if the given filename is a LikeC4 JSON config file (JSON, RC).
468
+ */
469
+ declare function isLikeC4JsonConfig(filename: string): filename is typeof configJsonFilenames[number];
470
+ /**
471
+ * Checks if the given filename is a LikeC4 non-JSON config file (JS, MJS, TS, MTS)
472
+ */
473
+ declare function isLikeC4NonJsonConfig(filename: string): filename is typeof configNonJsonFilenames[number];
474
+ /**
475
+ * Checks if the given filename is a LikeC4 config file (JSON or non-JSON)
476
+ */
477
+ declare function isLikeC4Config(filename: string): filename is typeof ConfigFilenames[number];
478
+ //#endregion
479
+ //#region src/define-config.d.ts
480
+ /**
481
+ * Defines LikeC4 Project, allows custom generators that can be executed using CLI:
482
+ *
483
+ * `$ likec4 gen <generator-name>`
484
+ *
485
+ * or VSCode command `LikeC4: Run code generator`
486
+ *
487
+ * @example
488
+ * ```ts
489
+ * export default defineConfig({
490
+ * name: 'my-project',
491
+ * title: 'My Project',
492
+ *
493
+ * exclude: ['picomatch pattern'],
494
+ * generators: {
495
+ * '<generator-name>': async ({ likec4model, ctx }) => {
496
+ * await ctx.write('my-generator.txt', likec4model.project.id)
497
+ * }
498
+ * }
499
+ * })
500
+ * ```
501
+ */
502
+ declare function defineConfig<C extends LikeC4ProjectConfigInput>(config: C): LikeC4ProjectConfig;
503
+ /**
504
+ * Define reusable custom generators
505
+ *
506
+ * @example
507
+ * ```ts
508
+ * // generators.ts
509
+ * export default defineGenerators({
510
+ * 'my-generator': async ({ likec4model, ctx }) => {
511
+ * await ctx.write('my-generator.txt', likec4model.project.id)
512
+ * }
513
+ * })
514
+ *
515
+ * // likec4.config.ts
516
+ * import generators from './generators'
517
+ *
518
+ * export default defineConfig({
519
+ * name: 'my-project',
520
+ * generators,
521
+ * })
522
+ * ```
523
+ */
524
+ declare function defineGenerators<const G extends Record<string, GeneratorFn>>(generators: G): G;
525
+ /**
526
+ * Define reusable custom theme color
527
+ * @example
528
+ * ```ts
529
+ * export default defineThemeColor({
530
+ * element: {
531
+ * fill: 'red'
532
+ * }
533
+ * })
534
+ * ```
535
+ */
536
+ declare function defineThemeColor<const S extends ThemeColorValuesInput>(colors: S): ThemeColorValues$1;
537
+ /**
538
+ * Define reusable custom theme
539
+ * @example
540
+ * ```ts
541
+ * import { defineThemeColor, defineTheme } from 'likec4/config'
542
+ *
543
+ * export default defineTheme({
544
+ * colors: {
545
+ * primary: '#FF0000',
546
+ * // Or use defineThemeColor
547
+ * red: defineThemeColor({
548
+ * elements: {
549
+ * fill: 'red'
550
+ * }
551
+ * })
552
+ * }
553
+ * })
554
+ * ```
555
+ */
556
+ declare function defineTheme<const S extends LikeC4ConfigThemeInput>(theme: S): LikeC4ProjectTheme;
557
+ /**
558
+ * Define reusable custom style
559
+ * @example
560
+ * ```ts
561
+ * import { defineStyle, defineThemeColor } from 'likec4/config'
562
+ *
563
+ * export default defineStyle({
564
+ * theme: {
565
+ * colors: {
566
+ * red: defineThemeColor({
567
+ * elements: {
568
+ * fill: 'red'
569
+ * }
570
+ * })
571
+ * }
572
+ * },
573
+ * defaults: {
574
+ * color: 'red',
575
+ * opacity: 50,
576
+ * border: 'solid',
577
+ * size: 'sm',
578
+ * relationship: {
579
+ * color: 'grey',
580
+ * line: 'solid',
581
+ * }
582
+ * }
583
+ * })
584
+ */
585
+ declare function defineStyle<const S extends LikeC4StylesConfigInput>(styles: S): LikeC4ProjectStylesConfig;
586
+ //#endregion
587
+ //#region src/node/load-config.d.ts
11
588
  /**
12
589
  * Load LikeC4 Project config file.
13
590
  * If filepath is a non-JSON file, it will be bundled and required
14
591
  */
15
- declare function loadConfig(filepath: URI): Promise<LikeC4ProjectConfig>;
16
-
17
- export { LikeC4ProjectConfig, loadConfig };
592
+ declare function loadConfig(filepath: VscodeURI | string): Promise<LikeC4ProjectConfig>;
593
+ //#endregion
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 };