likec4 1.19.0 → 1.19.1

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/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { F as Fqn, $ as ViewId, K as ElementKind$1, a2 as NonEmptyArray, Z as Tag$1, a3 as ElementShape$1, a4 as IconUrl, m as Color$1, a5 as BorderStyle, a6 as RelationshipKind$1, a7 as RelationshipLineType, a8 as RelationshipArrowType, a9 as CustomColor$1, O as HexColorLiteral, v as DeploymentNodeKind$1, aa as DeploymentNodeKindSpecification, X as RelationId, t as DeploymentElement$1, u as DeploymentNode$1, s as DeployedInstance$1, w as DeploymentRelation$1, ab as ModelGlobals, ac as ViewRule$1, ad as ViewManualLayout, ae as DynamicViewStepOrParallel, af as DynamicViewRule$1, ag as DeploymentViewRule$1, U as ParsedLikeC4Model, r as ComputedLikeC4Model, i as ComputedView, ah as ViewChange, T as OverviewGraph, z as DiagramView, L as LikeC4Model } from './shared/likec4.DCwaTTuF.mjs';
1
+ import { i as ComputedView, T as OverviewGraph, z as DiagramView, F as Fqn, $ as ViewId, K as ElementKind$1, a2 as NonEmptyArray, Z as Tag$1, a3 as ElementShape$1, a4 as IconUrl, m as Color$1, a5 as BorderStyle, a6 as RelationshipKind$1, a7 as RelationshipLineType, a8 as RelationshipArrowType, a9 as CustomColor$1, O as HexColorLiteral, v as DeploymentNodeKind$1, aa as DeploymentNodeKindSpecification, X as RelationId, t as DeploymentElement$1, u as DeploymentNode$1, s as DeployedInstance$1, w as DeploymentRelation$1, ab as ModelGlobals, ac as ViewRule$1, ad as ViewManualLayout, ae as DynamicViewStepOrParallel, af as DynamicViewRule$1, ag as DeploymentViewRule$1, U as ParsedLikeC4Model, r as ComputedLikeC4Model, ah as ViewChange, L as LikeC4Model } from './shared/likec4.DCwaTTuF.mjs';
2
2
  export { k as AbstractRelation, A as AnyAux, l as AutoLayoutDirection, e as Aux, B as BBox, n as ComputedDeploymentView, o as ComputedDynamicView, p as ComputedEdge, q as ComputedElementView, C as ComputedNode, x as DeploymentView, y as DiagramEdge, j as DiagramNode, G as DynamicView, H as EdgeId, J as Element, M as ElementView, P as LayoutedLikeC4Model, g as LikeC4DeploymentModel, Q as LikeC4View, h as LikeC4ViewModel, S as NodeId, V as Point, W as RelationExpr, Y as StepEdgeId, _ as ThemeColor, a1 as XYPoint } from './shared/likec4.DCwaTTuF.mjs';
3
- import { Writable, ValueOf, ConditionalPick, Tagged } from 'type-fest';
3
+ import { Tagged, Writable, ValueOf, ConditionalPick } from 'type-fest';
4
4
 
5
5
  declare function invariant(condition: any, message?: string): asserts condition;
6
6
 
