@dbml/parse 11.0.0-alpha.6 → 11.0.1-alpha.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.
Files changed (51) hide show
  1. package/LICENSE +0 -0
  2. package/dist/dbml-parse.js +32 -38
  3. package/dist/dbml-parse.mjs +5089 -6134
  4. package/dist/src/compiler/index.d.ts +14 -30
  5. package/dist/src/compiler/projectLayout/layout.d.ts +7 -0
  6. package/dist/src/compiler/queries/transform/index.d.ts +2 -2
  7. package/dist/src/compiler/queries/transform/types.d.ts +1 -10
  8. package/dist/src/compiler/queries/transform/updateElementMetadata.d.ts +13 -0
  9. package/dist/src/compiler/queries/utils.d.ts +13 -11
  10. package/dist/src/core/global_modules/index.d.ts +1 -2
  11. package/dist/src/core/global_modules/metadata/interpret.d.ts +2 -2
  12. package/dist/src/core/global_modules/metadata/registries.d.ts +19 -0
  13. package/dist/src/core/global_modules/metadata/utils.d.ts +19 -14
  14. package/dist/src/core/global_modules/note/interpret.d.ts +1 -3
  15. package/dist/src/core/global_modules/program/bind.d.ts +0 -1
  16. package/dist/src/core/global_modules/program/interpret.d.ts +0 -2
  17. package/dist/src/core/global_modules/records/utils/data/values.d.ts +1 -2
  18. package/dist/src/core/global_modules/table/interpret.d.ts +1 -4
  19. package/dist/src/core/global_modules/tableGroup/interpret.d.ts +1 -3
  20. package/dist/src/core/lexer/lexer.d.ts +1 -6
  21. package/dist/src/core/local_modules/dep/validate.d.ts +1 -4
  22. package/dist/src/core/local_modules/index.d.ts +0 -1
  23. package/dist/src/core/local_modules/note/validate.d.ts +0 -2
  24. package/dist/src/core/local_modules/table/validate.d.ts +1 -7
  25. package/dist/src/core/local_modules/tableGroup/validate.d.ts +1 -5
  26. package/dist/src/core/parser/parser.d.ts +1 -5
  27. package/dist/src/core/types/errors.d.ts +5 -16
  28. package/dist/src/core/types/filepath.d.ts +3 -1
  29. package/dist/src/core/types/nodes.d.ts +0 -1
  30. package/dist/src/core/types/schemaJson/types.d.ts +8 -47
  31. package/dist/src/core/types/symbol/metadata.d.ts +1 -13
  32. package/dist/src/core/types/symbol/symbols.d.ts +0 -9
  33. package/dist/src/core/types/tokens.d.ts +0 -1
  34. package/dist/src/core/utils/expression.d.ts +2 -0
  35. package/dist/src/core/utils/interpret.d.ts +15 -4
  36. package/dist/src/core/utils/validate.d.ts +0 -1
  37. package/dist/src/index.d.ts +6 -13
  38. package/dist/src/services/definition/provider.d.ts +1 -0
  39. package/dist/src/services/suggestions/provider.d.ts +2 -0
  40. package/dist/src/services/suggestions/use.d.ts +4 -1
  41. package/package.json +3 -3
  42. package/dist/src/compiler/queries/files/fileKind.d.ts +0 -12
  43. package/dist/src/compiler/queries/transform/renameElement.d.ts +0 -8
  44. package/dist/src/compiler/queries/transform/utils/arch.d.ts +0 -17
  45. package/dist/src/core/arch/icons.d.ts +0 -6
  46. package/dist/src/core/arch/read.d.ts +0 -59
  47. package/dist/src/core/arch/vocabulary.d.ts +0 -10
  48. package/dist/src/core/global_modules/arch/index.d.ts +0 -2
  49. package/dist/src/core/global_modules/arch/interpret.d.ts +0 -9
  50. package/dist/src/core/global_modules/arch/utils.d.ts +0 -5
  51. package/dist/src/core/local_modules/arch/index.d.ts +0 -2
