import { i as __name } from "./rolldown-runtime.mjs"; import { _ as input, a as ZodDefault, b as $strict, c as ZodLiteral, d as ZodOptional, f as ZodPipe, g as ZodUnion, h as ZodTransform, i as ZodCustom, l as ZodNumber, m as ZodString, n as ZodArray, o as ZodEnum, p as ZodRecord, r as ZodBoolean, s as ZodInt, t as ZodAny, u as ZodObject, v as output, x as $strip, y as $partial } from "./libs/zod.mjs"; import { LikeC4ProjectStylesConfig, LikeC4ProjectTheme, ProjectId, ThemeColorValues as ThemeColorValues$1, aux } from "@likec4/core/types"; import { DeploymentElementModel, DeploymentRelationModel, ElementModel, LikeC4Model, LikeC4ViewModel, RelationshipModel } from "@likec4/core/model"; //#region ../config/dist/index.d.mts //#region src/schema.include.d.ts declare const IncludeSchema: ZodObject<{ paths: ZodArray; maxDepth: ZodDefault; fileThreshold: ZodDefault; }, $strict>; type IncludeConfig = output; //#endregion //#region src/schema.d.ts interface VscodeURI { readonly scheme: string; readonly authority: string; readonly path: string; readonly fsPath: string; readonly query: string; readonly fragment: string; toString(): string; } declare const LikeC4ProjectJsonConfigSchema: ZodObject<{ name: ZodString; extends: ZodOptional]>>; title: ZodOptional; contactPerson: ZodOptional; metadata: ZodOptional>; styles: ZodOptional, ZodPipe, string & Record>, ZodTransform>>]>, ZodTransform> & $partial, ZodPipe, ZodTransform>, ZodPipe>]>; relationships: ZodUnion<[ZodPipe>; }, $strict>, ZodTransform>, ZodPipe>]>; }, $strict>, ZodTransform>, ZodPipe>]>, ZodTransform>>, ZodTransform, Partial>>>>; sizes: ZodOptional & $partial, ZodObject<{ width: ZodNumber; height: ZodNumber; }, $strict>>>; }, $strict>, ZodTransform | undefined; sizes?: Partial> | undefined; }>>>; defaults: ZodOptional, ZodPipe, string & Record>, ZodTransform>>]>, ZodTransform>>; opacity: ZodOptional; border: ZodOptional>; size: ZodOptional>; shape: ZodOptional>; iconPosition: ZodOptional>; group: ZodOptional, ZodPipe, string & Record>, ZodTransform>>]>, ZodTransform>>; opacity: ZodOptional; border: ZodOptional>; }, $strict>>; relationship: ZodOptional, ZodPipe, string & Record>, ZodTransform>>]>, ZodTransform>>; line: ZodOptional>; arrow: ZodOptional>; }, $strict>>; }, $strict>>; customCss: ZodOptional]>>; }, $strict>, ZodTransform>>; imageAliases: ZodOptional>; include: ZodOptional; maxDepth: ZodDefault; fileThreshold: ZodDefault; }, $strict>>; exclude: ZodOptional>; manualLayouts: ZodOptional; }, $strict>>; inferTechnologyFromIcon: ZodOptional; implicitViews: ZodOptional; landingPage: ZodOptional; }, $strict>, ZodObject<{ include: ZodArray; }, $strict>, ZodObject<{ exclude: ZodArray; }, $strict>]>>; }, $strip>; type LikeC4ProjectJsonConfig = input; /** * Result of the {@link GeneratorFnContext.locate} function */ type LocateResult = { /** * Range inside the source file */ range: { start: { line: number; character: number; }; end: { line: number; character: number; }; }; /** * Full path to the source file */ document: VscodeURI; /** * Document path relative to the project folder */ relativePath: string; /** * Folder, containing the source file ("dirname" of document) */ folder: string; /** * Source file name ("basename" of document) */ filename: string; }; interface GeneratorFnContext { /** * Workspace root directory */ readonly workspace: VscodeURI; /** * Current project */ readonly project: { /** * Project name */ readonly id: ProjectId; readonly title?: string; /** * Project folder */ readonly folder: VscodeURI; }; /** * Returns the location of the specified element, relation, view or deployment element */ locate(target: ElementModel | RelationshipModel | DeploymentRelationModel | LikeC4ViewModel | DeploymentElementModel): LocateResult; /** * Write a file * @param path - Path to the file, either absolute or relative to the project folder * All folders will be created automatically * @param content - Content of the file */ write(file: { path: string | string[] | VscodeURI; content: string | NodeJS.ArrayBufferView | Iterable | AsyncIterable | NodeJS.ReadableStream; }): Promise; /** * Abort the process */ abort(reason?: string): never; } type GeneratorFnParams = { /** * LikeC4 model */ likec4model: LikeC4Model; /** * Generator context */ ctx: GeneratorFnContext; }; interface GeneratorFn { (params: GeneratorFnParams): Promise | void; } /** * LikeC4 project configuration * * @example * ```ts * export default defineConfig({ * name: 'my-project', * generators: { * 'my-generator': async ({ likec4model, ctx }) => { * await ctx.write('my-generator.txt', likec4model.project.id) * } * } * }) * ``` */ type LikeC4ProjectConfig = output & { /** * Add custom generators to the project * @example * ```ts * export default defineConfig({ * name: 'my-project', * generators: { * 'my-generator': async ({ likec4model, ctx }) => { * await ctx.write('my-generator.txt', likec4model.project.id) * } * } * }) * ``` * * Execute generator: * ```bash * likec4 gen my-generator * ``` */ generators?: Record | undefined; }; type LikeC4ProjectConfigInput = LikeC4ProjectJsonConfig & { generators?: Record | undefined; }; /** * Validates Object into a LikeC4ProjectConfig object. * Zod v4 can strip optional union keys (e.g. landingPage) from parse output; * we validate landingPage once with LandingPageSchema and merge onto the result. */ declare function validateProjectConfig>(config: C): LikeC4ProjectConfig; /** * Parses JSON string into a LikeC4ProjectConfig object. * Does not process "extends" - use `loadConfig` function instead */ declare function parseProjectConfigJSON(config: string): LikeC4ProjectConfig; declare const LikeC4ProjectConfigOps: { parse: typeof parseProjectConfigJSON; validate: typeof validateProjectConfig; normalizeInclude: (include: input | undefined) => IncludeConfig; }; //#endregion //#region src/schema.theme.d.ts declare const ThemeColorValuesSchema: ZodPipe, ZodTransform>, ZodPipe>]>; relationships: ZodUnion<[ZodPipe>; }, $strict>, ZodTransform>, ZodPipe>]>; }, $strict>, ZodTransform>, ZodPipe>]>, ZodTransform>; type ThemeColorValuesInput = input; declare const LikeC4Config_Styles_Theme: ZodPipe, ZodPipe, string & Record>, ZodTransform>>]>, ZodTransform> & $partial, ZodPipe, ZodTransform>, ZodPipe>]>; relationships: ZodUnion<[ZodPipe>; }, $strict>, ZodTransform>, ZodPipe>]>; }, $strict>, ZodTransform>, ZodPipe>]>, ZodTransform>>, ZodTransform, Partial>>>>; sizes: ZodOptional & $partial, ZodObject<{ width: ZodNumber; height: ZodNumber; }, $strict>>>; }, $strict>, ZodTransform | undefined; sizes?: Partial> | undefined; }>>; type LikeC4ConfigThemeInput = input; declare const LikeC4StylesConfigSchema: ZodPipe, ZodPipe, string & Record>, ZodTransform>>]>, ZodTransform> & $partial, ZodPipe, ZodTransform>, ZodPipe>]>; relationships: ZodUnion<[ZodPipe>; }, $strict>, ZodTransform>, ZodPipe>]>; }, $strict>, ZodTransform>, ZodPipe>]>, ZodTransform>>, ZodTransform, Partial>>>>; sizes: ZodOptional & $partial, ZodObject<{ width: ZodNumber; height: ZodNumber; }, $strict>>>; }, $strict>, ZodTransform | undefined; sizes?: Partial> | undefined; }>>>; defaults: ZodOptional, ZodPipe, string & Record>, ZodTransform>>]>, ZodTransform>>; opacity: ZodOptional; border: ZodOptional>; size: ZodOptional>; shape: ZodOptional>; iconPosition: ZodOptional>; group: ZodOptional, ZodPipe, string & Record>, ZodTransform>>]>, ZodTransform>>; opacity: ZodOptional; border: ZodOptional>; }, $strict>>; relationship: ZodOptional, ZodPipe, string & Record>, ZodTransform>>]>, ZodTransform>>; line: ZodOptional>; arrow: ZodOptional>; }, $strict>>; }, $strict>>; customCss: ZodOptional]>>; }, $strict>, ZodTransform>; interface LikeC4StylesConfig extends output {} type LikeC4StylesConfigInput = input; //#endregion //#region src/filenames.d.ts /** All known LikeC4 config filenames (JSON and non-JSON). */ /** Returns true if the **basename** of the given path matches a known config filename. */ declare function isLikeC4JsonConfig(filename: string): boolean; /** * Returns true if the **basename** of the given path matches a known non-JSON config filename (JS, MJS, TS, MTS). */ declare function isLikeC4NonJsonConfig(filename: string): boolean; /** * Returns true if the **basename** of the given path matches a known LikeC4 config file (JSON or non-JSON). */ declare function isLikeC4Config(filename: string): boolean; //#endregion //#region src/define-config.d.ts /** * Defines LikeC4 Project, allows custom generators that can be executed using CLI: * * `$ likec4 gen ` * * or VSCode command `LikeC4: Run code generator` * * @example * ```ts * export default defineConfig({ * name: 'my-project', * title: 'My Project', * * exclude: ['picomatch pattern'], * generators: { * '': async ({ likec4model, ctx }) => { * await ctx.write('my-generator.txt', likec4model.project.id) * } * } * }) * ``` */ declare function defineConfig(config: C): LikeC4ProjectConfig; /** * Define reusable custom generators * * @example * ```ts * // generators.ts * export default defineGenerators({ * 'my-generator': async ({ likec4model, ctx }) => { * await ctx.write('my-generator.txt', likec4model.project.id) * } * }) * * // likec4.config.ts * import generators from './generators' * * export default defineConfig({ * name: 'my-project', * generators, * }) * ``` */ declare function defineGenerators>(generators: G): G; /** * Define reusable custom theme color * @example * ```ts * export default defineThemeColor({ * element: { * fill: 'red' * } * }) * ``` */ declare function defineThemeColor(colors: S): ThemeColorValues$1; /** * Define reusable custom theme * @example * ```ts * import { defineThemeColor, defineTheme } from 'likec4/config' * * export default defineTheme({ * colors: { * primary: '#FF0000', * // Or use defineThemeColor * red: defineThemeColor({ * elements: { * fill: 'red' * } * }) * } * }) * ``` */ declare function defineTheme(theme: S): LikeC4ProjectTheme; /** * Define reusable custom style * @example * ```ts * import { defineStyle, defineThemeColor } from 'likec4/config' * * export default defineStyle({ * theme: { * colors: { * red: defineThemeColor({ * elements: { * fill: 'red' * } * }) * } * }, * defaults: { * color: 'red', * opacity: 50, * border: 'solid', * size: 'sm', * relationship: { * color: 'grey', * line: 'solid', * } * } * }) */ declare function defineStyle(styles: S): LikeC4ProjectStylesConfig; //#endregion //#endregion export { isLikeC4JsonConfig as _, LikeC4ProjectConfig as a, LikeC4ProjectJsonConfig as c, defineConfig as d, defineGenerators as f, isLikeC4Config as g, defineThemeColor as h, IncludeConfig as i, LikeC4StylesConfig as l, defineTheme as m, GeneratorFnContext as n, LikeC4ProjectConfigInput as o, defineStyle as p, GeneratorFnParams as r, LikeC4ProjectConfigOps as s, GeneratorFn as t, LikeC4StylesConfigInput as u, isLikeC4NonJsonConfig as v };