@@ -11835,6 +11835,64 @@ type LangiumDefaultSharedCoreServices = {
11835
11835
  */
11836
11836
  type LangiumSharedCoreServices = LangiumDefaultSharedCoreServices & LangiumGeneratedSharedCoreServices;
11837
11837
 
11838
+ /**
11839
+ * @hidden
11840
+ */
11841
+ type $keywords<T extends string> = {
11842
+ [key in T]: key;
11843
+ };
11844
+
11845
+ declare module 'ts-graphviz' {
11846
+ namespace ClusterSubgraphAttributeKey {
11847
+ interface $values extends $keywords<'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_level' | 'likec4_depth'> {
11848
+ }
11849
+ }
11850
+ namespace NodeAttributeKey {
11851
+ interface $values extends $keywords<'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_level'> {
11852
+ }
11853
+ }
11854
+ namespace EdgeAttributeKey {
11855
+ interface $values extends $keywords<'likec4_id'> {
11856
+ }
11857
+ }
11858
+ namespace Attribute {
11859
+ interface $keys extends $keywords<'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_level' | 'likec4_depth'> {
11860
+ }
11861
+ interface $types {
11862
+ likec4_type: 'folder' | 'file' | 'view';
11863
+ likec4_path: string;
11864
+ likec4_id: string;
11865
+ likec4_level: number;
11866
+ likec4_depth: number;
11867
+ }
11868
+ }
11869
+ }
11870
+ type DotSource = Tagged<string, 'DotSource'>;
11871
+
11872
+ interface GraphvizPort {
11873
+ unflatten(dot: DotSource): Promise<DotSource>;
11874
+ acyclic(dot: DotSource): Promise<DotSource>;
11875
+ layoutJson(dot: DotSource): Promise<string>;
11876
+ svg(dot: DotSource): Promise<string>;
11877
+ }
11878
+ type LayoutResult = {
11879
+ dot: DotSource;
11880
+ diagram: DiagramView;
11881
+ };
11882
+ declare class GraphvizLayouter {
11883
+ private graphviz;
11884
+ constructor(graphviz: GraphvizPort);
11885
+ get port(): GraphvizPort;
11886
+ changePort(graphviz: GraphvizPort): void;
11887
+ layout(view: ComputedView): Promise<LayoutResult>;
11888
+ svg(view: ComputedView): Promise<{
11889
+ svg: string;
11890
+ dot: DotSource;
11891
+ }>;
11892
+ dot(computedView: ComputedView): Promise<DotSource>;
11893
+ layoutOverviewGraph(views: ComputedView[]): Promise<OverviewGraph>;
11894
+ }
11895
+
11838
11896
  interface WorkDoneProgressReporter {
11839
11897
  begin(title: string, percentage?: number, message?: string, cancellable?: boolean): void;
11840
11898
  report(percentage: number): void;
@@ -13823,6 +13881,13 @@ declare class DefaultCompletionProvider implements CompletionProvider {
13823
13881
  protected buildCompletionTextEdit(context: CompletionContext, label: string, newText: string): TextEdit$1 | undefined;
13824
13882
  }
13825
13883
 
13884
+ declare class LikeC4DocumentationProvider implements DocumentationProvider {
13885
+ private parser;
13886
+ private locator;
13887
+ constructor(services: LikeC4Services);
13888
+ getDocumentation(node: AstNode): string | undefined;
13889
+ }
13890
+
13826
13891
  declare class LikeC4CodeLensProvider implements CodeLensProvider {
13827
13892
  private services;
13828
13893
  constructor(services: LikeC4Services);
@@ -15065,38 +15130,6 @@ interface LikeC4LangiumDocument extends LikeC4GrammarDocument, LikeC4DocumentPro
15065
15130
  interface ParsedLikeC4LangiumDocument extends LikeC4GrammarDocument, Required<LikeC4DocumentProps> {
15066
15131
  }
15067
15132
 
15068
- declare class LikeC4DocumentSymbolProvider implements DocumentSymbolProvider {
15069
- private services;
15070
- protected readonly nodeKindProvider: NodeKindProvider$1;
15071
- constructor(services: LikeC4Services);
15072
- getSymbols({ parseResult: { value: { specifications, models, views, likec4lib } } }: LikeC4LangiumDocument): MaybePromise<DocumentSymbol[]>;
15073
- protected getLikec4LibSymbol(astLib: LikeC4Lib): DocumentSymbol[];
15074
- protected getSpecSymbol(astSpec: SpecificationRule): DocumentSymbol[];
15075
- protected getModelSymbol(astModel: Model): DocumentSymbol[];
15076
- protected getElementsSymbol(el: Element | Relation | ExtendElement): DocumentSymbol[];
15077
- protected getExtendElementSymbol(astElement: ExtendElement): DocumentSymbol[];
15078
- protected getElementSymbol(astElement: Element): DocumentSymbol[];
15079
- protected getModelViewsSymbol(astViews: ModelViews): DocumentSymbol[];
15080
- protected getKindSymbol(astKind: SpecificationElementKind | SpecificationRelationshipKind): DocumentSymbol | null;
15081
- protected getTagSymbol(astTag: SpecificationTag): DocumentSymbol | null;
15082
- protected getLibIconSymbol(astTag: LibIcon): DocumentSymbol | null;
15083
- protected getViewSymbol(astView: LikeC4View): DocumentSymbol[];
15084
- protected symbolKind(node: AstNode): SymbolKind;
15085
- }
15086
-
15087
- declare class LikeC4HoverProvider extends AstNodeHoverProvider {
15088
- private parser;
15089
- private locator;
15090
- constructor(services: LikeC4Services);
15091
- protected getAstNodeHoverContent(node: AstNode): MaybePromise<Hover | undefined>;
15092
- }
15093
-
15094
- declare class LikeC4SemanticTokenProvider extends AbstractSemanticTokenProvider {
15095
- protected highlightElement(node: AstNode, acceptor: SemanticTokenAcceptor): void | undefined | 'prune';
15096
- private highlightNameAndKind;
15097
- private highlightView;
15098
- }
15099
-
15100
15133
  declare class LikeC4NameProvider extends DefaultNameProvider {
15101
15134
  protected services: LikeC4Services;
15102
15135
  constructor(services: LikeC4Services);
@@ -15557,6 +15590,45 @@ declare class LikeC4ModelParser {
15557
15590
  forDocument(doc: LangiumDocument): DocumentParser;
15558
15591
  }
15559
15592
 
15593
+ declare class LikeC4DocumentSymbolProvider implements DocumentSymbolProvider {
15594
+ private services;
15595
+ protected readonly nodeKindProvider: NodeKindProvider$1;
15596
+ protected readonly nameProvider: LikeC4NameProvider;
15597
+ protected readonly parser: LikeC4ModelParser;
15598
+ protected readonly locator: LikeC4ModelLocator;
15599
+ constructor(services: LikeC4Services);
15600
+ getSymbols({ parseResult: { value: { specifications, models, deployments, views, likec4lib }, }, }: LikeC4LangiumDocument): MaybePromise<DocumentSymbol[]>;
15601
+ protected getLikec4LibSymbol(astLib: LikeC4Lib): DocumentSymbol[];
15602
+ protected getSpecSymbol(astSpec: SpecificationRule): DocumentSymbol[];
15603
+ protected getModelSymbol(astModel: Model): DocumentSymbol[];
15604
+ protected getDeploymentModelSymbol(astModel: ModelDeployments): DocumentSymbol[];
15605
+ protected getElementsSymbol(el: Element | Relation | ExtendElement): DocumentSymbol[];
15606
+ protected getExtendElementSymbol(astElement: ExtendElement): DocumentSymbol[];
15607
+ protected getElementSymbol(astElement: Element): DocumentSymbol[];
15608
+ protected getModelViewsSymbol(astViews: ModelViews): DocumentSymbol[];
15609
+ protected getKindSymbol(astKind: SpecificationElementKind | SpecificationRelationshipKind): DocumentSymbol | null;
15610
+ protected getTagSymbol(astTag: SpecificationTag): DocumentSymbol | null;
15611
+ protected getLibIconSymbol(astTag: LibIcon): DocumentSymbol | null;
15612
+ protected getViewSymbol(astView: LikeC4View): DocumentSymbol[];
15613
+ protected getDeploymentElementSymbol(el: DeploymentElement | DeploymentRelation): DocumentSymbol[];
15614
+ protected getDeploymentNodeSymbol(astElement: DeploymentNode): DocumentSymbol[];
15615
+ protected getDeployedInstanceSymbol(astElement: DeployedInstance): DocumentSymbol[];
15616
+ protected symbolKind(node: AstNode): SymbolKind;
15617
+ }
15618
+
15619
+ declare class LikeC4HoverProvider extends AstNodeHoverProvider {
15620
+ private parser;
15621
+ private locator;
15622
+ constructor(services: LikeC4Services);
15623
+ protected getAstNodeHoverContent(node: AstNode): MaybePromise<Hover | undefined>;
15624
+ }
15625
+
15626
+ declare class LikeC4SemanticTokenProvider extends AbstractSemanticTokenProvider {
15627
+ protected highlightElement(node: AstNode, acceptor: SemanticTokenAcceptor): void | undefined | 'prune';
15628
+ private highlightNameAndKind;
15629
+ private highlightView;
15630
+ }
15631
+
15560
15632
  interface ChangeViewRequestParams {
15561
15633
  viewId: ViewId;
15562
15634
  change: ViewChange;
@@ -15612,6 +15684,29 @@ declare class LikeC4WorkspaceManager extends DefaultWorkspaceManager {
15612
15684
  declare class WorkspaceSymbolProvider extends DefaultWorkspaceSymbolProvider {
15613
15685
  }
15614
15686
 
15687
+ type GraphvizOut = {
15688
+ dot: string;
15689
+ diagram: DiagramView;
15690
+ };
15691
+ type GraphvizSvgOut = {
15692
+ id: ViewId;
15693
+ dot: string;
15694
+ svg: string;
15695
+ };
15696
+ declare class LikeC4Views {
15697
+ private services;
15698
+ private cache;
15699
+ private viewsWithReportedErrors;
15700
+ constructor(services: LikeC4Services);
15701
+ private get layouter();
15702
+ computedViews(cancelToken?: CancellationToken): Promise<ComputedView[]>;
15703
+ layoutAllViews(cancelToken?: CancellationToken): Promise<Array<Readonly<GraphvizOut>>>;
15704
+ layoutView(viewId: ViewId, cancelToken?: CancellationToken): Promise<GraphvizOut | null>;
15705
+ diagrams(): Promise<Array<DiagramView>>;
15706
+ viewsAsGraphvizOut(): Promise<Array<GraphvizSvgOut>>;
15707
+ overviewGraph(): Promise<OverviewGraph>;
15708
+ }
15709
+
15615
15710
  interface LikeC4AddedSharedServices {
15616
15711
  lsp: {
15617
15712
  NodeKindProvider: NodeKindProvider;
@@ -15626,10 +15721,15 @@ type LikeC4SharedServices = LangiumSharedServices & LikeC4AddedSharedServices;
15626
15721
  * Declaration of custom services - add your own service classes here.
15627
15722
  */
15628
15723
  interface LikeC4AddedServices {
15724
+ documentation: {
15725
+ DocumentationProvider: LikeC4DocumentationProvider;
15726
+ };
15629
15727
  WorkspaceCache: WorkspaceCache<string, any>;
15630
15728
  DocumentCache: DocumentCache<string, any>;
15631
15729
  Rpc: Rpc;
15632
15730
  likec4: {
15731
+ Views: LikeC4Views;
15732
+ Layouter: GraphvizLayouter;
15633
15733
  DeploymentsIndex: DeploymentsIndex;
15634
15734
  FqnIndex: FqnIndex;
15635
15735
  ModelParser: LikeC4ModelParser;
@@ -15655,64 +15755,6 @@ interface LikeC4AddedServices {
15655
15755
  }
15656
15756
  type LikeC4Services = LangiumServices & LikeC4AddedServices;
15657
15757
 
15658
- /**
15659
- * @hidden
15660
- */
15661
- type $keywords<T extends string> = {
15662
- [key in T]: key;
15663
- };
15664
-
15665
- declare module 'ts-graphviz' {
15666
- namespace ClusterSubgraphAttributeKey {
15667
- interface $values extends $keywords<'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_level' | 'likec4_depth'> {
15668
- }
15669
- }
15670
- namespace NodeAttributeKey {
15671
- interface $values extends $keywords<'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_level'> {
15672
- }
15673
- }
15674
- namespace EdgeAttributeKey {
15675
- interface $values extends $keywords<'likec4_id'> {
15676
- }
15677
- }
15678
- namespace Attribute {
15679
- interface $keys extends $keywords<'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_level' | 'likec4_depth'> {
15680
- }
15681
- interface $types {
15682
- likec4_type: 'folder' | 'file' | 'view';
15683
- likec4_path: string;
15684
- likec4_id: string;
15685
- likec4_level: number;
15686
- likec4_depth: number;
15687
- }
15688
- }
15689
- }
15690
- type DotSource = Tagged<string, 'DotSource'>;
15691
-
15692
- interface GraphvizPort {
15693
- unflatten(dot: DotSource): Promise<DotSource>;
15694
- acyclic(dot: DotSource): Promise<DotSource>;
15695
- layoutJson(dot: DotSource): Promise<string>;
15696
- svg(dot: DotSource): Promise<string>;
15697
- }
15698
- type LayoutResult = {
15699
- dot: DotSource;
15700
- diagram: DiagramView;
15701
- };
15702
- declare class GraphvizLayouter {
15703
- private graphviz;
15704
- constructor(graphviz: GraphvizPort);
15705
- get port(): GraphvizPort;
15706
- changePort(graphviz: GraphvizPort): void;
15707
- layout(view: ComputedView): Promise<LayoutResult>;
15708
- svg(view: ComputedView): Promise<{
15709
- svg: string;
15710
- dot: DotSource;
15711
- }>;
15712
- dot(computedView: ComputedView): Promise<DotSource>;
15713
- layoutOverviewGraph(views: ComputedView[]): Promise<OverviewGraph>;
15714
- }
15715
-
15716
15758
  // This definition file follows a somewhat unusual format. ESTree allows
15717
15759
  // runtime type checks based on the `type` parameter. In order to explain this
15718
15760
  // to typescript we want to use discriminated union types:
@@ -16327,50 +16369,6 @@ type Logger = {
16327
16369
  error(err: unknown): void;
16328
16370
  };
16329
16371
 
16330
- declare class CliWorkspace {
16331
- private services;
16332
- private isInitialized;
16333
- constructor(services: CliServices);
16334
- initWorkspace(workspace: WorkspaceFolder): Promise<void>;
16335
- init(): Promise<void>;
16336
- }
16337
-
16338
- type CliAddedServices = {
16339
- logger: Logger;
16340
- likec4: {
16341
- Layouter: GraphvizLayouter;
16342
- Views: Views;
16343
- };
16344
- cli: {
16345
- Workspace: CliWorkspace;
16346
- };
16347
- };
16348
- type CliServices = LikeC4Services & CliAddedServices;
16349
-
16350
- type GraphvizOut = {
16351
- dot: string;
16352
- diagram: DiagramView;
16353
- };
16354
- type GraphvizSvgOut = {
16355
- id: ViewId;
16356
- dot: string;
16357
- svg: string;
16358
- };
16359
- declare class Views {
16360
- private services;
16361
- private cache;
16362
- private layouter;
16363
- private previousAction;
16364
- private limit;
16365
- constructor(services: CliServices);
16366
- private inflightRequest;
16367
- computedViews(): Promise<ComputedView[]>;
16368
- layoutViews(): Promise<Array<Readonly<GraphvizOut>>>;
16369
- diagrams(): Promise<Array<DiagramView>>;
16370
- viewsAsGraphvizOut(): Promise<Array<GraphvizSvgOut>>;
16371
- overviewGraph(): Promise<OverviewGraph>;
16372
- }
16373
-
16374
16372
  type LikeC4Options = {
16375
16373
  /**
16376
16374
  * By default, if LikeC4 model is invalid, errors are printed to the console.
@@ -16415,7 +16413,7 @@ declare class LikeC4 {
16415
16413
  private modelLayoutedRef;
16416
16414
  private logger;
16417
16415
  private constructor();
16418
- get viewsService(): Views;
16416
+ get viewsService(): LikeC4Views;
16419
16417
  private get LangiumDocuments();
16420
16418
  /**
16421
16419
  * Diagram is a computed view, layouted using Graphviz
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { F as Fqn, $ as ViewId, K as ElementKind$1, a2 as NonEmptyArray, Z as Tag$1, a3 as ElementShape$1, a4 as IconUrl, m as Color$1, a5 as BorderStyle, a6 as RelationshipKind$1, a7 as RelationshipLineType, a8 as RelationshipArrowType, a9 as CustomColor$1, O as HexColorLiteral, v as DeploymentNodeKind$1, aa as DeploymentNodeKindSpecification, X as RelationId, t as DeploymentElement$1, u as DeploymentNode$1, s as DeployedInstance$1, w as DeploymentRelation$1, ab as ModelGlobals, ac as ViewRule$1, ad as ViewManualLayout, ae as DynamicViewStepOrParallel, af as DynamicViewRule$1, ag as DeploymentViewRule$1, U as ParsedLikeC4Model, r as ComputedLikeC4Model, i as ComputedView, ah as ViewChange, T as OverviewGraph, z as DiagramView, L as LikeC4Model } from './shared/likec4.DCwaTTuF.js';
1
+ import { i as ComputedView, T as OverviewGraph, z as DiagramView, F as Fqn, $ as ViewId, K as ElementKind$1, a2 as NonEmptyArray, Z as Tag$1, a3 as ElementShape$1, a4 as IconUrl, m as Color$1, a5 as BorderStyle, a6 as RelationshipKind$1, a7 as RelationshipLineType, a8 as RelationshipArrowType, a9 as CustomColor$1, O as HexColorLiteral, v as DeploymentNodeKind$1, aa as DeploymentNodeKindSpecification, X as RelationId, t as DeploymentElement$1, u as DeploymentNode$1, s as DeployedInstance$1, w as DeploymentRelation$1, ab as ModelGlobals, ac as ViewRule$1, ad as ViewManualLayout, ae as DynamicViewStepOrParallel, af as DynamicViewRule$1, ag as DeploymentViewRule$1, U as ParsedLikeC4Model, r as ComputedLikeC4Model, ah as ViewChange, L as LikeC4Model } from './shared/likec4.DCwaTTuF.js';
2
2
  export { k as AbstractRelation, A as AnyAux, l as AutoLayoutDirection, e as Aux, B as BBox, n as ComputedDeploymentView, o as ComputedDynamicView, p as ComputedEdge, q as ComputedElementView, C as ComputedNode, x as DeploymentView, y as DiagramEdge, j as DiagramNode, G as DynamicView, H as EdgeId, J as Element, M as ElementView, P as LayoutedLikeC4Model, g as LikeC4DeploymentModel, Q as LikeC4View, h as LikeC4ViewModel, S as NodeId, V as Point, W as RelationExpr, Y as StepEdgeId, _ as ThemeColor, a1 as XYPoint } from './shared/likec4.DCwaTTuF.js';
3
- import { Writable, ValueOf, ConditionalPick, Tagged } from 'type-fest';
3
+ import { Tagged, Writable, ValueOf, ConditionalPick } from 'type-fest';
4
4
 
5
5
  declare function invariant(condition: any, message?: string): asserts condition;
6
6
 
@@ -11835,6 +11835,64 @@ type LangiumDefaultSharedCoreServices = {
11835
11835
  */
11836
11836
  type LangiumSharedCoreServices = LangiumDefaultSharedCoreServices & LangiumGeneratedSharedCoreServices;
11837
11837
 
11838
+ /**
11839
+ * @hidden
11840
+ */
11841
+ type $keywords<T extends string> = {
11842
+ [key in T]: key;
11843
+ };
11844
+
11845
+ declare module 'ts-graphviz' {
11846
+ namespace ClusterSubgraphAttributeKey {
11847
+ interface $values extends $keywords<'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_level' | 'likec4_depth'> {
11848
+ }
11849
+ }
11850
+ namespace NodeAttributeKey {
11851
+ interface $values extends $keywords<'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_level'> {
11852
+ }
11853
+ }
11854
+ namespace EdgeAttributeKey {
11855
+ interface $values extends $keywords<'likec4_id'> {
11856
+ }
11857
+ }
11858
+ namespace Attribute {
11859
+ interface $keys extends $keywords<'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_level' | 'likec4_depth'> {
11860
+ }
11861
+ interface $types {
11862
+ likec4_type: 'folder' | 'file' | 'view';
11863
+ likec4_path: string;
11864
+ likec4_id: string;
11865
+ likec4_level: number;
11866
+ likec4_depth: number;
11867
+ }
11868
+ }
11869
+ }
11870
+ type DotSource = Tagged<string, 'DotSource'>;
11871
+
11872
+ interface GraphvizPort {
11873
+ unflatten(dot: DotSource): Promise<DotSource>;
11874
+ acyclic(dot: DotSource): Promise<DotSource>;
11875
+ layoutJson(dot: DotSource): Promise<string>;
11876
+ svg(dot: DotSource): Promise<string>;
11877
+ }
11878
+ type LayoutResult = {
11879
+ dot: DotSource;
11880
+ diagram: DiagramView;
11881
+ };
11882
+ declare class GraphvizLayouter {
11883
+ private graphviz;
11884
+ constructor(graphviz: GraphvizPort);
11885
+ get port(): GraphvizPort;
11886
+ changePort(graphviz: GraphvizPort): void;
11887
+ layout(view: ComputedView): Promise<LayoutResult>;
11888
+ svg(view: ComputedView): Promise<{
11889
+ svg: string;
11890
+ dot: DotSource;
11891
+ }>;
11892
+ dot(computedView: ComputedView): Promise<DotSource>;
11893
+ layoutOverviewGraph(views: ComputedView[]): Promise<OverviewGraph>;
11894
+ }
11895
+
11838
11896
  interface WorkDoneProgressReporter {
11839
11897
  begin(title: string, percentage?: number, message?: string, cancellable?: boolean): void;
11840
11898
  report(percentage: number): void;
@@ -13823,6 +13881,13 @@ declare class DefaultCompletionProvider implements CompletionProvider {
13823
13881
  protected buildCompletionTextEdit(context: CompletionContext, label: string, newText: string): TextEdit$1 | undefined;
13824
13882
  }
13825
13883
 
13884
+ declare class LikeC4DocumentationProvider implements DocumentationProvider {
13885
+ private parser;
13886
+ private locator;
13887
+ constructor(services: LikeC4Services);
13888
+ getDocumentation(node: AstNode): string | undefined;
13889
+ }
13890
+
13826
13891
  declare class LikeC4CodeLensProvider implements CodeLensProvider {
13827
13892
  private services;
13828
13893
  constructor(services: LikeC4Services);
@@ -15065,38 +15130,6 @@ interface LikeC4LangiumDocument extends LikeC4GrammarDocument, LikeC4DocumentPro
15065
15130
  interface ParsedLikeC4LangiumDocument extends LikeC4GrammarDocument, Required<LikeC4DocumentProps> {
15066
15131
  }
15067
15132
 
15068
- declare class LikeC4DocumentSymbolProvider implements DocumentSymbolProvider {
15069
- private services;
15070
- protected readonly nodeKindProvider: NodeKindProvider$1;
15071
- constructor(services: LikeC4Services);
15072
- getSymbols({ parseResult: { value: { specifications, models, views, likec4lib } } }: LikeC4LangiumDocument): MaybePromise<DocumentSymbol[]>;
15073
- protected getLikec4LibSymbol(astLib: LikeC4Lib): DocumentSymbol[];
15074
- protected getSpecSymbol(astSpec: SpecificationRule): DocumentSymbol[];
15075
- protected getModelSymbol(astModel: Model): DocumentSymbol[];
15076
- protected getElementsSymbol(el: Element | Relation | ExtendElement): DocumentSymbol[];
15077
- protected getExtendElementSymbol(astElement: ExtendElement): DocumentSymbol[];
15078
- protected getElementSymbol(astElement: Element): DocumentSymbol[];
15079
- protected getModelViewsSymbol(astViews: ModelViews): DocumentSymbol[];
15080
- protected getKindSymbol(astKind: SpecificationElementKind | SpecificationRelationshipKind): DocumentSymbol | null;
15081
- protected getTagSymbol(astTag: SpecificationTag): DocumentSymbol | null;
15082
- protected getLibIconSymbol(astTag: LibIcon): DocumentSymbol | null;
15083
- protected getViewSymbol(astView: LikeC4View): DocumentSymbol[];
15084
- protected symbolKind(node: AstNode): SymbolKind;
15085
- }
15086
-
15087
- declare class LikeC4HoverProvider extends AstNodeHoverProvider {
15088
- private parser;
15089
- private locator;
15090
- constructor(services: LikeC4Services);
15091
- protected getAstNodeHoverContent(node: AstNode): MaybePromise<Hover | undefined>;
15092
- }
15093
-
15094
- declare class LikeC4SemanticTokenProvider extends AbstractSemanticTokenProvider {
15095
- protected highlightElement(node: AstNode, acceptor: SemanticTokenAcceptor): void | undefined | 'prune';
15096
- private highlightNameAndKind;
15097
- private highlightView;
15098
- }
15099
-
15100
15133
  declare class LikeC4NameProvider extends DefaultNameProvider {
15101
15134
  protected services: LikeC4Services;
15102
15135
  constructor(services: LikeC4Services);
@@ -15557,6 +15590,45 @@ declare class LikeC4ModelParser {
15557
15590
  forDocument(doc: LangiumDocument): DocumentParser;
15558
15591
  }
15559
15592
 
15593
+ declare class LikeC4DocumentSymbolProvider implements DocumentSymbolProvider {
15594
+ private services;
15595
+ protected readonly nodeKindProvider: NodeKindProvider$1;
15596
+ protected readonly nameProvider: LikeC4NameProvider;
15597
+ protected readonly parser: LikeC4ModelParser;
15598
+ protected readonly locator: LikeC4ModelLocator;
15599
+ constructor(services: LikeC4Services);
15600
+ getSymbols({ parseResult: { value: { specifications, models, deployments, views, likec4lib }, }, }: LikeC4LangiumDocument): MaybePromise<DocumentSymbol[]>;
15601
+ protected getLikec4LibSymbol(astLib: LikeC4Lib): DocumentSymbol[];
15602
+ protected getSpecSymbol(astSpec: SpecificationRule): DocumentSymbol[];
15603
+ protected getModelSymbol(astModel: Model): DocumentSymbol[];
15604
+ protected getDeploymentModelSymbol(astModel: ModelDeployments): DocumentSymbol[];
15605
+ protected getElementsSymbol(el: Element | Relation | ExtendElement): DocumentSymbol[];
15606
+ protected getExtendElementSymbol(astElement: ExtendElement): DocumentSymbol[];
15607
+ protected getElementSymbol(astElement: Element): DocumentSymbol[];
15608
+ protected getModelViewsSymbol(astViews: ModelViews): DocumentSymbol[];
15609
+ protected getKindSymbol(astKind: SpecificationElementKind | SpecificationRelationshipKind): DocumentSymbol | null;
15610
+ protected getTagSymbol(astTag: SpecificationTag): DocumentSymbol | null;
15611
+ protected getLibIconSymbol(astTag: LibIcon): DocumentSymbol | null;
15612
+ protected getViewSymbol(astView: LikeC4View): DocumentSymbol[];
15613
+ protected getDeploymentElementSymbol(el: DeploymentElement | DeploymentRelation): DocumentSymbol[];
15614
+ protected getDeploymentNodeSymbol(astElement: DeploymentNode): DocumentSymbol[];
15615
+ protected getDeployedInstanceSymbol(astElement: DeployedInstance): DocumentSymbol[];
15616
+ protected symbolKind(node: AstNode): SymbolKind;
15617
+ }
15618
+
15619
+ declare class LikeC4HoverProvider extends AstNodeHoverProvider {
15620
+ private parser;
15621
+ private locator;
15622
+ constructor(services: LikeC4Services);
15623
+ protected getAstNodeHoverContent(node: AstNode): MaybePromise<Hover | undefined>;
15624
+ }
15625
+
15626
+ declare class LikeC4SemanticTokenProvider extends AbstractSemanticTokenProvider {
15627
+ protected highlightElement(node: AstNode, acceptor: SemanticTokenAcceptor): void | undefined | 'prune';
15628
+ private highlightNameAndKind;
15629
+ private highlightView;
15630
+ }
15631
+
15560
15632
  interface ChangeViewRequestParams {
15561
15633
  viewId: ViewId;
15562
15634
  change: ViewChange;
@@ -15612,6 +15684,29 @@ declare class LikeC4WorkspaceManager extends DefaultWorkspaceManager {
15612
15684
  declare class WorkspaceSymbolProvider extends DefaultWorkspaceSymbolProvider {
15613
15685
  }
15614
15686
 
15687
+ type GraphvizOut = {
15688
+ dot: string;
15689
+ diagram: DiagramView;
15690
+ };
15691
+ type GraphvizSvgOut = {
15692
+ id: ViewId;
15693
+ dot: string;
15694
+ svg: string;
15695
+ };
15696
+ declare class LikeC4Views {
15697
+ private services;
15698
+ private cache;
15699
+ private viewsWithReportedErrors;
15700
+ constructor(services: LikeC4Services);
15701
+ private get layouter();
15702
+ computedViews(cancelToken?: CancellationToken): Promise<ComputedView[]>;
15703
+ layoutAllViews(cancelToken?: CancellationToken): Promise<Array<Readonly<GraphvizOut>>>;
15704
+ layoutView(viewId: ViewId, cancelToken?: CancellationToken): Promise<GraphvizOut | null>;
15705
+ diagrams(): Promise<Array<DiagramView>>;
15706
+ viewsAsGraphvizOut(): Promise<Array<GraphvizSvgOut>>;
15707
+ overviewGraph(): Promise<OverviewGraph>;
15708
+ }
15709
+
15615
15710
  interface LikeC4AddedSharedServices {
15616
15711
  lsp: {
15617
15712
  NodeKindProvider: NodeKindProvider;
@@ -15626,10 +15721,15 @@ type LikeC4SharedServices = LangiumSharedServices & LikeC4AddedSharedServices;
15626
15721
  * Declaration of custom services - add your own service classes here.
15627
15722
  */
15628
15723
  interface LikeC4AddedServices {
15724
+ documentation: {
15725
+ DocumentationProvider: LikeC4DocumentationProvider;
15726
+ };
15629
15727
  WorkspaceCache: WorkspaceCache<string, any>;
15630
15728
  DocumentCache: DocumentCache<string, any>;
15631
15729
  Rpc: Rpc;
15632
15730
  likec4: {
15731
+ Views: LikeC4Views;
15732
+ Layouter: GraphvizLayouter;
15633
15733
  DeploymentsIndex: DeploymentsIndex;
15634
15734
  FqnIndex: FqnIndex;
15635
15735
  ModelParser: LikeC4ModelParser;
@@ -15655,64 +15755,6 @@ interface LikeC4AddedServices {
15655
15755
  }
15656
15756
  type LikeC4Services = LangiumServices & LikeC4AddedServices;
15657
15757
 
15658
- /**
15659
- * @hidden
15660
- */
15661
- type $keywords<T extends string> = {
15662
- [key in T]: key;
15663
- };
15664
-
15665
- declare module 'ts-graphviz' {
15666
- namespace ClusterSubgraphAttributeKey {
15667
- interface $values extends $keywords<'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_level' | 'likec4_depth'> {
15668
- }
15669
- }
15670
- namespace NodeAttributeKey {
15671
- interface $values extends $keywords<'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_level'> {
15672
- }
15673
- }
15674
- namespace EdgeAttributeKey {
15675
- interface $values extends $keywords<'likec4_id'> {
15676
- }
15677
- }
15678
- namespace Attribute {
15679
- interface $keys extends $keywords<'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_level' | 'likec4_depth'> {
15680
- }
15681
- interface $types {
15682
- likec4_type: 'folder' | 'file' | 'view';
15683
- likec4_path: string;
15684
- likec4_id: string;
15685
- likec4_level: number;
15686
- likec4_depth: number;
15687
- }
15688
- }
15689
- }
15690
- type DotSource = Tagged<string, 'DotSource'>;
15691
-
15692
- interface GraphvizPort {
15693
- unflatten(dot: DotSource): Promise<DotSource>;
15694
- acyclic(dot: DotSource): Promise<DotSource>;
15695
- layoutJson(dot: DotSource): Promise<string>;
15696
- svg(dot: DotSource): Promise<string>;
15697
- }
15698
- type LayoutResult = {
15699
- dot: DotSource;
15700
- diagram: DiagramView;
15701
- };
15702
- declare class GraphvizLayouter {
15703
- private graphviz;
15704
- constructor(graphviz: GraphvizPort);
15705
- get port(): GraphvizPort;
15706
- changePort(graphviz: GraphvizPort): void;
15707
- layout(view: ComputedView): Promise<LayoutResult>;
15708
- svg(view: ComputedView): Promise<{
15709
- svg: string;
15710
- dot: DotSource;
15711
- }>;
15712
- dot(computedView: ComputedView): Promise<DotSource>;
15713
- layoutOverviewGraph(views: ComputedView[]): Promise<OverviewGraph>;
15714
- }
15715
-
15716
15758
  // This definition file follows a somewhat unusual format. ESTree allows
15717
15759
  // runtime type checks based on the `type` parameter. In order to explain this
15718
15760
  // to typescript we want to use discriminated union types:
@@ -16327,50 +16369,6 @@ type Logger = {
16327
16369
  error(err: unknown): void;
16328
16370
  };
16329
16371
 
16330
- declare class CliWorkspace {
16331
- private services;
16332
- private isInitialized;
16333
- constructor(services: CliServices);
16334
- initWorkspace(workspace: WorkspaceFolder): Promise<void>;
16335
- init(): Promise<void>;
16336
- }
16337
-
16338
- type CliAddedServices = {
16339
- logger: Logger;
16340
- likec4: {
16341
- Layouter: GraphvizLayouter;
16342
- Views: Views;
16343
- };
16344
- cli: {
16345
- Workspace: CliWorkspace;
16346
- };
16347
- };
16348
- type CliServices = LikeC4Services & CliAddedServices;
16349
-
16350
- type GraphvizOut = {
16351
- dot: string;
16352
- diagram: DiagramView;
16353
- };
16354
- type GraphvizSvgOut = {
16355
- id: ViewId;
16356
- dot: string;
16357
- svg: string;
16358
- };
16359
- declare class Views {
16360
- private services;
16361
- private cache;
16362
- private layouter;
16363
- private previousAction;
16364
- private limit;
16365
- constructor(services: CliServices);
16366
- private inflightRequest;
16367
- computedViews(): Promise<ComputedView[]>;
16368
- layoutViews(): Promise<Array<Readonly<GraphvizOut>>>;
16369
- diagrams(): Promise<Array<DiagramView>>;
16370
- viewsAsGraphvizOut(): Promise<Array<GraphvizSvgOut>>;
16371
- overviewGraph(): Promise<OverviewGraph>;
16372
- }
16373
-
16374
16372
  type LikeC4Options = {
16375
16373
  /**
16376
16374
  * By default, if LikeC4 model is invalid, errors are printed to the console.
@@ -16415,7 +16413,7 @@ declare class LikeC4 {
16415
16413
  private modelLayoutedRef;
16416
16414
  private logger;
16417
16415
  private constructor();
16418
- get viewsService(): Views;
16416
+ get viewsService(): LikeC4Views;
16419
16417
  private get LangiumDocuments();
16420
16418
  /**
16421
16419
  * Diagram is a computed view, layouted using Graphviz
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export{L as LikeC4}from"./shared/likec4.CbSUX9bc.mjs";export{M as LikeC4DeploymentModel,j as LikeC4Model,P as LikeC4ViewModel}from"./shared/likec4.LktBLTET.mjs";import"node:fs";import"node:path";import"node:url";import"tty";import"node:util";import"util";import"path";import"os";import"crypto";import"net";import"url";import"fs";import"child_process";import"node:fs/promises";import"node:process";import"node:tty";import"buffer";import"@hpcc-js/wasm-graphviz";import"node:child_process";import"node:string_decoder";import"node:timers/promises";import"node:os";import"node:events";import"node:v8";import"node:stream";import"node:buffer";import"node:stream/promises";import"vite";
1
+ export{L as LikeC4}from"./shared/likec4.CLgnaOeL.mjs";export{M as LikeC4DeploymentModel,j as LikeC4Model,P as LikeC4ViewModel}from"./shared/likec4.1r1CQuHw.mjs";import"node:fs";import"node:path";import"node:url";import"tty";import"node:util";import"util";import"path";import"os";import"crypto";import"net";import"url";import"fs";import"child_process";import"node:fs/promises";import"node:process";import"node:tty";import"@hpcc-js/wasm-graphviz";import"buffer";import"node:child_process";import"node:string_decoder";import"node:timers/promises";import"node:os";import"node:events";import"node:v8";import"node:stream";import"node:buffer";import"node:stream/promises";import"vite";