@@ -2,7 +2,13 @@ import { NONE_COLOR } from '../../../constants';
2
2
  import { Filepath } from '../filepath';
3
3
  import { Position } from '../position';
4
4
  import { RelationshipOp, RelationCardinality } from '../relation';
5
- export type CustomMetadata = Record<string, string>;
5
+ export type CustomMetadataValueType = 'string' | 'number' | 'bool' | 'color';
6
+ export interface CustomMetadataValue {
7
+ value: string | number | boolean;
8
+ type: CustomMetadataValueType;
9
+ token: TokenPosition;
10
+ }
11
+ export type CustomMetadata = Record<string, CustomMetadataValue>;
6
12
  export type Color = `#${string}` | typeof NONE_COLOR;
7
13
  export declare enum AliasKind {
8
14
  Table = "table"
@@ -27,8 +33,6 @@ export interface DatabaseExternals {
27
33
  tableGroups: ElementRef[];
28
34
  tablePartials: ElementRef[];
29
35
  notes: ElementRef[];
30
- nodes?: ElementRef[];
31
- groups?: ElementRef[];
32
36
  }
33
37
  /**
34
38
  * FilterConfig is a tri-state filter:
@@ -72,45 +76,6 @@ export interface Database {
72
76
  externals: DatabaseExternals;
73
77
  diagramViews: DiagramView[];
74
78
  token?: TokenPosition;
75
- nodes?: Node[];
76
- groups?: Group[];
77
- links?: Link[];
78
- frontMatter?: Record<string, string>;
79
- diagramType?: 'arch';
80
- }
81
- export type ArchSettingValue = string | number | boolean;
82
- export type ArchSettings = Record<string, ArchSettingValue>;
83
- export interface Node {
84
- name: string;
85
- alias: string | null;
86
- role: string;
87
- type: string | null;
88
- image: string | null;
89
- settings: ArchSettings;
90
- note: {
91
- value: string;
92
- token: TokenPosition;
93
- } | null;
94
- token: TokenPosition;
95
- }
96
- export interface Group {
97
- name: string;
98
- alias: string | null;
99
- children: string[];
100
- settings: ArchSettings;
101
- note: {
102
- value: string;
103
- token: TokenPosition;
104
- } | null;
105
- token: TokenPosition;
106
- }
107
- export type LinkOp = '>' | '<' | '<>' | '-';
108
- export interface Link {
109
- from: string;
110
- to: string;
111
- op: LinkOp;
112
- settings: ArchSettings;
113
- token: TokenPosition;
114
79
  }
115
80
  export interface MasterDatabase {
116
81
  files: Record<string, Database>;
@@ -320,10 +285,6 @@ export interface TableRecord {
320
285
  example?: boolean;
321
286
  token: TokenPosition;
322
287
  }
323
- export type MetadataValues = Record<string, {
324
- value: string;
325
- token: TokenPosition;
326
- }>;
327
288
  export type Project = Record<string, never> | {
328
289
  name: string | null;
329
290
  tables: Table[];
@@ -338,4 +299,4 @@ export type Project = Record<string, never> | {
338
299
  token: TokenPosition;
339
300
  [index: string & Omit<any, 'name' | 'tables' | 'refs' | 'enums' | 'tableGroups' | 'note' | 'tablePartials' | 'records'>]: string;
340
301
  };
341
- export type SchemaElement = Database | Project | Table | Note | Column | ColumnType | Index | Check | InlineRef | InlineDep | Ref | RefEndpoint | Dep | DepEdge | DepEndpoint | Enum | EnumField | TableGroup | TableGroupField | Alias | TablePartial | TablePartialInjection | TableRecord | RecordValue | MetadataValues | Node | Group | Link | ArchSettings;
302
+ export type SchemaElement = Database | Project | Table | Note | Column | ColumnType | Index | Check | InlineRef | InlineDep | Ref | RefEndpoint | Dep | DepEdge | DepEndpoint | Enum | EnumField | TableGroup | TableGroupField | Alias | TablePartial | TablePartialInjection | TableRecord | RecordValue | CustomMetadata;
@@ -12,8 +12,7 @@ export declare enum MetadataKind {
12
12
  Indexes = "indexes",
13
13
  Records = "records",
14
14
  Project = "project",
15
- MetadataElement = "metadata element",
16
- Link = "link"
15
+ MetadataElement = "metadata element"
17
16
  }
18
17
  declare const __nodeMetadataBrand: unique symbol;
19
18
  export type NodeMetadataId = number & {
@@ -116,17 +115,6 @@ export declare class MetadataElementMetadata extends NodeMetadata {
116
115
  target(compiler: Compiler): NodeSymbol | undefined;
117
116
  owners(compiler: Compiler): NodeSymbol[];
118
117
  }
119
- export declare class LinkMetadata extends NodeMetadata {
120
- declaration: ElementDeclarationNode | AttributeNode;
121
- readonly kind = MetadataKind.Link;
122
- constructor(declaration: ElementDeclarationNode | AttributeNode);
123
- op(): string | undefined;
124
- endpoints(compiler: Compiler): [NodeSymbol | undefined, NodeSymbol | undefined];
125
- owners(compiler: Compiler): NodeSymbol[];
126
- }
127
- export declare class ArchMetadataElementMetadata extends MetadataElementMetadata {
128
- target(compiler: Compiler): NodeSymbol | undefined;
129
- }
130
118
  export declare class ProjectMetadata extends NodeMetadata {
131
119
  readonly kind = MetadataKind.Project;
132
120
  constructor(declaration: SyntaxNode);
@@ -25,7 +25,6 @@ export declare enum SymbolKind {
25
25
  DiagramViewNote = "DiagramView note",
26
26
  DiagramViewSchema = "DiagramView schema",
27
27
  Metadata = "Metadata",
28
- Element = "Element",
29
28
  Program = "Program"
30
29
  }
31
30
  export declare const ImportKind: {
@@ -204,14 +203,6 @@ export declare class TableGroupFieldSymbol extends NodeSymbol {
204
203
  get canBeImported(): boolean;
205
204
  get originalSymbol(): NodeSymbol;
206
205
  }
207
- export declare class ElementSymbol extends NodeSymbol {
208
- constructor({ declaration, name, }: {
209
- declaration?: SyntaxNode;
210
- name?: string;
211
- }, id: NodeSymbolId, filepath: Filepath);
212
- get canBeImported(): boolean;
213
- get originalSymbol(): NodeSymbol;
214
- }
215
206
  export declare class NoteSymbol extends NodeSymbol {
216
207
  constructor({ declaration, name, }: {
217
208
  declaration?: SyntaxNode;
@@ -25,7 +25,6 @@ export declare enum SyntaxTokenKind {
25
25
  COLON = "<colon>",
26
26
  SINGLE_LINE_COMMENT = "<single-line-comment>",
27
27
  MULTILINE_COMMENT = "<multiline-comment>",
28
- FRONT_MATTER = "<front-matter>",
29
28
  WILDCARD = "<wildcard>"
30
29
  }
31
30
  export declare function isTriviaToken(token: SyntaxToken): boolean;
@@ -23,6 +23,8 @@ export declare function destructureIndexNode(node?: SyntaxNode): {
23
23
  } | undefined;
24
24
  export declare function extractQuotedStringToken(value?: SyntaxNode): string | undefined;
25
25
  export declare function extractNumericLiteral(node?: SyntaxNode): number | null;
26
+ export declare function extractSignedNumber(node: SyntaxNode): number | null;
27
+ export declare function extractBooleanLiteral(node?: SyntaxNode): boolean | null;
26
28
  export declare function destructureCallExpression(node?: SyntaxNode): {
27
29
  variables: (PrimaryExpressionNode & {
28
30
  expression: VariableNode;
@@ -1,15 +1,18 @@
1
1
  import { default as Compiler } from '../../compiler';
2
- import { Color, ColumnType, CustomMetadata, TokenPosition } from '../types/schemaJson';
2
+ import { Color, ColumnType, CustomMetadata, CustomMetadataValue, TokenPosition } from '../types/schemaJson';
3
3
  import { SyntaxNode } from '../types/nodes';
4
4
  import { default as Report } from '../types/report';
5
5
  import { Settings } from './validate';
6
6
  import { SettingName } from '../types';
7
+ import { MetadataFieldRegistry, MetadataTarget } from '../global_modules/metadata/utils';
7
8
  export declare function getTokenPosition(node: SyntaxNode): TokenPosition;
8
9
  export declare function normalizeNote(content: string): string;
9
10
  export declare function extractElementName(nameNode: SyntaxNode): {
10
11
  schemaName: string[];
11
12
  name: string;
12
13
  };
14
+ export declare function extractNote(node?: SyntaxNode): string | undefined;
15
+ export declare function extractHexColor(node?: SyntaxNode): Color | undefined;
13
16
  export declare function extractColor(node?: SyntaxNode): Color | undefined;
14
17
  export declare function processDefaultValue(valueNode?: SyntaxNode): {
15
18
  type: 'number' | 'string' | 'boolean' | 'expression';
@@ -17,10 +20,18 @@ export declare function processDefaultValue(valueNode?: SyntaxNode): {
17
20
  } | undefined;
18
21
  export declare function processColumnType(compiler: Compiler, typeNode: SyntaxNode): Report<ColumnType>;
19
22
  /**
20
- * Extract inline custom metadata from an aggregated setting list,
21
- * excluding keys that are natively attached to the element (headercolor and note in `table`, color in `tablegroup`, .etc).
23
+ * Extract inline custom metadata from an aggregated setting list, excluding the given recognized settings.
24
+ * Used for columns, whose recognized settings (pk, ref, note, .etc) are interpreted by the column symbol rather than field specs.
22
25
  *
23
26
  * NOTE: This is used during interpret phase, so no need to validate values, just extract them
24
27
  */
25
28
  export declare function extractCustomInlineMetadata(settingMap: Settings, builtinSettings: readonly SettingName[]): CustomMetadata;
26
- export declare function extractMetadataValue(node?: SyntaxNode): string | Color | undefined;
29
+ /**
30
+ * Interpret an element's aggregated setting list as metadata:
31
+ * - Builtin fields (headercolor and note in `table`, color in `tablegroup`, .etc) are parsed and assigned onto the element by their field spec
32
+ * - Every other key becomes free-form custom metadata on `element.metadata`
33
+ *
34
+ * Invalid values are skipped (reported at validate phase).
35
+ */
36
+ export declare function assignInlineMetadata<T extends MetadataTarget>(element: Partial<T>, settingMap: Settings, registry: MetadataFieldRegistry<T, any>): void;
37
+ export declare function extractMetadataValue(node?: SyntaxNode): Omit<CustomMetadataValue, 'token'> | undefined;
@@ -54,7 +54,6 @@ export declare function isTupleOfVariables(value?: SyntaxNode): value is TupleEx
54
54
  };
