likec4 1.57.0 → 1.59.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/__app__/codegen/react.mjs +7 -8
- package/__app__/codegen/webcomponent.mjs +78 -889
- package/__app__/src/aichat/index.mjs +8 -1
- package/__app__/src/chunks/AIChat.mjs +956 -0
- package/__app__/src/chunks/LikeC4Styles.mjs +2164 -0
- package/__app__/src/chunks/ProjectsOverview.mjs +537 -0
- package/__app__/src/chunks/es.mjs +439 -0
- package/__app__/src/chunks/hooks.mjs +458 -0
- package/__app__/src/chunks/libs/@floating-ui.mjs +2218 -0
- package/__app__/src/chunks/libs/@mantine.mjs +12974 -0
- package/__app__/src/chunks/libs/@tanstack-ai.mjs +1768 -0
- package/__app__/src/chunks/libs/@tanstack.mjs +2693 -0
- package/__app__/src/chunks/libs/@xstate/react.mjs +1996 -0
- package/__app__/src/chunks/libs/@xyflow/react.mjs +5280 -0
- package/__app__/src/chunks/libs/bezier-js.mjs +1006 -0
- package/__app__/src/chunks/libs/d3.mjs +2842 -0
- package/__app__/src/chunks/libs/fast-equals.mjs +268 -0
- package/__app__/src/chunks/libs/framer.mjs +5905 -0
- package/__app__/src/chunks/libs/zod.mjs +3173 -0
- package/__app__/src/chunks/rolldown-runtime.mjs +30 -0
- package/__app__/src/chunks/styled-system.mjs +1047 -0
- package/__app__/src/fonts.css +1 -1
- package/__app__/src/main.mjs +27659 -14
- package/__app__/src/style.css +1 -1
- package/dist/chunks/dist.mjs +10 -0
- package/dist/chunks/enableServer.mjs +1 -1
- package/dist/chunks/filenames.mjs +2 -2
- package/dist/chunks/index.d.mts +9 -9
- package/dist/chunks/index2.d.mts +2167 -867
- package/dist/chunks/libs/@chevrotain/gast.mjs +1 -1
- package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +1 -1
- package/dist/chunks/libs/@logtape/logtape.mjs +4 -3
- package/dist/chunks/libs/@ts-graphviz/common.d.mts +1 -2
- package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -1
- package/dist/chunks/libs/chevrotain-allstar.mjs +2 -2
- package/dist/chunks/libs/chevrotain.mjs +25 -25
- package/dist/chunks/libs/json5.mjs +1 -1
- package/dist/chunks/libs/langium.d.mts +2940 -2914
- package/dist/chunks/libs/langium.mjs +9 -9
- package/dist/chunks/libs/merge-error-cause.mjs +1 -1
- package/dist/chunks/libs/p-queue.mjs +1 -1
- package/dist/chunks/libs/package-manager-detector.mjs +1 -1
- package/dist/chunks/libs/pako.mjs +1 -1
- package/dist/chunks/libs/picomatch.mjs +1 -1
- package/dist/chunks/libs/pretty-ms.mjs +1 -1
- package/dist/chunks/libs/remeda.mjs +1 -1
- package/dist/chunks/libs/ufo.mjs +1 -1
- package/dist/chunks/libs/unstorage.d.mts +1 -0
- package/dist/chunks/libs/unstorage.mjs +1 -1
- package/dist/chunks/libs/which.mjs +1 -1
- package/dist/chunks/libs/zod.d.mts +48 -36
- package/dist/chunks/libs/zod.mjs +65 -0
- package/dist/chunks/logger.mjs +1 -0
- package/dist/chunks/node.mjs +65 -63
- package/dist/chunks/rolldown-runtime.mjs +1 -1
- package/dist/chunks/sequence-view.mjs +1 -1
- package/dist/chunks/{plugin.mjs → vite-plugin.mjs} +41 -41
- package/dist/cli/index.mjs +186 -144
- package/dist/index.d.mts +3 -4
- package/dist/index.mjs +1 -1
- package/dist/model/index.d.mts +6 -5
- package/dist/vite-plugin/index.d.mts +6 -9
- package/dist/vite-plugin/index.mjs +1 -1
- package/dist/vite-plugin/internal/index.d.mts +64 -64
- package/dist/vite-plugin/internal/index.mjs +946 -1
- package/package.json +51 -52
- package/react/index.d.mts +853 -134
- package/react/index.mjs +49718 -44030
- package/__app__/chunks/AIChat2.mjs +0 -2
- package/__app__/chunks/DiagramActorProvider.mjs +0 -10
- package/__app__/chunks/EmbedPage.mjs +0 -1
- package/__app__/chunks/ExportPage.mjs +0 -2
- package/__app__/chunks/LikeC4Diagram.mjs +0 -19
- package/__app__/chunks/LikeC4Styles.mjs +0 -48
- package/__app__/chunks/Markdown.mjs +0 -1
- package/__app__/chunks/NavigationPanel.mjs +0 -1
- package/__app__/chunks/ViewReact.mjs +0 -1
- package/__app__/chunks/adhoc-editor.mjs +0 -1
- package/__app__/chunks/aichat.mjs +0 -1
- package/__app__/chunks/box.mjs +0 -1
- package/__app__/chunks/create-style-context.mjs +0 -1
- package/__app__/chunks/css.mjs +0 -1
- package/__app__/chunks/factory.mjs +0 -1
- package/__app__/chunks/hooks.mjs +0 -1
- package/__app__/chunks/hstack.mjs +0 -1
- package/__app__/chunks/libs/@dagrejs/dagre.mjs +0 -1
- package/__app__/chunks/libs/@floating-ui/core.mjs +0 -1
- package/__app__/chunks/libs/@floating-ui/dom.mjs +0 -1
- package/__app__/chunks/libs/@floating-ui/react.mjs +0 -1
- package/__app__/chunks/libs/@mantine/core.mjs +0 -41
- package/__app__/chunks/libs/@mantine/hooks.mjs +0 -1
- package/__app__/chunks/libs/@nanostores/react.mjs +0 -1
- package/__app__/chunks/libs/@react-hookz/web.mjs +0 -1
- package/__app__/chunks/libs/@tabler/icons-react.mjs +0 -358
- package/__app__/chunks/libs/@tanstack/ai-client.mjs +0 -2
- package/__app__/chunks/libs/@tanstack/ai-react-ui.mjs +0 -1
- package/__app__/chunks/libs/@tanstack/ai-react.mjs +0 -1
- package/__app__/chunks/libs/@tanstack/ai.mjs +0 -2
- package/__app__/chunks/libs/@tanstack/history.mjs +0 -1
- package/__app__/chunks/libs/@tanstack/react-router.mjs +0 -3
- package/__app__/chunks/libs/@tanstack/router-core.mjs +0 -1
- package/__app__/chunks/libs/@xstate/react.mjs +0 -1
- package/__app__/chunks/libs/@xstate/store.mjs +0 -1
- package/__app__/chunks/libs/@xyflow/react.mjs +0 -7
- package/__app__/chunks/libs/@zag-js/anatomy.mjs +0 -1
- package/__app__/chunks/libs/@zag-js/collection.mjs +0 -1
- package/__app__/chunks/libs/@zag-js/core.mjs +0 -1
- package/__app__/chunks/libs/@zag-js/react.mjs +0 -1
- package/__app__/chunks/libs/@zag-js/tree-view.mjs +0 -1
- package/__app__/chunks/libs/bezier-js.mjs +0 -1
- package/__app__/chunks/libs/copy-anything.mjs +0 -1
- package/__app__/chunks/libs/d3-path.mjs +0 -1
- package/__app__/chunks/libs/d3-shape.mjs +0 -1
- package/__app__/chunks/libs/fast-equals.mjs +0 -1
- package/__app__/chunks/libs/framer-motion.mjs +0 -9
- package/__app__/chunks/libs/html-to-image.mjs +0 -2
- package/__app__/chunks/libs/motion-dom.mjs +0 -1
- package/__app__/chunks/libs/nanostores.mjs +0 -1
- package/__app__/chunks/libs/react-error-boundary.mjs +0 -1
- package/__app__/chunks/libs/react-resizable-panels.mjs +0 -1
- package/__app__/chunks/libs/remeda.mjs +0 -1
- package/__app__/chunks/libs/superjson.mjs +0 -1
- package/__app__/chunks/libs/zod.mjs +0 -64
- package/__app__/chunks/rolldown-runtime.mjs +0 -1
- package/__app__/chunks/styles.css.mjs +0 -1
- package/__app__/chunks/txt.mjs +0 -1
- package/__app__/chunks/useLikeC4Project.mjs +0 -1
- package/__app__/src/pages/AdHocViewEditor.mjs +0 -1
- package/__app__/src/pages/EmbedPage.mjs +0 -1
- package/__app__/src/pages/ExportPage.mjs +0 -1
- package/__app__/src/pages/ProjectsOverview.mjs +0 -1
- package/__app__/src/pages/ViewAsD2.mjs +0 -1
- package/__app__/src/pages/ViewAsDot.mjs +0 -1
- package/__app__/src/pages/ViewAsMmd.mjs +0 -1
- package/__app__/src/pages/ViewAsPuml.mjs +0 -1
- package/__app__/src/pages/ViewEditor.mjs +0 -1
- package/__app__/src/pages/ViewReact.mjs +0 -1
- package/dist/chunks/libs/@chevrotain/utils.mjs +0 -1
- package/dist/chunks/libs/@hono/mcp.mjs +0 -70
- package/dist/chunks/libs/@hono/node-server.mjs +0 -1
- package/dist/chunks/libs/@logtape/logtape.d.mts +0 -1023
- package/dist/chunks/libs/@modelcontextprotocol/sdk.mjs +0 -12
- package/dist/chunks/libs/ajv.mjs +0 -1
- package/dist/chunks/libs/ansi-align.mjs +0 -2
- package/dist/chunks/libs/ansi-regex.mjs +0 -1
- package/dist/chunks/libs/ansi-styles.mjs +0 -1
- package/dist/chunks/libs/atomically.mjs +0 -1
- package/dist/chunks/libs/boxen.mjs +0 -22
- package/dist/chunks/libs/conf.mjs +0 -1
- package/dist/chunks/libs/defu.mjs +0 -1
- package/dist/chunks/libs/destr.mjs +0 -1
- package/dist/chunks/libs/find-up-simple.mjs +0 -1
- package/dist/chunks/libs/get-port.mjs +0 -1
- package/dist/chunks/libs/hono.mjs +0 -1
- package/dist/chunks/libs/is-docker.mjs +0 -1
- package/dist/chunks/libs/is-error-instance.mjs +0 -1
- package/dist/chunks/libs/is-inside-container.mjs +0 -1
- package/dist/chunks/libs/is-plain-obj.mjs +0 -1
- package/dist/chunks/libs/isexe.mjs +0 -1
- package/dist/chunks/libs/ky.mjs +0 -3
- package/dist/chunks/libs/p-debounce.mjs +0 -1
- package/dist/chunks/libs/p-limit.mjs +0 -1
- package/dist/chunks/libs/p-timeout.mjs +0 -1
- package/dist/chunks/libs/package-up.mjs +0 -1
- package/dist/chunks/libs/parse-ms.mjs +0 -1
- package/dist/chunks/libs/safe-stringify.mjs +0 -1
- package/dist/chunks/libs/strip-indent.mjs +0 -1
- package/dist/chunks/libs/tinyrainbow.mjs +0 -1
- package/dist/chunks/libs/ts-graphviz.mjs +0 -1
- package/dist/chunks/libs/unctx.mjs +0 -1
- package/dist/chunks/libs/vscode-languageserver.mjs +0 -1
- package/dist/chunks/libs/word-wrap.mjs +0 -12
- package/dist/vite-plugin/internal/chunks/libs/@nanostores/react.mjs +0 -1
- package/dist/vite-plugin/internal/chunks/libs/birpc.mjs +0 -1
- package/dist/vite-plugin/internal/chunks/libs/fast-equals.mjs +0 -1
- package/dist/vite-plugin/internal/chunks/libs/nanostores.mjs +0 -1
- package/dist/vite-plugin/internal/chunks/libs/remeda.mjs +0 -1
- package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +0 -1
package/dist/chunks/index2.d.mts
CHANGED
|
@@ -1,754 +1,1577 @@
|
|
|
1
1
|
import { i as __name } from "./rolldown-runtime.mjs";
|
|
2
2
|
import { a as LikeC4ProjectConfig, i as IncludeConfig, o as LikeC4ProjectConfigInput } from "./index.mjs";
|
|
3
|
-
import { t as
|
|
4
|
-
import { $ as FileSystemProvider, A as DefaultValueConverter, B as AsyncDisposable, C as CodeLensParams, D as ValidationOptions, E as DefaultDocumentValidator, F as JSDocDocumentationProvider, G as Reference, H as AstNode, I as DefaultIndexManager, J as LangiumDocument, K as ReferenceInfo, L as ReferenceDescription, M as MaybePromise, N as DefaultScopeProvider, O as DiagnosticInfo, P as Scope, Q as FileSystemNode, R as DefaultNameProvider, S as CodeActionParams, T as DocumentSymbolParams, U as AstNodeDescription, V as Disposable$1, W as CstNode, X as PrecomputedScopes, Y as LangiumDocumentFactory, Z as Stream, _ as CodeLensProvider, _t as SymbolKind, a as LangiumServices, at as CodeAction, b as FileSelector, c as AbstractSemanticTokenProvider, ct as CompletionItemKind, d as AbstractFormatter, dt as DocumentLink, et as Keyword, f as FormattingRegion, ft as DocumentSymbol, g as DefaultDocumentHighlightProvider, gt as Range, h as DocumentLinkProvider, ht as Location, i as NextFeature, it as RequestType, j as ValueType, k as DefaultScopeComputation, l as SemanticTokenAcceptor, lt as Diagnostic, m as NodeKindProvider, mt as Hover, n as CompletionContext, nt as CancellationToken$1, o as LangiumSharedServices, ot as CodeLens, p as DocumentSymbolProvider, pt as FormattingOptions, q as DefaultLangiumDocuments, r as DefaultCompletionProvider, rt as NotificationType, s as DefaultWorkspaceSymbolProvider, st as Command, t as CompletionAcceptor, tt as URI, u as AstNodeHoverProvider, ut as DocumentHighlight, v as CodeActionProvider, vt as TextEdit, w as DocumentLinkParams, x as BuildOptions, y as DefaultWorkspaceManager, yt as WorkspaceFolder, z as WorkspaceCache } from "./libs/langium.mjs";
|
|
3
|
+
import { $ as Stream, A as DefaultScopeComputation, B as WorkspaceCache, C as DocumentLinkParams, D as DefaultDocumentValidator, E as RequestType, F as Scope, G as CstNode, H as Disposable$1, I as JSDocDocumentationProvider, J as DefaultLangiumDocuments, K as Reference, L as DefaultIndexManager, M as ValueType, N as MaybePromise, O as ValidationOptions, P as DefaultScopeProvider, Q as CancellationToken$1, R as ReferenceDescription, S as CodeLensParams, T as NotificationType, U as AstNode, V as AsyncDisposable, W as AstNodeDescription, X as LangiumDocumentFactory, Y as LangiumDocument, Z as PrecomputedScopes, _ as CodeLensProvider, _t as Keyword, a as LangiumServices, at as CompletionItemKind, b as BuildOptions, c as AbstractSemanticTokenProvider, ct as DocumentLink, d as AbstractFormatter, dt as Hover, et as FileSystemNode, f as FormattingRegion, ft as Location, g as DefaultDocumentHighlightProvider, gt as WorkspaceFolder, h as DocumentLinkProvider, ht as TextEdit, i as NextFeature, it as Command, j as DefaultValueConverter, k as DiagnosticInfo, l as SemanticTokenAcceptor, lt as DocumentSymbol, m as NodeKindProvider, mt as SymbolKind, n as CompletionContext, nt as CodeAction, o as LangiumSharedServices, ot as Diagnostic, p as DocumentSymbolProvider, pt as Range, q as ReferenceInfo, r as DefaultCompletionProvider, rt as CodeLens, s as DefaultWorkspaceSymbolProvider, st as DocumentHighlight, t as CompletionAcceptor, tt as FileSystemProvider, u as AstNodeHoverProvider, ut as FormattingOptions, v as CodeActionProvider, vt as URI, w as DocumentSymbolParams, x as CodeActionParams, y as DefaultWorkspaceManager, z as DefaultNameProvider } from "./libs/langium.mjs";
|
|
5
4
|
import { t as $keywords } from "./libs/@ts-graphviz/common.mjs";
|
|
5
|
+
import "./libs/unstorage.mjs";
|
|
6
6
|
import { LikeC4Styles } from "@likec4/core/styles";
|
|
7
7
|
import { EdgeId, Fqn, GuardedBy, LayoutedView, NodeId, NonEmptyArray, NonEmptyReadonlyArray, ProjectId, ViewId } from "@likec4/core/types";
|
|
8
|
+
import { AnyTypes, Builder, BuilderMode, BuilderSpecification, Types } from "@likec4/core/builder";
|
|
8
9
|
import * as c4 from "@likec4/core";
|
|
9
10
|
import { AnyAux, ComputedView, DeploymentFqn, DiagramView, EdgeId as EdgeId$1, Fqn as Fqn$1, LayoutType, LayoutedView as LayoutedView$1, LikeC4Styles as LikeC4Styles$1, NonEmptyArray as NonEmptyArray$1, NonEmptyReadonlyArray as NonEmptyReadonlyArray$1, ProjectId as ProjectId$1, RelationId, Tag, UnknownComputed, UnknownLayouted, UnknownParsed, ViewChange, ViewId as ViewId$1, aux as aux$1 } from "@likec4/core";
|
|
10
11
|
import { DefaultWeakMap, MultiMap } from "@likec4/core/utils";
|
|
11
12
|
import { ElementModel, LikeC4Model } from "@likec4/core/model";
|
|
12
13
|
import { AdhocViewPredicate, ComputedProjectsView, LayoutedProjectsView } from "@likec4/core/compute-view";
|
|
13
|
-
import * as type_fest0 from "type-fest";
|
|
14
14
|
import { ConditionalPick, MergeExclusive, Simplify, Tagged, ValueOf, Writable } from "type-fest";
|
|
15
|
-
|
|
16
|
-
//#region
|
|
15
|
+
//#region ../../node_modules/.pnpm/@logtape+logtape@2.1.1/node_modules/@logtape/logtape/dist/level.d.ts
|
|
16
|
+
//#region src/level.d.ts
|
|
17
|
+
declare const logLevels: readonly ["trace", "debug", "info", "warning", "error", "fatal"];
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
+
* The severity level of a {@link LogRecord}.
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
minlen?: number;
|
|
25
|
-
}
|
|
21
|
+
type LogLevel = typeof logLevels[number];
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region ../../node_modules/.pnpm/@logtape+logtape@2.1.1/node_modules/@logtape/logtape/dist/record.d.ts
|
|
24
|
+
//#region src/record.d.ts
|
|
26
25
|
/**
|
|
27
|
-
*
|
|
28
|
-
* This is the JSON schema the LLM must produce.
|
|
26
|
+
* A log record.
|
|
29
27
|
*/
|
|
30
|
-
interface
|
|
31
|
-
direction?: 'TB' | 'BT' | 'LR' | 'RL';
|
|
32
|
-
ranks: ReadonlyArray<{
|
|
33
|
-
rank: 'same' | 'source' | 'sink' | 'min' | 'max';
|
|
34
|
-
nodes: NonEmptyArray<NodeId>;
|
|
35
|
-
}>;
|
|
36
|
-
edgeWeight: Record<EdgeId, number>;
|
|
37
|
-
edgeMinlen: Record<EdgeId, number>;
|
|
28
|
+
interface LogRecord {
|
|
38
29
|
/**
|
|
39
|
-
*
|
|
40
|
-
* Unique array of EdgeIds.
|
|
30
|
+
* The category of the logger that produced the log record.
|
|
41
31
|
*/
|
|
42
|
-
|
|
32
|
+
readonly category: readonly string[];
|
|
43
33
|
/**
|
|
44
|
-
*
|
|
45
|
-
* Unique array of EdgeIds.
|
|
34
|
+
* The log level.
|
|
46
35
|
*/
|
|
47
|
-
|
|
36
|
+
readonly level: LogLevel;
|
|
48
37
|
/**
|
|
49
|
-
*
|
|
38
|
+
* The log message. This is the result of substituting the message template
|
|
39
|
+
* with the values. The number of elements in this array is always odd,
|
|
40
|
+
* with the message template values interleaved between the substitution
|
|
41
|
+
* values.
|
|
50
42
|
*/
|
|
51
|
-
|
|
43
|
+
readonly message: readonly unknown[];
|
|
52
44
|
/**
|
|
53
|
-
*
|
|
45
|
+
* The raw log message. This is the original message template without any
|
|
46
|
+
* further processing. It can be either:
|
|
47
|
+
*
|
|
48
|
+
* - A string without any substitutions if the log record was created with
|
|
49
|
+
* a method call syntax, e.g., "Hello, {name}!" for
|
|
50
|
+
* `logger.info("Hello, {name}!", { name })`.
|
|
51
|
+
* - A template string array if the log record was created with a tagged
|
|
52
|
+
* template literal syntax, e.g., `["Hello, ", "!"]` for
|
|
53
|
+
* ``logger.info`Hello, ${name}!```.
|
|
54
|
+
*
|
|
55
|
+
* @since 0.6.0
|
|
54
56
|
*/
|
|
55
|
-
|
|
57
|
+
readonly rawMessage: string | TemplateStringsArray;
|
|
56
58
|
/**
|
|
57
|
-
*
|
|
59
|
+
* The timestamp of the log record in milliseconds since the Unix epoch.
|
|
58
60
|
*/
|
|
59
|
-
|
|
61
|
+
readonly timestamp: number;
|
|
60
62
|
/**
|
|
61
|
-
*
|
|
63
|
+
* The extra properties of the log record.
|
|
62
64
|
*/
|
|
63
|
-
|
|
64
|
-
} //#endregion
|
|
65
|
-
//#endregion
|
|
66
|
-
//#region ../language-server/dist/_chunks/protocol.d.mts
|
|
67
|
-
/**
|
|
68
|
-
* When server requests to open a likec4 preview panel
|
|
69
|
-
* (available only in the editor).
|
|
70
|
-
* (not the best place, but seems to be working)
|
|
71
|
-
*/
|
|
72
|
-
declare namespace DidRequestOpenViewNotification {
|
|
73
|
-
type Params = {
|
|
74
|
-
viewId: ViewId$1;
|
|
75
|
-
projectId: ProjectId$1;
|
|
76
|
-
};
|
|
77
|
-
const type: NotificationType<Params>;
|
|
78
|
-
type Type = typeof type;
|
|
65
|
+
readonly properties: Record<string, unknown>;
|
|
79
66
|
}
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region ../../node_modules/.pnpm/@logtape+logtape@2.1.1/node_modules/@logtape/logtape/dist/logger.d.ts
|
|
80
69
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
*
|
|
87
|
-
*
|
|
70
|
+
* A logger interface. It provides methods to log messages at different
|
|
71
|
+
* severity levels.
|
|
72
|
+
*
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const logger = getLogger("category");
|
|
75
|
+
* logger.trace `A trace message with ${value}`
|
|
76
|
+
* logger.debug `A debug message with ${value}.`;
|
|
77
|
+
* logger.info `An info message with ${value}.`;
|
|
78
|
+
* logger.warn `A warning message with ${value}.`;
|
|
79
|
+
* logger.error `An error message with ${value}.`;
|
|
80
|
+
* logger.fatal `A fatal error message with ${value}.`;
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* Callback-based string-message overloads should be treated as
|
|
84
|
+
* fire-and-forget. Async callbacks return `Promise<void>`, and when a
|
|
85
|
+
* callback is filtered out because the level is disabled an implementation may
|
|
86
|
+
* still return an already-resolved promise so the async path remains awaitable
|
|
87
|
+
* without invoking the callback. Call sites should not branch on these
|
|
88
|
+
* return values.
|
|
88
89
|
*/
|
|
89
|
-
|
|
90
|
-
type Params =
|
|
90
|
+
interface Logger {
|
|
91
91
|
/**
|
|
92
|
-
*
|
|
92
|
+
* The category of the logger. It is an array of strings.
|
|
93
93
|
*/
|
|
94
|
-
|
|
95
|
-
element: Fqn$1;
|
|
96
|
-
projectId?: string | undefined;
|
|
97
|
-
property?: string;
|
|
98
|
-
}
|
|
94
|
+
readonly category: readonly string[];
|
|
99
95
|
/**
|
|
100
|
-
*
|
|
96
|
+
* The logger with the supercategory of the current logger. If the current
|
|
97
|
+
* logger is the root logger, this is `null`.
|
|
101
98
|
*/
|
|
102
|
-
|
|
|
103
|
-
projectId?: string | undefined;
|
|
104
|
-
relation: RelationId;
|
|
105
|
-
}
|
|
99
|
+
readonly parent: Logger | null;
|
|
106
100
|
/**
|
|
107
|
-
*
|
|
101
|
+
* Get a child logger with the given subcategory.
|
|
102
|
+
*
|
|
103
|
+
* ```typescript
|
|
104
|
+
* const logger = getLogger("category");
|
|
105
|
+
* const subLogger = logger.getChild("sub-category");
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* The above code is equivalent to:
|
|
109
|
+
*
|
|
110
|
+
* ```typescript
|
|
111
|
+
* const logger = getLogger("category");
|
|
112
|
+
* const subLogger = getLogger(["category", "sub-category"]);
|
|
113
|
+
* ```
|
|
114
|
+
*
|
|
115
|
+
* @param subcategory The subcategory.
|
|
116
|
+
* @returns The child logger.
|
|
108
117
|
*/
|
|
109
|
-
|
|
|
110
|
-
deployment: DeploymentFqn;
|
|
111
|
-
projectId?: string | undefined;
|
|
112
|
-
property?: string;
|
|
113
|
-
}
|
|
118
|
+
getChild(subcategory: string | readonly [string] | readonly [string, ...string[]]): Logger;
|
|
114
119
|
/**
|
|
115
|
-
*
|
|
120
|
+
* Get a logger with contextual properties. This is useful for
|
|
121
|
+
* log multiple messages with the shared set of properties.
|
|
122
|
+
*
|
|
123
|
+
* ```typescript
|
|
124
|
+
* const logger = getLogger("category");
|
|
125
|
+
* const ctx = logger.with({ foo: 123, bar: "abc" });
|
|
126
|
+
* ctx.info("A message with {foo} and {bar}.");
|
|
127
|
+
* ctx.warn("Another message with {foo}, {bar}, and {baz}.", { baz: true });
|
|
128
|
+
* ```
|
|
129
|
+
*
|
|
130
|
+
* The above code is equivalent to:
|
|
131
|
+
*
|
|
132
|
+
* ```typescript
|
|
133
|
+
* const logger = getLogger("category");
|
|
134
|
+
* logger.info("A message with {foo} and {bar}.", { foo: 123, bar: "abc" });
|
|
135
|
+
* logger.warn(
|
|
136
|
+
* "Another message with {foo}, {bar}, and {baz}.",
|
|
137
|
+
* { foo: 123, bar: "abc", baz: true },
|
|
138
|
+
* );
|
|
139
|
+
* ```
|
|
140
|
+
*
|
|
141
|
+
* @param properties
|
|
142
|
+
* @returns
|
|
143
|
+
* @since 0.5.0
|
|
116
144
|
*/
|
|
117
|
-
|
|
118
|
-
view: ViewId$1;
|
|
119
|
-
astPath: string;
|
|
120
|
-
projectId?: string | undefined;
|
|
121
|
-
}
|
|
145
|
+
with(properties: Record<string, unknown>): Logger;
|
|
122
146
|
/**
|
|
123
|
-
*
|
|
147
|
+
* Log a trace message. Use this as a template string prefix.
|
|
148
|
+
*
|
|
149
|
+
* ```typescript
|
|
150
|
+
* logger.trace `A trace message with ${value}.`;
|
|
151
|
+
* ```
|
|
152
|
+
*
|
|
153
|
+
* @param message The message template strings array.
|
|
154
|
+
* @param values The message template values.
|
|
155
|
+
* @since 0.12.0
|
|
124
156
|
*/
|
|
125
|
-
|
|
126
|
-
view: ViewId$1;
|
|
127
|
-
projectId?: string | undefined;
|
|
128
|
-
};
|
|
129
|
-
type Res = Location | null;
|
|
130
|
-
const req: RequestType<Params, Res, void>;
|
|
131
|
-
type Req = typeof req;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Request to change the view
|
|
135
|
-
* If LSP has multiple projects, the projectId is required.
|
|
136
|
-
*/
|
|
137
|
-
declare namespace ChangeView {
|
|
138
|
-
type Params = {
|
|
139
|
-
viewId: ViewId$1;
|
|
140
|
-
change: ViewChange;
|
|
141
|
-
projectId?: string | undefined;
|
|
142
|
-
};
|
|
143
|
-
type Res = {
|
|
144
|
-
success: true;
|
|
145
|
-
location: Location | null;
|
|
146
|
-
} | {
|
|
147
|
-
success: false;
|
|
148
|
-
location?: Location | null;
|
|
149
|
-
error: string;
|
|
150
|
-
};
|
|
151
|
-
const req: RequestType<Params, Res, void>;
|
|
152
|
-
type Req = typeof req;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Request to fetch telemetry metrics
|
|
156
|
-
*/
|
|
157
|
-
//#endregion
|
|
158
|
-
//#region ../layouts/dist/_chunks/GraphvizLayoter.d.mts
|
|
159
|
-
//#region src/graphviz/types.d.ts
|
|
160
|
-
/**
|
|
161
|
-
* Partially implements CancellationToken interface from vscode-jsonrpc
|
|
162
|
-
*/
|
|
163
|
-
type CancellationToken = {
|
|
157
|
+
trace(message: TemplateStringsArray, ...values: readonly unknown[]): void;
|
|
164
158
|
/**
|
|
165
|
-
*
|
|
159
|
+
* Log a trace message with properties.
|
|
160
|
+
*
|
|
161
|
+
* ```typescript
|
|
162
|
+
* logger.trace('A trace message with {value}.', { value });
|
|
163
|
+
* ```
|
|
164
|
+
*
|
|
165
|
+
* If the properties are expensive to compute, you can pass a callback that
|
|
166
|
+
* returns the properties:
|
|
167
|
+
*
|
|
168
|
+
* ```typescript
|
|
169
|
+
* logger.trace(
|
|
170
|
+
* 'A trace message with {value}.',
|
|
171
|
+
* () => ({ value: expensiveComputation() })
|
|
172
|
+
* );
|
|
173
|
+
* ```
|
|
174
|
+
*
|
|
175
|
+
* @param message The message template. Placeholders to be replaced with
|
|
176
|
+
* `values` are indicated by keys in curly braces (e.g.,
|
|
177
|
+
* `{value}`).
|
|
178
|
+
* @param properties The values to replace placeholders with. For lazy
|
|
179
|
+
* evaluation, this can be a callback that returns the
|
|
180
|
+
* properties.
|
|
181
|
+
* @since 0.12.0
|
|
166
182
|
*/
|
|
167
|
-
|
|
168
|
-
};
|
|
169
|
-
declare module 'ts-graphviz' {
|
|
170
|
-
namespace GraphAttributeKey {
|
|
171
|
-
interface $values extends $keywords<'likec4_viewId'> {}
|
|
172
|
-
}
|
|
173
|
-
namespace ClusterSubgraphAttributeKey {
|
|
174
|
-
interface $values extends $keywords<'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_level' | 'likec4_depth'> {}
|
|
175
|
-
}
|
|
176
|
-
namespace NodeAttributeKey {
|
|
177
|
-
interface $values extends $keywords<'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_project' | 'likec4_level'> {}
|
|
178
|
-
}
|
|
179
|
-
namespace EdgeAttributeKey {
|
|
180
|
-
interface $values extends $keywords<'likec4_id' | 'likec4_project'> {}
|
|
181
|
-
}
|
|
182
|
-
namespace Attribute {
|
|
183
|
-
interface $keys extends $keywords<'likec4_viewId' | 'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_project' | 'likec4_level' | 'likec4_depth'> {}
|
|
184
|
-
interface $types {
|
|
185
|
-
likec4_viewId: string;
|
|
186
|
-
likec4_type: 'folder' | 'file' | 'view';
|
|
187
|
-
likec4_path: string;
|
|
188
|
-
likec4_id: string;
|
|
189
|
-
likec4_project: string;
|
|
190
|
-
likec4_level: number;
|
|
191
|
-
likec4_depth: number;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
type DotSource = Tagged<string, 'DotSource'>; //#endregion
|
|
196
|
-
//#region src/graphviz/types-dot.d.ts
|
|
197
|
-
type GvNodeName = Tagged<string, 'GvNodeName'>;
|
|
198
|
-
type GvId = Tagged<number, 'GvId'>;
|
|
199
|
-
type Point = [x: number, y: number];
|
|
200
|
-
interface GraphvizJson {
|
|
201
|
-
name: GvNodeName;
|
|
202
|
-
directed: boolean;
|
|
203
|
-
strict: boolean;
|
|
204
|
-
_draw_: GraphvizJson.Draw[];
|
|
205
|
-
bb: string;
|
|
206
|
-
compound: string;
|
|
207
|
-
fontname: string;
|
|
208
|
-
fontsize: string;
|
|
209
|
-
label: string;
|
|
210
|
-
nodesep: string;
|
|
211
|
-
outputorder: string;
|
|
212
|
-
rankdir: string;
|
|
213
|
-
ranksep: string;
|
|
214
|
-
splines: string;
|
|
215
|
-
xdotversion: string;
|
|
216
|
-
_subgraph_cnt: number;
|
|
217
|
-
objects?: GraphvizJson.GvObject[];
|
|
218
|
-
edges?: GraphvizJson.Edge[];
|
|
219
|
-
}
|
|
220
|
-
declare namespace GraphvizJson {
|
|
221
|
-
interface Draw {
|
|
222
|
-
op: string;
|
|
223
|
-
grad: string;
|
|
224
|
-
color: string;
|
|
225
|
-
points: Point[];
|
|
226
|
-
}
|
|
227
|
-
interface Draw2 {
|
|
228
|
-
op: string;
|
|
229
|
-
grad: string;
|
|
230
|
-
color: string;
|
|
231
|
-
points: Point[];
|
|
232
|
-
}
|
|
233
|
-
namespace DrawOps {
|
|
234
|
-
type Style = {
|
|
235
|
-
op: 'S';
|
|
236
|
-
style: string;
|
|
237
|
-
};
|
|
238
|
-
type BSpline = {
|
|
239
|
-
op: 'b' | 'B';
|
|
240
|
-
points: Point[];
|
|
241
|
-
};
|
|
242
|
-
type Color = {
|
|
243
|
-
op: 'c';
|
|
244
|
-
grad: string;
|
|
245
|
-
color: string;
|
|
246
|
-
};
|
|
247
|
-
type Polygon = {
|
|
248
|
-
op: 'p' | 'P';
|
|
249
|
-
points: Point[];
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
type DrawOp = DrawOps.Style | DrawOps.BSpline | DrawOps.Color | DrawOps.Polygon;
|
|
253
|
-
type LabelDrawOps = {
|
|
254
|
-
op: 'F';
|
|
255
|
-
size: number;
|
|
256
|
-
face: string;
|
|
257
|
-
} | {
|
|
258
|
-
op: 'c';
|
|
259
|
-
color: string;
|
|
260
|
-
} | {
|
|
261
|
-
op: 't';
|
|
262
|
-
fontchar: number;
|
|
263
|
-
} | {
|
|
264
|
-
op: 'T';
|
|
265
|
-
pt: Point;
|
|
266
|
-
align: 'l' | 'r' | 'c';
|
|
267
|
-
width: number;
|
|
268
|
-
text: string;
|
|
269
|
-
};
|
|
270
|
-
type GvObject = GvNodeObject | GvSubgraph;
|
|
271
|
-
interface GvSubgraph {
|
|
272
|
-
bb: string;
|
|
273
|
-
label?: string;
|
|
274
|
-
compound: 'true';
|
|
275
|
-
_ldraw_?: LabelDrawOps[];
|
|
276
|
-
likec4_type?: 'folder' | 'file';
|
|
277
|
-
likec4_path?: string;
|
|
278
|
-
likec4_id?: Fqn$1;
|
|
279
|
-
likec4_level?: number;
|
|
280
|
-
likec4_depth?: number;
|
|
281
|
-
_gvid: GvId;
|
|
282
|
-
subgraphs?: GvId[];
|
|
283
|
-
nodes?: GvId[];
|
|
284
|
-
edges?: GvId[];
|
|
285
|
-
}
|
|
286
|
-
interface GvNodeObject {
|
|
287
|
-
_draw_: Draw[];
|
|
288
|
-
_ldraw_?: LabelDrawOps[];
|
|
289
|
-
likec4_type?: 'folder' | 'file' | 'view';
|
|
290
|
-
likec4_path?: string;
|
|
291
|
-
likec4_id?: Fqn$1;
|
|
292
|
-
likec4_level?: number;
|
|
293
|
-
_gvid: GvId;
|
|
294
|
-
height: string;
|
|
295
|
-
pos: string;
|
|
296
|
-
shape: 'rect';
|
|
297
|
-
width: string;
|
|
298
|
-
label?: string;
|
|
299
|
-
}
|
|
300
|
-
interface Draw3 {
|
|
301
|
-
op: string;
|
|
302
|
-
grad: string;
|
|
303
|
-
color: string;
|
|
304
|
-
points: Point[];
|
|
305
|
-
}
|
|
306
|
-
interface Hdraw {
|
|
307
|
-
op: string;
|
|
308
|
-
style: string;
|
|
309
|
-
grad: string;
|
|
310
|
-
color: string;
|
|
311
|
-
points: Point[];
|
|
312
|
-
}
|
|
313
|
-
interface Edge {
|
|
314
|
-
_gvid: GvId;
|
|
315
|
-
tail: GvId;
|
|
316
|
-
head: GvId;
|
|
317
|
-
dir?: 'forward' | 'back' | 'both' | 'none';
|
|
318
|
-
_draw_: DrawOp[];
|
|
319
|
-
_hdraw_?: DrawOp[];
|
|
320
|
-
_tdraw_?: DrawOp[];
|
|
321
|
-
_ldraw_?: LabelDrawOps[];
|
|
322
|
-
_tldraw_?: LabelDrawOps[];
|
|
323
|
-
_hldraw_?: LabelDrawOps[];
|
|
324
|
-
fontname: string;
|
|
325
|
-
fontsize: string;
|
|
326
|
-
likec4_id?: EdgeId$1;
|
|
327
|
-
label: string;
|
|
328
|
-
lp: string;
|
|
329
|
-
nojustify?: 'true' | 'false';
|
|
330
|
-
pos?: string;
|
|
331
|
-
}
|
|
332
|
-
} //#endregion
|
|
333
|
-
//#region src/graphviz/GraphvizLayoter.d.ts
|
|
334
|
-
interface GraphvizPort extends Disposable {
|
|
335
|
-
get name(): string;
|
|
336
|
-
get concurrency(): number;
|
|
337
|
-
unflatten(dot: DotSource): Promise<DotSource>;
|
|
338
|
-
acyclic(dot: DotSource): Promise<DotSource>;
|
|
339
|
-
layoutJson(dot: DotSource): Promise<string>;
|
|
340
|
-
svg(dot: DotSource): Promise<string>;
|
|
341
|
-
dispose(): void;
|
|
342
|
-
}
|
|
343
|
-
type LayoutTaskParams<A extends aux$1.Any = aux$1.Any> = {
|
|
344
|
-
view: ComputedView<A>;
|
|
345
|
-
styles: LikeC4Styles$1;
|
|
346
|
-
};
|
|
347
|
-
type LayoutResult<A extends aux$1.Any = aux$1.Any> = {
|
|
348
|
-
dot: DotSource;
|
|
349
|
-
diagram: DiagramView<A>;
|
|
350
|
-
};
|
|
351
|
-
declare class GraphvizLayouter implements Disposable {
|
|
352
|
-
private graphviz;
|
|
353
|
-
constructor(graphviz?: GraphvizPort);
|
|
354
|
-
dispose(): void;
|
|
355
|
-
[Symbol.dispose](): void;
|
|
356
|
-
get graphvizPort(): GraphvizPort;
|
|
357
|
-
changePort(graphviz: GraphvizPort): void;
|
|
183
|
+
trace(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
|
|
358
184
|
/**
|
|
359
|
-
*
|
|
360
|
-
*
|
|
361
|
-
*
|
|
185
|
+
* Log a trace message with properties computed asynchronously.
|
|
186
|
+
*
|
|
187
|
+
* Use this when the properties require async operations to compute:
|
|
188
|
+
*
|
|
189
|
+
* ```typescript
|
|
190
|
+
* await logger.trace(
|
|
191
|
+
* 'A trace message with {value}.',
|
|
192
|
+
* async () => ({ value: await fetchValue() })
|
|
193
|
+
* );
|
|
194
|
+
* ```
|
|
195
|
+
*
|
|
196
|
+
* @param message The message template. Placeholders to be replaced with
|
|
197
|
+
* `values` are indicated by keys in curly braces (e.g.,
|
|
198
|
+
* `{value}`).
|
|
199
|
+
* @param properties An async callback that returns the properties.
|
|
200
|
+
* @returns A promise that resolves when the log is written.
|
|
201
|
+
* @since 2.0.0
|
|
362
202
|
*/
|
|
363
|
-
|
|
364
|
-
protected newScopedLogger(operation: string): any;
|
|
365
|
-
dotToJson(dot: DotSource): Promise<GraphvizJson>;
|
|
366
|
-
layout<A extends AnyAux>(params: LayoutTaskParams<A>): Promise<LayoutResult<A>>;
|
|
367
|
-
aiLayout<A extends AnyAux>({
|
|
368
|
-
view,
|
|
369
|
-
styles
|
|
370
|
-
}: LayoutTaskParams<A>, hints: AILayoutHints): Promise<LayoutResult<A>>;
|
|
371
|
-
svg<A extends AnyAux>(params: LayoutTaskParams<A>): Promise<{
|
|
372
|
-
svg: string;
|
|
373
|
-
dot: DotSource;
|
|
374
|
-
}>;
|
|
375
|
-
dot<A extends AnyAux>(params: LayoutTaskParams<A>): Promise<DotSource>;
|
|
376
|
-
layoutProjectsView(view: ComputedProjectsView): Promise<LayoutedProjectsView>;
|
|
377
|
-
} //#endregion
|
|
378
|
-
//#endregion
|
|
379
|
-
//#region ../layouts/dist/index.d.mts
|
|
380
|
-
//#region src/graphviz/QueueGraphvizLayoter.d.ts
|
|
381
|
-
declare class QueueGraphvizLayoter extends GraphvizLayouter {
|
|
382
|
-
private queue;
|
|
383
|
-
private isProcessingBatch;
|
|
384
|
-
constructor(options?: {
|
|
385
|
-
graphviz?: GraphvizPort;
|
|
386
|
-
/**
|
|
387
|
-
* Concurrency limit.
|
|
388
|
-
* Minimum: `1`.
|
|
389
|
-
* @default 2
|
|
390
|
-
*/
|
|
391
|
-
concurrency?: number;
|
|
392
|
-
/**
|
|
393
|
-
* Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already.
|
|
394
|
-
* @default 20_000
|
|
395
|
-
*/
|
|
396
|
-
timeout?: number;
|
|
397
|
-
/**
|
|
398
|
-
* Whether or not a timeout is considered an exception.
|
|
399
|
-
* @default true
|
|
400
|
-
*/
|
|
401
|
-
throwOnTimeout?: boolean;
|
|
402
|
-
});
|
|
403
|
-
private runInQueue;
|
|
404
|
-
changePort(graphvizPort: GraphvizPort): void;
|
|
405
|
-
layout<A extends AnyAux>(params: LayoutTaskParams<A>): Promise<LayoutResult<A>>;
|
|
406
|
-
layoutProjectsView(view: ComputedProjectsView): Promise<LayoutedProjectsView>;
|
|
407
|
-
batchLayout<A extends AnyAux>(params: {
|
|
408
|
-
batch: LayoutTaskParams<A>[];
|
|
409
|
-
cancelToken?: CancellationToken | undefined;
|
|
410
|
-
onSuccess?: (task: LayoutTaskParams<A>, result: LayoutResult<A>) => void;
|
|
411
|
-
onError?: (task: LayoutTaskParams<A>, error: unknown) => void;
|
|
412
|
-
}): Promise<LayoutResult<A>[]>;
|
|
203
|
+
trace(message: string, properties: () => Promise<Record<string, unknown>>): Promise<void>;
|
|
413
204
|
/**
|
|
414
|
-
*
|
|
415
|
-
*
|
|
205
|
+
* Log a trace values with no message. This is useful when you
|
|
206
|
+
* want to log properties without a message, e.g., when you want to log
|
|
207
|
+
* the context of a request or an operation.
|
|
208
|
+
*
|
|
209
|
+
* ```typescript
|
|
210
|
+
* logger.trace({ method: 'GET', url: '/api/v1/resource' });
|
|
211
|
+
* ```
|
|
212
|
+
*
|
|
213
|
+
* Note that this is a shorthand for:
|
|
214
|
+
*
|
|
215
|
+
* ```typescript
|
|
216
|
+
* logger.trace('{*}', { method: 'GET', url: '/api/v1/resource' });
|
|
217
|
+
* ```
|
|
218
|
+
*
|
|
219
|
+
* If the properties are expensive to compute, you cannot use this shorthand
|
|
220
|
+
* and should use the following syntax instead:
|
|
221
|
+
*
|
|
222
|
+
* ```typescript
|
|
223
|
+
* logger.trace('{*}', () => ({
|
|
224
|
+
* method: expensiveMethod(),
|
|
225
|
+
* url: expensiveUrl(),
|
|
226
|
+
* }));
|
|
227
|
+
* ```
|
|
228
|
+
*
|
|
229
|
+
* @param properties The values to log. Note that this does not take
|
|
230
|
+
* a callback.
|
|
231
|
+
* @since 0.12.0
|
|
416
232
|
*/
|
|
417
|
-
|
|
418
|
-
dispose(): void;
|
|
419
|
-
} //#endregion
|
|
420
|
-
//#region src/graphviz/wasm/GraphvizWasmAdapter.d.ts
|
|
421
|
-
//#endregion
|
|
422
|
-
//#region ../language-server/dist/_chunks/module.d.mts
|
|
423
|
-
//#region src/documentation/documentation-provider.d.ts
|
|
424
|
-
/**
|
|
425
|
-
* Provides documentation for LikeC4 AST nodes, extending JSDoc parsing
|
|
426
|
-
* with specialized formatting for deployment nodes, deployed instances, and elements.
|
|
427
|
-
*/
|
|
428
|
-
declare class LikeC4DocumentationProvider extends JSDocDocumentationProvider {
|
|
429
|
-
private parser;
|
|
430
|
-
private locator;
|
|
233
|
+
trace(properties: Record<string, unknown>): void;
|
|
431
234
|
/**
|
|
432
|
-
*
|
|
433
|
-
*
|
|
235
|
+
* Lazily log a trace message. Use this when the message values are expensive
|
|
236
|
+
* to compute and should only be computed if the message is actually logged.
|
|
237
|
+
*
|
|
238
|
+
* ```typescript
|
|
239
|
+
* logger.trace(l => l`A trace message with ${expensiveValue()}.`);
|
|
240
|
+
* ```
|
|
241
|
+
*
|
|
242
|
+
* @param callback A callback that returns the message template prefix.
|
|
243
|
+
* @throws {TypeError} If no log record was made inside the callback.
|
|
244
|
+
* @since 0.12.0
|
|
434
245
|
*/
|
|
435
|
-
|
|
246
|
+
trace(callback: LogCallback): void;
|
|
436
247
|
/**
|
|
437
|
-
*
|
|
438
|
-
*
|
|
439
|
-
*
|
|
248
|
+
* Log a debug message. Use this as a template string prefix.
|
|
249
|
+
*
|
|
250
|
+
* ```typescript
|
|
251
|
+
* logger.debug `A debug message with ${value}.`;
|
|
252
|
+
* ```
|
|
253
|
+
*
|
|
254
|
+
* @param message The message template strings array.
|
|
255
|
+
* @param values The message template values.
|
|
440
256
|
*/
|
|
441
|
-
|
|
442
|
-
} //#endregion
|
|
443
|
-
//#region src/workspace/ProjectsManager.d.ts
|
|
444
|
-
type NormalizedUri = Tagged<string, 'NormalizedUri'>;
|
|
445
|
-
type DocOrUri = LangiumDocument | string | URI;
|
|
446
|
-
/**
|
|
447
|
-
* A tagged string that represents a project folder URI (with trailing slash).
|
|
448
|
-
* Used in `startsWith` checks to determine if a document belongs to a project.
|
|
449
|
-
*/
|
|
450
|
-
type ProjectFolder = Tagged<string, 'ProjectFolder'>;
|
|
451
|
-
declare function ProjectFolder(folder: URI | string): ProjectFolder;
|
|
452
|
-
interface Project {
|
|
453
|
-
id: ProjectId;
|
|
454
|
-
folderUri: URI;
|
|
455
|
-
config: LikeC4ProjectConfig;
|
|
456
|
-
}
|
|
457
|
-
interface ProjectData extends Project {
|
|
458
|
-
id: ProjectId;
|
|
459
|
-
folder: ProjectFolder;
|
|
460
|
-
config: LikeC4ProjectConfig;
|
|
461
|
-
configUri: URI;
|
|
462
|
-
folderUri: URI;
|
|
463
|
-
exclude?: {
|
|
464
|
-
(test: string): boolean;
|
|
465
|
-
};
|
|
257
|
+
debug(message: TemplateStringsArray, ...values: readonly unknown[]): void;
|
|
466
258
|
/**
|
|
467
|
-
*
|
|
468
|
-
*
|
|
259
|
+
* Log a debug message with properties.
|
|
260
|
+
*
|
|
261
|
+
* ```typescript
|
|
262
|
+
* logger.debug('A debug message with {value}.', { value });
|
|
263
|
+
* ```
|
|
264
|
+
*
|
|
265
|
+
* If the properties are expensive to compute, you can pass a callback that
|
|
266
|
+
* returns the properties:
|
|
267
|
+
*
|
|
268
|
+
* ```typescript
|
|
269
|
+
* logger.debug(
|
|
270
|
+
* 'A debug message with {value}.',
|
|
271
|
+
* () => ({ value: expensiveComputation() })
|
|
272
|
+
* );
|
|
273
|
+
* ```
|
|
274
|
+
*
|
|
275
|
+
* @param message The message template. Placeholders to be replaced with
|
|
276
|
+
* `values` are indicated by keys in curly braces (e.g.,
|
|
277
|
+
* `{value}`).
|
|
278
|
+
* @param properties The values to replace placeholders with. For lazy
|
|
279
|
+
* evaluation, this can be a callback that returns the
|
|
280
|
+
* properties.
|
|
469
281
|
*/
|
|
470
|
-
|
|
471
|
-
uri: URI;
|
|
472
|
-
folder: ProjectFolder;
|
|
473
|
-
}>;
|
|
282
|
+
debug(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
|
|
474
283
|
/**
|
|
475
|
-
*
|
|
284
|
+
* Log a debug message with properties computed asynchronously.
|
|
285
|
+
*
|
|
286
|
+
* Use this when the properties require async operations to compute:
|
|
287
|
+
*
|
|
288
|
+
* ```typescript
|
|
289
|
+
* await logger.debug(
|
|
290
|
+
* 'A debug message with {value}.',
|
|
291
|
+
* async () => ({ value: await fetchValue() })
|
|
292
|
+
* );
|
|
293
|
+
* ```
|
|
294
|
+
*
|
|
295
|
+
* @param message The message template. Placeholders to be replaced with
|
|
296
|
+
* `values` are indicated by keys in curly braces (e.g.,
|
|
297
|
+
* `{value}`).
|
|
298
|
+
* @param properties An async callback that returns the properties.
|
|
299
|
+
* @returns A promise that resolves when the log is written.
|
|
300
|
+
* @since 2.0.0
|
|
476
301
|
*/
|
|
477
|
-
|
|
478
|
-
}
|
|
479
|
-
type RegisterProjectOptions = {
|
|
480
|
-
config: LikeC4ProjectConfig | LikeC4ProjectConfigInput;
|
|
481
|
-
} & ({
|
|
482
|
-
configUri: URI | string;
|
|
483
|
-
} | {
|
|
484
|
-
folderUri: URI | string;
|
|
485
|
-
});
|
|
486
|
-
declare class ProjectsManager {
|
|
487
|
-
#private;
|
|
488
|
-
protected services: LikeC4SharedServices;
|
|
302
|
+
debug(message: string, properties: () => Promise<Record<string, unknown>>): Promise<void>;
|
|
489
303
|
/**
|
|
490
|
-
*
|
|
491
|
-
*
|
|
304
|
+
* Log a debug values with no message. This is useful when you
|
|
305
|
+
* want to log properties without a message, e.g., when you want to log
|
|
306
|
+
* the context of a request or an operation.
|
|
307
|
+
*
|
|
308
|
+
* ```typescript
|
|
309
|
+
* logger.debug({ method: 'GET', url: '/api/v1/resource' });
|
|
310
|
+
* ```
|
|
311
|
+
*
|
|
312
|
+
* Note that this is a shorthand for:
|
|
313
|
+
*
|
|
314
|
+
* ```typescript
|
|
315
|
+
* logger.debug('{*}', { method: 'GET', url: '/api/v1/resource' });
|
|
316
|
+
* ```
|
|
317
|
+
*
|
|
318
|
+
* If the properties are expensive to compute, you cannot use this shorthand
|
|
319
|
+
* and should use the following syntax instead:
|
|
320
|
+
*
|
|
321
|
+
* ```typescript
|
|
322
|
+
* logger.debug('{*}', () => ({
|
|
323
|
+
* method: expensiveMethod(),
|
|
324
|
+
* url: expensiveUrl(),
|
|
325
|
+
* }));
|
|
326
|
+
* ```
|
|
327
|
+
*
|
|
328
|
+
* @param properties The values to log. Note that this does not take
|
|
329
|
+
* a callback.
|
|
330
|
+
* @since 0.11.0
|
|
492
331
|
*/
|
|
493
|
-
|
|
494
|
-
constructor(services: LikeC4SharedServices);
|
|
332
|
+
debug(properties: Record<string, unknown>): void;
|
|
495
333
|
/**
|
|
496
|
-
*
|
|
497
|
-
*
|
|
334
|
+
* Lazily log a debug message. Use this when the message values are expensive
|
|
335
|
+
* to compute and should only be computed if the message is actually logged.
|
|
336
|
+
*
|
|
337
|
+
* ```typescript
|
|
338
|
+
* logger.debug(l => l`A debug message with ${expensiveValue()}.`);
|
|
339
|
+
* ```
|
|
340
|
+
*
|
|
341
|
+
* @param callback A callback that returns the message template prefix.
|
|
342
|
+
* @throws {TypeError} If no log record was made inside the callback.
|
|
498
343
|
*/
|
|
499
|
-
|
|
344
|
+
debug(callback: LogCallback): void;
|
|
500
345
|
/**
|
|
501
|
-
*
|
|
502
|
-
*
|
|
346
|
+
* Log an informational message. Use this as a template string prefix.
|
|
347
|
+
*
|
|
348
|
+
* ```typescript
|
|
349
|
+
* logger.info `An info message with ${value}.`;
|
|
350
|
+
* ```
|
|
351
|
+
*
|
|
352
|
+
* @param message The message template strings array.
|
|
353
|
+
* @param values The message template values.
|
|
503
354
|
*/
|
|
504
|
-
|
|
355
|
+
info(message: TemplateStringsArray, ...values: readonly unknown[]): void;
|
|
505
356
|
/**
|
|
506
|
-
*
|
|
507
|
-
*
|
|
508
|
-
*
|
|
509
|
-
*
|
|
510
|
-
*
|
|
357
|
+
* Log an informational message with properties.
|
|
358
|
+
*
|
|
359
|
+
* ```typescript
|
|
360
|
+
* logger.info('An info message with {value}.', { value });
|
|
361
|
+
* ```
|
|
362
|
+
*
|
|
363
|
+
* If the properties are expensive to compute, you can pass a callback that
|
|
364
|
+
* returns the properties:
|
|
365
|
+
*
|
|
366
|
+
* ```typescript
|
|
367
|
+
* logger.info(
|
|
368
|
+
* 'An info message with {value}.',
|
|
369
|
+
* () => ({ value: expensiveComputation() })
|
|
370
|
+
* );
|
|
371
|
+
* ```
|
|
372
|
+
*
|
|
373
|
+
* @param message The message template. Placeholders to be replaced with
|
|
374
|
+
* `values` are indicated by keys in curly braces (e.g.,
|
|
375
|
+
* `{value}`).
|
|
376
|
+
* @param properties The values to replace placeholders with. For lazy
|
|
377
|
+
* evaluation, this can be a callback that returns the
|
|
378
|
+
* properties.
|
|
511
379
|
*/
|
|
512
|
-
|
|
513
|
-
set defaultProjectId(id: string | ProjectId | undefined);
|
|
514
|
-
get default(): ProjectData;
|
|
515
|
-
get all(): NonEmptyReadonlyArray$1<ProjectId>;
|
|
516
|
-
getProject(arg: ProjectId | LangiumDocument): ProjectData;
|
|
380
|
+
info(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
|
|
517
381
|
/**
|
|
518
|
-
*
|
|
382
|
+
* Log an informational message with properties computed asynchronously.
|
|
383
|
+
*
|
|
384
|
+
* Use this when the properties require async operations to compute:
|
|
385
|
+
*
|
|
386
|
+
* ```typescript
|
|
387
|
+
* await logger.info(
|
|
388
|
+
* 'An info message with {value}.',
|
|
389
|
+
* async () => ({ value: await fetchValue() })
|
|
390
|
+
* );
|
|
391
|
+
* ```
|
|
392
|
+
*
|
|
393
|
+
* @param message The message template. Placeholders to be replaced with
|
|
394
|
+
* `values` are indicated by keys in curly braces (e.g.,
|
|
395
|
+
* `{value}`).
|
|
396
|
+
* @param properties An async callback that returns the properties.
|
|
397
|
+
* @returns A promise that resolves when the log is written.
|
|
398
|
+
* @since 2.0.0
|
|
519
399
|
*/
|
|
520
|
-
|
|
400
|
+
info(message: string, properties: () => Promise<Record<string, unknown>>): Promise<void>;
|
|
521
401
|
/**
|
|
522
|
-
*
|
|
523
|
-
*
|
|
524
|
-
*
|
|
402
|
+
* Log an informational values with no message. This is useful when you
|
|
403
|
+
* want to log properties without a message, e.g., when you want to log
|
|
404
|
+
* the context of a request or an operation.
|
|
405
|
+
*
|
|
406
|
+
* ```typescript
|
|
407
|
+
* logger.info({ method: 'GET', url: '/api/v1/resource' });
|
|
408
|
+
* ```
|
|
409
|
+
*
|
|
410
|
+
* Note that this is a shorthand for:
|
|
411
|
+
*
|
|
412
|
+
* ```typescript
|
|
413
|
+
* logger.info('{*}', { method: 'GET', url: '/api/v1/resource' });
|
|
414
|
+
* ```
|
|
415
|
+
*
|
|
416
|
+
* If the properties are expensive to compute, you cannot use this shorthand
|
|
417
|
+
* and should use the following syntax instead:
|
|
418
|
+
*
|
|
419
|
+
* ```typescript
|
|
420
|
+
* logger.info('{*}', () => ({
|
|
421
|
+
* method: expensiveMethod(),
|
|
422
|
+
* url: expensiveUrl(),
|
|
423
|
+
* }));
|
|
424
|
+
* ```
|
|
425
|
+
*
|
|
426
|
+
* @param properties The values to log. Note that this does not take
|
|
427
|
+
* a callback.
|
|
428
|
+
* @since 0.11.0
|
|
525
429
|
*/
|
|
526
|
-
|
|
430
|
+
info(properties: Record<string, unknown>): void;
|
|
527
431
|
/**
|
|
528
|
-
*
|
|
529
|
-
*
|
|
432
|
+
* Lazily log an informational message. Use this when the message values are
|
|
433
|
+
* expensive to compute and should only be computed if the message is actually
|
|
434
|
+
* logged.
|
|
530
435
|
*
|
|
531
|
-
*
|
|
436
|
+
* ```typescript
|
|
437
|
+
* logger.info(l => l`An info message with ${expensiveValue()}.`);
|
|
438
|
+
* ```
|
|
532
439
|
*
|
|
533
|
-
* @
|
|
440
|
+
* @param callback A callback that returns the message template prefix.
|
|
441
|
+
* @throws {TypeError} If no log record was made inside the callback.
|
|
534
442
|
*/
|
|
535
|
-
|
|
536
|
-
hasMultipleProjects(): boolean;
|
|
443
|
+
info(callback: LogCallback): void;
|
|
537
444
|
/**
|
|
538
|
-
*
|
|
445
|
+
* Log a warning.
|
|
446
|
+
*
|
|
447
|
+
* This overload is a shorthand for logging an {@link Error} instance as a
|
|
448
|
+
* structured property.
|
|
449
|
+
*
|
|
450
|
+
* ```typescript
|
|
451
|
+
* logger.warn(new Error("Oops"));
|
|
452
|
+
* ```
|
|
453
|
+
*
|
|
454
|
+
* Note that this uses `{error.message}` as the default message template.
|
|
455
|
+
* If you want to include the stack trace in text output, include `{error}`
|
|
456
|
+
* in the message template instead.
|
|
457
|
+
*
|
|
458
|
+
* @param error The error to log.
|
|
459
|
+
* @since 2.0.0
|
|
539
460
|
*/
|
|
540
|
-
|
|
461
|
+
warn(error: Error): void;
|
|
541
462
|
/**
|
|
542
|
-
*
|
|
463
|
+
* Log a warning with additional properties.
|
|
464
|
+
*
|
|
465
|
+
* This overload is a shorthand for logging an {@link Error} instance as a
|
|
466
|
+
* structured property while also adding extra properties.
|
|
467
|
+
*
|
|
468
|
+
* ```typescript
|
|
469
|
+
* logger.warn(new Error("Oops"), { requestId });
|
|
470
|
+
* ```
|
|
471
|
+
*
|
|
472
|
+
* @param error The error to log.
|
|
473
|
+
* @param properties Additional properties to log alongside the error.
|
|
474
|
+
* @since 2.1.0
|
|
543
475
|
*/
|
|
544
|
-
|
|
476
|
+
warn(error: Error, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
|
|
545
477
|
/**
|
|
546
|
-
*
|
|
547
|
-
*
|
|
548
|
-
*
|
|
478
|
+
* Log a warning with additional properties computed asynchronously.
|
|
479
|
+
*
|
|
480
|
+
* @param error The error to log.
|
|
481
|
+
* @param properties An async callback that returns the properties.
|
|
482
|
+
* @returns A promise that resolves when the log is written.
|
|
483
|
+
* @since 2.1.0
|
|
549
484
|
*/
|
|
550
|
-
|
|
485
|
+
warn(error: Error, properties: () => Promise<Record<string, unknown>>): Promise<void>;
|
|
551
486
|
/**
|
|
552
|
-
*
|
|
487
|
+
* Log a warning message with an {@link Error}.
|
|
488
|
+
*
|
|
489
|
+
* ```typescript
|
|
490
|
+
* logger.warn("Failed to do something", new Error("Oops"));
|
|
491
|
+
* ```
|
|
492
|
+
*
|
|
493
|
+
* @param message The message.
|
|
494
|
+
* @param error The error to log.
|
|
495
|
+
* @since 2.0.0
|
|
553
496
|
*/
|
|
554
|
-
|
|
497
|
+
warn(message: string, error: Error): void;
|
|
555
498
|
/**
|
|
556
|
-
*
|
|
557
|
-
*
|
|
499
|
+
* Log a warning message. Use this as a template string prefix.
|
|
500
|
+
*
|
|
501
|
+
* ```typescript
|
|
502
|
+
* logger.warn `A warning message with ${value}.`;
|
|
503
|
+
* ```
|
|
504
|
+
*
|
|
505
|
+
* @param message The message template strings array.
|
|
506
|
+
* @param values The message template values.
|
|
558
507
|
*/
|
|
559
|
-
|
|
508
|
+
warn(message: TemplateStringsArray, ...values: readonly unknown[]): void;
|
|
560
509
|
/**
|
|
561
|
-
*
|
|
562
|
-
*
|
|
510
|
+
* Log a warning message with properties.
|
|
511
|
+
*
|
|
512
|
+
* ```typescript
|
|
513
|
+
* logger.warn('A warning message with {value}.', { value });
|
|
514
|
+
* ```
|
|
515
|
+
*
|
|
516
|
+
* If the properties are expensive to compute, you can pass a callback that
|
|
517
|
+
* returns the properties:
|
|
518
|
+
*
|
|
519
|
+
* ```typescript
|
|
520
|
+
* logger.warn(
|
|
521
|
+
* 'A warning message with {value}.',
|
|
522
|
+
* () => ({ value: expensiveComputation() })
|
|
523
|
+
* );
|
|
524
|
+
* ```
|
|
525
|
+
*
|
|
526
|
+
* @param message The message template. Placeholders to be replaced with
|
|
527
|
+
* `values` are indicated by keys in curly braces (e.g.,
|
|
528
|
+
* `{value}`).
|
|
529
|
+
* @param properties The values to replace placeholders with. For lazy
|
|
530
|
+
* evaluation, this can be a callback that returns the
|
|
531
|
+
* properties.
|
|
563
532
|
*/
|
|
564
|
-
|
|
533
|
+
warn(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
|
|
565
534
|
/**
|
|
566
|
-
*
|
|
567
|
-
*
|
|
535
|
+
* Log a warning message with properties computed asynchronously.
|
|
536
|
+
*
|
|
537
|
+
* Use this when the properties require async operations to compute:
|
|
538
|
+
*
|
|
539
|
+
* ```typescript
|
|
540
|
+
* await logger.warn(
|
|
541
|
+
* 'A warning message with {value}.',
|
|
542
|
+
* async () => ({ value: await fetchValue() })
|
|
543
|
+
* );
|
|
544
|
+
* ```
|
|
545
|
+
*
|
|
546
|
+
* @param message The message template. Placeholders to be replaced with
|
|
547
|
+
* `values` are indicated by keys in curly braces (e.g.,
|
|
548
|
+
* `{value}`).
|
|
549
|
+
* @param properties An async callback that returns the properties.
|
|
550
|
+
* @returns A promise that resolves when the log is written.
|
|
551
|
+
* @since 2.0.0
|
|
568
552
|
*/
|
|
569
|
-
|
|
553
|
+
warn(message: string, properties: () => Promise<Record<string, unknown>>): Promise<void>;
|
|
570
554
|
/**
|
|
571
|
-
*
|
|
572
|
-
*
|
|
555
|
+
* Log a warning values with no message. This is useful when you
|
|
556
|
+
* want to log properties without a message, e.g., when you want to log
|
|
557
|
+
* the context of a request or an operation.
|
|
558
|
+
*
|
|
559
|
+
* ```typescript
|
|
560
|
+
* logger.warn({ method: 'GET', url: '/api/v1/resource' });
|
|
561
|
+
* ```
|
|
562
|
+
*
|
|
563
|
+
* Note that this is a shorthand for:
|
|
564
|
+
*
|
|
565
|
+
* ```typescript
|
|
566
|
+
* logger.warn('{*}', { method: 'GET', url: '/api/v1/resource' });
|
|
567
|
+
* ```
|
|
568
|
+
*
|
|
569
|
+
* If the properties are expensive to compute, you cannot use this shorthand
|
|
570
|
+
* and should use the following syntax instead:
|
|
571
|
+
*
|
|
572
|
+
* ```typescript
|
|
573
|
+
* logger.warn('{*}', () => ({
|
|
574
|
+
* method: expensiveMethod(),
|
|
575
|
+
* url: expensiveUrl(),
|
|
576
|
+
* }));
|
|
577
|
+
* ```
|
|
578
|
+
*
|
|
579
|
+
* @param properties The values to log. Note that this does not take
|
|
580
|
+
* a callback.
|
|
581
|
+
* @since 0.11.0
|
|
573
582
|
*/
|
|
574
|
-
|
|
575
|
-
reloadProjects(cancelToken?: CancellationToken$1): Promise<void>;
|
|
576
|
-
protected _reloadProjects(cancelToken?: CancellationToken$1): Promise<void>;
|
|
577
|
-
protected uniqueProjectId(name: string): ProjectId;
|
|
578
|
-
protected resetCaches(): void;
|
|
579
|
-
rebuildProject(projectId: ProjectId, cancelToken?: CancellationToken$1): Promise<void>;
|
|
583
|
+
warn(properties: Record<string, unknown>): void;
|
|
580
584
|
/**
|
|
581
|
-
*
|
|
582
|
-
*
|
|
585
|
+
* Lazily log a warning message. Use this when the message values are
|
|
586
|
+
* expensive to compute and should only be computed if the message is actually
|
|
587
|
+
* logged.
|
|
588
|
+
*
|
|
589
|
+
* ```typescript
|
|
590
|
+
* logger.warn(l => l`A warning message with ${expensiveValue()}.`);
|
|
591
|
+
* ```
|
|
592
|
+
*
|
|
593
|
+
* @param callback A callback that returns the message template prefix.
|
|
594
|
+
* @throws {TypeError} If no log record was made inside the callback.
|
|
583
595
|
*/
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
596
|
+
warn(callback: LogCallback): void;
|
|
597
|
+
/**
|
|
598
|
+
* Log a warning.
|
|
599
|
+
*
|
|
600
|
+
* This overload is a shorthand for logging an {@link Error} instance as a
|
|
601
|
+
* structured property.
|
|
602
|
+
*
|
|
603
|
+
* ```typescript
|
|
604
|
+
* logger.warning(new Error("Oops"));
|
|
605
|
+
* ```
|
|
606
|
+
*
|
|
607
|
+
* Note that this uses `{error.message}` as the default message template.
|
|
608
|
+
* If you want to include the stack trace in text output, include `{error}`
|
|
609
|
+
* in the message template instead.
|
|
610
|
+
*
|
|
611
|
+
* @param error The error to log.
|
|
612
|
+
* @since 2.0.0
|
|
613
|
+
*/
|
|
614
|
+
warning(error: Error): void;
|
|
615
|
+
/**
|
|
616
|
+
* Log a warning with additional properties.
|
|
617
|
+
*
|
|
618
|
+
* This overload is a shorthand for logging an {@link Error} instance as a
|
|
619
|
+
* structured property while also adding extra properties.
|
|
620
|
+
*
|
|
621
|
+
* ```typescript
|
|
622
|
+
* logger.warning(new Error("Oops"), { requestId });
|
|
623
|
+
* ```
|
|
624
|
+
*
|
|
625
|
+
* @param error The error to log.
|
|
626
|
+
* @param properties Additional properties to log alongside the error.
|
|
627
|
+
* @since 2.1.0
|
|
628
|
+
*/
|
|
629
|
+
warning(error: Error, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
|
|
630
|
+
/**
|
|
631
|
+
* Log a warning with additional properties computed asynchronously.
|
|
632
|
+
*
|
|
633
|
+
* @param error The error to log.
|
|
634
|
+
* @param properties An async callback that returns the properties.
|
|
635
|
+
* @returns A promise that resolves when the log is written.
|
|
636
|
+
* @since 2.1.0
|
|
637
|
+
*/
|
|
638
|
+
warning(error: Error, properties: () => Promise<Record<string, unknown>>): Promise<void>;
|
|
639
|
+
/**
|
|
640
|
+
* Log a warning message with an {@link Error}.
|
|
641
|
+
*
|
|
642
|
+
* ```typescript
|
|
643
|
+
* logger.warning("Failed to do something", new Error("Oops"));
|
|
644
|
+
* ```
|
|
645
|
+
*
|
|
646
|
+
* @param message The message.
|
|
647
|
+
* @param error The error to log.
|
|
648
|
+
* @since 2.0.0
|
|
649
|
+
*/
|
|
650
|
+
warning(message: string, error: Error): void;
|
|
651
|
+
/**
|
|
652
|
+
* Log a warning message. Use this as a template string prefix.
|
|
653
|
+
*
|
|
654
|
+
* ```typescript
|
|
655
|
+
* logger.warning `A warning message with ${value}.`;
|
|
656
|
+
* ```
|
|
657
|
+
*
|
|
658
|
+
* @param message The message template strings array.
|
|
659
|
+
* @param values The message template values.
|
|
660
|
+
* @since 0.12.0
|
|
661
|
+
*/
|
|
662
|
+
warning(message: TemplateStringsArray, ...values: readonly unknown[]): void;
|
|
663
|
+
/**
|
|
664
|
+
* Log a warning message with properties.
|
|
665
|
+
*
|
|
666
|
+
* ```typescript
|
|
667
|
+
* logger.warning('A warning message with {value}.', { value });
|
|
668
|
+
* ```
|
|
669
|
+
*
|
|
670
|
+
* If the properties are expensive to compute, you can pass a callback that
|
|
671
|
+
* returns the properties:
|
|
672
|
+
*
|
|
673
|
+
* ```typescript
|
|
674
|
+
* logger.warning(
|
|
675
|
+
* 'A warning message with {value}.',
|
|
676
|
+
* () => ({ value: expensiveComputation() })
|
|
677
|
+
* );
|
|
678
|
+
* ```
|
|
679
|
+
*
|
|
680
|
+
* @param message The message template. Placeholders to be replaced with
|
|
681
|
+
* `values` are indicated by keys in curly braces (e.g.,
|
|
682
|
+
* `{value}`).
|
|
683
|
+
* @param properties The values to replace placeholders with. For lazy
|
|
684
|
+
* evaluation, this can be a callback that returns the
|
|
685
|
+
* properties.
|
|
686
|
+
* @since 0.12.0
|
|
687
|
+
*/
|
|
688
|
+
warning(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
|
|
689
|
+
/**
|
|
690
|
+
* Log a warning message with properties computed asynchronously.
|
|
691
|
+
*
|
|
692
|
+
* Use this when the properties require async operations to compute:
|
|
693
|
+
*
|
|
694
|
+
* ```typescript
|
|
695
|
+
* await logger.warning(
|
|
696
|
+
* 'A warning message with {value}.',
|
|
697
|
+
* async () => ({ value: await fetchValue() })
|
|
698
|
+
* );
|
|
699
|
+
* ```
|
|
700
|
+
*
|
|
701
|
+
* @param message The message template. Placeholders to be replaced with
|
|
702
|
+
* `values` are indicated by keys in curly braces (e.g.,
|
|
703
|
+
* `{value}`).
|
|
704
|
+
* @param properties An async callback that returns the properties.
|
|
705
|
+
* @returns A promise that resolves when the log is written.
|
|
706
|
+
* @since 2.0.0
|
|
707
|
+
*/
|
|
708
|
+
warning(message: string, properties: () => Promise<Record<string, unknown>>): Promise<void>;
|
|
709
|
+
/**
|
|
710
|
+
* Log a warning values with no message. This is useful when you
|
|
711
|
+
* want to log properties without a message, e.g., when you want to log
|
|
712
|
+
* the context of a request or an operation.
|
|
713
|
+
*
|
|
714
|
+
* ```typescript
|
|
715
|
+
* logger.warning({ method: 'GET', url: '/api/v1/resource' });
|
|
716
|
+
* ```
|
|
717
|
+
*
|
|
718
|
+
* Note that this is a shorthand for:
|
|
719
|
+
*
|
|
720
|
+
* ```typescript
|
|
721
|
+
* logger.warning('{*}', { method: 'GET', url: '/api/v1/resource' });
|
|
722
|
+
* ```
|
|
723
|
+
*
|
|
724
|
+
* If the properties are expensive to compute, you cannot use this shorthand
|
|
725
|
+
* and should use the following syntax instead:
|
|
726
|
+
*
|
|
727
|
+
* ```typescript
|
|
728
|
+
* logger.warning('{*}', () => ({
|
|
729
|
+
* method: expensiveMethod(),
|
|
730
|
+
* url: expensiveUrl(),
|
|
731
|
+
* }));
|
|
732
|
+
* ```
|
|
733
|
+
*
|
|
734
|
+
* @param properties The values to log. Note that this does not take
|
|
735
|
+
* a callback.
|
|
736
|
+
* @since 0.12.0
|
|
737
|
+
*/
|
|
738
|
+
warning(properties: Record<string, unknown>): void;
|
|
739
|
+
/**
|
|
740
|
+
* Lazily log a warning message. Use this when the message values are
|
|
741
|
+
* expensive to compute and should only be computed if the message is actually
|
|
742
|
+
* logged.
|
|
743
|
+
*
|
|
744
|
+
* ```typescript
|
|
745
|
+
* logger.warning(l => l`A warning message with ${expensiveValue()}.`);
|
|
746
|
+
* ```
|
|
747
|
+
*
|
|
748
|
+
* @param callback A callback that returns the message template prefix.
|
|
749
|
+
* @throws {TypeError} If no log record was made inside the callback.
|
|
750
|
+
* @since 0.12.0
|
|
751
|
+
*/
|
|
752
|
+
warning(callback: LogCallback): void;
|
|
753
|
+
/**
|
|
754
|
+
* Log an error.
|
|
755
|
+
*
|
|
756
|
+
* This overload is a shorthand for logging an {@link Error} instance as a
|
|
757
|
+
* structured property.
|
|
758
|
+
*
|
|
759
|
+
* ```typescript
|
|
760
|
+
* logger.error(new Error("Oops"));
|
|
761
|
+
* ```
|
|
762
|
+
*
|
|
763
|
+
* Note that this uses `{error.message}` as the default message template.
|
|
764
|
+
* If you want to include the stack trace in text output, include `{error}`
|
|
765
|
+
* in the message template instead.
|
|
766
|
+
*
|
|
767
|
+
* @param error The error to log.
|
|
768
|
+
* @since 2.0.0
|
|
769
|
+
*/
|
|
770
|
+
error(error: Error): void;
|
|
771
|
+
/**
|
|
772
|
+
* Log an error with additional properties.
|
|
773
|
+
*
|
|
774
|
+
* This overload is a shorthand for logging an {@link Error} instance as a
|
|
775
|
+
* structured property while also adding extra properties.
|
|
776
|
+
*
|
|
777
|
+
* ```typescript
|
|
778
|
+
* logger.error(new Error("Oops"), { requestId });
|
|
779
|
+
* ```
|
|
780
|
+
*
|
|
781
|
+
* If the properties are expensive to compute, you can pass a callback that
|
|
782
|
+
* returns the properties:
|
|
783
|
+
*
|
|
784
|
+
* ```typescript
|
|
785
|
+
* logger.error(
|
|
786
|
+
* new Error("Oops"),
|
|
787
|
+
* () => ({ requestId: expensiveLookup() })
|
|
788
|
+
* );
|
|
789
|
+
* ```
|
|
790
|
+
*
|
|
791
|
+
* @param error The error to log.
|
|
792
|
+
* @param properties Additional properties to log alongside the error.
|
|
793
|
+
* @since 2.1.0
|
|
794
|
+
*/
|
|
795
|
+
error(error: Error, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
|
|
796
|
+
/**
|
|
797
|
+
* Log an error with additional properties computed asynchronously.
|
|
798
|
+
*
|
|
799
|
+
* Use this when the properties require async operations to compute:
|
|
800
|
+
*
|
|
801
|
+
* ```typescript
|
|
802
|
+
* await logger.error(
|
|
803
|
+
* new Error("Oops"),
|
|
804
|
+
* async () => ({ requestId: await fetchRequestId() })
|
|
805
|
+
* );
|
|
806
|
+
* ```
|
|
807
|
+
*
|
|
808
|
+
* @param error The error to log.
|
|
809
|
+
* @param properties An async callback that returns the properties.
|
|
810
|
+
* @returns A promise that resolves when the log is written.
|
|
811
|
+
* @since 2.1.0
|
|
812
|
+
*/
|
|
813
|
+
error(error: Error, properties: () => Promise<Record<string, unknown>>): Promise<void>;
|
|
814
|
+
/**
|
|
815
|
+
* Log an error message with an {@link Error}.
|
|
816
|
+
*
|
|
817
|
+
* ```typescript
|
|
818
|
+
* logger.error("Failed to do something", new Error("Oops"));
|
|
819
|
+
* ```
|
|
820
|
+
*
|
|
821
|
+
* @param message The message.
|
|
822
|
+
* @param error The error to log.
|
|
823
|
+
* @since 2.0.0
|
|
824
|
+
*/
|
|
825
|
+
error(message: string, error: Error): void;
|
|
826
|
+
/**
|
|
827
|
+
* Log an error message. Use this as a template string prefix.
|
|
828
|
+
*
|
|
829
|
+
* ```typescript
|
|
830
|
+
* logger.error `An error message with ${value}.`;
|
|
831
|
+
* ```
|
|
832
|
+
*
|
|
833
|
+
* @param message The message template strings array.
|
|
834
|
+
* @param values The message template values.
|
|
835
|
+
*/
|
|
836
|
+
error(message: TemplateStringsArray, ...values: readonly unknown[]): void;
|
|
837
|
+
/**
|
|
838
|
+
* Log an error message with properties.
|
|
839
|
+
*
|
|
840
|
+
* ```typescript
|
|
841
|
+
* logger.warn('An error message with {value}.', { value });
|
|
842
|
+
* ```
|
|
843
|
+
*
|
|
844
|
+
* If the properties are expensive to compute, you can pass a callback that
|
|
845
|
+
* returns the properties:
|
|
846
|
+
*
|
|
847
|
+
* ```typescript
|
|
848
|
+
* logger.error(
|
|
849
|
+
* 'An error message with {value}.',
|
|
850
|
+
* () => ({ value: expensiveComputation() })
|
|
851
|
+
* );
|
|
852
|
+
* ```
|
|
853
|
+
*
|
|
854
|
+
* @param message The message template. Placeholders to be replaced with
|
|
855
|
+
* `values` are indicated by keys in curly braces (e.g.,
|
|
856
|
+
* `{value}`).
|
|
857
|
+
* @param properties The values to replace placeholders with. For lazy
|
|
858
|
+
* evaluation, this can be a callback that returns the
|
|
859
|
+
* properties.
|
|
860
|
+
*/
|
|
861
|
+
error(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
|
|
862
|
+
/**
|
|
863
|
+
* Log an error message with properties computed asynchronously.
|
|
864
|
+
*
|
|
865
|
+
* Use this when the properties require async operations to compute:
|
|
866
|
+
*
|
|
867
|
+
* ```typescript
|
|
868
|
+
* await logger.error(
|
|
869
|
+
* 'An error message with {value}.',
|
|
870
|
+
* async () => ({ value: await fetchValue() })
|
|
871
|
+
* );
|
|
872
|
+
* ```
|
|
873
|
+
*
|
|
874
|
+
* @param message The message template. Placeholders to be replaced with
|
|
875
|
+
* `values` are indicated by keys in curly braces (e.g.,
|
|
876
|
+
* `{value}`).
|
|
877
|
+
* @param properties An async callback that returns the properties.
|
|
878
|
+
* @returns A promise that resolves when the log is written.
|
|
879
|
+
* @since 2.0.0
|
|
880
|
+
*/
|
|
881
|
+
error(message: string, properties: () => Promise<Record<string, unknown>>): Promise<void>;
|
|
882
|
+
/**
|
|
883
|
+
* Log an error values with no message. This is useful when you
|
|
884
|
+
* want to log properties without a message, e.g., when you want to log
|
|
885
|
+
* the context of a request or an operation.
|
|
886
|
+
*
|
|
887
|
+
* ```typescript
|
|
888
|
+
* logger.error({ method: 'GET', url: '/api/v1/resource' });
|
|
889
|
+
* ```
|
|
890
|
+
*
|
|
891
|
+
* Note that this is a shorthand for:
|
|
892
|
+
*
|
|
893
|
+
* ```typescript
|
|
894
|
+
* logger.error('{*}', { method: 'GET', url: '/api/v1/resource' });
|
|
895
|
+
* ```
|
|
896
|
+
*
|
|
897
|
+
* If the properties are expensive to compute, you cannot use this shorthand
|
|
898
|
+
* and should use the following syntax instead:
|
|
899
|
+
*
|
|
900
|
+
* ```typescript
|
|
901
|
+
* logger.error('{*}', () => ({
|
|
902
|
+
* method: expensiveMethod(),
|
|
903
|
+
* url: expensiveUrl(),
|
|
904
|
+
* }));
|
|
905
|
+
* ```
|
|
906
|
+
*
|
|
907
|
+
* @param properties The values to log. Note that this does not take
|
|
908
|
+
* a callback.
|
|
909
|
+
* @since 0.11.0
|
|
910
|
+
*/
|
|
911
|
+
error(properties: Record<string, unknown>): void;
|
|
912
|
+
/**
|
|
913
|
+
* Lazily log an error message. Use this when the message values are
|
|
914
|
+
* expensive to compute and should only be computed if the message is actually
|
|
915
|
+
* logged.
|
|
916
|
+
*
|
|
917
|
+
* ```typescript
|
|
918
|
+
* logger.error(l => l`An error message with ${expensiveValue()}.`);
|
|
919
|
+
* ```
|
|
920
|
+
*
|
|
921
|
+
* @param callback A callback that returns the message template prefix.
|
|
922
|
+
* @throws {TypeError} If no log record was made inside the callback.
|
|
923
|
+
*/
|
|
924
|
+
error(callback: LogCallback): void;
|
|
925
|
+
/**
|
|
926
|
+
* Log a fatal error.
|
|
927
|
+
*
|
|
928
|
+
* This overload is a shorthand for logging an {@link Error} instance as a
|
|
929
|
+
* structured property.
|
|
930
|
+
*
|
|
931
|
+
* ```typescript
|
|
932
|
+
* logger.fatal(new Error("Oops"));
|
|
933
|
+
* ```
|
|
934
|
+
*
|
|
935
|
+
* Note that this uses `{error.message}` as the default message template.
|
|
936
|
+
* If you want to include the stack trace in text output, include `{error}`
|
|
937
|
+
* in the message template instead.
|
|
938
|
+
*
|
|
939
|
+
* @param error The error to log.
|
|
940
|
+
* @since 2.0.0
|
|
941
|
+
*/
|
|
942
|
+
fatal(error: Error): void;
|
|
943
|
+
/**
|
|
944
|
+
* Log a fatal error with additional properties.
|
|
945
|
+
*
|
|
946
|
+
* This overload is a shorthand for logging an {@link Error} instance as a
|
|
947
|
+
* structured property while also adding extra properties.
|
|
948
|
+
*
|
|
949
|
+
* ```typescript
|
|
950
|
+
* logger.fatal(new Error("Oops"), { requestId });
|
|
951
|
+
* ```
|
|
952
|
+
*
|
|
953
|
+
* @param error The error to log.
|
|
954
|
+
* @param properties Additional properties to log alongside the error.
|
|
955
|
+
* @since 2.1.0
|
|
956
|
+
*/
|
|
957
|
+
fatal(error: Error, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
|
|
958
|
+
/**
|
|
959
|
+
* Log a fatal error with additional properties computed asynchronously.
|
|
960
|
+
*
|
|
961
|
+
* @param error The error to log.
|
|
962
|
+
* @param properties An async callback that returns the properties.
|
|
963
|
+
* @returns A promise that resolves when the log is written.
|
|
964
|
+
* @since 2.1.0
|
|
965
|
+
*/
|
|
966
|
+
fatal(error: Error, properties: () => Promise<Record<string, unknown>>): Promise<void>;
|
|
967
|
+
/**
|
|
968
|
+
* Log a fatal error message with an {@link Error}.
|
|
969
|
+
*
|
|
970
|
+
* ```typescript
|
|
971
|
+
* logger.fatal("Failed to do something", new Error("Oops"));
|
|
972
|
+
* ```
|
|
973
|
+
*
|
|
974
|
+
* @param message The message.
|
|
975
|
+
* @param error The error to log.
|
|
976
|
+
* @since 2.0.0
|
|
977
|
+
*/
|
|
978
|
+
fatal(message: string, error: Error): void;
|
|
979
|
+
/**
|
|
980
|
+
* Log a fatal error message. Use this as a template string prefix.
|
|
981
|
+
*
|
|
982
|
+
* ```typescript
|
|
983
|
+
* logger.fatal `A fatal error message with ${value}.`;
|
|
984
|
+
* ```
|
|
985
|
+
*
|
|
986
|
+
* @param message The message template strings array.
|
|
987
|
+
* @param values The message template values.
|
|
988
|
+
*/
|
|
989
|
+
fatal(message: TemplateStringsArray, ...values: readonly unknown[]): void;
|
|
990
|
+
/**
|
|
991
|
+
* Log a fatal error message with properties.
|
|
992
|
+
*
|
|
993
|
+
* ```typescript
|
|
994
|
+
* logger.warn('A fatal error message with {value}.', { value });
|
|
995
|
+
* ```
|
|
996
|
+
*
|
|
997
|
+
* If the properties are expensive to compute, you can pass a callback that
|
|
998
|
+
* returns the properties:
|
|
999
|
+
*
|
|
1000
|
+
* ```typescript
|
|
1001
|
+
* logger.fatal(
|
|
1002
|
+
* 'A fatal error message with {value}.',
|
|
1003
|
+
* () => ({ value: expensiveComputation() })
|
|
1004
|
+
* );
|
|
1005
|
+
* ```
|
|
1006
|
+
*
|
|
1007
|
+
* @param message The message template. Placeholders to be replaced with
|
|
1008
|
+
* `values` are indicated by keys in curly braces (e.g.,
|
|
1009
|
+
* `{value}`).
|
|
1010
|
+
* @param properties The values to replace placeholders with. For lazy
|
|
1011
|
+
* evaluation, this can be a callback that returns the
|
|
1012
|
+
* properties.
|
|
1013
|
+
*/
|
|
1014
|
+
fatal(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
|
|
1015
|
+
/**
|
|
1016
|
+
* Log a fatal error message with properties computed asynchronously.
|
|
1017
|
+
*
|
|
1018
|
+
* Use this when the properties require async operations to compute:
|
|
1019
|
+
*
|
|
1020
|
+
* ```typescript
|
|
1021
|
+
* await logger.fatal(
|
|
1022
|
+
* 'A fatal error message with {value}.',
|
|
1023
|
+
* async () => ({ value: await fetchValue() })
|
|
1024
|
+
* );
|
|
1025
|
+
* ```
|
|
1026
|
+
*
|
|
1027
|
+
* @param message The message template. Placeholders to be replaced with
|
|
1028
|
+
* `values` are indicated by keys in curly braces (e.g.,
|
|
1029
|
+
* `{value}`).
|
|
1030
|
+
* @param properties An async callback that returns the properties.
|
|
1031
|
+
* @returns A promise that resolves when the log is written.
|
|
1032
|
+
* @since 2.0.0
|
|
1033
|
+
*/
|
|
1034
|
+
fatal(message: string, properties: () => Promise<Record<string, unknown>>): Promise<void>;
|
|
1035
|
+
/**
|
|
1036
|
+
* Log a fatal error values with no message. This is useful when you
|
|
1037
|
+
* want to log properties without a message, e.g., when you want to log
|
|
1038
|
+
* the context of a request or an operation.
|
|
1039
|
+
*
|
|
1040
|
+
* ```typescript
|
|
1041
|
+
* logger.fatal({ method: 'GET', url: '/api/v1/resource' });
|
|
1042
|
+
* ```
|
|
1043
|
+
*
|
|
1044
|
+
* Note that this is a shorthand for:
|
|
1045
|
+
*
|
|
1046
|
+
* ```typescript
|
|
1047
|
+
* logger.fatal('{*}', { method: 'GET', url: '/api/v1/resource' });
|
|
1048
|
+
* ```
|
|
1049
|
+
*
|
|
1050
|
+
* If the properties are expensive to compute, you cannot use this shorthand
|
|
1051
|
+
* and should use the following syntax instead:
|
|
1052
|
+
*
|
|
1053
|
+
* ```typescript
|
|
1054
|
+
* logger.fatal('{*}', () => ({
|
|
1055
|
+
* method: expensiveMethod(),
|
|
1056
|
+
* url: expensiveUrl(),
|
|
1057
|
+
* }));
|
|
1058
|
+
* ```
|
|
1059
|
+
*
|
|
1060
|
+
* @param properties The values to log. Note that this does not take
|
|
1061
|
+
* a callback.
|
|
1062
|
+
* @since 0.11.0
|
|
1063
|
+
*/
|
|
1064
|
+
fatal(properties: Record<string, unknown>): void;
|
|
1065
|
+
/**
|
|
1066
|
+
* Lazily log a fatal error message. Use this when the message values are
|
|
1067
|
+
* expensive to compute and should only be computed if the message is actually
|
|
1068
|
+
* logged.
|
|
1069
|
+
*
|
|
1070
|
+
* ```typescript
|
|
1071
|
+
* logger.fatal(l => l`A fatal error message with ${expensiveValue()}.`);
|
|
1072
|
+
* ```
|
|
1073
|
+
*
|
|
1074
|
+
* @param callback A callback that returns the message template prefix.
|
|
1075
|
+
* @throws {TypeError} If no log record was made inside the callback.
|
|
1076
|
+
*/
|
|
1077
|
+
fatal(callback: LogCallback): void;
|
|
1078
|
+
/**
|
|
1079
|
+
* Emits a log record with custom fields while using this logger's
|
|
1080
|
+
* category.
|
|
1081
|
+
*
|
|
1082
|
+
* This is a low-level API for integration scenarios where you need full
|
|
1083
|
+
* control over the log record, particularly for preserving timestamps
|
|
1084
|
+
* from external systems.
|
|
1085
|
+
*
|
|
1086
|
+
* ```typescript
|
|
1087
|
+
* const logger = getLogger(["my-app", "integration"]);
|
|
1088
|
+
*
|
|
1089
|
+
* // Emit a log with a custom timestamp
|
|
1090
|
+
* logger.emit({
|
|
1091
|
+
* timestamp: kafkaLog.originalTimestamp,
|
|
1092
|
+
* level: "info",
|
|
1093
|
+
* message: [kafkaLog.message],
|
|
1094
|
+
* rawMessage: kafkaLog.message,
|
|
1095
|
+
* properties: {
|
|
1096
|
+
* source: "kafka",
|
|
1097
|
+
* partition: kafkaLog.partition,
|
|
1098
|
+
* offset: kafkaLog.offset,
|
|
1099
|
+
* },
|
|
1100
|
+
* });
|
|
1101
|
+
* ```
|
|
1102
|
+
*
|
|
1103
|
+
* @param record Log record without category field (category comes from
|
|
1104
|
+
* the logger instance)
|
|
1105
|
+
* @since 1.1.0
|
|
1106
|
+
*/
|
|
1107
|
+
emit(record: Omit<LogRecord, "category">): void;
|
|
1108
|
+
/**
|
|
1109
|
+
* Check if a message of the given severity level would be processed by
|
|
1110
|
+
* this logger.
|
|
1111
|
+
*
|
|
1112
|
+
* This is useful for conditionally executing expensive computations
|
|
1113
|
+
* before logging, particularly for async operations where lazy
|
|
1114
|
+
* evaluation callbacks cannot be used:
|
|
1115
|
+
*
|
|
1116
|
+
* ```typescript
|
|
1117
|
+
* if (logger.isEnabledFor("debug")) {
|
|
1118
|
+
* const result = await expensiveAsync();
|
|
1119
|
+
* logger.debug("Result: {result}", { result });
|
|
1120
|
+
* }
|
|
1121
|
+
* ```
|
|
1122
|
+
*
|
|
1123
|
+
* @param level The log level to check.
|
|
1124
|
+
* @returns `true` if a message of the given level would be logged,
|
|
1125
|
+
* `false` otherwise.
|
|
1126
|
+
* @since 2.0.0
|
|
1127
|
+
*/
|
|
1128
|
+
isEnabledFor(level: LogLevel): boolean;
|
|
1129
|
+
}
|
|
1130
|
+
/**
|
|
1131
|
+
* A logging callback function. It is used to defer the computation of a
|
|
1132
|
+
* message template until it is actually logged.
|
|
1133
|
+
* @param prefix The message template prefix.
|
|
1134
|
+
* @returns The rendered message array.
|
|
1135
|
+
*/
|
|
1136
|
+
type LogCallback = (prefix: LogTemplatePrefix) => unknown[];
|
|
1137
|
+
/**
|
|
1138
|
+
* A logging template prefix function. It is used to log a message in
|
|
1139
|
+
* a {@link LogCallback} function.
|
|
1140
|
+
* @param message The message template strings array.
|
|
1141
|
+
* @param values The message template values.
|
|
1142
|
+
* @returns The rendered message array.
|
|
1143
|
+
*/
|
|
1144
|
+
type LogTemplatePrefix = (message: TemplateStringsArray, ...values: unknown[]) => unknown[];
|
|
1145
|
+
//#endregion
|
|
1146
|
+
//#region ../layouts/dist/chunks/types.d.mts
|
|
1147
|
+
/**
|
|
1148
|
+
* invisible edge added by AI to enforce better layout
|
|
1149
|
+
*/
|
|
1150
|
+
interface AIEnforcementEdge {
|
|
1151
|
+
source: NodeId;
|
|
1152
|
+
target: NodeId;
|
|
1153
|
+
weight?: number;
|
|
1154
|
+
minlen?: number;
|
|
1155
|
+
}
|
|
1156
|
+
/**
|
|
1157
|
+
* Complete set of AI-generated layout hints.
|
|
1158
|
+
* This is the JSON schema the LLM must produce.
|
|
1159
|
+
*/
|
|
1160
|
+
interface AILayoutHints {
|
|
1161
|
+
direction?: 'TB' | 'BT' | 'LR' | 'RL';
|
|
1162
|
+
ranks: ReadonlyArray<{
|
|
1163
|
+
rank: 'same' | 'source' | 'sink' | 'min' | 'max';
|
|
1164
|
+
nodes: NonEmptyArray<NodeId>;
|
|
588
1165
|
}>;
|
|
1166
|
+
edgeWeight: Record<EdgeId, number>;
|
|
1167
|
+
edgeMinlen: Record<EdgeId, number>;
|
|
589
1168
|
/**
|
|
590
|
-
*
|
|
591
|
-
*
|
|
1169
|
+
* These edges should be reversed in DOT
|
|
1170
|
+
* Unique array of EdgeIds.
|
|
592
1171
|
*/
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
1172
|
+
reverseRank?: NonEmptyReadonlyArray<EdgeId>;
|
|
1173
|
+
/**
|
|
1174
|
+
* These edges should be excluded, i.e. `constraint=false` in Graphviz, to allow more flexible layouts.
|
|
1175
|
+
* Unique array of EdgeIds.
|
|
1176
|
+
*/
|
|
1177
|
+
excludeFromRanking?: NonEmptyReadonlyArray<EdgeId>;
|
|
1178
|
+
/**
|
|
1179
|
+
* Suggested order of edges for DOT output, to influence edge routing.
|
|
1180
|
+
*/
|
|
1181
|
+
edgeOrder?: NonEmptyReadonlyArray<EdgeId>;
|
|
1182
|
+
/**
|
|
1183
|
+
* Suggested order of nodes for DOT output, to influence node placement.
|
|
1184
|
+
*/
|
|
1185
|
+
nodeOrder?: NonEmptyReadonlyArray<NodeId>;
|
|
1186
|
+
/**
|
|
1187
|
+
* Invisible edges added by AI to enforce better layout
|
|
1188
|
+
*/
|
|
1189
|
+
invisibleEdges?: NonEmptyReadonlyArray<AIEnforcementEdge>;
|
|
1190
|
+
/**
|
|
1191
|
+
* LLM reasoning for debugging/display
|
|
1192
|
+
*/
|
|
1193
|
+
reasoning: string;
|
|
603
1194
|
}
|
|
604
|
-
|
|
1195
|
+
//#endregion
|
|
1196
|
+
//#region ../language-server/dist/chunks/protocol.d.mts
|
|
1197
|
+
/**
|
|
1198
|
+
* When server requests to open a likec4 preview panel
|
|
1199
|
+
* (available only in the editor).
|
|
1200
|
+
* (not the best place, but seems to be working)
|
|
1201
|
+
*/
|
|
1202
|
+
declare namespace DidRequestOpenViewNotification {
|
|
1203
|
+
type Params = {
|
|
1204
|
+
viewId: ViewId$1;
|
|
1205
|
+
projectId: ProjectId$1;
|
|
1206
|
+
};
|
|
1207
|
+
const type: NotificationType<Params>;
|
|
1208
|
+
type Type = typeof type;
|
|
1209
|
+
}
|
|
1210
|
+
/**
|
|
1211
|
+
* Request to locate an element, relation, deployment or view.
|
|
1212
|
+
* If LSP has multiple projects, the projectId is required.
|
|
1213
|
+
*/
|
|
1214
|
+
declare namespace Locate {
|
|
1215
|
+
type Params =
|
|
605
1216
|
/**
|
|
606
|
-
*
|
|
607
|
-
* @returns The list of file system entries that are contained within the specified directory.
|
|
1217
|
+
* Locate an element by its fqn
|
|
608
1218
|
*/
|
|
609
|
-
|
|
1219
|
+
{
|
|
1220
|
+
element: Fqn$1;
|
|
1221
|
+
projectId?: string | undefined;
|
|
1222
|
+
property?: string;
|
|
1223
|
+
} |
|
|
610
1224
|
/**
|
|
611
|
-
*
|
|
612
|
-
* @returns The project config.
|
|
613
|
-
* @throws Error if the file does not exist or is not a valid project config.
|
|
1225
|
+
* Locate a relation by its id
|
|
614
1226
|
*/
|
|
615
|
-
|
|
1227
|
+
{
|
|
1228
|
+
projectId?: string | undefined;
|
|
1229
|
+
relation: RelationId;
|
|
1230
|
+
} |
|
|
616
1231
|
/**
|
|
617
|
-
*
|
|
618
|
-
*
|
|
619
|
-
* @param options.recursive If true, recursively reads the directory,
|
|
620
|
-
* @param options.maxDepth Maximum depth to traverse when recursive is true (default: Infinity)
|
|
1232
|
+
* Locate a deployment by its fqn
|
|
621
1233
|
*/
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
1234
|
+
{
|
|
1235
|
+
deployment: DeploymentFqn;
|
|
1236
|
+
projectId?: string | undefined;
|
|
1237
|
+
property?: string;
|
|
1238
|
+
} |
|
|
626
1239
|
/**
|
|
627
|
-
*
|
|
1240
|
+
* Locate a step in a dynamic view by its astPath
|
|
628
1241
|
*/
|
|
629
|
-
|
|
1242
|
+
{
|
|
1243
|
+
view: ViewId$1;
|
|
1244
|
+
astPath: string;
|
|
1245
|
+
projectId?: string | undefined;
|
|
1246
|
+
} |
|
|
630
1247
|
/**
|
|
631
|
-
*
|
|
632
|
-
* Used by manual layouts.
|
|
1248
|
+
* Locate a view by its id
|
|
633
1249
|
*/
|
|
634
|
-
|
|
1250
|
+
{
|
|
1251
|
+
view: ViewId$1;
|
|
1252
|
+
projectId?: string | undefined;
|
|
1253
|
+
};
|
|
1254
|
+
type Res = Location | null;
|
|
1255
|
+
const req: RequestType<Params, Res, void>;
|
|
1256
|
+
type Req = typeof req;
|
|
1257
|
+
}
|
|
1258
|
+
/**
|
|
1259
|
+
* Request to change the view
|
|
1260
|
+
* If LSP has multiple projects, the projectId is required.
|
|
1261
|
+
*/
|
|
1262
|
+
declare namespace ChangeView {
|
|
1263
|
+
type Params = {
|
|
1264
|
+
viewId: ViewId$1;
|
|
1265
|
+
change: ViewChange;
|
|
1266
|
+
projectId?: string | undefined;
|
|
1267
|
+
};
|
|
1268
|
+
type Res = {
|
|
1269
|
+
success: true;
|
|
1270
|
+
location: Location | null;
|
|
1271
|
+
} | {
|
|
1272
|
+
success: false;
|
|
1273
|
+
location?: Location | null;
|
|
1274
|
+
error: string;
|
|
1275
|
+
};
|
|
1276
|
+
const req: RequestType<Params, Res, void>;
|
|
1277
|
+
type Req = typeof req;
|
|
1278
|
+
}
|
|
1279
|
+
//#endregion
|
|
1280
|
+
//#region ../layouts/dist/chunks/GraphvizLayoter.d.mts
|
|
1281
|
+
//#region src/graphviz/types.d.ts
|
|
1282
|
+
/**
|
|
1283
|
+
* Partially implements CancellationToken interface from vscode-jsonrpc
|
|
1284
|
+
*/
|
|
1285
|
+
type CancellationToken = {
|
|
635
1286
|
/**
|
|
636
|
-
*
|
|
637
|
-
* Used by manual layouts.
|
|
638
|
-
* @return true if the file was deleted, false if the file did not exist.
|
|
1287
|
+
* Is `true` when the token has been cancelled, `false` otherwise.
|
|
639
1288
|
*/
|
|
640
|
-
|
|
1289
|
+
readonly isCancellationRequested: boolean;
|
|
1290
|
+
};
|
|
1291
|
+
declare module 'ts-graphviz' {
|
|
1292
|
+
namespace GraphAttributeKey {
|
|
1293
|
+
interface $values extends $keywords<'likec4_viewId'> {}
|
|
1294
|
+
}
|
|
1295
|
+
namespace ClusterSubgraphAttributeKey {
|
|
1296
|
+
interface $values extends $keywords<'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_level' | 'likec4_depth'> {}
|
|
1297
|
+
}
|
|
1298
|
+
namespace NodeAttributeKey {
|
|
1299
|
+
interface $values extends $keywords<'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_project' | 'likec4_level'> {}
|
|
1300
|
+
}
|
|
1301
|
+
namespace EdgeAttributeKey {
|
|
1302
|
+
interface $values extends $keywords<'likec4_id' | 'likec4_project'> {}
|
|
1303
|
+
}
|
|
1304
|
+
namespace Attribute {
|
|
1305
|
+
interface $keys extends $keywords<'likec4_viewId' | 'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_project' | 'likec4_level' | 'likec4_depth'> {}
|
|
1306
|
+
interface $types {
|
|
1307
|
+
likec4_viewId: string;
|
|
1308
|
+
likec4_type: 'folder' | 'file' | 'view';
|
|
1309
|
+
likec4_path: string;
|
|
1310
|
+
likec4_id: string;
|
|
1311
|
+
likec4_project: string;
|
|
1312
|
+
likec4_level: number;
|
|
1313
|
+
likec4_depth: number;
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
type DotSource = Tagged<string, 'DotSource'>;
|
|
1318
|
+
//#endregion
|
|
1319
|
+
//#region src/graphviz/types-dot.d.ts
|
|
1320
|
+
type GvNodeName = Tagged<string, 'GvNodeName'>;
|
|
1321
|
+
type GvId = Tagged<number, 'GvId'>;
|
|
1322
|
+
type Point = [x: number, y: number];
|
|
1323
|
+
interface GraphvizJson {
|
|
1324
|
+
name: GvNodeName;
|
|
1325
|
+
directed: boolean;
|
|
1326
|
+
strict: boolean;
|
|
1327
|
+
_draw_: GraphvizJson.Draw[];
|
|
1328
|
+
bb: string;
|
|
1329
|
+
compound: string;
|
|
1330
|
+
fontname: string;
|
|
1331
|
+
fontsize: string;
|
|
1332
|
+
label: string;
|
|
1333
|
+
nodesep: string;
|
|
1334
|
+
outputorder: string;
|
|
1335
|
+
rankdir: string;
|
|
1336
|
+
ranksep: string;
|
|
1337
|
+
splines: string;
|
|
1338
|
+
xdotversion: string;
|
|
1339
|
+
_subgraph_cnt: number;
|
|
1340
|
+
objects?: GraphvizJson.GvObject[];
|
|
1341
|
+
edges?: GraphvizJson.Edge[];
|
|
1342
|
+
}
|
|
1343
|
+
declare namespace GraphvizJson {
|
|
1344
|
+
interface Draw {
|
|
1345
|
+
op: string;
|
|
1346
|
+
grad: string;
|
|
1347
|
+
color: string;
|
|
1348
|
+
points: Point[];
|
|
1349
|
+
}
|
|
1350
|
+
interface Draw2 {
|
|
1351
|
+
op: string;
|
|
1352
|
+
grad: string;
|
|
1353
|
+
color: string;
|
|
1354
|
+
points: Point[];
|
|
1355
|
+
}
|
|
1356
|
+
namespace DrawOps {
|
|
1357
|
+
type Style = {
|
|
1358
|
+
op: 'S';
|
|
1359
|
+
style: string;
|
|
1360
|
+
};
|
|
1361
|
+
type BSpline = {
|
|
1362
|
+
op: 'b' | 'B';
|
|
1363
|
+
points: Point[];
|
|
1364
|
+
};
|
|
1365
|
+
type Color = {
|
|
1366
|
+
op: 'c';
|
|
1367
|
+
grad: string;
|
|
1368
|
+
color: string;
|
|
1369
|
+
};
|
|
1370
|
+
type Polygon = {
|
|
1371
|
+
op: 'p' | 'P';
|
|
1372
|
+
points: Point[];
|
|
1373
|
+
};
|
|
1374
|
+
}
|
|
1375
|
+
type DrawOp = DrawOps.Style | DrawOps.BSpline | DrawOps.Color | DrawOps.Polygon;
|
|
1376
|
+
type LabelDrawOps = {
|
|
1377
|
+
op: 'F';
|
|
1378
|
+
size: number;
|
|
1379
|
+
face: string;
|
|
1380
|
+
} | {
|
|
1381
|
+
op: 'c';
|
|
1382
|
+
color: string;
|
|
1383
|
+
} | {
|
|
1384
|
+
op: 't';
|
|
1385
|
+
fontchar: number;
|
|
1386
|
+
} | {
|
|
1387
|
+
op: 'T';
|
|
1388
|
+
pt: Point;
|
|
1389
|
+
align: 'l' | 'r' | 'c';
|
|
1390
|
+
width: number;
|
|
1391
|
+
text: string;
|
|
1392
|
+
};
|
|
1393
|
+
type GvObject = GvNodeObject | GvSubgraph;
|
|
1394
|
+
interface GvSubgraph {
|
|
1395
|
+
bb: string;
|
|
1396
|
+
label?: string;
|
|
1397
|
+
compound: 'true';
|
|
1398
|
+
_ldraw_?: LabelDrawOps[];
|
|
1399
|
+
likec4_type?: 'folder' | 'file';
|
|
1400
|
+
likec4_path?: string;
|
|
1401
|
+
likec4_id?: Fqn$1;
|
|
1402
|
+
likec4_level?: number;
|
|
1403
|
+
likec4_depth?: number;
|
|
1404
|
+
_gvid: GvId;
|
|
1405
|
+
subgraphs?: GvId[];
|
|
1406
|
+
nodes?: GvId[];
|
|
1407
|
+
edges?: GvId[];
|
|
1408
|
+
}
|
|
1409
|
+
interface GvNodeObject {
|
|
1410
|
+
_draw_: Draw[];
|
|
1411
|
+
_ldraw_?: LabelDrawOps[];
|
|
1412
|
+
likec4_type?: 'folder' | 'file' | 'view';
|
|
1413
|
+
likec4_path?: string;
|
|
1414
|
+
likec4_id?: Fqn$1;
|
|
1415
|
+
likec4_level?: number;
|
|
1416
|
+
_gvid: GvId;
|
|
1417
|
+
height: string;
|
|
1418
|
+
pos: string;
|
|
1419
|
+
shape: 'rect';
|
|
1420
|
+
width: string;
|
|
1421
|
+
label?: string;
|
|
1422
|
+
}
|
|
1423
|
+
interface Draw3 {
|
|
1424
|
+
op: string;
|
|
1425
|
+
grad: string;
|
|
1426
|
+
color: string;
|
|
1427
|
+
points: Point[];
|
|
1428
|
+
}
|
|
1429
|
+
interface Hdraw {
|
|
1430
|
+
op: string;
|
|
1431
|
+
style: string;
|
|
1432
|
+
grad: string;
|
|
1433
|
+
color: string;
|
|
1434
|
+
points: Point[];
|
|
1435
|
+
}
|
|
1436
|
+
interface Edge {
|
|
1437
|
+
_gvid: GvId;
|
|
1438
|
+
tail: GvId;
|
|
1439
|
+
head: GvId;
|
|
1440
|
+
dir?: 'forward' | 'back' | 'both' | 'none';
|
|
1441
|
+
_draw_: DrawOp[];
|
|
1442
|
+
_hdraw_?: DrawOp[];
|
|
1443
|
+
_tdraw_?: DrawOp[];
|
|
1444
|
+
_ldraw_?: LabelDrawOps[];
|
|
1445
|
+
_tldraw_?: LabelDrawOps[];
|
|
1446
|
+
_hldraw_?: LabelDrawOps[];
|
|
1447
|
+
fontname: string;
|
|
1448
|
+
fontsize: string;
|
|
1449
|
+
likec4_id?: EdgeId$1;
|
|
1450
|
+
label: string;
|
|
1451
|
+
lp: string;
|
|
1452
|
+
nojustify?: 'true' | 'false';
|
|
1453
|
+
pos?: string;
|
|
1454
|
+
}
|
|
641
1455
|
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
1456
|
+
//#endregion
|
|
1457
|
+
//#region src/graphviz/GraphvizLayoter.d.ts
|
|
1458
|
+
interface GraphvizPort extends Disposable {
|
|
1459
|
+
get name(): string;
|
|
1460
|
+
get concurrency(): number;
|
|
1461
|
+
unflatten(dot: DotSource): Promise<DotSource>;
|
|
1462
|
+
acyclic(dot: DotSource): Promise<DotSource>;
|
|
1463
|
+
layoutJson(dot: DotSource): Promise<string>;
|
|
1464
|
+
svg(dot: DotSource): Promise<string>;
|
|
1465
|
+
dispose(): void;
|
|
647
1466
|
}
|
|
648
|
-
type
|
|
649
|
-
|
|
650
|
-
|
|
1467
|
+
type LayoutTaskParams<A extends aux$1.Any = aux$1.Any> = {
|
|
1468
|
+
view: ComputedView<A>;
|
|
1469
|
+
styles: LikeC4Styles$1;
|
|
651
1470
|
};
|
|
652
|
-
type
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
1471
|
+
type LayoutResult<A extends aux$1.Any = aux$1.Any> = {
|
|
1472
|
+
dot: DotSource;
|
|
1473
|
+
diagram: DiagramView<A>;
|
|
1474
|
+
};
|
|
1475
|
+
declare class GraphvizLayouter implements Disposable {
|
|
1476
|
+
private graphviz;
|
|
1477
|
+
constructor(graphviz?: GraphvizPort);
|
|
1478
|
+
dispose(): void;
|
|
1479
|
+
[Symbol.dispose](): void;
|
|
1480
|
+
get graphvizPort(): GraphvizPort;
|
|
1481
|
+
changePort(graphviz: GraphvizPort): void;
|
|
659
1482
|
/**
|
|
660
|
-
*
|
|
1483
|
+
* Generates DOT source for the given view and styles.
|
|
1484
|
+
* If `hints` are provided, they will be used to influence the layout (e.g. by specifying node/edge order).
|
|
1485
|
+
* This method does not perform unflattening or any other post-processing on the DOT output, so it may be used for debugging or to generate DOT for external processing.
|
|
661
1486
|
*/
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
1487
|
+
printToDot(params: LayoutTaskParams, hints?: AILayoutHints): DotSource;
|
|
1488
|
+
protected newScopedLogger(operation: string): any;
|
|
1489
|
+
dotToJson(dot: DotSource): Promise<GraphvizJson>;
|
|
1490
|
+
layout<A extends AnyAux>(params: LayoutTaskParams<A>): Promise<LayoutResult<A>>;
|
|
1491
|
+
aiLayout<A extends AnyAux>({ view, styles }: LayoutTaskParams<A>, hints: AILayoutHints): Promise<LayoutResult<A>>;
|
|
1492
|
+
svg<A extends AnyAux>(params: LayoutTaskParams<A>): Promise<{
|
|
1493
|
+
svg: string;
|
|
1494
|
+
dot: DotSource;
|
|
1495
|
+
}>;
|
|
1496
|
+
dot<A extends AnyAux>(params: LayoutTaskParams<A>): Promise<DotSource>;
|
|
1497
|
+
layoutProjectsView(view: ComputedProjectsView): Promise<LayoutedProjectsView>;
|
|
1498
|
+
}
|
|
1499
|
+
//#endregion
|
|
1500
|
+
//#region ../layouts/dist/index.d.mts
|
|
1501
|
+
//#region src/graphviz/QueueGraphvizLayoter.d.ts
|
|
1502
|
+
declare class QueueGraphvizLayoter extends GraphvizLayouter {
|
|
1503
|
+
private queue;
|
|
1504
|
+
private isProcessingBatch;
|
|
1505
|
+
constructor(options?: {
|
|
1506
|
+
graphviz?: GraphvizPort;
|
|
1507
|
+
/**
|
|
1508
|
+
* Concurrency limit.
|
|
1509
|
+
* Minimum: `1`.
|
|
1510
|
+
* @default 2
|
|
1511
|
+
*/
|
|
1512
|
+
concurrency?: number;
|
|
1513
|
+
/**
|
|
1514
|
+
* Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already.
|
|
1515
|
+
* @default 20_000
|
|
1516
|
+
*/
|
|
1517
|
+
timeout?: number;
|
|
1518
|
+
/**
|
|
1519
|
+
* Whether or not a timeout is considered an exception.
|
|
1520
|
+
* @default true
|
|
1521
|
+
*/
|
|
1522
|
+
throwOnTimeout?: boolean;
|
|
1523
|
+
});
|
|
1524
|
+
private runInQueue;
|
|
1525
|
+
changePort(graphvizPort: GraphvizPort): void;
|
|
1526
|
+
layout<A extends AnyAux>(params: LayoutTaskParams<A>): Promise<LayoutResult<A>>;
|
|
1527
|
+
layoutProjectsView(view: ComputedProjectsView): Promise<LayoutedProjectsView>;
|
|
1528
|
+
batchLayout<A extends AnyAux>(params: {
|
|
1529
|
+
batch: LayoutTaskParams<A>[];
|
|
1530
|
+
cancelToken?: CancellationToken | undefined;
|
|
1531
|
+
onSuccess?: (task: LayoutTaskParams<A>, result: LayoutResult<A>) => void;
|
|
1532
|
+
onError?: (task: LayoutTaskParams<A>, error: unknown) => void;
|
|
1533
|
+
}): Promise<LayoutResult<A>[]>;
|
|
666
1534
|
/**
|
|
667
|
-
*
|
|
668
|
-
*
|
|
1535
|
+
* Custom backpressure
|
|
1536
|
+
* (basically allow same amount of tasks to be in queue as concurrency)
|
|
669
1537
|
*/
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
1538
|
+
private waitForQueueToShrink;
|
|
1539
|
+
dispose(): void;
|
|
1540
|
+
}
|
|
1541
|
+
//#endregion
|
|
1542
|
+
//#region ../language-server/dist/chunks/module.d.mts
|
|
1543
|
+
//#region src/documentation/documentation-provider.d.ts
|
|
1544
|
+
/**
|
|
1545
|
+
* Provides documentation for LikeC4 AST nodes, extending JSDoc parsing
|
|
1546
|
+
* with specialized formatting for deployment nodes, deployed instances, and elements.
|
|
1547
|
+
*/
|
|
1548
|
+
declare class LikeC4DocumentationProvider extends JSDocDocumentationProvider {
|
|
1549
|
+
private parser;
|
|
1550
|
+
private locator;
|
|
675
1551
|
/**
|
|
676
|
-
*
|
|
677
|
-
*
|
|
1552
|
+
* Creates a new documentation provider.
|
|
1553
|
+
* @param services - The LikeC4 language services.
|
|
678
1554
|
*/
|
|
679
|
-
|
|
1555
|
+
constructor(services: LikeC4Services);
|
|
680
1556
|
/**
|
|
681
|
-
*
|
|
682
|
-
*
|
|
683
|
-
* @
|
|
1557
|
+
* Returns documentation for the given AST node (deployment nodes, deployed instances, elements, or JSDoc fallback).
|
|
1558
|
+
* @param node - The AST node to document.
|
|
1559
|
+
* @returns Formatted documentation string, or undefined if none.
|
|
684
1560
|
*/
|
|
685
|
-
|
|
686
|
-
update: URI;
|
|
687
|
-
delete?: never;
|
|
688
|
-
} | {
|
|
689
|
-
delete: URI;
|
|
690
|
-
update?: never;
|
|
691
|
-
}): Promise<void>;
|
|
692
|
-
} //#endregion
|
|
693
|
-
//#region src/filesystem/noop.d.ts
|
|
694
|
-
//#endregion
|
|
695
|
-
//#region src/formatting/LikeC4Formatter.d.ts
|
|
696
|
-
type QuoteStyle = 'single' | 'double' | 'ignore' | 'auto';
|
|
697
|
-
interface LikeC4FormatterOptions {
|
|
698
|
-
quoteStyle: QuoteStyle;
|
|
1561
|
+
getDocumentation(node: AstNode): string | undefined;
|
|
699
1562
|
}
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
1563
|
+
//#endregion
|
|
1564
|
+
//#region src/utils/disposable.d.ts
|
|
1565
|
+
declare abstract class ADisposable implements Disposable$1 {
|
|
1566
|
+
protected toDispose: Disposable$1[];
|
|
1567
|
+
protected isDisposed: boolean;
|
|
1568
|
+
onDispose(...disposable: Disposable$1[]): void;
|
|
1569
|
+
dispose(): void;
|
|
1570
|
+
protected throwIfDisposed(): void;
|
|
704
1571
|
}
|
|
705
|
-
|
|
706
|
-
protected options: LikeC4FormatterOptions;
|
|
707
|
-
extendedFormattingCommands: ExtendedFormattingCommand[];
|
|
708
|
-
constructor(services: LikeC4Services);
|
|
709
|
-
protected doDocumentFormat(document: LangiumDocument, options: FormattingOptions, range?: Range): TextEdit[];
|
|
710
|
-
protected format(node: AstNode): void;
|
|
711
|
-
protected formatTags(node: AstNode): void;
|
|
712
|
-
protected formatDeploymentRelation(node: AstNode): void;
|
|
713
|
-
protected formatExtendDeployment(node: AstNode): void;
|
|
714
|
-
protected formatRelation(node: AstNode): void;
|
|
715
|
-
protected removeIndentFromTopLevelStatements(node: AstNode): void;
|
|
716
|
-
protected indentContentInBraces(node: AstNode): void;
|
|
717
|
-
protected appendKeywordsWithSpace(node: AstNode): void;
|
|
718
|
-
protected formatView(node: AstNode): void;
|
|
719
|
-
protected formatLeafProperty(node: AstNode): void;
|
|
720
|
-
protected formatLinkProperty(node: AstNode): void;
|
|
721
|
-
protected formatNavigateToProperty(node: AstNode): void;
|
|
722
|
-
protected formatAutolayoutProperty(node: AstNode): void;
|
|
723
|
-
protected formatMetadataProperty(node: AstNode): void;
|
|
724
|
-
protected formatElementDeclaration(node: AstNode): void;
|
|
725
|
-
protected formatExtendElement(node: AstNode): void;
|
|
726
|
-
protected formatGlobals(node: AstNode): void;
|
|
727
|
-
protected formatImports(node: AstNode): void;
|
|
728
|
-
protected formatSpecificationRule(node: AstNode): void;
|
|
729
|
-
protected formatWithPredicate(node: AstNode): void;
|
|
730
|
-
protected formatDeploymentNodeDeclaration(node: AstNode): void;
|
|
731
|
-
protected formatDeployedInstance(node: AstNode): void;
|
|
732
|
-
protected formatViewRuleGlobalStyle(node: AstNode): void;
|
|
733
|
-
protected formatViewRuleGlobalPredicate(node: AstNode): void;
|
|
734
|
-
protected formatViewRuleGroup(node: AstNode): void;
|
|
735
|
-
protected formatViewRuleStyle(node: AstNode): void;
|
|
736
|
-
protected formatWhereExpression(node: AstNode): void;
|
|
737
|
-
protected formatWhereRelationExpression(node: AstNode): void;
|
|
738
|
-
protected formatWhereElementExpression(node: AstNode): void;
|
|
739
|
-
protected formatIncludeExcludeExpressions(node: AstNode): void;
|
|
740
|
-
protected formatRelationExpression(node: AstNode): void;
|
|
741
|
-
private findPredicateExpressionRoot;
|
|
742
|
-
private on;
|
|
743
|
-
private doExtendedFormatting;
|
|
744
|
-
protected normalizeQuotes(node: AstNode): void;
|
|
745
|
-
private quotesNormalizerFactory;
|
|
746
|
-
private escapeQuotesInternalQuotes;
|
|
747
|
-
private getAutoQuoteStyle;
|
|
748
|
-
private onConfigurationUpdate;
|
|
749
|
-
} //#endregion
|
|
1572
|
+
//#endregion
|
|
750
1573
|
//#region src/generated/ast.d.ts
|
|
751
|
-
type AnyProperty = DynamicViewProperty | ElementProperty | NavigateToProperty |
|
|
1574
|
+
type AnyProperty = DynamicViewProperty | ElementProperty | NavigateToProperty | RelationProperty | RelationshipStyleProperty | StringProperty | StyleProperty | ViewProperty;
|
|
752
1575
|
declare const AnyProperty = "AnyProperty";
|
|
753
1576
|
type ArrowType = 'crow' | 'diamond' | 'dot' | 'none' | 'normal' | 'odiamond' | 'odot' | 'onormal' | 'open' | 'vee';
|
|
754
1577
|
type BorderStyleValue = 'none' | LineOptions;
|
|
@@ -766,13 +1589,13 @@ type DynamicViewProperty = DynamicViewDisplayVariantProperty | ViewProperty;
|
|
|
766
1589
|
declare const DynamicViewProperty = "DynamicViewProperty";
|
|
767
1590
|
type DynamicViewRule = DynamicViewGlobalPredicateRef | DynamicViewIncludePredicate | ViewRuleAutoLayout | ViewRuleStyleOrGlobalRef;
|
|
768
1591
|
declare const DynamicViewRule = "DynamicViewRule";
|
|
769
|
-
type DynamicViewStep = DynamicStepChain | DynamicStepSingle;
|
|
770
|
-
declare const DynamicViewStep = "DynamicViewStep";
|
|
771
1592
|
type ElementProperty = ElementStringProperty | ElementStyleProperty | IconProperty | LinkProperty | MetadataProperty;
|
|
772
1593
|
declare const ElementProperty = "ElementProperty";
|
|
773
1594
|
type ElementShape = 'browser' | 'bucket' | 'component' | 'cylinder' | 'document' | 'mobile' | 'person' | 'queue' | 'rectangle' | 'storage';
|
|
774
1595
|
type ExpressionV2 = FqnExprOrWith | RelationExprOrWith;
|
|
775
1596
|
declare const ExpressionV2 = "ExpressionV2";
|
|
1597
|
+
type ExtendElementOrRelation = ExtendElement | ExtendRelation;
|
|
1598
|
+
declare const ExtendElementOrRelation = "ExtendElementOrRelation";
|
|
776
1599
|
type ExtendElementProperty = LinkProperty | MetadataProperty;
|
|
777
1600
|
declare const ExtendElementProperty = "ExtendElementProperty";
|
|
778
1601
|
type ExtendRelationProperty = LinkProperty | MetadataProperty;
|
|
@@ -796,6 +1619,8 @@ type MetadataProperty = MetadataBody;
|
|
|
796
1619
|
declare const MetadataProperty = "MetadataProperty";
|
|
797
1620
|
type MetadataValue = MarkdownOrString | MetadataArray;
|
|
798
1621
|
declare const MetadataValue = "MetadataValue";
|
|
1622
|
+
type ModelElement = Element | ExtendElementOrRelation | Relation;
|
|
1623
|
+
declare const ModelElement = "ModelElement";
|
|
799
1624
|
type ModelReferenceable = Element | Imported;
|
|
800
1625
|
declare const ModelReferenceable = "ModelReferenceable";
|
|
801
1626
|
type Participant = 'source' | 'target';
|
|
@@ -815,11 +1640,17 @@ declare const RelationshipStyleProperty = "RelationshipStyleProperty";
|
|
|
815
1640
|
type SizeProperty = IconSizeProperty | PaddingSizeProperty | ShapeSizeProperty | TextSizeProperty;
|
|
816
1641
|
declare const SizeProperty = "SizeProperty";
|
|
817
1642
|
type SizeValue = 'large' | 'lg' | 'md' | 'medium' | 'sm' | 'small' | 'xl' | 'xlarge' | 'xs' | 'xsmall';
|
|
1643
|
+
type StepOrSeries = Step | StepSeries;
|
|
1644
|
+
declare const StepOrSeries = "StepOrSeries";
|
|
1645
|
+
type StepStatement = AltSteps | StepOrSeries | SubflowStep | TryStep;
|
|
1646
|
+
declare const StepStatement = "StepStatement";
|
|
818
1647
|
type StringProperty = ElementStringProperty | MetadataAttribute | NotationProperty | NotesProperty | RelationStringProperty | SpecificationElementStringProperty | SpecificationRelationshipStringProperty | ViewStringProperty;
|
|
819
1648
|
declare const StringProperty = "StringProperty";
|
|
820
1649
|
type StyleProperty = BorderProperty | ColorProperty | IconColorProperty | IconPositionProperty | IconProperty | IconSizeProperty | MultipleProperty | OpacityProperty | PaddingSizeProperty | ShapeProperty | ShapeSizeProperty | TextSizeProperty;
|
|
821
1650
|
declare const StyleProperty = "StyleProperty";
|
|
822
1651
|
type ThemeColor = 'amber' | 'blue' | 'gray' | 'green' | 'indigo' | 'muted' | 'primary' | 'red' | 'secondary' | 'sky' | 'slate';
|
|
1652
|
+
type TryStep = CatchBlock | FinallyBlock | TryBlock;
|
|
1653
|
+
declare const TryStep = "TryStep";
|
|
823
1654
|
type Uri = string;
|
|
824
1655
|
type ViewLayoutDirection = 'BottomTop' | 'LeftRight' | 'RightLeft' | 'TopBottom';
|
|
825
1656
|
type ViewProperty = LinkProperty | ViewStringProperty;
|
|
@@ -844,16 +1675,23 @@ type WhereRelationExpression = WhereBinaryExpression | WhereRelation | WhereRela
|
|
|
844
1675
|
declare const WhereRelationExpression = "WhereRelationExpression";
|
|
845
1676
|
type WhereTagEqual = WhereElementTag | WhereRelationParticipantTag | WhereRelationTag;
|
|
846
1677
|
declare const WhereTagEqual = "WhereTagEqual";
|
|
847
|
-
interface
|
|
848
|
-
readonly $container:
|
|
849
|
-
readonly $type: '
|
|
1678
|
+
interface AbstractStep extends AstNode {
|
|
1679
|
+
readonly $container: DynamicViewBody | StepSeries | StepsBlock;
|
|
1680
|
+
readonly $type: 'AbstractStep' | 'Step' | 'StepSeries';
|
|
850
1681
|
custom?: CustomRelationProperties;
|
|
851
1682
|
dotKind?: RelationKindDotRef;
|
|
852
1683
|
kind?: Reference<RelationshipKind>;
|
|
853
1684
|
target: ElementRef;
|
|
854
1685
|
title?: string;
|
|
855
1686
|
}
|
|
856
|
-
declare const
|
|
1687
|
+
declare const AbstractStep = "AbstractStep";
|
|
1688
|
+
interface AltSteps extends AstNode {
|
|
1689
|
+
readonly $container: DynamicViewBody | StepsBlock;
|
|
1690
|
+
readonly $type: 'AltSteps';
|
|
1691
|
+
branches: Array<SubflowStep>;
|
|
1692
|
+
title?: string;
|
|
1693
|
+
}
|
|
1694
|
+
declare const AltSteps = "AltSteps";
|
|
857
1695
|
interface ArrowProperty extends AstNode {
|
|
858
1696
|
readonly $container: CustomRelationProperties | RelationStyleProperty | SpecificationRelationshipKind;
|
|
859
1697
|
readonly $type: 'ArrowProperty';
|
|
@@ -868,6 +1706,14 @@ interface BorderProperty extends AstNode {
|
|
|
868
1706
|
value: BorderStyleValue;
|
|
869
1707
|
}
|
|
870
1708
|
declare const BorderProperty = "BorderProperty";
|
|
1709
|
+
interface CatchBlock extends AstNode {
|
|
1710
|
+
readonly $container: DynamicViewBody | FinallyBlock | StepsBlock;
|
|
1711
|
+
readonly $type: 'CatchBlock';
|
|
1712
|
+
catch: StepsBlock;
|
|
1713
|
+
title?: string;
|
|
1714
|
+
try: TryBlock;
|
|
1715
|
+
}
|
|
1716
|
+
declare const CatchBlock = "CatchBlock";
|
|
871
1717
|
interface ColorProperty extends AstNode {
|
|
872
1718
|
readonly $container: CustomElementProperties | CustomRelationProperties | DeploymentViewRuleStyle | ElementStyleProperty | GlobalStyle | RelationStyleProperty | SpecificationRelationshipKind | ViewRuleGroup | ViewRuleStyle;
|
|
873
1719
|
readonly $type: 'ColorProperty';
|
|
@@ -889,7 +1735,7 @@ interface CustomElementProperties extends AstNode {
|
|
|
889
1735
|
}
|
|
890
1736
|
declare const CustomElementProperties = "CustomElementProperties";
|
|
891
1737
|
interface CustomRelationProperties extends AstNode {
|
|
892
|
-
readonly $container:
|
|
1738
|
+
readonly $container: AbstractStep | RelationExprWith;
|
|
893
1739
|
readonly $type: 'CustomRelationProperties';
|
|
894
1740
|
props: Array<MultipleProperty | NotationProperty | NotesProperty | RelationNavigateToProperty | RelationStringProperty | RelationshipStyleProperty>;
|
|
895
1741
|
}
|
|
@@ -1005,7 +1851,7 @@ interface DynamicViewBody extends AstNode {
|
|
|
1005
1851
|
readonly $type: 'DynamicViewBody';
|
|
1006
1852
|
props: Array<DynamicViewProperty>;
|
|
1007
1853
|
rules: Array<DynamicViewRule>;
|
|
1008
|
-
steps: Array<
|
|
1854
|
+
steps: Array<StepStatement>;
|
|
1009
1855
|
tags?: Tags;
|
|
1010
1856
|
}
|
|
1011
1857
|
declare const DynamicViewBody = "DynamicViewBody";
|
|
@@ -1027,13 +1873,7 @@ interface DynamicViewIncludePredicate extends AstNode {
|
|
|
1027
1873
|
readonly $type: 'DynamicViewIncludePredicate';
|
|
1028
1874
|
exprs: Expressions;
|
|
1029
1875
|
}
|
|
1030
|
-
declare const DynamicViewIncludePredicate = "DynamicViewIncludePredicate";
|
|
1031
|
-
interface DynamicViewParallelSteps extends AstNode {
|
|
1032
|
-
readonly $container: DynamicViewBody;
|
|
1033
|
-
readonly $type: 'DynamicViewParallelSteps';
|
|
1034
|
-
steps: Array<DynamicViewStep>;
|
|
1035
|
-
}
|
|
1036
|
-
declare const DynamicViewParallelSteps = "DynamicViewParallelSteps";
|
|
1876
|
+
declare const DynamicViewIncludePredicate = "DynamicViewIncludePredicate";
|
|
1037
1877
|
interface DynamicViewRef extends AstNode {
|
|
1038
1878
|
readonly $container: RelationNavigateToProperty;
|
|
1039
1879
|
readonly $type: 'DynamicViewRef';
|
|
@@ -1071,7 +1911,7 @@ interface ElementKindExpression extends AstNode {
|
|
|
1071
1911
|
}
|
|
1072
1912
|
declare const ElementKindExpression = "ElementKindExpression";
|
|
1073
1913
|
interface ElementRef extends AstNode {
|
|
1074
|
-
readonly $container:
|
|
1914
|
+
readonly $container: AbstractStep | DeployedInstance | ElementView | Step;
|
|
1075
1915
|
readonly $type: 'ElementRef';
|
|
1076
1916
|
modelElement: FqnRef$2;
|
|
1077
1917
|
}
|
|
@@ -1175,6 +2015,14 @@ interface ExtendRelationBody extends AstNode {
|
|
|
1175
2015
|
tags?: Tags;
|
|
1176
2016
|
}
|
|
1177
2017
|
declare const ExtendRelationBody = "ExtendRelationBody";
|
|
2018
|
+
interface FinallyBlock extends AstNode {
|
|
2019
|
+
readonly $container: DynamicViewBody | StepsBlock;
|
|
2020
|
+
readonly $type: 'FinallyBlock';
|
|
2021
|
+
finally: StepsBlock;
|
|
2022
|
+
title?: string;
|
|
2023
|
+
tryCatch: CatchBlock | TryBlock;
|
|
2024
|
+
}
|
|
2025
|
+
declare const FinallyBlock = "FinallyBlock";
|
|
1178
2026
|
interface FqnExpressions extends AstNode {
|
|
1179
2027
|
readonly $container: DeploymentViewRuleStyle | FqnExpressions | GlobalStyle | ViewRuleRank | ViewRuleStyle;
|
|
1180
2028
|
readonly $type: 'FqnExpressions';
|
|
@@ -1346,7 +2194,7 @@ interface LineProperty extends AstNode {
|
|
|
1346
2194
|
}
|
|
1347
2195
|
declare const LineProperty = "LineProperty";
|
|
1348
2196
|
interface LinkProperty extends AstNode {
|
|
1349
|
-
readonly $container: DeployedInstanceBody | DeploymentNodeBody | DeploymentRelationBody | DeploymentViewBody | DynamicViewBody | ElementBody | ElementViewBody | ExtendDeploymentBody | ExtendElementBody | ExtendRelationBody | RelationBody | SpecificationDeploymentNodeKind | SpecificationElementKind;
|
|
2197
|
+
readonly $container: DeployedInstanceBody | DeploymentNodeBody | DeploymentRelationBody | DeploymentViewBody | DynamicViewBody | ElementBody | ElementViewBody | ExtendDeploymentBody | ExtendElementBody | ExtendRelationBody | RelationBody | SpecificationDeploymentNodeKind | SpecificationElementKind | SpecificationRelationshipKind;
|
|
1350
2198
|
readonly $type: 'LinkProperty';
|
|
1351
2199
|
key: 'link';
|
|
1352
2200
|
title?: string;
|
|
@@ -1383,7 +2231,7 @@ declare const MetadataBody = "MetadataBody";
|
|
|
1383
2231
|
interface Model extends AstNode {
|
|
1384
2232
|
readonly $container: LikeC4Grammar;
|
|
1385
2233
|
readonly $type: 'Model';
|
|
1386
|
-
elements: Array<
|
|
2234
|
+
elements: Array<ModelElement>;
|
|
1387
2235
|
name: 'model';
|
|
1388
2236
|
}
|
|
1389
2237
|
declare const Model = "Model";
|
|
@@ -1490,7 +2338,7 @@ interface RelationExprWith extends AstNode {
|
|
|
1490
2338
|
}
|
|
1491
2339
|
declare const RelationExprWith = "RelationExprWith";
|
|
1492
2340
|
interface RelationKindDotRef extends AstNode {
|
|
1493
|
-
readonly $container:
|
|
2341
|
+
readonly $container: AbstractStep | DeploymentRelation | ExtendRelation | OutgoingRelationExpr | Relation;
|
|
1494
2342
|
readonly $type: 'RelationKindDotRef';
|
|
1495
2343
|
kind: Reference<RelationshipKind>;
|
|
1496
2344
|
}
|
|
@@ -1579,13 +2427,14 @@ interface SpecificationRelationshipKind extends AstNode {
|
|
|
1579
2427
|
readonly $container: SpecificationRule;
|
|
1580
2428
|
readonly $type: 'SpecificationRelationshipKind';
|
|
1581
2429
|
kind: RelationshipKind;
|
|
1582
|
-
props: Array<MultipleProperty | RelationshipStyleProperty | SpecificationRelationshipStringProperty>;
|
|
2430
|
+
props: Array<LinkProperty | MultipleProperty | RelationshipStyleProperty | SpecificationRelationshipStringProperty>;
|
|
2431
|
+
tags?: Tags;
|
|
1583
2432
|
}
|
|
1584
2433
|
declare const SpecificationRelationshipKind = "SpecificationRelationshipKind";
|
|
1585
2434
|
interface SpecificationRelationshipStringProperty extends AstNode {
|
|
1586
2435
|
readonly $container: SpecificationRelationshipKind;
|
|
1587
2436
|
readonly $type: 'SpecificationRelationshipStringProperty';
|
|
1588
|
-
key: 'notation' | 'technology';
|
|
2437
|
+
key: 'description' | 'notation' | 'technology' | 'title';
|
|
1589
2438
|
value: MarkdownOrString;
|
|
1590
2439
|
}
|
|
1591
2440
|
declare const SpecificationRelationshipStringProperty = "SpecificationRelationshipStringProperty";
|
|
@@ -1607,6 +2456,12 @@ interface SpecificationTag extends AstNode {
|
|
|
1607
2456
|
tag: Tag$1;
|
|
1608
2457
|
}
|
|
1609
2458
|
declare const SpecificationTag = "SpecificationTag";
|
|
2459
|
+
interface StepsBlock extends AstNode {
|
|
2460
|
+
readonly $container: AltSteps | CatchBlock | DynamicViewBody | FinallyBlock | StepsBlock;
|
|
2461
|
+
readonly $type: 'StepsBlock' | 'SubflowStep' | 'TryBlock';
|
|
2462
|
+
steps: Array<StepStatement>;
|
|
2463
|
+
}
|
|
2464
|
+
declare const StepsBlock = "StepsBlock";
|
|
1610
2465
|
interface StrictFqnElementRef extends AstNode {
|
|
1611
2466
|
readonly $container: ExtendElement | StrictFqnElementRef;
|
|
1612
2467
|
readonly $type: 'StrictFqnElementRef';
|
|
@@ -1634,7 +2489,7 @@ interface TagRef extends AstNode {
|
|
|
1634
2489
|
}
|
|
1635
2490
|
declare const TagRef = "TagRef";
|
|
1636
2491
|
interface Tags extends AstNode {
|
|
1637
|
-
readonly $container: DeployedInstanceBody | DeploymentNodeBody | DeploymentRelation | DeploymentRelationBody | DeploymentViewBody | DynamicViewBody | ElementBody | ElementViewBody | ExtendDeploymentBody | ExtendElementBody | ExtendRelationBody | Relation | RelationBody | SpecificationDeploymentNodeKind | SpecificationElementKind | Tags;
|
|
2492
|
+
readonly $container: DeployedInstanceBody | DeploymentNodeBody | DeploymentRelation | DeploymentRelationBody | DeploymentViewBody | DynamicViewBody | ElementBody | ElementViewBody | ExtendDeploymentBody | ExtendElementBody | ExtendRelationBody | Relation | RelationBody | SpecificationDeploymentNodeKind | SpecificationElementKind | SpecificationRelationshipKind | Tags;
|
|
1638
2493
|
readonly $type: 'Tags';
|
|
1639
2494
|
prev?: Tags;
|
|
1640
2495
|
values: Array<TagRef>;
|
|
@@ -1820,24 +2675,47 @@ interface WildcardExpression extends AstNode {
|
|
|
1820
2675
|
isWildcard: boolean;
|
|
1821
2676
|
}
|
|
1822
2677
|
declare const WildcardExpression = "WildcardExpression";
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
readonly $container: DynamicStepChain | DynamicViewBody | DynamicViewParallelSteps;
|
|
1831
|
-
readonly $type: 'DynamicStepSingle';
|
|
2678
|
+
/**
|
|
2679
|
+
* A single step in a dynamic view flow
|
|
2680
|
+
* source -> target
|
|
2681
|
+
*/
|
|
2682
|
+
interface Step extends AbstractStep {
|
|
2683
|
+
readonly $container: DynamicViewBody | StepSeries | StepsBlock;
|
|
2684
|
+
readonly $type: 'Step';
|
|
1832
2685
|
isBackward: boolean;
|
|
1833
2686
|
source: ElementRef;
|
|
1834
2687
|
}
|
|
1835
|
-
declare const
|
|
2688
|
+
declare const Step = "Step";
|
|
2689
|
+
/**
|
|
2690
|
+
* A series of steps in a dynamic view flow
|
|
2691
|
+
* source -> target1 -> target2 -> ...
|
|
2692
|
+
*/
|
|
2693
|
+
interface StepSeries extends AbstractStep {
|
|
2694
|
+
readonly $container: DynamicViewBody | StepSeries | StepsBlock;
|
|
2695
|
+
readonly $type: 'StepSeries';
|
|
2696
|
+
source: Step | StepSeries;
|
|
2697
|
+
}
|
|
2698
|
+
declare const StepSeries = "StepSeries";
|
|
2699
|
+
interface SubflowStep extends StepsBlock {
|
|
2700
|
+
readonly $container: AltSteps | DynamicViewBody | StepsBlock;
|
|
2701
|
+
readonly $type: 'SubflowStep';
|
|
2702
|
+
kind: 'break' | 'else' | 'if' | 'loop' | 'opt' | 'par' | 'parallel' | 'when';
|
|
2703
|
+
title?: string;
|
|
2704
|
+
}
|
|
2705
|
+
declare const SubflowStep = "SubflowStep";
|
|
2706
|
+
interface TryBlock extends StepsBlock {
|
|
2707
|
+
readonly $container: CatchBlock | DynamicViewBody | FinallyBlock | StepsBlock;
|
|
2708
|
+
readonly $type: 'TryBlock';
|
|
2709
|
+
title?: string;
|
|
2710
|
+
}
|
|
2711
|
+
declare const TryBlock = "TryBlock";
|
|
1836
2712
|
type LikeC4AstType = {
|
|
1837
|
-
|
|
2713
|
+
AbstractStep: AbstractStep;
|
|
2714
|
+
AltSteps: AltSteps;
|
|
1838
2715
|
AnyProperty: AnyProperty;
|
|
1839
2716
|
ArrowProperty: ArrowProperty;
|
|
1840
2717
|
BorderProperty: BorderProperty;
|
|
2718
|
+
CatchBlock: CatchBlock;
|
|
1841
2719
|
ColorLiteral: ColorLiteral$1;
|
|
1842
2720
|
ColorProperty: ColorProperty;
|
|
1843
2721
|
CustomColor: CustomColor;
|
|
@@ -1858,18 +2736,14 @@ type LikeC4AstType = {
|
|
|
1858
2736
|
DeploymentViewRulePredicate: DeploymentViewRulePredicate;
|
|
1859
2737
|
DeploymentViewRuleStyle: DeploymentViewRuleStyle;
|
|
1860
2738
|
DirectedRelationExpr: DirectedRelationExpr;
|
|
1861
|
-
DynamicStepChain: DynamicStepChain;
|
|
1862
|
-
DynamicStepSingle: DynamicStepSingle;
|
|
1863
2739
|
DynamicView: DynamicView;
|
|
1864
2740
|
DynamicViewBody: DynamicViewBody;
|
|
1865
2741
|
DynamicViewDisplayVariantProperty: DynamicViewDisplayVariantProperty;
|
|
1866
2742
|
DynamicViewGlobalPredicateRef: DynamicViewGlobalPredicateRef;
|
|
1867
2743
|
DynamicViewIncludePredicate: DynamicViewIncludePredicate;
|
|
1868
|
-
DynamicViewParallelSteps: DynamicViewParallelSteps;
|
|
1869
2744
|
DynamicViewProperty: DynamicViewProperty;
|
|
1870
2745
|
DynamicViewRef: DynamicViewRef;
|
|
1871
2746
|
DynamicViewRule: DynamicViewRule;
|
|
1872
|
-
DynamicViewStep: DynamicViewStep;
|
|
1873
2747
|
Element: Element;
|
|
1874
2748
|
ElementBody: ElementBody;
|
|
1875
2749
|
ElementKind: ElementKind;
|
|
@@ -1888,10 +2762,12 @@ type LikeC4AstType = {
|
|
|
1888
2762
|
ExtendDeploymentBody: ExtendDeploymentBody;
|
|
1889
2763
|
ExtendElement: ExtendElement;
|
|
1890
2764
|
ExtendElementBody: ExtendElementBody;
|
|
2765
|
+
ExtendElementOrRelation: ExtendElementOrRelation;
|
|
1891
2766
|
ExtendElementProperty: ExtendElementProperty;
|
|
1892
2767
|
ExtendRelation: ExtendRelation;
|
|
1893
2768
|
ExtendRelationBody: ExtendRelationBody;
|
|
1894
2769
|
ExtendRelationProperty: ExtendRelationProperty;
|
|
2770
|
+
FinallyBlock: FinallyBlock;
|
|
1895
2771
|
FqnExpr: FqnExpr$2;
|
|
1896
2772
|
FqnExprOrWhere: FqnExprOrWhere;
|
|
1897
2773
|
FqnExprOrWith: FqnExprOrWith;
|
|
@@ -1930,6 +2806,7 @@ type LikeC4AstType = {
|
|
|
1930
2806
|
MetadataValue: MetadataValue;
|
|
1931
2807
|
Model: Model;
|
|
1932
2808
|
ModelDeployments: ModelDeployments;
|
|
2809
|
+
ModelElement: ModelElement;
|
|
1933
2810
|
ModelReferenceable: ModelReferenceable;
|
|
1934
2811
|
ModelViews: ModelViews;
|
|
1935
2812
|
MultipleProperty: MultipleProperty;
|
|
@@ -1966,14 +2843,22 @@ type LikeC4AstType = {
|
|
|
1966
2843
|
SpecificationRelationshipStringProperty: SpecificationRelationshipStringProperty;
|
|
1967
2844
|
SpecificationRule: SpecificationRule;
|
|
1968
2845
|
SpecificationTag: SpecificationTag;
|
|
2846
|
+
Step: Step;
|
|
2847
|
+
StepOrSeries: StepOrSeries;
|
|
2848
|
+
StepSeries: StepSeries;
|
|
2849
|
+
StepStatement: StepStatement;
|
|
2850
|
+
StepsBlock: StepsBlock;
|
|
1969
2851
|
StrictFqnElementRef: StrictFqnElementRef;
|
|
1970
2852
|
StrictFqnRef: StrictFqnRef;
|
|
1971
2853
|
StringProperty: StringProperty;
|
|
1972
2854
|
StyleProperty: StyleProperty;
|
|
2855
|
+
SubflowStep: SubflowStep;
|
|
1973
2856
|
Tag: Tag$1;
|
|
1974
2857
|
TagRef: TagRef;
|
|
1975
2858
|
Tags: Tags;
|
|
1976
2859
|
TextSizeProperty: TextSizeProperty;
|
|
2860
|
+
TryBlock: TryBlock;
|
|
2861
|
+
TryStep: TryStep;
|
|
1977
2862
|
ViewProperty: ViewProperty;
|
|
1978
2863
|
ViewRef: ViewRef;
|
|
1979
2864
|
ViewRule: ViewRule;
|
|
@@ -2008,7 +2893,8 @@ type LikeC4AstType = {
|
|
|
2008
2893
|
WhereRelationTag: WhereRelationTag;
|
|
2009
2894
|
WhereTagEqual: WhereTagEqual;
|
|
2010
2895
|
WildcardExpression: WildcardExpression;
|
|
2011
|
-
};
|
|
2896
|
+
};
|
|
2897
|
+
//#endregion
|
|
2012
2898
|
//#region src/validation/DocumentValidator.d.ts
|
|
2013
2899
|
declare class LikeC4DocumentValidator extends DefaultDocumentValidator {
|
|
2014
2900
|
protected services: LikeC4Services;
|
|
@@ -2017,7 +2903,8 @@ declare class LikeC4DocumentValidator extends DefaultDocumentValidator {
|
|
|
2017
2903
|
* If the document is excluded, then we skip validation and return an empty array of diagnostics.
|
|
2018
2904
|
*/
|
|
2019
2905
|
validateDocument(document: LangiumDocument, options?: ValidationOptions, cancelToken?: CancellationToken$1): Promise<Diagnostic[]>;
|
|
2020
|
-
}
|
|
2906
|
+
}
|
|
2907
|
+
//#endregion
|
|
2021
2908
|
//#region src/validation/index.d.ts
|
|
2022
2909
|
declare const isValidatableAstNode: any;
|
|
2023
2910
|
type ValidatableAstNode = GuardedBy<typeof isValidatableAstNode>;
|
|
@@ -2026,7 +2913,8 @@ declare function checksFromDiagnostics(doc: LikeC4LangiumDocument): {
|
|
|
2026
2913
|
invalidNodes: WeakSet<WeakKey>;
|
|
2027
2914
|
};
|
|
2028
2915
|
type ChecksFromDiagnostics = ReturnType<typeof checksFromDiagnostics>;
|
|
2029
|
-
type IsValidFn = ChecksFromDiagnostics['isValid'];
|
|
2916
|
+
type IsValidFn = ChecksFromDiagnostics['isValid'];
|
|
2917
|
+
//#endregion
|
|
2030
2918
|
//#region src/ast.d.ts
|
|
2031
2919
|
declare module 'langium' {
|
|
2032
2920
|
interface LangiumDocument {
|
|
@@ -2077,15 +2965,7 @@ interface ParsedAstSpecification {
|
|
|
2077
2965
|
color?: c4.ColorLiteral;
|
|
2078
2966
|
}>;
|
|
2079
2967
|
elements: Record<c4.ElementKind, c4.ElementSpecification>;
|
|
2080
|
-
relationships: Record<c4.RelationshipKind,
|
|
2081
|
-
technology?: string;
|
|
2082
|
-
notation?: string;
|
|
2083
|
-
color?: c4.Color;
|
|
2084
|
-
line?: c4.RelationshipLineType;
|
|
2085
|
-
head?: c4.RelationshipArrowType;
|
|
2086
|
-
tail?: c4.RelationshipArrowType;
|
|
2087
|
-
multiple?: boolean;
|
|
2088
|
-
}>;
|
|
2968
|
+
relationships: Record<c4.RelationshipKind, c4.RelationshipSpecification>;
|
|
2089
2969
|
colors: Record<c4.CustomColor, {
|
|
2090
2970
|
color: c4.ColorLiteral;
|
|
2091
2971
|
}>;
|
|
@@ -2166,54 +3046,365 @@ interface ParsedAstElementView {
|
|
|
2166
3046
|
links: c4.NonEmptyArray<c4.Link> | null;
|
|
2167
3047
|
rules: c4.ElementViewRule[];
|
|
2168
3048
|
}
|
|
2169
|
-
interface ParsedAstDynamicView {
|
|
2170
|
-
id: c4.ViewId;
|
|
2171
|
-
astPath: string;
|
|
2172
|
-
title: string | null;
|
|
2173
|
-
description: c4.MarkdownOrString | null;
|
|
2174
|
-
tags: c4.NonEmptyArray<c4.Tag> | null;
|
|
2175
|
-
links: c4.NonEmptyArray<c4.Link> | null;
|
|
2176
|
-
steps: c4.
|
|
2177
|
-
rules: Array<c4.DynamicViewRule>;
|
|
2178
|
-
variant: c4.DynamicViewDisplayVariant | undefined;
|
|
3049
|
+
interface ParsedAstDynamicView {
|
|
3050
|
+
id: c4.ViewId;
|
|
3051
|
+
astPath: string;
|
|
3052
|
+
title: string | null;
|
|
3053
|
+
description: c4.MarkdownOrString | null;
|
|
3054
|
+
tags: c4.NonEmptyArray<c4.Tag> | null;
|
|
3055
|
+
links: c4.NonEmptyArray<c4.Link> | null;
|
|
3056
|
+
steps: c4.Step.Any[];
|
|
3057
|
+
rules: Array<c4.DynamicViewRule>;
|
|
3058
|
+
variant: c4.DynamicViewDisplayVariant | undefined;
|
|
3059
|
+
}
|
|
3060
|
+
interface ParsedAstDeploymentView {
|
|
3061
|
+
id: c4.ViewId;
|
|
3062
|
+
astPath: string;
|
|
3063
|
+
title: string | null;
|
|
3064
|
+
description: c4.MarkdownOrString | null;
|
|
3065
|
+
tags: c4.NonEmptyArray<c4.Tag> | null;
|
|
3066
|
+
links: c4.NonEmptyArray<c4.Link> | null;
|
|
3067
|
+
rules: Array<c4.DeploymentViewRule>;
|
|
3068
|
+
}
|
|
3069
|
+
type ParsedAstView = ParsedAstElementView | ParsedAstDynamicView | ParsedAstDeploymentView;
|
|
3070
|
+
interface AstNodeDescriptionWithFqn extends AstNodeDescription {
|
|
3071
|
+
likec4ProjectId: c4.ProjectId;
|
|
3072
|
+
id: c4.Fqn;
|
|
3073
|
+
}
|
|
3074
|
+
type LikeC4AstNode = ValueOf<ConditionalPick<LikeC4AstType, AstNode>>;
|
|
3075
|
+
type LikeC4DocumentDiagnostic = Diagnostic & DiagnosticInfo<LikeC4AstNode>;
|
|
3076
|
+
interface LikeC4DocumentProps {
|
|
3077
|
+
diagnostics?: Array<LikeC4DocumentDiagnostic>;
|
|
3078
|
+
c4Specification?: ParsedAstSpecification;
|
|
3079
|
+
c4Elements?: ParsedAstElement[];
|
|
3080
|
+
c4ExtendElements?: ParsedAstExtend[];
|
|
3081
|
+
c4ExtendDeployments?: ParsedAstExtend[];
|
|
3082
|
+
c4ExtendRelations?: ParsedAstExtendRelation[];
|
|
3083
|
+
c4Relations?: ParsedAstRelation[];
|
|
3084
|
+
c4Globals?: ParsedAstGlobals;
|
|
3085
|
+
c4Views?: ParsedAstView[];
|
|
3086
|
+
c4Deployments?: ParsedAstDeployment[];
|
|
3087
|
+
c4DeploymentRelations?: ParsedAstDeploymentRelation[];
|
|
3088
|
+
c4Imports?: MultiMap<c4.ProjectId, c4.Fqn, Set<c4.Fqn>>;
|
|
3089
|
+
}
|
|
3090
|
+
type LikeC4GrammarDocument = Omit<LangiumDocument<LikeC4Grammar>, 'diagnostics'>;
|
|
3091
|
+
interface LikeC4LangiumDocument extends LikeC4GrammarDocument, LikeC4DocumentProps {
|
|
3092
|
+
likec4ProjectId: c4.ProjectId;
|
|
3093
|
+
}
|
|
3094
|
+
interface ParsedLikeC4LangiumDocument extends LikeC4GrammarDocument, Required<LikeC4DocumentProps> {
|
|
3095
|
+
likec4ProjectId: c4.ProjectId;
|
|
3096
|
+
}
|
|
3097
|
+
//#endregion
|
|
3098
|
+
//#region src/workspace/ProjectsManager.d.ts
|
|
3099
|
+
type NormalizedUri = Tagged<string, 'NormalizedUri'>;
|
|
3100
|
+
type DocOrUri = LangiumDocument | string | URI;
|
|
3101
|
+
/**
|
|
3102
|
+
* A tagged string that represents a project folder URI (with trailing slash).
|
|
3103
|
+
* Used in `startsWith` checks to determine if a document belongs to a project.
|
|
3104
|
+
*/
|
|
3105
|
+
type ProjectFolder = Tagged<string, 'ProjectFolder'>;
|
|
3106
|
+
declare function ProjectFolder(folder: URI | string): ProjectFolder;
|
|
3107
|
+
interface Project {
|
|
3108
|
+
id: ProjectId;
|
|
3109
|
+
folderUri: URI;
|
|
3110
|
+
config: LikeC4ProjectConfig;
|
|
3111
|
+
}
|
|
3112
|
+
interface ProjectData extends Project {
|
|
3113
|
+
id: ProjectId;
|
|
3114
|
+
folder: ProjectFolder;
|
|
3115
|
+
config: LikeC4ProjectConfig;
|
|
3116
|
+
configUri: URI;
|
|
3117
|
+
folderUri: URI;
|
|
3118
|
+
exclude?: {
|
|
3119
|
+
(test: string): boolean;
|
|
3120
|
+
};
|
|
3121
|
+
/**
|
|
3122
|
+
* Resolved include paths with both URI and folder string representations.
|
|
3123
|
+
* These are additional directories that are part of this project.
|
|
3124
|
+
*/
|
|
3125
|
+
includePaths?: NonEmptyArray$1<{
|
|
3126
|
+
uri: URI;
|
|
3127
|
+
folder: ProjectFolder;
|
|
3128
|
+
}>;
|
|
3129
|
+
/**
|
|
3130
|
+
* Normalized include configuration (paths, maxDepth, fileThreshold).
|
|
3131
|
+
*/
|
|
3132
|
+
includeConfig: IncludeConfig;
|
|
3133
|
+
}
|
|
3134
|
+
type RegisterProjectOptions = {
|
|
3135
|
+
config: LikeC4ProjectConfig | LikeC4ProjectConfigInput;
|
|
3136
|
+
} & ({
|
|
3137
|
+
configUri: URI | string;
|
|
3138
|
+
} | {
|
|
3139
|
+
folderUri: URI | string;
|
|
3140
|
+
});
|
|
3141
|
+
declare class ProjectsManager extends ADisposable {
|
|
3142
|
+
#private;
|
|
3143
|
+
protected services: LikeC4SharedServices;
|
|
3144
|
+
/**
|
|
3145
|
+
* The global project ID used for all documents
|
|
3146
|
+
* that are not part of a specific project.
|
|
3147
|
+
*/
|
|
3148
|
+
static readonly DefaultProjectId: ProjectId;
|
|
3149
|
+
constructor(services: LikeC4SharedServices);
|
|
3150
|
+
/**
|
|
3151
|
+
* Checks if a document is excluded by workspace-level patterns.
|
|
3152
|
+
* These patterns come from VS Code settings and take precedence over project-level excludes.
|
|
3153
|
+
*/
|
|
3154
|
+
isExcludedByWorkspace(uri: NormalizedUri | URI): boolean;
|
|
3155
|
+
/**
|
|
3156
|
+
* Updates the workspace-level exclude patterns from VS Code settings.
|
|
3157
|
+
* Called during initial server startup; dynamic changes restart the server.
|
|
3158
|
+
*/
|
|
3159
|
+
setWorkspaceExcludePatterns(patterns: string[] | undefined): void;
|
|
3160
|
+
/**
|
|
3161
|
+
* Returns:
|
|
3162
|
+
* - configured default project ID if set
|
|
3163
|
+
* - the default project ID if there are no projects.
|
|
3164
|
+
* - the ID of the only project
|
|
3165
|
+
* - undefined if there are multiple projects.
|
|
3166
|
+
*/
|
|
3167
|
+
get defaultProjectId(): ProjectId | undefined;
|
|
3168
|
+
set defaultProjectId(id: string | ProjectId | undefined);
|
|
3169
|
+
get default(): ProjectData;
|
|
3170
|
+
get all(): NonEmptyReadonlyArray$1<ProjectId>;
|
|
3171
|
+
getProject(arg: ProjectId | LangiumDocument): ProjectData;
|
|
3172
|
+
/**
|
|
3173
|
+
* Returns all projects that overlap with the specified folder (is parent or child)
|
|
3174
|
+
*/
|
|
3175
|
+
findOverlaped(folder: URI | string): ReadonlyArray<ProjectData>;
|
|
3176
|
+
/**
|
|
3177
|
+
* Validates and ensures the project ID.
|
|
3178
|
+
* If no project ID is specified, returns default project ID
|
|
3179
|
+
* If there are multiple projects and default project is not set, throws an error
|
|
3180
|
+
*/
|
|
3181
|
+
ensureProjectId(projectId?: ProjectId | undefined): ProjectId;
|
|
3182
|
+
/**
|
|
3183
|
+
* Validates and ensures the project data.
|
|
3184
|
+
* If projectId is not specified, returns default project
|
|
3185
|
+
*
|
|
3186
|
+
* If there are multiple projects and default project is not set, throws an error
|
|
3187
|
+
*
|
|
3188
|
+
* @see ensureProjectId - to validate project ID only
|
|
3189
|
+
*/
|
|
3190
|
+
ensureProject(projectId?: ProjectId | undefined): ProjectData;
|
|
3191
|
+
hasMultipleProjects(): boolean;
|
|
3192
|
+
/**
|
|
3193
|
+
* Checks if given document (or URI) must be excluded from processing.
|
|
3194
|
+
*/
|
|
3195
|
+
isExcluded(document: DocOrUri): boolean;
|
|
3196
|
+
/**
|
|
3197
|
+
* Checks if given document (or URI) must be excluded in the context of the project.
|
|
3198
|
+
*/
|
|
3199
|
+
isExcluded(projectId: ProjectId, document: DocOrUri): boolean;
|
|
3200
|
+
/**
|
|
3201
|
+
* Checks if the specified document is included by the project:
|
|
3202
|
+
* - if the document belongs to the project and is not excluded
|
|
3203
|
+
* - if the document is included by the project
|
|
3204
|
+
*/
|
|
3205
|
+
isIncluded(projectId: ProjectId, document: LangiumDocument | URI | string): boolean;
|
|
3206
|
+
/**
|
|
3207
|
+
* Registers likec4 project by config file.
|
|
3208
|
+
*/
|
|
3209
|
+
registerConfigFile(configUri: URI, cancelToken?: CancellationToken$1): Promise<ProjectData>;
|
|
3210
|
+
/**
|
|
3211
|
+
* Registers (or reloads) likec4 project by config file or config object.
|
|
3212
|
+
* If there is some project registered at same folder, it will be reloaded.
|
|
3213
|
+
*/
|
|
3214
|
+
registerProject(opts: RegisterProjectOptions, cancelToken?: CancellationToken$1): Promise<ProjectData>;
|
|
3215
|
+
/**
|
|
3216
|
+
* Determines which project the given document belongs to.
|
|
3217
|
+
* If the document does not belong to any project, returns the default project ID.
|
|
3218
|
+
*/
|
|
3219
|
+
ownerProjectId(document: LangiumDocument | URI | string): ProjectId;
|
|
3220
|
+
protected findOwnerProject(uri: NormalizedUri): ProjectData | undefined;
|
|
3221
|
+
/**
|
|
3222
|
+
* Returns path to the document relative to the project folder.
|
|
3223
|
+
* If the document does not belong to any project, returns the document URI as string.
|
|
3224
|
+
*/
|
|
3225
|
+
relativePath(document: LangiumDocument | URI | string): string;
|
|
3226
|
+
/**
|
|
3227
|
+
* Returns true if the manager is currently initializing or reloading projects.
|
|
3228
|
+
* This is used to prevent duplicate reload operations.
|
|
3229
|
+
*/
|
|
3230
|
+
protected get isInitiatingOrReloading(): boolean;
|
|
3231
|
+
reloadProjects(cancelToken?: CancellationToken$1): Promise<void>;
|
|
3232
|
+
protected _reloadProjects(cancelToken?: CancellationToken$1): Promise<void>;
|
|
3233
|
+
protected uniqueProjectId(name: string): ProjectId;
|
|
3234
|
+
clearCaches(): void;
|
|
3235
|
+
rebuildProject(projectId: ProjectId, cancelToken?: CancellationToken$1): Promise<void>;
|
|
3236
|
+
/**
|
|
3237
|
+
* Returns all include paths from all projects.
|
|
3238
|
+
* Used by WorkspaceManager to scan additional directories for C4 files.
|
|
3239
|
+
*/
|
|
3240
|
+
getAllIncludePaths(): Array<{
|
|
3241
|
+
projectId: ProjectId;
|
|
3242
|
+
includePath: URI;
|
|
3243
|
+
includeConfig: IncludeConfig;
|
|
3244
|
+
}>;
|
|
3245
|
+
/**
|
|
3246
|
+
* Register a listener to be called when the projects configuration has changed.
|
|
3247
|
+
* @returns A disposable that can be used to unregister the callback.
|
|
3248
|
+
*/
|
|
3249
|
+
onProjectsUpdate(callback: () => void): Disposable$1;
|
|
3250
|
+
private getWorkspaceFolder;
|
|
3251
|
+
private notifyListeners;
|
|
3252
|
+
private updateIncludesExcludes;
|
|
3253
|
+
private warnIfConfigOverride;
|
|
3254
|
+
}
|
|
3255
|
+
//#endregion
|
|
3256
|
+
//#region src/filesystem/types.d.ts
|
|
3257
|
+
interface FileNode extends FileSystemNode {
|
|
3258
|
+
readonly isFile: true;
|
|
3259
|
+
readonly isDirectory: false;
|
|
3260
|
+
}
|
|
3261
|
+
interface FileSystemProvider$1 extends FileSystemProvider {
|
|
3262
|
+
/**
|
|
3263
|
+
* Scans the project files for the given URI.
|
|
3264
|
+
* @returns The list of file system entries that are contained within the specified directory.
|
|
3265
|
+
*/
|
|
3266
|
+
scanProjectFiles(folderUri: URI): Promise<FileNode[]>;
|
|
3267
|
+
/**
|
|
3268
|
+
* Loads the project config from the given file.
|
|
3269
|
+
* @returns The project config.
|
|
3270
|
+
* @throws Error if the file does not exist or is not a valid project config.
|
|
3271
|
+
*/
|
|
3272
|
+
loadProjectConfig(filepath: URI): Promise<LikeC4ProjectConfig>;
|
|
3273
|
+
/**
|
|
3274
|
+
* Reads the directory and returns LikeC4 files.
|
|
3275
|
+
*
|
|
3276
|
+
* @param options.recursive If true, recursively reads the directory,
|
|
3277
|
+
* @param options.maxDepth Maximum depth to traverse when recursive is true (default: Infinity)
|
|
3278
|
+
*/
|
|
3279
|
+
readDirectory(uri: URI, options?: {
|
|
3280
|
+
recursive?: boolean;
|
|
3281
|
+
maxDepth?: number;
|
|
3282
|
+
}): Promise<FileNode[]>;
|
|
3283
|
+
/**
|
|
3284
|
+
* Finds all files in the given directory, matching the given filter.
|
|
3285
|
+
*/
|
|
3286
|
+
scanDirectory(directory: URI, filter: (filepath: string, isDirectory: boolean) => boolean): Promise<FileNode[]>;
|
|
3287
|
+
/**
|
|
3288
|
+
* Writes the content to the file system.
|
|
3289
|
+
* Used by manual layouts.
|
|
3290
|
+
*/
|
|
3291
|
+
writeFile(uri: URI, content: string): Promise<void>;
|
|
3292
|
+
/**
|
|
3293
|
+
* Deletes the file from the file system.
|
|
3294
|
+
* Used by manual layouts.
|
|
3295
|
+
* @return true if the file was deleted, false if the file did not exist.
|
|
3296
|
+
*/
|
|
3297
|
+
deleteFile(uri: URI): Promise<boolean>;
|
|
3298
|
+
}
|
|
3299
|
+
interface FileSystemWatcher extends AsyncDisposable {
|
|
3300
|
+
/**
|
|
3301
|
+
* Watches a folder for changes and triggers a reload of the documents and projects.
|
|
3302
|
+
*/
|
|
3303
|
+
watch(folder: string): void;
|
|
2179
3304
|
}
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
3305
|
+
type ManualLayoutsSnapshot = {
|
|
3306
|
+
hash: string;
|
|
3307
|
+
views: Record<ViewId, LayoutedView>;
|
|
3308
|
+
};
|
|
3309
|
+
type ManualLayoutUpdateEvent = {
|
|
3310
|
+
updated: URI;
|
|
3311
|
+
projectId: ProjectId;
|
|
3312
|
+
viewId: ViewId;
|
|
3313
|
+
} | {
|
|
3314
|
+
removed: URI;
|
|
3315
|
+
projectId: ProjectId;
|
|
3316
|
+
/**
|
|
3317
|
+
* Missing if triggered by FS event (file was deleted)
|
|
3318
|
+
*/
|
|
3319
|
+
viewId?: ViewId;
|
|
3320
|
+
};
|
|
3321
|
+
type ManualLayoutUpdateListener = (event: ManualLayoutUpdateEvent) => void;
|
|
3322
|
+
interface LikeC4ManualLayouts extends Disposable$1 {
|
|
3323
|
+
/**
|
|
3324
|
+
* Reads a single layouted view from the file system by its URI.
|
|
3325
|
+
* Used by the language server to get the current layout state.
|
|
3326
|
+
*/
|
|
3327
|
+
readSnapshot(uri: URI): Promise<LayoutedView | null>;
|
|
3328
|
+
read(project: Project): Promise<ManualLayoutsSnapshot | null>;
|
|
3329
|
+
write(project: Project, layouted: LayoutedView): Promise<Location>;
|
|
3330
|
+
remove(project: Project, view: ViewId): Promise<Location | null>;
|
|
3331
|
+
clearCaches(): void;
|
|
3332
|
+
/**
|
|
3333
|
+
* Registers a listener for manual layout updates.
|
|
3334
|
+
* The listener will be called when a manual layout is created, updated, or deleted.
|
|
3335
|
+
*/
|
|
3336
|
+
onManualLayoutUpdate(listener: ManualLayoutUpdateListener): Disposable$1;
|
|
3337
|
+
/**
|
|
3338
|
+
* Handles file system updates for manual layouts.
|
|
3339
|
+
* Used by the file system watcher to notify the manual layouts module of changes.
|
|
3340
|
+
* @param event The file system event
|
|
3341
|
+
*/
|
|
3342
|
+
handleFileSystemUpdate(event: {
|
|
3343
|
+
update: URI;
|
|
3344
|
+
delete?: never;
|
|
3345
|
+
} | {
|
|
3346
|
+
delete: URI;
|
|
3347
|
+
update?: never;
|
|
3348
|
+
}): Promise<void>;
|
|
2188
3349
|
}
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
3350
|
+
//#endregion
|
|
3351
|
+
//#region src/formatting/LikeC4Formatter.d.ts
|
|
3352
|
+
type QuoteStyle = 'single' | 'double' | 'ignore' | 'auto';
|
|
3353
|
+
interface LikeC4FormatterOptions {
|
|
3354
|
+
quoteStyle: QuoteStyle;
|
|
2193
3355
|
}
|
|
2194
|
-
type
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
c4Specification?: ParsedAstSpecification;
|
|
2199
|
-
c4Elements?: ParsedAstElement[];
|
|
2200
|
-
c4ExtendElements?: ParsedAstExtend[];
|
|
2201
|
-
c4ExtendDeployments?: ParsedAstExtend[];
|
|
2202
|
-
c4ExtendRelations?: ParsedAstExtendRelation[];
|
|
2203
|
-
c4Relations?: ParsedAstRelation[];
|
|
2204
|
-
c4Globals?: ParsedAstGlobals;
|
|
2205
|
-
c4Views?: ParsedAstView[];
|
|
2206
|
-
c4Deployments?: ParsedAstDeployment[];
|
|
2207
|
-
c4DeploymentRelations?: ParsedAstDeploymentRelation[];
|
|
2208
|
-
c4Imports?: MultiMap<c4.ProjectId, c4.Fqn, Set<c4.Fqn>>;
|
|
3356
|
+
type ExtendedFormattingCommandType = 'normalizeQuotes';
|
|
3357
|
+
interface ExtendedFormattingCommand {
|
|
3358
|
+
type: ExtendedFormattingCommandType;
|
|
3359
|
+
region: FormattingRegion;
|
|
2209
3360
|
}
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
3361
|
+
declare class LikeC4Formatter extends AbstractFormatter {
|
|
3362
|
+
protected options: LikeC4FormatterOptions;
|
|
3363
|
+
extendedFormattingCommands: ExtendedFormattingCommand[];
|
|
3364
|
+
constructor(services: LikeC4Services);
|
|
3365
|
+
protected doDocumentFormat(document: LangiumDocument, options: FormattingOptions, range?: Range): TextEdit[];
|
|
3366
|
+
protected format(node: AstNode): void;
|
|
3367
|
+
protected formatTags(node: AstNode): void;
|
|
3368
|
+
protected formatDeploymentRelation(node: AstNode): void;
|
|
3369
|
+
protected formatExtendDeployment(node: AstNode): void;
|
|
3370
|
+
protected formatRelation(node: AstNode): void;
|
|
3371
|
+
protected removeIndentFromTopLevelStatements(node: AstNode): void;
|
|
3372
|
+
protected indentContentInBraces(node: AstNode): void;
|
|
3373
|
+
protected appendKeywordsWithSpace(node: AstNode): void;
|
|
3374
|
+
protected formatView(node: AstNode): void;
|
|
3375
|
+
protected formatLeafProperty(node: AstNode): void;
|
|
3376
|
+
protected formatLinkProperty(node: AstNode): void;
|
|
3377
|
+
protected formatNavigateToProperty(node: AstNode): void;
|
|
3378
|
+
protected formatAutolayoutProperty(node: AstNode): void;
|
|
3379
|
+
protected formatMetadataProperty(node: AstNode): void;
|
|
3380
|
+
protected formatElementDeclaration(node: AstNode): void;
|
|
3381
|
+
protected formatExtendElement(node: AstNode): void;
|
|
3382
|
+
protected formatGlobals(node: AstNode): void;
|
|
3383
|
+
protected formatImports(node: AstNode): void;
|
|
3384
|
+
protected formatSpecificationRule(node: AstNode): void;
|
|
3385
|
+
protected formatWithPredicate(node: AstNode): void;
|
|
3386
|
+
protected formatDeploymentNodeDeclaration(node: AstNode): void;
|
|
3387
|
+
protected formatDeployedInstance(node: AstNode): void;
|
|
3388
|
+
protected formatViewRuleGlobalStyle(node: AstNode): void;
|
|
3389
|
+
protected formatViewRuleGlobalPredicate(node: AstNode): void;
|
|
3390
|
+
protected formatViewRuleGroup(node: AstNode): void;
|
|
3391
|
+
protected formatViewRuleStyle(node: AstNode): void;
|
|
3392
|
+
protected formatWhereExpression(node: AstNode): void;
|
|
3393
|
+
protected formatWhereRelationExpression(node: AstNode): void;
|
|
3394
|
+
protected formatWhereElementExpression(node: AstNode): void;
|
|
3395
|
+
protected formatIncludeExcludeExpressions(node: AstNode): void;
|
|
3396
|
+
protected formatRelationExpression(node: AstNode): void;
|
|
3397
|
+
protected formatSteps(node: AstNode): void;
|
|
3398
|
+
private findPredicateExpressionRoot;
|
|
3399
|
+
private on;
|
|
3400
|
+
private doExtendedFormatting;
|
|
3401
|
+
protected normalizeQuotes(node: AstNode): void;
|
|
3402
|
+
private quotesNormalizerFactory;
|
|
3403
|
+
private escapeQuotesInternalQuotes;
|
|
3404
|
+
private getAutoQuoteStyle;
|
|
3405
|
+
private onConfigurationUpdate;
|
|
2213
3406
|
}
|
|
2214
|
-
|
|
2215
|
-
likec4ProjectId: c4.ProjectId;
|
|
2216
|
-
} //#endregion
|
|
3407
|
+
//#endregion
|
|
2217
3408
|
//#region src/references/name-provider.d.ts
|
|
2218
3409
|
declare class LikeC4NameProvider extends DefaultNameProvider {
|
|
2219
3410
|
protected services: LikeC4Services;
|
|
@@ -2221,7 +3412,8 @@ declare class LikeC4NameProvider extends DefaultNameProvider {
|
|
|
2221
3412
|
getNameStrict(node: AstNode): string;
|
|
2222
3413
|
getName(node: AstNode): string | undefined;
|
|
2223
3414
|
getNameNode(node: AstNode): CstNode | undefined;
|
|
2224
|
-
}
|
|
3415
|
+
}
|
|
3416
|
+
//#endregion
|
|
2225
3417
|
//#region src/references/scope-computation.d.ts
|
|
2226
3418
|
type ElementsContainer = Model | ElementBody | ExtendElementBody;
|
|
2227
3419
|
type DeploymentsContainer = ModelDeployments | DeploymentNodeBody | ExtendDeploymentBody | DeployedInstanceBody;
|
|
@@ -2237,14 +3429,16 @@ declare class LikeC4ScopeComputation extends DefaultScopeComputation {
|
|
|
2237
3429
|
computeLocalScopes(document: LikeC4LangiumDocument, _cancelToken?: CancellationToken$1): Promise<PrecomputedScopes>;
|
|
2238
3430
|
protected processContainer(container: ElementsContainer, scopes: PrecomputedScopes, document: LikeC4LangiumDocument): AstNodeDescription[];
|
|
2239
3431
|
protected processDeployments(container: DeploymentsContainer, scopes: PrecomputedScopes, document: LikeC4LangiumDocument): AstNodeDescription[];
|
|
2240
|
-
}
|
|
3432
|
+
}
|
|
3433
|
+
//#endregion
|
|
2241
3434
|
//#region src/workspace/IndexManager.d.ts
|
|
2242
3435
|
declare class IndexManager extends DefaultIndexManager {
|
|
2243
3436
|
protected services: LikeC4SharedServices;
|
|
2244
3437
|
constructor(services: LikeC4SharedServices);
|
|
2245
3438
|
updateContent(document: LangiumDocument, cancelToken?: CancellationToken$1): Promise<void>;
|
|
2246
3439
|
projectElements(projectId: ProjectId$1, nodeType?: string, uris?: Set<string>): Stream<AstNodeDescription>;
|
|
2247
|
-
}
|
|
3440
|
+
}
|
|
3441
|
+
//#endregion
|
|
2248
3442
|
//#region src/workspace/LangiumDocuments.d.ts
|
|
2249
3443
|
declare class LangiumDocuments extends DefaultLangiumDocuments {
|
|
2250
3444
|
protected services: LikeC4SharedServices;
|
|
@@ -2270,15 +3464,16 @@ declare class LangiumDocuments extends DefaultLangiumDocuments {
|
|
|
2270
3464
|
* Returns the URIs
|
|
2271
3465
|
*/
|
|
2272
3466
|
resetProjectIds(): URI[];
|
|
2273
|
-
}
|
|
3467
|
+
}
|
|
3468
|
+
//#endregion
|
|
2274
3469
|
//#region src/workspace/WorkspaceManager.d.ts
|
|
2275
3470
|
declare class LikeC4WorkspaceManager extends DefaultWorkspaceManager {
|
|
2276
3471
|
#private;
|
|
2277
3472
|
private services;
|
|
2278
|
-
protected readonly documentFactory: LangiumDocumentFactory;
|
|
2279
3473
|
protected readonly fileSystemProvider: FileSystemProvider$1;
|
|
2280
3474
|
initialBuildOptions: BuildOptions;
|
|
2281
3475
|
constructor(services: LikeC4SharedServices);
|
|
3476
|
+
protected get documentFactory(): LangiumDocumentFactory;
|
|
2282
3477
|
/**
|
|
2283
3478
|
* Whether the workspace is ready, use {@link ready} promise to wait for it
|
|
2284
3479
|
*/
|
|
@@ -2288,20 +3483,11 @@ declare class LikeC4WorkspaceManager extends DefaultWorkspaceManager {
|
|
|
2288
3483
|
*/
|
|
2289
3484
|
protected performStartup(folders: WorkspaceFolder[]): Promise<LangiumDocument[]>;
|
|
2290
3485
|
/**
|
|
2291
|
-
*
|
|
2292
|
-
* folders and add them to the collector. This can be used to include built-in libraries of
|
|
2293
|
-
* your language, which can be either loaded from provided files or constructed in memory.
|
|
2294
|
-
*/
|
|
2295
|
-
protected loadAdditionalDocuments(folders: WorkspaceFolder[], collector: (document: LangiumDocument) => void): Promise<void>;
|
|
2296
|
-
/**
|
|
2297
|
-
* Traverse the file system folder identified by the given URI and its subfolders. All
|
|
2298
|
-
* contained files that match the file extensions are added to the collector.
|
|
3486
|
+
* Scans all include paths (from all projects) and returns found likec4 files
|
|
2299
3487
|
*/
|
|
2300
|
-
protected
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
*/
|
|
2304
|
-
protected includeEntry(_: WorkspaceFolder, entry: FileSystemNode, selector: FileSelector): boolean;
|
|
3488
|
+
protected scanProjectIncludePaths(): Promise<FileSystemNode[]>;
|
|
3489
|
+
protected loadDocuments(files: FileSystemNode[]): Promise<LangiumDocument[]>;
|
|
3490
|
+
protected saveAddDocument(document: LangiumDocument): void;
|
|
2305
3491
|
workspace(): WorkspaceFolder | null;
|
|
2306
3492
|
rebuildAll(cancelToken?: CancellationToken$1): Promise<void>;
|
|
2307
3493
|
get workspaceUri(): URI;
|
|
@@ -2319,26 +3505,21 @@ declare class LikeC4WorkspaceManager extends DefaultWorkspaceManager {
|
|
|
2319
3505
|
* Uses a timeout fallback for third-party IDEs that may not support workspace/configuration.
|
|
2320
3506
|
*/
|
|
2321
3507
|
private readExcludeConfig;
|
|
2322
|
-
}
|
|
3508
|
+
}
|
|
3509
|
+
//#endregion
|
|
2323
3510
|
//#region src/references/scope-provider.d.ts
|
|
2324
3511
|
declare class LikeC4ScopeProvider extends DefaultScopeProvider {
|
|
2325
|
-
protected
|
|
2326
|
-
protected fqnIndex: FqnIndex;
|
|
3512
|
+
protected services: LikeC4Services;
|
|
2327
3513
|
protected readonly indexManager: IndexManager;
|
|
2328
3514
|
constructor(services: LikeC4Services);
|
|
3515
|
+
protected get fqnIndex(): FqnIndex;
|
|
3516
|
+
protected get deploymentsIndex(): DeploymentsIndex;
|
|
2329
3517
|
getScope(context: ReferenceInfo): Scope;
|
|
2330
3518
|
protected genUniqueDescedants(element: Element | DeploymentNode | undefined): Generator<AstNodeDescriptionWithFqn, void, any>;
|
|
2331
|
-
protected genScopeExtendElement({
|
|
2332
|
-
|
|
2333
|
-
}: ExtendElement): Generator<AstNodeDescription>;
|
|
2334
|
-
protected genScopeElementView({
|
|
2335
|
-
viewOf,
|
|
2336
|
-
extends: ext
|
|
2337
|
-
}: ElementView): Generator<AstNodeDescription>;
|
|
3519
|
+
protected genScopeExtendElement({ element }: ExtendElement): Generator<AstNodeDescription>;
|
|
3520
|
+
protected genScopeElementView({ viewOf, extends: ext }: ElementView): Generator<AstNodeDescription>;
|
|
2338
3521
|
protected getScopeForStrictFqnRef(projectId: ProjectId$1, container: StrictFqnRef, context: ReferenceInfo): Scope;
|
|
2339
|
-
protected genScopeExtendDeployment({
|
|
2340
|
-
deploymentNode
|
|
2341
|
-
}: ExtendDeployment): Generator<AstNodeDescription>;
|
|
3522
|
+
protected genScopeExtendDeployment({ deploymentNode }: ExtendDeployment): Generator<AstNodeDescription>;
|
|
2342
3523
|
protected streamForFqnRef(projectId: ProjectId$1, container: FqnRef$2, context: ReferenceInfo): Stream<AstNodeDescription>;
|
|
2343
3524
|
protected genScopeForParentlessFqnRef(projectId: ProjectId$1, container: FqnRef$2, context: ReferenceInfo): Generator<AstNodeDescription>;
|
|
2344
3525
|
/**
|
|
@@ -2361,15 +3542,8 @@ declare class LikeC4ScopeProvider extends DefaultScopeProvider {
|
|
|
2361
3542
|
* Create a global scope filtered for the given reference type.
|
|
2362
3543
|
*/
|
|
2363
3544
|
protected getGlobalScope(referenceType: string, context: ReferenceInfo): Scope;
|
|
2364
|
-
}
|
|
2365
|
-
//#
|
|
2366
|
-
declare abstract class ADisposable implements Disposable$1 {
|
|
2367
|
-
protected toDispose: Disposable$1[];
|
|
2368
|
-
protected isDisposed: boolean;
|
|
2369
|
-
onDispose(...disposable: Disposable$1[]): void;
|
|
2370
|
-
dispose(): void;
|
|
2371
|
-
protected throwIfDisposed(): void;
|
|
2372
|
-
} //#endregion
|
|
3545
|
+
}
|
|
3546
|
+
//#endregion
|
|
2373
3547
|
//#region src/model/fqn-index.d.ts
|
|
2374
3548
|
declare class FqnIndex<AstNd = Element> extends ADisposable {
|
|
2375
3549
|
protected services: LikeC4Services;
|
|
@@ -2412,23 +3586,21 @@ declare class DocumentFqnIndex {
|
|
|
2412
3586
|
/**
|
|
2413
3587
|
* direct children of elements
|
|
2414
3588
|
*/
|
|
2415
|
-
|
|
2416
3589
|
_children: MultiMap<Fqn, AstNodeDescriptionWithFqn>,
|
|
2417
3590
|
/**
|
|
2418
3591
|
* All descendants of an element (unique by name)
|
|
2419
3592
|
*/
|
|
2420
|
-
|
|
2421
3593
|
_descendants: MultiMap<Fqn, AstNodeDescriptionWithFqn>,
|
|
2422
3594
|
/**
|
|
2423
3595
|
* All elements by FQN
|
|
2424
3596
|
*/
|
|
2425
|
-
|
|
2426
3597
|
_byfqn: MultiMap<Fqn, AstNodeDescriptionWithFqn>, projectId: ProjectId);
|
|
2427
3598
|
rootElements(): readonly AstNodeDescriptionWithFqn[];
|
|
2428
3599
|
byFqn(fqn: Fqn): readonly AstNodeDescriptionWithFqn[];
|
|
2429
3600
|
children(parent: Fqn): readonly AstNodeDescriptionWithFqn[];
|
|
2430
3601
|
descendants(nodeName: Fqn): readonly AstNodeDescriptionWithFqn[];
|
|
2431
|
-
}
|
|
3602
|
+
}
|
|
3603
|
+
//#endregion
|
|
2432
3604
|
//#region src/model/deployments-index.d.ts
|
|
2433
3605
|
declare class DeploymentsIndex extends FqnIndex<DeploymentElement> {
|
|
2434
3606
|
protected services: LikeC4Services;
|
|
@@ -2436,7 +3608,8 @@ declare class DeploymentsIndex extends FqnIndex<DeploymentElement> {
|
|
|
2436
3608
|
protected logger: any;
|
|
2437
3609
|
constructor(services: LikeC4Services);
|
|
2438
3610
|
protected createDocumentIndex(document: LikeC4LangiumDocument): DocumentFqnIndex;
|
|
2439
|
-
}
|
|
3611
|
+
}
|
|
3612
|
+
//#endregion
|
|
2440
3613
|
//#region src/model/builder/MergedSpecification.d.ts
|
|
2441
3614
|
/**
|
|
2442
3615
|
* The `MergedSpecification` class is responsible for merging multiple parsed
|
|
@@ -2457,30 +3630,11 @@ declare class MergedSpecification {
|
|
|
2457
3630
|
/**
|
|
2458
3631
|
* Converts a parsed model into a C4 model element.
|
|
2459
3632
|
*/
|
|
2460
|
-
toModelElement: ({
|
|
2461
|
-
tags,
|
|
2462
|
-
links,
|
|
2463
|
-
style,
|
|
2464
|
-
id,
|
|
2465
|
-
kind,
|
|
2466
|
-
title,
|
|
2467
|
-
description,
|
|
2468
|
-
technology,
|
|
2469
|
-
summary,
|
|
2470
|
-
metadata
|
|
2471
|
-
}: ParsedAstElement) => c4.Element | null;
|
|
3633
|
+
toModelElement: ({ tags, links, style, id, kind, title, description, technology, summary, metadata }: ParsedAstElement) => c4.Element | null;
|
|
2472
3634
|
/**
|
|
2473
3635
|
* Converts a parsed model into a C4 model relation.
|
|
2474
3636
|
*/
|
|
2475
|
-
toModelRelation: ({
|
|
2476
|
-
astPath: _astPath,
|
|
2477
|
-
source,
|
|
2478
|
-
target,
|
|
2479
|
-
kind,
|
|
2480
|
-
links,
|
|
2481
|
-
id,
|
|
2482
|
-
...model
|
|
2483
|
-
}: ParsedAstRelation) => c4.Relationship | null;
|
|
3637
|
+
toModelRelation: ({ astPath: _astPath, source, target, kind, links, id, title, tags, ...model }: ParsedAstRelation) => c4.Relationship | null;
|
|
2484
3638
|
/**
|
|
2485
3639
|
* Converts a parsed deployment model into a C4 deployment model
|
|
2486
3640
|
*/
|
|
@@ -2488,22 +3642,15 @@ declare class MergedSpecification {
|
|
|
2488
3642
|
/**
|
|
2489
3643
|
* Converts a parsed deployment relation into a C4 deployment relation.
|
|
2490
3644
|
*/
|
|
2491
|
-
toDeploymentRelation: ({
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
target,
|
|
2495
|
-
kind,
|
|
2496
|
-
links,
|
|
2497
|
-
id,
|
|
2498
|
-
...model
|
|
2499
|
-
}: ParsedAstDeploymentRelation) => c4.DeploymentRelationship | null;
|
|
2500
|
-
} //#endregion
|
|
3645
|
+
toDeploymentRelation: ({ astPath: _astPath, source, target, kind, links, id, tags, ...model }: ParsedAstDeploymentRelation) => c4.DeploymentRelationship | null;
|
|
3646
|
+
}
|
|
3647
|
+
//#endregion
|
|
2501
3648
|
//#region src/model/last-seen-artifacts.d.ts
|
|
2502
3649
|
/**
|
|
2503
3650
|
* Provides access to "last seen artifacts" for a given project,
|
|
2504
3651
|
* (Results of the last successful parsing)
|
|
2505
3652
|
*/
|
|
2506
|
-
declare class LastSeenArtifacts {
|
|
3653
|
+
declare class LastSeenArtifacts extends ADisposable {
|
|
2507
3654
|
#private;
|
|
2508
3655
|
constructor(services: LikeC4Services);
|
|
2509
3656
|
/**
|
|
@@ -2536,7 +3683,8 @@ declare class LastSeenArtifacts {
|
|
|
2536
3683
|
* @returns LikeC4Model.Computed or undefined.
|
|
2537
3684
|
*/
|
|
2538
3685
|
model(projectId: c4.ProjectId): LikeC4Model.Computed | undefined;
|
|
2539
|
-
}
|
|
3686
|
+
}
|
|
3687
|
+
//#endregion
|
|
2540
3688
|
//#region src/model/model-builder.d.ts
|
|
2541
3689
|
type ModelParsedListener = (projectId: ProjectId$1, docs: URI[]) => void;
|
|
2542
3690
|
interface LikeC4ModelBuilder extends Disposable$1 {
|
|
@@ -2545,7 +3693,8 @@ interface LikeC4ModelBuilder extends Disposable$1 {
|
|
|
2545
3693
|
computeModel(projectId?: ProjectId$1 | undefined, cancelToken?: CancellationToken$1): Promise<LikeC4Model<UnknownComputed>>;
|
|
2546
3694
|
onModelParsed(callback: ModelParsedListener): Disposable$1;
|
|
2547
3695
|
clearCache(): void;
|
|
2548
|
-
}
|
|
3696
|
+
}
|
|
3697
|
+
//#endregion
|
|
2549
3698
|
//#region src/model/model-locator.d.ts
|
|
2550
3699
|
/** Result of locating a view: document, view AST, and view block node. */
|
|
2551
3700
|
type ViewLocateResult = {
|
|
@@ -2614,7 +3763,8 @@ declare class LikeC4ModelLocator {
|
|
|
2614
3763
|
astPath: string;
|
|
2615
3764
|
projectId?: c4.ProjectId | undefined;
|
|
2616
3765
|
}): Location | null;
|
|
2617
|
-
}
|
|
3766
|
+
}
|
|
3767
|
+
//#endregion
|
|
2618
3768
|
//#region src/views/LikeC4Views.d.ts
|
|
2619
3769
|
type GraphvizOut = {
|
|
2620
3770
|
readonly dot: string;
|
|
@@ -2635,10 +3785,11 @@ type LayoutViewParams = {
|
|
|
2635
3785
|
*/
|
|
2636
3786
|
layoutType?: LayoutType | undefined;
|
|
2637
3787
|
projectId?: ProjectId$1 | undefined;
|
|
2638
|
-
cancelToken?: CancellationToken$1 | undefined;
|
|
3788
|
+
cancelToken?: CancellationToken$1 | undefined;
|
|
3789
|
+
/** Optional AI-generated layout hints */
|
|
2639
3790
|
layoutHints?: AILayoutHints | undefined;
|
|
2640
3791
|
};
|
|
2641
|
-
interface LikeC4Views {
|
|
3792
|
+
interface LikeC4Views extends Disposable$1 {
|
|
2642
3793
|
readonly layouter: GraphvizLayouter;
|
|
2643
3794
|
/**
|
|
2644
3795
|
* Returns computed views (i.e. views with predicates computed)
|
|
@@ -2687,8 +3838,7 @@ interface LikeC4Views {
|
|
|
2687
3838
|
* @param projectId - project id, if not specified - uses the default project
|
|
2688
3839
|
*/
|
|
2689
3840
|
adhocView(predicates: AdhocViewPredicate[], projectId?: ProjectId$1 | undefined): Promise<LayoutedView$1>;
|
|
2690
|
-
}
|
|
2691
|
-
//#region src/views/index.d.ts
|
|
3841
|
+
}
|
|
2692
3842
|
//#endregion
|
|
2693
3843
|
//#region src/model/parser/Base.d.ts
|
|
2694
3844
|
type ParserLevel = 'base' | 'model' | 'deployment' | 'fqnref' | 'relation' | 'views' | 'globals' | 'imports' | 'specification';
|
|
@@ -2704,7 +3854,7 @@ declare class BaseParser {
|
|
|
2704
3854
|
constructor(services: LikeC4Services, doc: ParsedLikeC4LangiumDocument, project: Project);
|
|
2705
3855
|
logError(error: unknown, astNode?: AstNode | Reference<AstNode>, level?: ParserLevel): void;
|
|
2706
3856
|
tryParse<N extends AstNode, T>(level: ParserLevel, node: N | undefined, fn: (node: NoInfer<N>) => T | undefined): T | undefined;
|
|
2707
|
-
tryMap<N extends AstNode, T>(level: ParserLevel, iterable: ReadonlyArray<N>, fn: (node: N) => T | undefined): T[];
|
|
3857
|
+
tryMap<N extends AstNode, T>(level: ParserLevel, iterable: ReadonlyArray<N>, fn: (node: N, index: number) => T | undefined): T[];
|
|
2708
3858
|
resolveFqn(node: FqnReferenceable): c4.Fqn;
|
|
2709
3859
|
getAstNodePath(node: AstNode): string;
|
|
2710
3860
|
getMetadata(metadataAstNode: MetadataProperty | undefined): {
|
|
@@ -2747,7 +3897,8 @@ declare class BaseParser {
|
|
|
2747
3897
|
description?: c4.MarkdownOrString;
|
|
2748
3898
|
technology?: string;
|
|
2749
3899
|
};
|
|
2750
|
-
}
|
|
3900
|
+
}
|
|
3901
|
+
//#endregion
|
|
2751
3902
|
//#region src/model/model-parser.d.ts
|
|
2752
3903
|
declare const DocumentParserFromMixins: {
|
|
2753
3904
|
new (...args: any[]): {
|
|
@@ -2769,13 +3920,17 @@ declare const DocumentParserFromMixins: {
|
|
|
2769
3920
|
parseDynamicElementView(astNode: DynamicView, additionalStyles: any[]): ParsedAstDynamicView;
|
|
2770
3921
|
parseDynamicViewRule(astRule: DynamicViewRule): ProjectId$1;
|
|
2771
3922
|
parseDynamicViewIncludePredicate(astRule: DynamicViewIncludePredicate): ProjectId$1;
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
3923
|
+
parseSteps(nodes: StepStatement[]): ProjectId$1[];
|
|
3924
|
+
parseStepStatement(node: StepStatement): ProjectId$1;
|
|
3925
|
+
parseStepSeries(node: StepSeries): ProjectId$1;
|
|
3926
|
+
recursiveParseStepSeries(node: StepSeries, callstack?: Array<[source: ProjectId$1, target: ProjectId$1]>): ProjectId$1[];
|
|
3927
|
+
parseStep(node: Step): ProjectId$1;
|
|
3928
|
+
parseAbstractDynamicStep(astnode: AbstractStep): import("type-fest").Writable<import("type-fest").Except<ProjectId$1, "source", {
|
|
2777
3929
|
requireExactProps: true;
|
|
2778
3930
|
}>>;
|
|
3931
|
+
parseSubflowStep(node: SubflowStep): ProjectId$1 | ProjectId$1 | ProjectId$1 | ProjectId$1;
|
|
3932
|
+
parseTryStep(node: TryStep): ProjectId$1;
|
|
3933
|
+
parseAltSteps(node: AltSteps): ProjectId$1;
|
|
2779
3934
|
parsePredicate(astNode: ExpressionV2): ProjectId$1;
|
|
2780
3935
|
parseElementPredicate(astNode: FqnExprOrWith): ProjectId$1;
|
|
2781
3936
|
parseElementPredicateOrWhere(astNode: FqnExprOrWhere): ProjectId$1;
|
|
@@ -2798,7 +3953,7 @@ declare const DocumentParserFromMixins: {
|
|
|
2798
3953
|
parseFqnExpressions(astNode: FqnExpressions): ProjectId$1[];
|
|
2799
3954
|
parseRelationExprOrWith(astNode: RelationExprOrWith): ProjectId$1;
|
|
2800
3955
|
parseRelationExprWith(astNode: RelationExprWith): ProjectId$1;
|
|
2801
|
-
parseCustomRelationProperties(custom: CustomRelationProperties | undefined):
|
|
3956
|
+
parseCustomRelationProperties(custom: CustomRelationProperties | undefined): import("type-fest").Except<ProjectId$1["customRelation"], "expr">;
|
|
2802
3957
|
parseRelationExprOrWhere(astNode: RelationExprOrWhere): ProjectId$1;
|
|
2803
3958
|
parseRelationExprWhere(astNode: RelationExprWhere): ProjectId$1;
|
|
2804
3959
|
parseRelationExpr(astNode: RelationExpr$1): ProjectId$1;
|
|
@@ -2812,7 +3967,7 @@ declare const DocumentParserFromMixins: {
|
|
|
2812
3967
|
readonly project: Project;
|
|
2813
3968
|
logError(error: unknown, astNode?: AstNode | Reference<AstNode>, level?: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification"): void;
|
|
2814
3969
|
tryParse<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", node: N | undefined, fn: (node: NoInfer<N>) => T | undefined): T | undefined;
|
|
2815
|
-
tryMap<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", iterable: ReadonlyArray<N>, fn: (node: N) => T | undefined): T[];
|
|
3970
|
+
tryMap<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", iterable: ReadonlyArray<N>, fn: (node: N, index: number) => T | undefined): T[];
|
|
2816
3971
|
resolveFqn(node: FqnReferenceable): ProjectId$1;
|
|
2817
3972
|
getAstNodePath(node: AstNode): string;
|
|
2818
3973
|
getMetadata(metadataAstNode: MetadataProperty | undefined): {
|
|
@@ -2874,13 +4029,17 @@ declare const DocumentParserFromMixins: {
|
|
|
2874
4029
|
parseDynamicElementView(astNode: DynamicView, additionalStyles: any[]): ParsedAstDynamicView;
|
|
2875
4030
|
parseDynamicViewRule(astRule: DynamicViewRule): ProjectId$1;
|
|
2876
4031
|
parseDynamicViewIncludePredicate(astRule: DynamicViewIncludePredicate): ProjectId$1;
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
4032
|
+
parseSteps(nodes: StepStatement[]): ProjectId$1[];
|
|
4033
|
+
parseStepStatement(node: StepStatement): ProjectId$1;
|
|
4034
|
+
parseStepSeries(node: StepSeries): ProjectId$1;
|
|
4035
|
+
recursiveParseStepSeries(node: StepSeries, callstack?: Array<[source: ProjectId$1, target: ProjectId$1]>): ProjectId$1[];
|
|
4036
|
+
parseStep(node: Step): ProjectId$1;
|
|
4037
|
+
parseAbstractDynamicStep(astnode: AbstractStep): import("type-fest").Writable<import("type-fest").Except<ProjectId$1, "source", {
|
|
2882
4038
|
requireExactProps: true;
|
|
2883
4039
|
}>>;
|
|
4040
|
+
parseSubflowStep(node: SubflowStep): ProjectId$1 | ProjectId$1 | ProjectId$1 | ProjectId$1;
|
|
4041
|
+
parseTryStep(node: TryStep): ProjectId$1;
|
|
4042
|
+
parseAltSteps(node: AltSteps): ProjectId$1;
|
|
2884
4043
|
parsePredicate(astNode: ExpressionV2): ProjectId$1;
|
|
2885
4044
|
parseElementPredicate(astNode: FqnExprOrWith): ProjectId$1;
|
|
2886
4045
|
parseElementPredicateOrWhere(astNode: FqnExprOrWhere): ProjectId$1;
|
|
@@ -2903,7 +4062,7 @@ declare const DocumentParserFromMixins: {
|
|
|
2903
4062
|
parseFqnExpressions(astNode: FqnExpressions): ProjectId$1[];
|
|
2904
4063
|
parseRelationExprOrWith(astNode: RelationExprOrWith): ProjectId$1;
|
|
2905
4064
|
parseRelationExprWith(astNode: RelationExprWith): ProjectId$1;
|
|
2906
|
-
parseCustomRelationProperties(custom: CustomRelationProperties | undefined):
|
|
4065
|
+
parseCustomRelationProperties(custom: CustomRelationProperties | undefined): import("type-fest").Except<ProjectId$1["customRelation"], "expr">;
|
|
2907
4066
|
parseRelationExprOrWhere(astNode: RelationExprOrWhere): ProjectId$1;
|
|
2908
4067
|
parseRelationExprWhere(astNode: RelationExprWhere): ProjectId$1;
|
|
2909
4068
|
parseRelationExpr(astNode: RelationExpr$1): ProjectId$1;
|
|
@@ -2917,7 +4076,7 @@ declare const DocumentParserFromMixins: {
|
|
|
2917
4076
|
readonly project: Project;
|
|
2918
4077
|
logError(error: unknown, astNode?: AstNode | Reference<AstNode>, level?: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification"): void;
|
|
2919
4078
|
tryParse<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", node: N | undefined, fn: (node: NoInfer<N>) => T | undefined): T | undefined;
|
|
2920
|
-
tryMap<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", iterable: ReadonlyArray<N>, fn: (node: N) => T | undefined): T[];
|
|
4079
|
+
tryMap<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", iterable: ReadonlyArray<N>, fn: (node: N, index: number) => T | undefined): T[];
|
|
2921
4080
|
resolveFqn(node: FqnReferenceable): ProjectId$1;
|
|
2922
4081
|
getAstNodePath(node: AstNode): string;
|
|
2923
4082
|
getMetadata(metadataAstNode: MetadataProperty | undefined): {
|
|
@@ -2977,7 +4136,7 @@ declare const DocumentParserFromMixins: {
|
|
|
2977
4136
|
readonly project: Project;
|
|
2978
4137
|
logError(error: unknown, astNode?: AstNode | Reference<AstNode>, level?: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification"): void;
|
|
2979
4138
|
tryParse<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", node: N | undefined, fn: (node: NoInfer<N>) => T | undefined): T | undefined;
|
|
2980
|
-
tryMap<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", iterable: ReadonlyArray<N>, fn: (node: N) => T | undefined): T[];
|
|
4139
|
+
tryMap<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", iterable: ReadonlyArray<N>, fn: (node: N, index: number) => T | undefined): T[];
|
|
2981
4140
|
resolveFqn(node: FqnReferenceable): ProjectId$1;
|
|
2982
4141
|
getAstNodePath(node: AstNode): string;
|
|
2983
4142
|
getMetadata(metadataAstNode: MetadataProperty | undefined): {
|
|
@@ -3038,7 +4197,7 @@ declare const DocumentParserFromMixins: {
|
|
|
3038
4197
|
parseFqnExpressions(astNode: FqnExpressions): ProjectId$1[];
|
|
3039
4198
|
parseRelationExprOrWith(astNode: RelationExprOrWith): ProjectId$1;
|
|
3040
4199
|
parseRelationExprWith(astNode: RelationExprWith): ProjectId$1;
|
|
3041
|
-
parseCustomRelationProperties(custom: CustomRelationProperties | undefined):
|
|
4200
|
+
parseCustomRelationProperties(custom: CustomRelationProperties | undefined): import("type-fest").Except<ProjectId$1["customRelation"], "expr">;
|
|
3042
4201
|
parseRelationExprOrWhere(astNode: RelationExprOrWhere): ProjectId$1;
|
|
3043
4202
|
parseRelationExprWhere(astNode: RelationExprWhere): ProjectId$1;
|
|
3044
4203
|
parseRelationExpr(astNode: RelationExpr$1): ProjectId$1;
|
|
@@ -3052,7 +4211,7 @@ declare const DocumentParserFromMixins: {
|
|
|
3052
4211
|
readonly project: Project;
|
|
3053
4212
|
logError(error: unknown, astNode?: AstNode | Reference<AstNode>, level?: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification"): void;
|
|
3054
4213
|
tryParse<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", node: N | undefined, fn: (node: NoInfer<N>) => T | undefined): T | undefined;
|
|
3055
|
-
tryMap<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", iterable: ReadonlyArray<N>, fn: (node: N) => T | undefined): T[];
|
|
4214
|
+
tryMap<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", iterable: ReadonlyArray<N>, fn: (node: N, index: number) => T | undefined): T[];
|
|
3056
4215
|
resolveFqn(node: FqnReferenceable): ProjectId$1;
|
|
3057
4216
|
getAstNodePath(node: AstNode): string;
|
|
3058
4217
|
getMetadata(metadataAstNode: MetadataProperty | undefined): {
|
|
@@ -3106,7 +4265,7 @@ declare const DocumentParserFromMixins: {
|
|
|
3106
4265
|
parseFqnExpressions(astNode: FqnExpressions): ProjectId$1[];
|
|
3107
4266
|
parseRelationExprOrWith(astNode: RelationExprOrWith): ProjectId$1;
|
|
3108
4267
|
parseRelationExprWith(astNode: RelationExprWith): ProjectId$1;
|
|
3109
|
-
parseCustomRelationProperties(custom: CustomRelationProperties | undefined):
|
|
4268
|
+
parseCustomRelationProperties(custom: CustomRelationProperties | undefined): import("type-fest").Except<ProjectId$1["customRelation"], "expr">;
|
|
3110
4269
|
parseRelationExprOrWhere(astNode: RelationExprOrWhere): ProjectId$1;
|
|
3111
4270
|
parseRelationExprWhere(astNode: RelationExprWhere): ProjectId$1;
|
|
3112
4271
|
parseRelationExpr(astNode: RelationExpr$1): ProjectId$1;
|
|
@@ -3120,7 +4279,7 @@ declare const DocumentParserFromMixins: {
|
|
|
3120
4279
|
readonly project: Project;
|
|
3121
4280
|
logError(error: unknown, astNode?: AstNode | Reference<AstNode>, level?: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification"): void;
|
|
3122
4281
|
tryParse<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", node: N | undefined, fn: (node: NoInfer<N>) => T | undefined): T | undefined;
|
|
3123
|
-
tryMap<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", iterable: ReadonlyArray<N>, fn: (node: N) => T | undefined): T[];
|
|
4282
|
+
tryMap<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", iterable: ReadonlyArray<N>, fn: (node: N, index: number) => T | undefined): T[];
|
|
3124
4283
|
resolveFqn(node: FqnReferenceable): ProjectId$1;
|
|
3125
4284
|
getAstNodePath(node: AstNode): string;
|
|
3126
4285
|
getMetadata(metadataAstNode: MetadataProperty | undefined): {
|
|
@@ -3182,7 +4341,7 @@ declare const DocumentParserFromMixins: {
|
|
|
3182
4341
|
parseFqnExpressions(astNode: FqnExpressions): ProjectId$1[];
|
|
3183
4342
|
parseRelationExprOrWith(astNode: RelationExprOrWith): ProjectId$1;
|
|
3184
4343
|
parseRelationExprWith(astNode: RelationExprWith): ProjectId$1;
|
|
3185
|
-
parseCustomRelationProperties(custom: CustomRelationProperties | undefined):
|
|
4344
|
+
parseCustomRelationProperties(custom: CustomRelationProperties | undefined): import("type-fest").Except<ProjectId$1["customRelation"], "expr">;
|
|
3186
4345
|
parseRelationExprOrWhere(astNode: RelationExprOrWhere): ProjectId$1;
|
|
3187
4346
|
parseRelationExprWhere(astNode: RelationExprWhere): ProjectId$1;
|
|
3188
4347
|
parseRelationExpr(astNode: RelationExpr$1): ProjectId$1;
|
|
@@ -3196,7 +4355,7 @@ declare const DocumentParserFromMixins: {
|
|
|
3196
4355
|
readonly project: Project;
|
|
3197
4356
|
logError(error: unknown, astNode?: AstNode | Reference<AstNode>, level?: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification"): void;
|
|
3198
4357
|
tryParse<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", node: N | undefined, fn: (node: NoInfer<N>) => T | undefined): T | undefined;
|
|
3199
|
-
tryMap<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", iterable: ReadonlyArray<N>, fn: (node: N) => T | undefined): T[];
|
|
4358
|
+
tryMap<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", iterable: ReadonlyArray<N>, fn: (node: N, index: number) => T | undefined): T[];
|
|
3200
4359
|
resolveFqn(node: FqnReferenceable): ProjectId$1;
|
|
3201
4360
|
getAstNodePath(node: AstNode): string;
|
|
3202
4361
|
getMetadata(metadataAstNode: MetadataProperty | undefined): {
|
|
@@ -3252,7 +4411,7 @@ declare const DocumentParserFromMixins: {
|
|
|
3252
4411
|
parseFqnExpressions(astNode: FqnExpressions): ProjectId$1[];
|
|
3253
4412
|
parseRelationExprOrWith(astNode: RelationExprOrWith): ProjectId$1;
|
|
3254
4413
|
parseRelationExprWith(astNode: RelationExprWith): ProjectId$1;
|
|
3255
|
-
parseCustomRelationProperties(custom: CustomRelationProperties | undefined):
|
|
4414
|
+
parseCustomRelationProperties(custom: CustomRelationProperties | undefined): import("type-fest").Except<ProjectId$1["customRelation"], "expr">;
|
|
3256
4415
|
parseRelationExprOrWhere(astNode: RelationExprOrWhere): ProjectId$1;
|
|
3257
4416
|
parseRelationExprWhere(astNode: RelationExprWhere): ProjectId$1;
|
|
3258
4417
|
parseRelationExpr(astNode: RelationExpr$1): ProjectId$1;
|
|
@@ -3266,7 +4425,7 @@ declare const DocumentParserFromMixins: {
|
|
|
3266
4425
|
readonly project: Project;
|
|
3267
4426
|
logError(error: unknown, astNode?: AstNode | Reference<AstNode>, level?: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification"): void;
|
|
3268
4427
|
tryParse<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", node: N | undefined, fn: (node: NoInfer<N>) => T | undefined): T | undefined;
|
|
3269
|
-
tryMap<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", iterable: ReadonlyArray<N>, fn: (node: N) => T | undefined): T[];
|
|
4428
|
+
tryMap<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", iterable: ReadonlyArray<N>, fn: (node: N, index: number) => T | undefined): T[];
|
|
3270
4429
|
resolveFqn(node: FqnReferenceable): ProjectId$1;
|
|
3271
4430
|
getAstNodePath(node: AstNode): string;
|
|
3272
4431
|
getMetadata(metadataAstNode: MetadataProperty | undefined): {
|
|
@@ -3314,7 +4473,7 @@ declare const DocumentParserFromMixins: {
|
|
|
3314
4473
|
readonly project: Project;
|
|
3315
4474
|
logError(error: unknown, astNode?: AstNode | Reference<AstNode>, level?: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification"): void;
|
|
3316
4475
|
tryParse<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", node: N | undefined, fn: (node: NoInfer<N>) => T | undefined): T | undefined;
|
|
3317
|
-
tryMap<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", iterable: ReadonlyArray<N>, fn: (node: N) => T | undefined): T[];
|
|
4476
|
+
tryMap<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", iterable: ReadonlyArray<N>, fn: (node: N, index: number) => T | undefined): T[];
|
|
3318
4477
|
resolveFqn(node: FqnReferenceable): ProjectId$1;
|
|
3319
4478
|
getAstNodePath(node: AstNode): string;
|
|
3320
4479
|
getMetadata(metadataAstNode: MetadataProperty | undefined): {
|
|
@@ -3364,7 +4523,7 @@ declare const DocumentParserFromMixins: {
|
|
|
3364
4523
|
parseFqnExpressions(astNode: FqnExpressions): ProjectId$1[];
|
|
3365
4524
|
parseRelationExprOrWith(astNode: RelationExprOrWith): ProjectId$1;
|
|
3366
4525
|
parseRelationExprWith(astNode: RelationExprWith): ProjectId$1;
|
|
3367
|
-
parseCustomRelationProperties(custom: CustomRelationProperties | undefined):
|
|
4526
|
+
parseCustomRelationProperties(custom: CustomRelationProperties | undefined): import("type-fest").Except<ProjectId$1["customRelation"], "expr">;
|
|
3368
4527
|
parseRelationExprOrWhere(astNode: RelationExprOrWhere): ProjectId$1;
|
|
3369
4528
|
parseRelationExprWhere(astNode: RelationExprWhere): ProjectId$1;
|
|
3370
4529
|
parseRelationExpr(astNode: RelationExpr$1): ProjectId$1;
|
|
@@ -3378,7 +4537,7 @@ declare const DocumentParserFromMixins: {
|
|
|
3378
4537
|
readonly project: Project;
|
|
3379
4538
|
logError(error: unknown, astNode?: AstNode | Reference<AstNode>, level?: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification"): void;
|
|
3380
4539
|
tryParse<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", node: N | undefined, fn: (node: NoInfer<N>) => T | undefined): T | undefined;
|
|
3381
|
-
tryMap<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", iterable: ReadonlyArray<N>, fn: (node: N) => T | undefined): T[];
|
|
4540
|
+
tryMap<N extends AstNode, T>(level: "base" | "model" | "deployment" | "fqnref" | "relation" | "views" | "globals" | "imports" | "specification", iterable: ReadonlyArray<N>, fn: (node: N, index: number) => T | undefined): T[];
|
|
3382
4541
|
resolveFqn(node: FqnReferenceable): ProjectId$1;
|
|
3383
4542
|
getAstNodePath(node: AstNode): string;
|
|
3384
4543
|
getMetadata(metadataAstNode: MetadataProperty | undefined): {
|
|
@@ -3417,7 +4576,7 @@ declare const DocumentParserFromMixins: {
|
|
|
3417
4576
|
};
|
|
3418
4577
|
} & typeof BaseParser;
|
|
3419
4578
|
declare class DocumentParser extends DocumentParserFromMixins {}
|
|
3420
|
-
declare class LikeC4ModelParser {
|
|
4579
|
+
declare class LikeC4ModelParser extends ADisposable {
|
|
3421
4580
|
private services;
|
|
3422
4581
|
protected cachedParsers: any;
|
|
3423
4582
|
constructor(services: LikeC4Services);
|
|
@@ -3425,21 +4584,20 @@ declare class LikeC4ModelParser {
|
|
|
3425
4584
|
parse(doc: LangiumDocument): ParsedLikeC4LangiumDocument;
|
|
3426
4585
|
forDocument(doc: LangiumDocument): DocumentParser;
|
|
3427
4586
|
private createParser;
|
|
3428
|
-
}
|
|
4587
|
+
}
|
|
4588
|
+
//#endregion
|
|
3429
4589
|
//#region src/model/parser/ValueConverter.d.ts
|
|
3430
4590
|
declare class LikeC4ValueConverter extends DefaultValueConverter {
|
|
3431
4591
|
protected runConverter(rule: any, input: string, cstNode: CstNode): ValueType;
|
|
3432
|
-
}
|
|
4592
|
+
}
|
|
4593
|
+
//#endregion
|
|
3433
4594
|
//#region src/model-change/ModelChanges.d.ts
|
|
3434
4595
|
declare class LikeC4ModelChanges {
|
|
3435
4596
|
private services;
|
|
3436
4597
|
private locator;
|
|
3437
4598
|
constructor(services: LikeC4Services);
|
|
3438
4599
|
applyChange(changeView: ChangeView.Params): Promise<ChangeView.Res>;
|
|
3439
|
-
protected convertToTextEdit({
|
|
3440
|
-
lookup,
|
|
3441
|
-
change
|
|
3442
|
-
}: {
|
|
4600
|
+
protected convertToTextEdit({ lookup, change }: {
|
|
3443
4601
|
lookup: ViewLocateResult;
|
|
3444
4602
|
change: Exclude<ViewChange, ViewChange.SaveViewSnapshot | ViewChange.ResetManualLayout | ViewChange.ChangeProperty>;
|
|
3445
4603
|
}): {
|
|
@@ -3447,7 +4605,8 @@ declare class LikeC4ModelChanges {
|
|
|
3447
4605
|
edits: TextEdit[];
|
|
3448
4606
|
};
|
|
3449
4607
|
protected applyTextEdits(doc: ParsedLikeC4LangiumDocument, edits: TextEdit[]): Promise<boolean>;
|
|
3450
|
-
}
|
|
4608
|
+
}
|
|
4609
|
+
//#endregion
|
|
3451
4610
|
//#region src/LikeC4LanguageServices.d.ts
|
|
3452
4611
|
interface LikeC4LanguageServices {
|
|
3453
4612
|
readonly views: LikeC4Views;
|
|
@@ -3548,13 +4707,15 @@ interface FormatOptions {
|
|
|
3548
4707
|
insertFinalNewline?: boolean;
|
|
3549
4708
|
/** Trim all newlines after the final newline at the end of the file. */
|
|
3550
4709
|
trimFinalNewlines?: boolean;
|
|
3551
|
-
}
|
|
4710
|
+
}
|
|
4711
|
+
//#endregion
|
|
3552
4712
|
//#region src/lsp/CodeLensProvider.d.ts
|
|
3553
4713
|
declare class LikeC4CodeLensProvider implements CodeLensProvider {
|
|
3554
4714
|
private services;
|
|
3555
4715
|
constructor(services: LikeC4Services);
|
|
3556
4716
|
provideCodeLens(doc: LangiumDocument, _params: CodeLensParams, cancelToken?: CancellationToken$1): Promise<CodeLens[] | undefined>;
|
|
3557
|
-
}
|
|
4717
|
+
}
|
|
4718
|
+
//#endregion
|
|
3558
4719
|
//#region src/lsp/CompletionProvider.d.ts
|
|
3559
4720
|
declare class LikeC4CompletionProvider extends DefaultCompletionProvider {
|
|
3560
4721
|
protected services: LikeC4Services;
|
|
@@ -3565,14 +4726,16 @@ declare class LikeC4CompletionProvider extends DefaultCompletionProvider {
|
|
|
3565
4726
|
protected completionFor(context: CompletionContext, next: NextFeature, acceptor: CompletionAcceptor): MaybePromise<void>;
|
|
3566
4727
|
protected completionForKeyword(context: CompletionContext, keyword: Keyword, acceptor: CompletionAcceptor): MaybePromise<void>;
|
|
3567
4728
|
protected completionForImportedProject(context: CompletionContext, acceptor: CompletionAcceptor): void;
|
|
3568
|
-
}
|
|
4729
|
+
}
|
|
4730
|
+
//#endregion
|
|
3569
4731
|
//#region src/lsp/DocumentHighlightProvider.d.ts
|
|
3570
4732
|
declare class LikeC4DocumentHighlightProvider extends DefaultDocumentHighlightProvider {
|
|
3571
4733
|
/**
|
|
3572
4734
|
* Override this method to determine the highlight kind of the given reference.
|
|
3573
4735
|
*/
|
|
3574
4736
|
protected createDocumentHighlight(reference: ReferenceDescription): DocumentHighlight;
|
|
3575
|
-
}
|
|
4737
|
+
}
|
|
4738
|
+
//#endregion
|
|
3576
4739
|
//#region src/lsp/DocumentLinkProvider.d.ts
|
|
3577
4740
|
declare class LikeC4DocumentLinkProvider implements DocumentLinkProvider {
|
|
3578
4741
|
private services;
|
|
@@ -3580,7 +4743,8 @@ declare class LikeC4DocumentLinkProvider implements DocumentLinkProvider {
|
|
|
3580
4743
|
getDocumentLinks(doc: LangiumDocument, _params: DocumentLinkParams, _cancelToken?: CancellationToken$1): Promise<DocumentLink[]>;
|
|
3581
4744
|
resolveLink(doc: LangiumDocument, link: string): string;
|
|
3582
4745
|
relativeLink(doc: LangiumDocument, link: string): string | null;
|
|
3583
|
-
}
|
|
4746
|
+
}
|
|
4747
|
+
//#endregion
|
|
3584
4748
|
//#region src/lsp/DocumentSymbolProvider.d.ts
|
|
3585
4749
|
declare class LikeC4DocumentSymbolProvider implements DocumentSymbolProvider {
|
|
3586
4750
|
private services;
|
|
@@ -3594,7 +4758,7 @@ declare class LikeC4DocumentSymbolProvider implements DocumentSymbolProvider {
|
|
|
3594
4758
|
protected getSpecSymbol(astSpec: SpecificationRule): DocumentSymbol[];
|
|
3595
4759
|
protected getModelSymbol(astModel: Model): DocumentSymbol[];
|
|
3596
4760
|
protected getDeploymentModelSymbol(astModel: ModelDeployments): DocumentSymbol[];
|
|
3597
|
-
protected getElementsSymbol(el: Element | Relation | ExtendElement,
|
|
4761
|
+
protected getElementsSymbol(el: Element | Relation | ExtendElement, _parentFqn?: string): DocumentSymbol[];
|
|
3598
4762
|
protected getExtendElementSymbol(astElement: ExtendElement): DocumentSymbol[];
|
|
3599
4763
|
protected getElementSymbol(astElement: Element): DocumentSymbol[];
|
|
3600
4764
|
protected getModelViewsSymbol(astViews: ModelViews): DocumentSymbol[];
|
|
@@ -3606,7 +4770,8 @@ declare class LikeC4DocumentSymbolProvider implements DocumentSymbolProvider {
|
|
|
3606
4770
|
protected getDeploymentNodeSymbol(astElement: DeploymentNode): DocumentSymbol[];
|
|
3607
4771
|
protected getDeployedInstanceSymbol(astElement: DeployedInstance): DocumentSymbol[];
|
|
3608
4772
|
protected symbolKind(node: AstNode): SymbolKind;
|
|
3609
|
-
}
|
|
4773
|
+
}
|
|
4774
|
+
//#endregion
|
|
3610
4775
|
//#region src/lsp/HoverProvider.d.ts
|
|
3611
4776
|
/**
|
|
3612
4777
|
* Provides hover content for LikeC4 AST nodes (elements, tags, relations, etc.)
|
|
@@ -3644,7 +4809,8 @@ declare class LikeC4HoverProvider extends AstNodeHoverProvider {
|
|
|
3644
4809
|
* @returns Hover information with markdown content showing instance details.
|
|
3645
4810
|
*/
|
|
3646
4811
|
protected getDeployedInstanceHover(node: DeployedInstance): MaybePromise<Hover | undefined>;
|
|
3647
|
-
}
|
|
4812
|
+
}
|
|
4813
|
+
//#endregion
|
|
3648
4814
|
//#region src/lsp/CodeActionProvider.d.ts
|
|
3649
4815
|
type CommandOrCodeAction = Command | CodeAction;
|
|
3650
4816
|
declare class LikeC4CodeActionProvider implements CodeActionProvider {
|
|
@@ -3655,7 +4821,8 @@ declare class LikeC4CodeActionProvider implements CodeActionProvider {
|
|
|
3655
4821
|
* @throws `ResponseError` if an error is detected that should be sent as response to the client
|
|
3656
4822
|
*/
|
|
3657
4823
|
getCodeActions(_document: LangiumDocument, _params: CodeActionParams): CommandOrCodeAction[] | undefined;
|
|
3658
|
-
}
|
|
4824
|
+
}
|
|
4825
|
+
//#endregion
|
|
3659
4826
|
//#region src/lsp/SemanticTokenProvider.d.ts
|
|
3660
4827
|
declare class LikeC4SemanticTokenProvider extends AbstractSemanticTokenProvider {
|
|
3661
4828
|
protected services: LikeC4Services;
|
|
@@ -3666,14 +4833,16 @@ declare class LikeC4SemanticTokenProvider extends AbstractSemanticTokenProvider
|
|
|
3666
4833
|
private highlightNameAndKind;
|
|
3667
4834
|
private highlightView;
|
|
3668
4835
|
private mark;
|
|
3669
|
-
}
|
|
4836
|
+
}
|
|
4837
|
+
//#endregion
|
|
3670
4838
|
//#region src/Rpc.d.ts
|
|
3671
4839
|
declare class Rpc extends ADisposable {
|
|
3672
4840
|
private services;
|
|
3673
4841
|
constructor(services: LikeC4Services);
|
|
3674
4842
|
init: () => void;
|
|
3675
4843
|
openView(params: DidRequestOpenViewNotification.Params): Promise<void>;
|
|
3676
|
-
}
|
|
4844
|
+
}
|
|
4845
|
+
//#endregion
|
|
3677
4846
|
//#region src/shared/NodeKindProvider.d.ts
|
|
3678
4847
|
declare class NodeKindProvider$1 implements NodeKindProvider {
|
|
3679
4848
|
private services;
|
|
@@ -3686,9 +4855,11 @@ declare class NodeKindProvider$1 implements NodeKindProvider {
|
|
|
3686
4855
|
* Returns a `CompletionItemKind` as used by the `CompletionProvider`.
|
|
3687
4856
|
*/
|
|
3688
4857
|
getCompletionItemKind(node: AstNode | AstNodeDescription): CompletionItemKind;
|
|
3689
|
-
}
|
|
4858
|
+
}
|
|
4859
|
+
//#endregion
|
|
3690
4860
|
//#region src/shared/WorkspaceSymbolProvider.d.ts
|
|
3691
|
-
declare class WorkspaceSymbolProvider extends DefaultWorkspaceSymbolProvider {}
|
|
4861
|
+
declare class WorkspaceSymbolProvider extends DefaultWorkspaceSymbolProvider {}
|
|
4862
|
+
//#endregion
|
|
3692
4863
|
//#region src/module.d.ts
|
|
3693
4864
|
interface LikeC4AddedSharedServices {
|
|
3694
4865
|
lsp: {
|
|
@@ -3754,7 +4925,7 @@ interface LikeC4AddedServices {
|
|
|
3754
4925
|
}
|
|
3755
4926
|
type LikeC4Services = LangiumServices & LikeC4AddedServices;
|
|
3756
4927
|
//#endregion
|
|
3757
|
-
//#region ../language-services/dist/
|
|
4928
|
+
//#region ../language-services/dist/chunks/options.d.mts
|
|
3758
4929
|
//#region src/common/LikeC4.d.ts
|
|
3759
4930
|
interface LikeC4Langium {
|
|
3760
4931
|
shared: LikeC4SharedServices;
|
|
@@ -3767,15 +4938,15 @@ declare class LikeC4 {
|
|
|
3767
4938
|
/**
|
|
3768
4939
|
* File system path to the workspace root
|
|
3769
4940
|
*/
|
|
3770
|
-
get workspace():
|
|
4941
|
+
get workspace(): string;
|
|
3771
4942
|
/**
|
|
3772
4943
|
* URI of the workspace root
|
|
3773
4944
|
*/
|
|
3774
|
-
get workspaceURI():
|
|
4945
|
+
get workspaceURI(): URI;
|
|
3775
4946
|
/**
|
|
3776
4947
|
* URL of the workspace root
|
|
3777
4948
|
*/
|
|
3778
|
-
get workspaceURL():
|
|
4949
|
+
get workspaceURL(): URL;
|
|
3779
4950
|
get languageServices(): LikeC4LanguageServices;
|
|
3780
4951
|
get projectsManager(): ProjectsManager;
|
|
3781
4952
|
get viewsService(): LikeC4Views;
|
|
@@ -3803,6 +4974,104 @@ declare class LikeC4 {
|
|
|
3803
4974
|
* Not ready for rendering, but enough to traverse
|
|
3804
4975
|
*/
|
|
3805
4976
|
computedModel(project?: string | undefined): Promise<LikeC4Model.Computed>;
|
|
4977
|
+
/**
|
|
4978
|
+
* Returns the parsed model — elements, relations, views, deployments, globals
|
|
4979
|
+
* and imports as parsed from DSL, BEFORE view computation or layout.
|
|
4980
|
+
*
|
|
4981
|
+
* Use this when you need to inspect the raw parsed shape, or as input to
|
|
4982
|
+
* {@link toBuilder} for programmatic enrichment.
|
|
4983
|
+
*/
|
|
4984
|
+
parsedModel(project?: string | undefined): Promise<LikeC4Model.Parsed>;
|
|
4985
|
+
/**
|
|
4986
|
+
* Returns a {@link Builder} seeded with the parsed model of the given project.
|
|
4987
|
+
*
|
|
4988
|
+
* This unblocks programmatic enrichment — you can chain `.model(...)`,
|
|
4989
|
+
* `.deployment(...)` and `.views(...)` on the returned builder to add new
|
|
4990
|
+
* elements, relations and views on top of what was loaded from DSL.
|
|
4991
|
+
*
|
|
4992
|
+
* The builder is `editable` by default: re-declaring an element that already
|
|
4993
|
+
* exists (same FQN, same kind) edits it in place rather than throwing — which
|
|
4994
|
+
* is what you usually want when patching a loaded model. Pass `'strict'` to
|
|
4995
|
+
* get the strict builder where duplicate FQNs always throw (see
|
|
4996
|
+
* {@link BuilderMode}).
|
|
4997
|
+
*
|
|
4998
|
+
* Type-safety note: the returned builder is `Builder<AnyTypes>` — element
|
|
4999
|
+
* kinds, FQNs, view ids and tags are only known at runtime. See
|
|
5000
|
+
* {@link Builder.fromParsed} for details.
|
|
5001
|
+
*
|
|
5002
|
+
* @example
|
|
5003
|
+
* ```ts
|
|
5004
|
+
* const likec4 = await LikeC4.fromWorkspace('/path/to/workspace')
|
|
5005
|
+
* const enriched = (await likec4.toBuilder())
|
|
5006
|
+
* .model(({ system, component }, _) =>
|
|
5007
|
+
* _(system('monitoring').with(component('grafana'))),
|
|
5008
|
+
* )
|
|
5009
|
+
* .toLikeC4Model()
|
|
5010
|
+
*
|
|
5011
|
+
* // Strict builder — re-declaring an existing FQN throws:
|
|
5012
|
+
* const strict = await likec4.toBuilder('strict')
|
|
5013
|
+
* ```
|
|
5014
|
+
*/
|
|
5015
|
+
toBuilder(mode?: BuilderMode, project?: string | undefined): Promise<Builder<AnyTypes>>;
|
|
5016
|
+
/**
|
|
5017
|
+
* Like {@link toBuilder}, but validates the given `specification` against the
|
|
5018
|
+
* loaded model and returns a **typed** builder.
|
|
5019
|
+
*
|
|
5020
|
+
* Use this when your code authors the model with the same specification as the
|
|
5021
|
+
* DSL: pass that spec and get a `Builder<Types.FromSpecification<Spec>>` with
|
|
5022
|
+
* autocomplete on element / deployment / relationship kinds, tags and metadata
|
|
5023
|
+
* keys — replacing the unchecked `as unknown as Builder<...>` cast.
|
|
5024
|
+
*
|
|
5025
|
+
* Validation is **subset-based**: every kind / tag / metadata key you declare
|
|
5026
|
+
* must exist in the loaded model (otherwise the produced types would lie and we
|
|
5027
|
+
* throw). The loaded model may contain *extra* kinds you didn't declare — you
|
|
5028
|
+
* simply won't get typed helpers for them.
|
|
5029
|
+
*
|
|
5030
|
+
* Like {@link toBuilder}, the builder is `editable` by default — pass
|
|
5031
|
+
* `mode: 'strict'` for the throw-on-duplicate builder.
|
|
5032
|
+
*
|
|
5033
|
+
* Note: existing FQNs and view ids from the loaded model are still NOT part of
|
|
5034
|
+
* the static type set (only kinds/tags/metadata keys are) — see
|
|
5035
|
+
* {@link Builder.fromParsed}.
|
|
5036
|
+
*
|
|
5037
|
+
* @example
|
|
5038
|
+
* ```ts
|
|
5039
|
+
* const specification = {
|
|
5040
|
+
* elements: ['actor', 'system', 'component'],
|
|
5041
|
+
* tags: ['external'],
|
|
5042
|
+
* } as const
|
|
5043
|
+
*
|
|
5044
|
+
* const builder = await likec4.toTypedBuilder({ specification })
|
|
5045
|
+
* const enriched = builder
|
|
5046
|
+
* .model(({ system, component }, _) =>
|
|
5047
|
+
* _(system('monitoring').with(component('grafana'))),
|
|
5048
|
+
* )
|
|
5049
|
+
* .toLikeC4Model()
|
|
5050
|
+
* ```
|
|
5051
|
+
*/
|
|
5052
|
+
toTypedBuilder<const Spec extends BuilderSpecification>(options: {
|
|
5053
|
+
/** The specification your code expects — validated against the loaded model. */
|
|
5054
|
+
specification: Spec;
|
|
5055
|
+
/** Duplicate handling, defaults to `'editable'` (see {@link toBuilder}). */
|
|
5056
|
+
mode?: BuilderMode;
|
|
5057
|
+
/** Project name to seed from (for multi-project workspaces). */
|
|
5058
|
+
project?: string;
|
|
5059
|
+
}): Promise<Builder<Types.FromSpecification<Spec>>>;
|
|
5060
|
+
/**
|
|
5061
|
+
* Renders the parsed model of the given project back to LikeC4 DSL source.
|
|
5062
|
+
*
|
|
5063
|
+
* The output is a single, formatted `.c4` string containing the specification,
|
|
5064
|
+
* model, deployment and views blocks. This round-trip is intentionally LOSSY:
|
|
5065
|
+
* comments, source positions and original formatting are not preserved.
|
|
5066
|
+
*
|
|
5067
|
+
* Useful for "load + patch + emit" workflows where the source of truth is
|
|
5068
|
+
* external (e.g. a service catalogue or Terraform state) and DSL files are
|
|
5069
|
+
* regenerated wholesale.
|
|
5070
|
+
*
|
|
5071
|
+
* To write the output to disk, use the `writeDSL` helper from
|
|
5072
|
+
* `@likec4/language-services/node`.
|
|
5073
|
+
*/
|
|
5074
|
+
toDSL(project?: string | undefined): Promise<string>;
|
|
3806
5075
|
projects(): NonEmptyArray<ProjectId>;
|
|
3807
5076
|
/**
|
|
3808
5077
|
* Same as {@link computedModel()}, but also applies layout
|
|
@@ -3834,9 +5103,11 @@ declare class LikeC4 {
|
|
|
3834
5103
|
*/
|
|
3835
5104
|
documentCount(): number;
|
|
3836
5105
|
/**
|
|
3837
|
-
*
|
|
5106
|
+
* Subscribe to model updates
|
|
5107
|
+
* @param listener Function called when the model is updated - receives the project ID that was updated
|
|
5108
|
+
* @returns A function to dispose the listener
|
|
3838
5109
|
*/
|
|
3839
|
-
onModelUpdate(listener: () => void): () => void;
|
|
5110
|
+
onModelUpdate(listener: (projectId: ProjectId) => void): () => void;
|
|
3840
5111
|
/**
|
|
3841
5112
|
* Formats documents and returns a map of document URI → formatted source text.
|
|
3842
5113
|
*
|
|
@@ -3870,7 +5141,36 @@ interface LikeC4FormatOptions {
|
|
|
3870
5141
|
insertFinalNewline?: boolean;
|
|
3871
5142
|
/** Trim all newlines after the final newline at the end of the file. */
|
|
3872
5143
|
trimFinalNewlines?: boolean;
|
|
3873
|
-
}
|
|
3874
|
-
//#
|
|
5144
|
+
}
|
|
5145
|
+
//#endregion
|
|
5146
|
+
//#region ../language-services/dist/node/index.d.mts
|
|
5147
|
+
/**
|
|
5148
|
+
* Options for {@link writeDSL}.
|
|
5149
|
+
*/
|
|
5150
|
+
interface WriteDSLOptions {
|
|
5151
|
+
/** Project to render (when the workspace has multiple). Defaults to the only one. */
|
|
5152
|
+
project?: string;
|
|
5153
|
+
/** Output filename. Default: `model.c4`. */
|
|
5154
|
+
fileName?: string;
|
|
5155
|
+
}
|
|
5156
|
+
/**
|
|
5157
|
+
* Renders the parsed model back to LikeC4 DSL source and writes it to disk.
|
|
5158
|
+
*
|
|
5159
|
+
* The output is a single, formatted `.c4` file. This round-trip is intentionally
|
|
5160
|
+
* LOSSY: comments, source positions and original formatting are not preserved.
|
|
5161
|
+
*
|
|
5162
|
+
* @param likec4 - A LikeC4 instance (typically from `fromWorkspace`).
|
|
5163
|
+
* @param targetDir - Directory to write the output file into. Must already exist.
|
|
5164
|
+
* @param options - {@link WriteDSLOptions}
|
|
5165
|
+
* @returns The full path of the written file.
|
|
5166
|
+
*
|
|
5167
|
+
* @example
|
|
5168
|
+
* ```ts
|
|
5169
|
+
* const likec4 = await LikeC4.fromWorkspace('/path/to/workspace')
|
|
5170
|
+
* const out = await writeDSL(likec4, '/tmp/generated')
|
|
5171
|
+
* console.log(`Wrote DSL to ${out}`)
|
|
5172
|
+
* ```
|
|
5173
|
+
*/
|
|
5174
|
+
declare function writeDSL(likec4: LikeC4, targetDir: string, options?: WriteDSLOptions): Promise<string>;
|
|
3875
5175
|
//#endregion
|
|
3876
|
-
export { LikeC4LanguageServices as n, LikeC4 as t };
|
|
5176
|
+
export { LikeC4LanguageServices as i, writeDSL as n, LikeC4 as r, WriteDSLOptions as t };
|