55
55
  export declare function isValidColumnType(type: SyntaxNode): boolean;
56
56
  export type Settings = Record<SettingName | string, AttributeNode[]>;
57
- export declare function isValidMetadataValue(value?: SyntaxNode): boolean;
58
57
  export declare function aggregateSettingList(settingList?: ListExpressionNode): Report<Settings>;
59
58
  export declare function isExpressionAQuotedString(value?: unknown): value is PrimaryExpressionNode & ({
60
59
  expression: VariableNode & {
@@ -8,24 +8,17 @@ export { MetadataKind } from './core/types/symbol/metadata';
8
8
  export * from './core/global_modules/records/utils';
9
9
  export * from './core/types/nodes';
10
10
  export { SyntaxToken, SyntaxTokenKind, isTriviaToken, isOp, isOpToken, } from './core/types/tokens';
11
- export { CompileError, CompileErrorCode, } from './core/types/errors';
11
+ export { CompileError, CompileErrorCode, CompileWarning, CompileInfo, } from './core/types/errors';
12
+ export type { Diagnostic, DiagnosticQuickFix } from './services/diagnostics/provider';
12
13
  export type { Position, } from './core/types';
13
- export { ScopeKind, splitQualifiedIdentifier, unescapeString, escapeString, formatRecordValue, isValidIdentifier, addDoubleQuoteIfNeeded, normalizeQualifiedName, } from './compiler/index';
14
- export { type Database, type MasterDatabase, type Table, type Note, type Column, type ColumnType, type Index, type Check, type InlineRef, type Ref, type RefEndpointPair, type RefEndpoint, type Enum, type EnumField, type TableGroup, type TableGroupField, type Alias, type AliasKind, type TablePartial, type TablePartialInjection, type RecordValue, type RecordValueType, type TableRecord, type Project, type SchemaElement, type TokenPosition, type ElementRef, type FilterConfig, type DiagramView, type CustomMetadata, type Node, type Group, type Link, type LinkOp, type ArchSettings, type ArchSettingValue, } from './core/types/schemaJson';
15
- export { type FileKind, ARCH_DIAGRAM_TYPES, isArchDiagramType } from './compiler/queries/files/fileKind';
16
- export { BUILTIN_ROLES, suggestRole, suggestIcon, type RoleSpec, } from './core/arch/vocabulary';
17
- export { ICON_ALIAS, ICON_NAMES, isIconName, resolveIcon, } from './core/arch/icons';
14
+ export { ScopeKind, splitQualifiedIdentifier, unescapeString, escapeString, formatTypedValue, type TypedValue, isValidIdentifier, addDoubleQuoteIfNeeded, normalizeQualifiedName, } from './compiler/index';
15
+ export { type Database, type MasterDatabase, type Table, type Note, type Column, type ColumnType, type Index, type Check, type InlineRef, type Ref, type RefEndpointPair, type RefEndpoint, type Enum, type EnumField, type TableGroup, type TableGroupField, type Alias, type AliasKind, type TablePartial, type TablePartialInjection, type RecordValue, type RecordValueType, type TableRecord, type Project, type SchemaElement, type TokenPosition, type ElementRef, type FilterConfig, type DiagramView, type CustomMetadata, type CustomMetadataValue, type CustomMetadataValueType, } from './core/types/schemaJson';
18
16
  export { type RelationCardinality, type RelationshipOp, getRelationshipOp, getMultiplicities, parseCardinality, makeCardinalityRequired, makeCardinalityOptional, makeRelationshipRequired, isEndpointOneSide, isEndpointManySide, isEndpointOptional, isEndpointRequired, CARDINALITY_ONE, CARDINALITY_MAYBE, CARDINALITY_SOME, CARDINALITY_MANY, } from './core/types/relation';
19
17
  export type { DiagramViewSyncOperation, DiagramViewBlock, TextEdit, } from './compiler/queries/transform';
20
- export { findDiagramViewBlocks } from './compiler/queries/transform';
18
+ export { findDiagramViewBlocks, syncElementMetadata, applyTextEdits } from './compiler/queries/transform';
21
19
  export type { DepSyncOperation, DepSyncEdge, DepEndpointRef } from './compiler/queries/transform';
22
- export type { ElementIdentifier, SchemaIdentifier, TableIdentifier, ColumnIdentifier, EnumIdentifier, EndpointRef, RefIdentifier, DepIdentifier, NoteIdentifier, TableGroupIdentifier, ArchElementIdentifier, ArchLinkIdentifier, } from './compiler/queries/transform';
20
+ export type { ElementIdentifier, SchemaIdentifier, TableIdentifier, ColumnIdentifier, EnumIdentifier, EndpointRef, RefIdentifier, DepIdentifier, NoteIdentifier, TableGroupIdentifier, } from './compiler/queries/transform';
23
21
  export { dbmlLanguageConfig, dbmlMonarchTokensProvider, } from './services/monarch';
24
22
  export * from './compiler/projectLayout/layout';
25
- export { dbmlModules } from './core/global_modules';
26
- export type { GlobalModule } from './core/global_modules/types';
27
- export type { ParserOptions } from './core/parser/parser';
28
- export type { LexerOptions } from './core/lexer/lexer';
29
- export type { DialectOptions } from './compiler/index';
30
23
  export { Compiler };
31
24
  export * from './services';
@@ -4,4 +4,5 @@ export default class DBMLDefinitionProvider implements DefinitionProvider {
4
4
  private compiler;
5
5
  constructor(compiler: Compiler);
6
6
  provideDefinition(model: TextModel, position: Position): Definition;
7
+ private resolveImportPath;
7
8
  }
@@ -20,10 +20,12 @@ export declare const TABLE_BODY_SUGGESTION_LABELS: ("indexes" | "checks" | "Note
20
20
  export declare const PROJECT_FIELD_SUGGESTION_LABELS: ("Table" | "Enum" | "TableGroup" | "TablePartial" | "Note" | "Ref" | "Dep")[];
21
21
  export interface DBMLCompletionItemProviderOptions {
22
22
  triggerCharacters?: string[];
23
+ fileListDepth?: number;
23
24
  }
24
25
  export default class DBMLCompletionItemProvider implements CompletionItemProvider {
25
26
  private compiler;
26
27
  triggerCharacters: string[];
28
+ fileListDepth: number;
27
29
  constructor(compiler: Compiler, options?: DBMLCompletionItemProviderOptions);
28
30
  provideCompletionItems(model: TextModel, position: Position): CompletionList;
29
31
  }
@@ -2,4 +2,7 @@ import { default as Compiler } from '../../compiler';
2
2
  import { Filepath } from '../../core/types/filepath';
3
3
  import { SyntaxToken } from '../../core/types/tokens';
4
4
  import { CompletionList, TextModel } from '../types';
5
- export declare function suggestUseCompletion(compiler: Compiler, filepath: Filepath, offset: number, bOcToken: SyntaxToken | undefined, model: TextModel): CompletionList | null;
5
+ export interface SuggestUseCompletionOptions {
6
+ fileListDepth?: number;
7
+ }
8
+ export declare function suggestUseCompletion(compiler: Compiler, filepath: Filepath, offset: number, bOcToken: SyntaxToken | undefined, model: TextModel, options?: SuggestUseCompletionOptions): CompletionList | null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@dbml/parse",
4
- "version": "11.0.0-alpha.6",
4
+ "version": "11.0.1-alpha.0",
5
5
  "description": "DBML parser v2",
6
6
  "author": "Holistics <dev@holistics.io>",
7
7
  "license": "Apache-2.0",
@@ -25,7 +25,7 @@
25
25
  "dist"
26
26
  ],
27
27
  "scripts": {
28
- "build": "rm -rf ./dist && tsc --noEmit && vite build",
28
+ "build": "rimraf ./dist && tsc --noEmit && vite build",
29
29
  "dev": "vite build --watch",
30
30
  "test": "vitest run",
31
31
  "test:watch": "vitest watch",
@@ -51,5 +51,5 @@
51
51
  "engines": {
52
52
  "node": ">=18"
53
53
  },
54
- "gitHead": "8d191d7fc27af2f5daab6d9074f7c3882f3541ab"
54
+ "gitHead": "af62dc01c834b6183e9557f98b4d807313c4565a"
55
55
  }
@@ -1,12 +0,0 @@
1
- import { SyntaxToken } from '../../../core/types/tokens';
2
- export type FileKind = 'dbml' | 'arch';
3
- export declare const ARCH_DIAGRAM_TYPES: Set<string>;
4
- export declare const isArchDiagramType: (type: string | null | undefined) => boolean;
5
- export interface FileScan {
6
- frontMatter: Record<string, string>;
7
- topWords: string[];
8
- }
9
- export declare function readFrontMatter(block: string): Record<string, string>;
10
- export declare function frontMatterToken(tokens: readonly SyntaxToken[]): SyntaxToken | undefined;
11
- export declare function scanTokens(tokens: readonly SyntaxToken[]): FileScan;
12
- export declare function decideFileKind(scan: FileScan): FileKind;
@@ -1,8 +0,0 @@
1
- import { Filepath } from '../../../core/types/filepath';
2
- import { default as Compiler } from '../../index';
3
- /**
4
- * With an `as` alias only the name changes. Without one, every link endpoint, group member and
5
- * metadata target in the same file that names it is renamed too.
6
- * An empty map means no change (lookup miss or name collision).
7
- */
8
- export declare function renameElement(this: Compiler, filepath: Filepath, oldHandle: string, newName: string): Map<string, string>;
@@ -1,17 +0,0 @@
1
- import { Filepath } from '../../../../core/types/filepath';
2
- import { AttributeNode, ElementDeclarationNode, ListExpressionNode } from '../../../../core/types/nodes';
3
- import { default as Compiler } from '../../../index';
4
- import { TextEdit } from '../applyTextEdits';
5
- export declare function archDeclarations(compiler: Compiler, filepath: Filepath): ElementDeclarationNode[];
6
- export declare function findArchElement(compiler: Compiler, filepath: Filepath, handle: string): ElementDeclarationNode | undefined;
7
- export type ArchLinkDefinition = {
8
- kind: 'standalone';
9
- declaration: ElementDeclarationNode;
10
- } | {
11
- kind: 'inline';
12
- element: ElementDeclarationNode;
13
- attribute: AttributeNode;
14
- op: string;
15
- };
16
- export declare function findArchLink(compiler: Compiler, filepath: Filepath, from: string, to: string): ArchLinkDefinition | undefined;
17
- export declare function removeAttributeEdit(list: ListExpressionNode, attribute: AttributeNode, source: string): TextEdit;
@@ -1,6 +0,0 @@
1
- export declare const DRAWN_ICONS: string[];
2
- export declare const BRAND_ICONS: string[];
3
- export declare const ICON_NAMES: string[];
4
- export declare const ICON_ALIAS: Record<string, string>;
5
- export declare const resolveIcon: (name: string) => string;
6
- export declare const isIconName: (name: string) => boolean;
@@ -1,59 +0,0 @@
1
- import { AttributeNode, ElementDeclarationNode, ListExpressionNode, SyntaxNode } from '../types/nodes';
2
- import { ArchSettingValue, ArchSettings } from '../types/schemaJson';
3
- export type ArchSort = 'node' | 'group' | 'kind' | 'link' | 'metadata' | 'project';
4
- export declare const declarationWord: (node: ElementDeclarationNode) => string | undefined;
5
- export declare function isTopLevel(node: SyntaxNode): node is ElementDeclarationNode;
6
- export declare function archSort(node: SyntaxNode): ArchSort | undefined;
7
- export declare const isTopLevelNote: (node: SyntaxNode) => boolean;
8
- export declare function topLevelDeclaration(node: SyntaxNode): ElementDeclarationNode | undefined;
9
- export declare function nameOf(node?: SyntaxNode): string | undefined;
10
- export declare const handleOf: (node: ElementDeclarationNode) => string | undefined;
11
- export declare function numberOf(node?: SyntaxNode): number | null;
12
- export declare function valueOf(node: SyntaxNode): ArchSettingValue | undefined;
13
- export declare const isInlineLinkKey: (key: string) => boolean;
14
- export declare function settingsOf(list?: ListExpressionNode): ArchSettings;
15
- export declare function bodyOf(node: ElementDeclarationNode): SyntaxNode[];
16
- export interface Row {
17
- callee: SyntaxNode | undefined;
18
- args: SyntaxNode[];
19
- settings: ListExpressionNode | undefined;
20
- }
21
- export declare function rowOf(node: SyntaxNode | undefined): Row | undefined;
22
- export interface Infix {
23
- left: SyntaxNode;
24
- op: string;
25
- right: SyntaxNode;
26
- }
27
- export declare function infixOf(node?: SyntaxNode): Infix | undefined;
28
- export declare function endpointNode(node: SyntaxNode): SyntaxNode;
29
- export declare const LINK_OPS: Set<string>;
30
- export interface LinkParts {
31
- row: Row | undefined;
32
- infix: Infix;
33
- }
34
- export declare function linkPartsOf(declaration: ElementDeclarationNode): LinkParts | undefined;
35
- export declare function isInlineLink(attribute: AttributeNode): boolean;
36
- export declare function inlineLinksOf(declaration: ElementDeclarationNode): AttributeNode[];
37
- export interface InlineLink {
38
- op: string;
39
- target: SyntaxNode;
40
- }
41
- export declare function inlineLinkOf(attribute: AttributeNode): InlineLink | undefined;
42
- export interface Property {
43
- key: string;
44
- value: ArchSettingValue | undefined;
45
- }
46
- export declare function propertyOf(node: SyntaxNode): Property | undefined;
47
- export declare function noteDeclarationOf(declaration: ElementDeclarationNode): ElementDeclarationNode | undefined;
48
- export declare function noteTextOf(note: ElementDeclarationNode): string;
49
- export declare const IMAGE_URL: RegExp;
50
- export declare const IMAGE_REFUSED = "A picture must be an https: URL or a data:image/ URI.";
51
- export interface BodyRead {
52
- settings: ArchSettings;
53
- problems: {
54
- code: 'bad' | 'duplicate';
55
- message: string;
56
- node: SyntaxNode;
57
- }[];
58
- }
59
- export declare function readBody(declaration: ElementDeclarationNode, settings: ArchSettings, bareWordIsAFlag: boolean): BodyRead;
@@ -1,10 +0,0 @@
1
- export type RoleCategory = 'compute' | 'data' | 'net' | 'edge' | 'people' | 'ops';
2
- export interface RoleSpec {
3
- icon: string;
4
- category: RoleCategory;
5
- }
6
- export declare const BUILTIN_ROLES: Record<string, RoleSpec>;
7
- export declare const roleName: (typed: string) => string | undefined;
8
- export declare const NO_CUSTOM_ROLE_MESSAGE = "Custom roles are not supported. Use a built-in role; `type` sets the mark (a mark name or an image URL) and `color` the colour.";
9
- export declare function suggestRole(typed: string): string;
10
- export declare function suggestIcon(typed: string): string;
@@ -1,2 +0,0 @@
1
- import { GlobalModule } from '../types';
2
- export declare const archModule: GlobalModule;
@@ -1,9 +0,0 @@
1
- import { default as Compiler } from '../../../compiler';
2
- import { Filepath } from '../../types/filepath';
3
- import { default as Report } from '../../types/report';
4
- import { ArchSettings, Group, Link, Node } from '../../types/schemaJson';
5
- import { ElementSymbol } from '../../types/symbol';
6
- import { ArchMetadataElementMetadata, LinkMetadata } from '../../types/symbol/metadata';
7
- export declare function interpretElement(compiler: Compiler, symbol: ElementSymbol, filepath: Filepath): Report<Node | Group | undefined>;
8
- export declare function interpretLink(compiler: Compiler, metadata: LinkMetadata, filepath: Filepath): Report<Link | undefined>;
9
- export declare function interpretArchMetadata(metadata: ArchMetadataElementMetadata): Report<ArchSettings>;
@@ -1,5 +0,0 @@
1
- import { default as Compiler } from '../../../compiler';
2
- import { Filepath } from '../../types/filepath';
3
- import { NodeSymbol, SymbolKind } from '../../types/symbol';
4
- export declare function lookupVisible(compiler: Compiler, filepath: Filepath, kind: SymbolKind, name: string): NodeSymbol | undefined;
5
- export declare function originalHandle(compiler: Compiler, symbol: NodeSymbol, filepath: Filepath): string | undefined;
@@ -1,2 +0,0 @@
1
- import { LocalModule } from '../types';
2
- export declare const archModule: LocalModule;