@dou-ui/code 0.0.0-stage → 0.1.0-alpha.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/LICENSE +21 -0
- package/README.md +10 -2
- package/dist/_virtual/_rolldown/runtime.js +12 -0
- package/dist/assets/default-BZBMZKf_.js.map +1 -0
- package/dist/code-diff.js +6 -0
- package/dist/code-diff.js.map +1 -0
- package/dist/code-diff.vue_vue_type_script_setup_true_lang.js +792 -0
- package/dist/code-diff.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/code-editor.js +6 -0
- package/dist/code-editor.js.map +1 -0
- package/dist/code-editor.vue_vue_type_script_setup_true_lang.js +5078 -0
- package/dist/code-editor.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/code-input.js +6 -0
- package/dist/code-input.js.map +1 -0
- package/dist/code-input.vue_vue_type_script_setup_true_lang.js +237 -0
- package/dist/code-input.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/code-keys.js +42 -0
- package/dist/code-keys.js.map +1 -0
- package/dist/code-keys.vue_vue_type_script_setup_true_lang.js +244 -0
- package/dist/code-keys.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/code-keys2.js +6 -0
- package/dist/code-keys2.js.map +1 -0
- package/dist/collaboration/index.js +255 -0
- package/dist/collaboration/index.js.map +1 -0
- package/dist/completion/match.js +55 -0
- package/dist/completion/match.js.map +1 -0
- package/dist/completion/snippet.js +71 -0
- package/dist/completion/snippet.js.map +1 -0
- package/dist/core/brackets.js +55 -0
- package/dist/core/brackets.js.map +1 -0
- package/dist/core/changes.js +185 -0
- package/dist/core/changes.js.map +1 -0
- package/dist/core/chars.js +130 -0
- package/dist/core/chars.js.map +1 -0
- package/dist/core/commands.js +910 -0
- package/dist/core/commands.js.map +1 -0
- package/dist/core/diff.js +215 -0
- package/dist/core/diff.js.map +1 -0
- package/dist/core/folding.js +87 -0
- package/dist/core/folding.js.map +1 -0
- package/dist/core/history.js +74 -0
- package/dist/core/history.js.map +1 -0
- package/dist/core/keymap.js +326 -0
- package/dist/core/keymap.js.map +1 -0
- package/dist/core/search.js +91 -0
- package/dist/core/search.js.map +1 -0
- package/dist/core/selection.js +88 -0
- package/dist/core/selection.js.map +1 -0
- package/dist/core/text.js +320 -0
- package/dist/core/text.js.map +1 -0
- package/dist/core/transaction.js +98 -0
- package/dist/core/transaction.js.map +1 -0
- package/dist/extension.js +16 -0
- package/dist/extension.js.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/language/highlighter.js +336 -0
- package/dist/language/highlighter.js.map +1 -0
- package/dist/language/language.js +138 -0
- package/dist/language/language.js.map +1 -0
- package/dist/language/stream.js +112 -0
- package/dist/language/stream.js.map +1 -0
- package/dist/language/to-html.js +36 -0
- package/dist/language/to-html.js.map +1 -0
- package/dist/language/worker-client.js +198 -0
- package/dist/language/worker-client.js.map +1 -0
- package/dist/language/worker-protocol.js +48 -0
- package/dist/language/worker-protocol.js.map +1 -0
- package/dist/languages/css.js +128 -0
- package/dist/languages/css.js.map +1 -0
- package/dist/languages/html.js +175 -0
- package/dist/languages/html.js.map +1 -0
- package/dist/languages/javascript.js +300 -0
- package/dist/languages/javascript.js.map +1 -0
- package/dist/languages/json.js +45 -0
- package/dist/languages/json.js.map +1 -0
- package/dist/languages/markdown.js +82 -0
- package/dist/languages/markdown.js.map +1 -0
- package/dist/languages/python.js +88 -0
- package/dist/languages/python.js.map +1 -0
- package/dist/languages/shell.js +153 -0
- package/dist/languages/shell.js.map +1 -0
- package/dist/languages/sql.js +91 -0
- package/dist/languages/sql.js.map +1 -0
- package/dist/languages/yaml.js +85 -0
- package/dist/languages/yaml.js.map +1 -0
- package/dist/locale.js +158 -0
- package/dist/locale.js.map +1 -0
- package/dist/lsp/index.js +715 -0
- package/dist/lsp/index.js.map +1 -0
- package/dist/lsp/markup.js +139 -0
- package/dist/lsp/markup.js.map +1 -0
- package/dist/render-part.js +14 -0
- package/dist/render-part.js.map +1 -0
- package/dist/shiki/index.js +140 -0
- package/dist/shiki/index.js.map +1 -0
- package/dist/style.css +1 -0
- package/dist/style.d.ts +1 -0
- package/dist/style.js +4 -0
- package/dist/types/code-diff.vue.d.ts +45 -0
- package/dist/types/code-editor.vue.d.ts +43 -0
- package/dist/types/code-input.vue.d.ts +32 -0
- package/dist/types/code-keys.d.ts +9 -0
- package/dist/types/code-keys.vue.d.ts +8 -0
- package/dist/types/collaboration/index.d.ts +36 -0
- package/dist/types/completion/match.d.ts +13 -0
- package/dist/types/completion/snippet.d.ts +17 -0
- package/dist/types/core/brackets.d.ts +15 -0
- package/dist/types/core/changes.d.ts +52 -0
- package/dist/types/core/chars.d.ts +24 -0
- package/dist/types/core/commands.d.ts +199 -0
- package/dist/types/core/diff.d.ts +52 -0
- package/dist/types/core/folding.d.ts +23 -0
- package/dist/types/core/history.d.ts +24 -0
- package/dist/types/core/keymap.d.ts +29 -0
- package/dist/types/core/search.d.ts +37 -0
- package/dist/types/core/selection.d.ts +28 -0
- package/dist/types/core/text.d.ts +79 -0
- package/dist/types/core/transaction.d.ts +65 -0
- package/dist/types/extension.d.ts +321 -0
- package/dist/types/index.d.ts +159 -0
- package/dist/types/language/highlighter.d.ts +99 -0
- package/dist/types/language/language.d.ts +100 -0
- package/dist/types/language/stream.d.ts +56 -0
- package/dist/types/language/to-html.d.ts +17 -0
- package/dist/types/language/worker-client.d.ts +52 -0
- package/dist/types/language/worker-protocol.d.ts +50 -0
- package/dist/types/languages/css.d.ts +17 -0
- package/dist/types/languages/html.d.ts +34 -0
- package/dist/types/languages/javascript.d.ts +29 -0
- package/dist/types/languages/json.d.ts +7 -0
- package/dist/types/languages/markdown.d.ts +17 -0
- package/dist/types/languages/python.d.ts +9 -0
- package/dist/types/languages/shell.d.ts +11 -0
- package/dist/types/languages/sql.d.ts +9 -0
- package/dist/types/languages/yaml.d.ts +14 -0
- package/dist/types/locale.d.ts +79 -0
- package/dist/types/lsp/index.d.ts +119 -0
- package/dist/types/lsp/markup.d.ts +14 -0
- package/dist/types/render-part.d.ts +14 -0
- package/dist/types/shiki/index.d.ts +63 -0
- package/dist/types/types.d.ts +267 -0
- package/dist/types/view/input.d.ts +12 -0
- package/dist/types/view/layout.d.ts +55 -0
- package/dist/types/view/measure.d.ts +22 -0
- package/dist/types/view/viewport.d.ts +16 -0
- package/dist/types/view/viewport.test.d.ts +1 -0
- package/dist/types/worker/default.d.ts +1 -0
- package/dist/types/worker/index.d.ts +34 -0
- package/dist/view/input.js +27 -0
- package/dist/view/input.js.map +1 -0
- package/dist/view/layout.js +194 -0
- package/dist/view/layout.js.map +1 -0
- package/dist/view/measure.js +104 -0
- package/dist/view/measure.js.map +1 -0
- package/dist/view/viewport.js +31 -0
- package/dist/view/viewport.js.map +1 -0
- package/dist/worker/default.js +20 -0
- package/dist/worker/default.js.map +1 -0
- package/dist/worker/index.js +139 -0
- package/dist/worker/index.js.map +1 -0
- package/package.json +88 -4
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The document text: an immutable, balanced tree of lines.
|
|
3
|
+
*
|
|
4
|
+
* Leaves hold up to `LEAF_MAX` lines, branches up to `BRANCH_MAX` children,
|
|
5
|
+
* and every node knows its length and line count, so finding a line by
|
|
6
|
+
* number or by offset walks one path from the root: O(log n). An edit copies
|
|
7
|
+
* only that path and shares everything else with the old text, so keeping
|
|
8
|
+
* old versions around (undo, a `v-model:doc` snapshot) costs next to
|
|
9
|
+
* nothing.
|
|
10
|
+
*
|
|
11
|
+
* Offsets count UTF-16 code units, like the browser and language servers.
|
|
12
|
+
* Lines are numbered from 1 and are joined by one `\n`; a `\r\n` or a lone
|
|
13
|
+
* `\r` in the input becomes `\n`.
|
|
14
|
+
*/
|
|
15
|
+
/** One line of the text. */
|
|
16
|
+
export interface CodeLine {
|
|
17
|
+
/** The line number, from 1. */
|
|
18
|
+
readonly number: number;
|
|
19
|
+
/** Offset of the line's first character. */
|
|
20
|
+
readonly from: number;
|
|
21
|
+
/** Offset just after the line's last character, before its line break. */
|
|
22
|
+
readonly to: number;
|
|
23
|
+
/** The line's text, without the line break. */
|
|
24
|
+
readonly text: string;
|
|
25
|
+
}
|
|
26
|
+
type Node = Leaf | Branch;
|
|
27
|
+
declare class Leaf {
|
|
28
|
+
readonly text: readonly string[];
|
|
29
|
+
readonly length: number;
|
|
30
|
+
/** The longest line, in code units. */
|
|
31
|
+
readonly widest: number;
|
|
32
|
+
constructor(text: readonly string[]);
|
|
33
|
+
get lines(): number;
|
|
34
|
+
}
|
|
35
|
+
declare class Branch {
|
|
36
|
+
readonly children: readonly Node[];
|
|
37
|
+
readonly length: number;
|
|
38
|
+
readonly lines: number;
|
|
39
|
+
readonly widest: number;
|
|
40
|
+
constructor(children: readonly Node[]);
|
|
41
|
+
}
|
|
42
|
+
/** Splits text into lines, reading `\r\n` and a lone `\r` as line breaks too. */
|
|
43
|
+
export declare function splitLines(text: string): string[];
|
|
44
|
+
/** Where a text keeps its tree; a symbol rather than a private field, so a `ref` around a text keeps its type. */
|
|
45
|
+
declare const NODE: unique symbol;
|
|
46
|
+
export declare class CodeText {
|
|
47
|
+
/** @internal */
|
|
48
|
+
readonly [NODE]: Node;
|
|
49
|
+
private constructor();
|
|
50
|
+
/** The text of a string. */
|
|
51
|
+
static of(text: string | readonly string[]): CodeText;
|
|
52
|
+
/** An empty text: one empty line. */
|
|
53
|
+
static readonly empty: CodeText;
|
|
54
|
+
/** Length in UTF-16 code units, counting one per line break. */
|
|
55
|
+
get length(): number;
|
|
56
|
+
/** The number of lines, at least 1. */
|
|
57
|
+
get lines(): number;
|
|
58
|
+
/** The length of the longest line, in code units. */
|
|
59
|
+
get widest(): number;
|
|
60
|
+
/** Line `n`, counting from 1. */
|
|
61
|
+
line(n: number): CodeLine;
|
|
62
|
+
/** The text of line `n` (from 1); quicker than `line(n).text`, which also finds where it starts. */
|
|
63
|
+
lineText(n: number): string;
|
|
64
|
+
/** The line that holds offset `pos`; a line break belongs to the line before it. */
|
|
65
|
+
lineAt(pos: number): CodeLine;
|
|
66
|
+
/** The text of lines `from`–`to`, both counted from 1 and included. */
|
|
67
|
+
lineTexts(from: number, to?: number): string[];
|
|
68
|
+
/** The text between two offsets. */
|
|
69
|
+
slice(from?: number, to?: number): string;
|
|
70
|
+
/** A new text with `from`–`to` replaced by `insert`; this one stays as it is. */
|
|
71
|
+
replace(from: number, to: number, insert: string | readonly string[]): CodeText;
|
|
72
|
+
/** Every line, from 1 to the end. */
|
|
73
|
+
toLines(): string[];
|
|
74
|
+
/** The whole text, with `\n` between lines. */
|
|
75
|
+
toString(): string;
|
|
76
|
+
/** Whether two texts hold the same characters. */
|
|
77
|
+
eq(other: CodeText): boolean;
|
|
78
|
+
}
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ChangeSet } from './changes';
|
|
2
|
+
import { type CodeRange, type CodeSelection } from './selection';
|
|
3
|
+
import type { CodeText } from './text';
|
|
4
|
+
/** Where a transaction came from. Undo groups typing and deleting by it. */
|
|
5
|
+
export type CodeAction = 'input' | 'delete' | 'paste' | 'cut' | 'drop' | 'indent' | 'select' | 'undo' | 'redo' | 'external'
|
|
6
|
+
/** Someone else's change, from editing together. */
|
|
7
|
+
| 'remote' | (string & {});
|
|
8
|
+
export interface CodeTransactionMeta {
|
|
9
|
+
/**
|
|
10
|
+
* What made the change, e.g. `'input'` for typing, `'external'` for a new
|
|
11
|
+
* `v-model` value, `'remote'` for someone else's.
|
|
12
|
+
*/
|
|
13
|
+
action?: CodeAction;
|
|
14
|
+
/** `false` keeps the change out of undo. */
|
|
15
|
+
history?: boolean;
|
|
16
|
+
/** Scroll the main cursor into view afterwards; on by default for edits. */
|
|
17
|
+
scroll?: boolean;
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
/** The editor's content: the text and what is selected in it. */
|
|
21
|
+
export interface CodeState {
|
|
22
|
+
readonly doc: CodeText;
|
|
23
|
+
readonly selection: CodeSelection;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* One step from a state to the next. Every position given to it is in the
|
|
27
|
+
* text as it was when the transaction started, also after earlier calls in
|
|
28
|
+
* the same transaction; changes may not overlap.
|
|
29
|
+
*
|
|
30
|
+
* Without `select()`, the selection moves along with the changes.
|
|
31
|
+
*/
|
|
32
|
+
export declare class CodeTransaction {
|
|
33
|
+
readonly start: CodeState;
|
|
34
|
+
private specs;
|
|
35
|
+
private nextSelection;
|
|
36
|
+
readonly meta: CodeTransactionMeta;
|
|
37
|
+
constructor(start: CodeState);
|
|
38
|
+
get doc(): CodeText;
|
|
39
|
+
get selection(): CodeSelection;
|
|
40
|
+
/** Replaces `from`–`to` with `insert`. */
|
|
41
|
+
replace(from: number, to: number, insert: string): this;
|
|
42
|
+
insert(pos: number, text: string): this;
|
|
43
|
+
delete(from: number, to: number): this;
|
|
44
|
+
/** Sets the selection after the step, in the text after the step. */
|
|
45
|
+
select(selection: CodeSelection | number, head?: number): this;
|
|
46
|
+
/**
|
|
47
|
+
* Replaces every selected range with `text` (or what `text` returns for
|
|
48
|
+
* it) and leaves a cursor after each insertion.
|
|
49
|
+
*/
|
|
50
|
+
replaceSelection(text: string | ((range: CodeRange, index: number) => string)): this;
|
|
51
|
+
setMeta(meta: CodeTransactionMeta): this;
|
|
52
|
+
/** Whether the transaction changes the text. */
|
|
53
|
+
get docChanged(): boolean;
|
|
54
|
+
/** The changes, the new state, and the selection before. */
|
|
55
|
+
resolve(): CodeTransactionResult;
|
|
56
|
+
}
|
|
57
|
+
/** What a transaction did, as handed to `change` listeners. */
|
|
58
|
+
export interface CodeTransactionResult {
|
|
59
|
+
readonly changes: ChangeSet;
|
|
60
|
+
readonly state: CodeState;
|
|
61
|
+
readonly before: CodeState;
|
|
62
|
+
readonly meta: CodeTransactionMeta;
|
|
63
|
+
/** Whether the text or the selection changed; when neither did, nothing was applied. */
|
|
64
|
+
readonly changed: boolean;
|
|
65
|
+
}
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import type { CodeMessages } from './locale';
|
|
2
|
+
import { type Component, type InjectionKey, type VNodeChild } from 'vue';
|
|
3
|
+
import type { CodeKeymap } from './core/keymap';
|
|
4
|
+
import type { CodeSelection } from './core/selection';
|
|
5
|
+
import type { CodeText } from './core/text';
|
|
6
|
+
import type { CodeState, CodeTransaction, CodeTransactionResult } from './core/transaction';
|
|
7
|
+
import type { CodeEditorExpose } from './types';
|
|
8
|
+
/** How bad a diagnostic is, worst first. */
|
|
9
|
+
export type CodeDiagnosticSeverity = 'error' | 'warning' | 'info' | 'hint';
|
|
10
|
+
/** A fix offered with a diagnostic. */
|
|
11
|
+
export interface CodeDiagnosticAction {
|
|
12
|
+
label: string;
|
|
13
|
+
/** Makes the fix, usually with `context.transact`. */
|
|
14
|
+
run: (context: CodeExtensionContext, diagnostic: CodeDiagnostic) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A problem found in the text, from `from` to `to` (offsets in the text,
|
|
18
|
+
* the same as a language service's ranges). An empty range marks the
|
|
19
|
+
* character after it.
|
|
20
|
+
*/
|
|
21
|
+
export interface CodeDiagnostic {
|
|
22
|
+
from: number;
|
|
23
|
+
to: number;
|
|
24
|
+
severity: CodeDiagnosticSeverity;
|
|
25
|
+
message: string;
|
|
26
|
+
/** Who found it, shown after the message, e.g. the name of a linter. */
|
|
27
|
+
source?: string;
|
|
28
|
+
/** Fixes, shown under the message and with `Mod` + `.`. */
|
|
29
|
+
actions?: CodeDiagnosticAction[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* How a part of the text is drawn. Marks and line classes only change how
|
|
33
|
+
* the text looks (colors, backgrounds, underlines, borders), never its
|
|
34
|
+
* size, so the cursor still lands where the characters are; an inline
|
|
35
|
+
* widget takes its own room in the line.
|
|
36
|
+
*/
|
|
37
|
+
export type CodeDecoration =
|
|
38
|
+
/**
|
|
39
|
+
* Classes on the characters from `from` to `to`. `style` sets inline
|
|
40
|
+
* styles on them as well, e.g. a CSS variable holding a person's color;
|
|
41
|
+
* where marks overlap, the later one's styles win.
|
|
42
|
+
*/
|
|
43
|
+
{
|
|
44
|
+
type: 'mark';
|
|
45
|
+
from: number;
|
|
46
|
+
to: number;
|
|
47
|
+
class: string;
|
|
48
|
+
title?: string;
|
|
49
|
+
style?: Readonly<Record<string, string>>;
|
|
50
|
+
}
|
|
51
|
+
/** A class on a whole line (`line` from 1), e.g. a tinted background. */
|
|
52
|
+
| {
|
|
53
|
+
type: 'line';
|
|
54
|
+
line: number;
|
|
55
|
+
class: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Something drawn inside a line, before the character at `pos`, such as
|
|
59
|
+
* a color swatch or a parameter's name. It isn't text: the cursor steps
|
|
60
|
+
* over it and copying leaves it out. `width` in px saves measuring it;
|
|
61
|
+
* without it the widget is measured once drawn, and the width is kept by
|
|
62
|
+
* `id`.
|
|
63
|
+
*/
|
|
64
|
+
| {
|
|
65
|
+
type: 'inline';
|
|
66
|
+
pos: number;
|
|
67
|
+
render: () => VNodeChild;
|
|
68
|
+
width?: number;
|
|
69
|
+
id?: string;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* A component drawn between lines, across the editor, e.g. a review
|
|
73
|
+
* comment. The lines below move down to make room, and it moves with the
|
|
74
|
+
* text as lines are added or removed above it.
|
|
75
|
+
*/
|
|
76
|
+
export interface CodeWidget {
|
|
77
|
+
/** Tells widgets apart, unique among one extension's; its measured height is kept by it. */
|
|
78
|
+
id: string;
|
|
79
|
+
/**
|
|
80
|
+
* Where it is: below the line of text position `pos`, or below line
|
|
81
|
+
* `line` (from 1); above with `position: 'above'`. Give one of them.
|
|
82
|
+
*/
|
|
83
|
+
pos?: number;
|
|
84
|
+
line?: number;
|
|
85
|
+
/** Defaults to `below`. */
|
|
86
|
+
position?: 'above' | 'below';
|
|
87
|
+
render: () => VNodeChild;
|
|
88
|
+
/** Its height in px before it has been drawn and measured; defaults to one line. */
|
|
89
|
+
height?: number;
|
|
90
|
+
/** What it is, read out when the cursor moves onto its line, e.g. "戴兜的评论". */
|
|
91
|
+
label?: string;
|
|
92
|
+
}
|
|
93
|
+
/** Something drawn in a column beside the line numbers, on line `line` (from 1). */
|
|
94
|
+
export interface CodeGutterMarker {
|
|
95
|
+
line: number;
|
|
96
|
+
/** Drawn in the middle of the column. */
|
|
97
|
+
icon?: Component;
|
|
98
|
+
/** Short text, when there is no icon. */
|
|
99
|
+
text?: string;
|
|
100
|
+
class?: string;
|
|
101
|
+
/** Shown on hover and read out. */
|
|
102
|
+
title?: string;
|
|
103
|
+
}
|
|
104
|
+
/** A column of the gutter, left of the line numbers. */
|
|
105
|
+
export interface CodeGutter {
|
|
106
|
+
name: string;
|
|
107
|
+
/** In px. Defaults to 16. */
|
|
108
|
+
width?: number;
|
|
109
|
+
/** The markers on the lines in view; reactive state read here updates them. */
|
|
110
|
+
markers: (context: CodeExtensionContext) => CodeGutterMarker[];
|
|
111
|
+
/** A press on the column, on line `line`, e.g. to set a breakpoint. */
|
|
112
|
+
onPress?: (line: number, event: PointerEvent, context: CodeExtensionContext) => void;
|
|
113
|
+
}
|
|
114
|
+
/** An undo history that takes the place of the editor's own, e.g. one shared with others. */
|
|
115
|
+
export interface CodeHistoryHandler {
|
|
116
|
+
/** `false` when there is nothing to undo. */
|
|
117
|
+
undo: () => boolean;
|
|
118
|
+
redo: () => boolean;
|
|
119
|
+
/** Read in templates and computed values: keep them reactive. */
|
|
120
|
+
canUndo: () => boolean;
|
|
121
|
+
canRedo: () => boolean;
|
|
122
|
+
/** The next change starts a new undo step, e.g. when the editor loses focus. */
|
|
123
|
+
close?: () => void;
|
|
124
|
+
}
|
|
125
|
+
/** A bar above or below the text, inside the editor's frame. */
|
|
126
|
+
export interface CodePanel {
|
|
127
|
+
/** Tells panels apart, unique among one extension's. */
|
|
128
|
+
name: string;
|
|
129
|
+
/** Defaults to `bottom`. */
|
|
130
|
+
position?: 'top' | 'bottom';
|
|
131
|
+
render: () => VNodeChild;
|
|
132
|
+
}
|
|
133
|
+
/** What a completion is, shown as its icon. */
|
|
134
|
+
export type CodeCompletionKind = 'keyword' | 'function' | 'method' | 'variable' | 'property' | 'constant' | 'class' | 'type' | 'module' | 'snippet' | 'text';
|
|
135
|
+
/** One entry of the completion list. */
|
|
136
|
+
export interface CodeCompletion {
|
|
137
|
+
/** Shown, and matched against what was typed. */
|
|
138
|
+
label: string;
|
|
139
|
+
kind?: CodeCompletionKind;
|
|
140
|
+
/** Short, after the label, e.g. a type. */
|
|
141
|
+
detail?: string;
|
|
142
|
+
/** Longer, below the list while this entry is picked: text, or a function returning VNodes. */
|
|
143
|
+
info?: string | (() => VNodeChild);
|
|
144
|
+
/** What goes into the text, if not the label. */
|
|
145
|
+
insert?: string;
|
|
146
|
+
/** Inserted as a snippet instead: `${1:name}` places to fill in, Tab to the next, `$0` where it ends. */
|
|
147
|
+
snippet?: string;
|
|
148
|
+
/** Moves the entry up (positive) or down among equally good matches. */
|
|
149
|
+
boost?: number;
|
|
150
|
+
}
|
|
151
|
+
/** What a completion source is asked with. */
|
|
152
|
+
export interface CodeCompletionRequest {
|
|
153
|
+
/** The cursor. */
|
|
154
|
+
pos: number;
|
|
155
|
+
/** The word right before the cursor, by the language's word characters; empty when there is none. */
|
|
156
|
+
word: {
|
|
157
|
+
from: number;
|
|
158
|
+
to: number;
|
|
159
|
+
text: string;
|
|
160
|
+
};
|
|
161
|
+
/** Asked for from the keyboard (`Ctrl` + `Space`, `Alt` + `Esc`) rather than by typing. */
|
|
162
|
+
explicit: boolean;
|
|
163
|
+
/** Aborted when the answer is no longer wanted, so a slow source can stop. */
|
|
164
|
+
signal: AbortSignal;
|
|
165
|
+
}
|
|
166
|
+
/** What a hover or signature source is asked with. */
|
|
167
|
+
export interface CodePositionRequest {
|
|
168
|
+
/** The position asked about: under the pointer, or the cursor. */
|
|
169
|
+
pos: number;
|
|
170
|
+
/** Aborted when the answer is no longer wanted, so a slow source can stop. */
|
|
171
|
+
signal: AbortSignal;
|
|
172
|
+
}
|
|
173
|
+
/** What a completion source answers: entries to put in place of `from`–cursor. */
|
|
174
|
+
export interface CodeCompletionResult {
|
|
175
|
+
from: number;
|
|
176
|
+
options: CodeCompletion[];
|
|
177
|
+
}
|
|
178
|
+
/** Text shown on hover, or with the cursor on it from the keyboard. */
|
|
179
|
+
export interface CodeHoverResult {
|
|
180
|
+
/** What it is about, `from`–`to`; defaults to the word under the pointer. */
|
|
181
|
+
from?: number;
|
|
182
|
+
to?: number;
|
|
183
|
+
/** Plain text, or a render function for anything else. */
|
|
184
|
+
content: string | (() => VNodeChild);
|
|
185
|
+
}
|
|
186
|
+
/** The parameters of the call the cursor is in. */
|
|
187
|
+
export interface CodeSignatureResult {
|
|
188
|
+
/** The whole signature, e.g. `slice(start, end)`. */
|
|
189
|
+
label: string;
|
|
190
|
+
/** Each parameter as `[from, to]` in `label`. */
|
|
191
|
+
params: Array<[number, number]>;
|
|
192
|
+
/** Which parameter the cursor is at, from 0. */
|
|
193
|
+
active: number;
|
|
194
|
+
/** Shown under the signature: text, or a function returning VNodes. */
|
|
195
|
+
info?: string | (() => VNodeChild);
|
|
196
|
+
}
|
|
197
|
+
export interface CodeExtension {
|
|
198
|
+
name: string;
|
|
199
|
+
/** Higher runs first: its keys and hooks come before others. Defaults to 100. */
|
|
200
|
+
priority?: number;
|
|
201
|
+
/** Keys tried before the built-in ones, and after the `keymap` prop. */
|
|
202
|
+
keymap?: (context: CodeExtensionContext) => CodeKeymap;
|
|
203
|
+
/**
|
|
204
|
+
* How parts of the text look, read while drawing: reactive state read
|
|
205
|
+
* here updates them. Asked for the lines in view (`context.visible`),
|
|
206
|
+
* which is all that needs them.
|
|
207
|
+
*/
|
|
208
|
+
decorations?: (context: CodeExtensionContext) => CodeDecoration[];
|
|
209
|
+
/** Columns beside the line numbers. */
|
|
210
|
+
gutters?: CodeGutter[];
|
|
211
|
+
/**
|
|
212
|
+
* Components between lines. Unlike decorations, these are asked for the
|
|
213
|
+
* whole text, since their heights place every line after them; keep
|
|
214
|
+
* them few (comments, not one per line).
|
|
215
|
+
*/
|
|
216
|
+
widgets?: (context: CodeExtensionContext) => CodeWidget[];
|
|
217
|
+
/**
|
|
218
|
+
* Lines left out of view: line numbers (from 1, not text positions), from
|
|
219
|
+
* line `from` to line `to`, both left out,
|
|
220
|
+
* e.g. the unchanged lines of a diff. Unlike a fold, nothing marks the
|
|
221
|
+
* spot; put a widget there for that. Asked for the whole text; reactive
|
|
222
|
+
* state read here updates them. Moving up and down steps over them.
|
|
223
|
+
*/
|
|
224
|
+
hide?: (context: CodeExtensionContext) => Array<{
|
|
225
|
+
from: number;
|
|
226
|
+
to: number;
|
|
227
|
+
}>;
|
|
228
|
+
/** Bars above or below the text; reactive state read here updates them. */
|
|
229
|
+
panels?: (context: CodeExtensionContext) => CodePanel[];
|
|
230
|
+
/**
|
|
231
|
+
* Finds problems in the text. Run when the editor mounts and again a
|
|
232
|
+
* moment after the text stops changing; an answer that arrives after
|
|
233
|
+
* the text changed again is dropped, and the next run follows it.
|
|
234
|
+
* Meanwhile the problems found move with the text.
|
|
235
|
+
*/
|
|
236
|
+
lint?: (context: CodeExtensionContext) => CodeDiagnostic[] | null | undefined | Promise<CodeDiagnostic[] | null | undefined>;
|
|
237
|
+
/**
|
|
238
|
+
* Offers completions while typing (after a word character or one of
|
|
239
|
+
* `completionTriggers`) and on `Ctrl` + `Space` or `Alt` + `Esc`. Answers from every
|
|
240
|
+
* extension are put in one list; a Promise is waited for, and dropped
|
|
241
|
+
* when the text has moved on.
|
|
242
|
+
*/
|
|
243
|
+
completion?: (request: CodeCompletionRequest, context: CodeExtensionContext) => CodeCompletionResult | null | undefined | Promise<CodeCompletionResult | null | undefined>;
|
|
244
|
+
/** Characters that ask for completions when typed, such as `.`. */
|
|
245
|
+
completionTriggers?: string[];
|
|
246
|
+
/**
|
|
247
|
+
* Text about a position, shown on hover and with `Mod` + `I`. A Promise
|
|
248
|
+
* is waited for; `signal` aborts when the pointer moves on.
|
|
249
|
+
*/
|
|
250
|
+
hover?: (request: CodePositionRequest, context: CodeExtensionContext) => CodeHoverResult | null | undefined | Promise<CodeHoverResult | null | undefined>;
|
|
251
|
+
/**
|
|
252
|
+
* The parameters of the call around the cursor, shown while typing its
|
|
253
|
+
* arguments. A Promise is waited for, and dropped when the cursor has
|
|
254
|
+
* moved on.
|
|
255
|
+
*/
|
|
256
|
+
signature?: (request: CodePositionRequest, context: CodeExtensionContext) => CodeSignatureResult | null | undefined | Promise<CodeSignatureResult | null | undefined>;
|
|
257
|
+
/**
|
|
258
|
+
* Sees every change before it is applied, in priority order, and may add
|
|
259
|
+
* to it (positions are in the text before the change). Undo, redo, new
|
|
260
|
+
* `v-model` values and other people's changes (`action: 'remote'`) don't
|
|
261
|
+
* come through here.
|
|
262
|
+
*/
|
|
263
|
+
transaction?: (tr: CodeTransaction, context: CodeExtensionContext) => void;
|
|
264
|
+
/**
|
|
265
|
+
* Runs after every step the editor took, with the text and selection
|
|
266
|
+
* already updated: typing, commands, undo and redo, new `v-model`
|
|
267
|
+
* values and other people's changes. `result.meta.action` tells them
|
|
268
|
+
* apart.
|
|
269
|
+
*/
|
|
270
|
+
update?: (result: CodeTransactionResult, context: CodeExtensionContext) => void;
|
|
271
|
+
/**
|
|
272
|
+
* Replaces the editor's undo history; the first extension that has one
|
|
273
|
+
* wins. Called once per list of extensions: return the same handler
|
|
274
|
+
* each time.
|
|
275
|
+
*/
|
|
276
|
+
history?: (context: CodeExtensionContext) => CodeHistoryHandler;
|
|
277
|
+
/**
|
|
278
|
+
* Buttons added to the toolbar shown over the selection on touch screens,
|
|
279
|
+
* after cut, copy, paste and select all. Read again as the selection
|
|
280
|
+
* changes.
|
|
281
|
+
*/
|
|
282
|
+
menu?: (context: CodeExtensionContext) => CodeMenuItem[];
|
|
283
|
+
/** Runs once the editor is mounted. Return a function to run when it unmounts. */
|
|
284
|
+
setup?: (context: CodeExtensionContext) => void | (() => void);
|
|
285
|
+
}
|
|
286
|
+
/** A button of the touch toolbar, from an extension's `menu`. */
|
|
287
|
+
export interface CodeMenuItem {
|
|
288
|
+
label: string;
|
|
289
|
+
run: (context: CodeExtensionContext) => void;
|
|
290
|
+
}
|
|
291
|
+
/** What an extension sees of the editor: its instance, plus a little more. */
|
|
292
|
+
export interface CodeExtensionContext extends CodeEditorExpose {
|
|
293
|
+
/** The text and selection now; reading them in `decorations` or `panels` follows every change. */
|
|
294
|
+
readonly state: CodeState;
|
|
295
|
+
readonly doc: CodeText;
|
|
296
|
+
readonly selection: CodeSelection;
|
|
297
|
+
/** The lines in view: line numbers (from 1, not text positions), both ends in view. */
|
|
298
|
+
readonly visible: {
|
|
299
|
+
readonly from: number;
|
|
300
|
+
readonly to: number;
|
|
301
|
+
};
|
|
302
|
+
/** The problems found now, by all linters and the `diagnostics` prop, in text order. */
|
|
303
|
+
readonly diagnostics: readonly CodeDiagnostic[];
|
|
304
|
+
/** Whether the editor has focus; reading it in reactive code follows it. */
|
|
305
|
+
readonly focused: boolean;
|
|
306
|
+
/** The editor's texts, in DouUI's locale or as given by the `messages` prop. */
|
|
307
|
+
readonly messages: CodeMessages;
|
|
308
|
+
/** Reads a message out to screen readers. */
|
|
309
|
+
announce: (message: string) => void;
|
|
310
|
+
/**
|
|
311
|
+
* Runs the linter of the extension named `name` again now (every linter
|
|
312
|
+
* without a name), for problems that arrive by themselves, such as ones a
|
|
313
|
+
* server pushes.
|
|
314
|
+
*/
|
|
315
|
+
relint: (name?: string) => void;
|
|
316
|
+
}
|
|
317
|
+
/** Types an extension; returns it as it is. */
|
|
318
|
+
export declare function defineCodeExtension(extension: CodeExtension): CodeExtension;
|
|
319
|
+
export declare const CODE_EDITOR_KEY: InjectionKey<CodeExtensionContext>;
|
|
320
|
+
/** The editor a panel or gutter component is drawn in. */
|
|
321
|
+
export declare function useCodeEditor(): CodeExtensionContext;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
export declare const DouCodeEditor: import("dou-ui").WithInstall<import("vue").DefineComponent<import("./types").CodeEditorProps, import("./types").CodeEditorExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2
|
+
blur: (event: FocusEvent) => any;
|
|
3
|
+
focus: (event: FocusEvent) => any;
|
|
4
|
+
"update:modelValue": (value: string) => any;
|
|
5
|
+
"update:doc": (value: import("./index.js").CodeText) => any;
|
|
6
|
+
"update:selection": (value: import("./index.js").CodeSelection) => any;
|
|
7
|
+
transaction: (result: import("./index.js").CodeTransactionResult) => any;
|
|
8
|
+
foldChange: (lines: number[]) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<import("./types").CodeEditorProps> & Readonly<{
|
|
10
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
11
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
12
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
13
|
+
"onUpdate:doc"?: ((value: import("./index.js").CodeText) => any) | undefined;
|
|
14
|
+
"onUpdate:selection"?: ((value: import("./index.js").CodeSelection) => any) | undefined;
|
|
15
|
+
onTransaction?: ((result: import("./index.js").CodeTransactionResult) => any) | undefined;
|
|
16
|
+
onFoldChange?: ((lines: number[]) => any) | undefined;
|
|
17
|
+
}>, {
|
|
18
|
+
keys: boolean | readonly (string | import("./types").CodeKey)[];
|
|
19
|
+
selection: import("./index.js").CodeSelection;
|
|
20
|
+
doc: import("./index.js").CodeText;
|
|
21
|
+
language: import("./index.js").CodeLanguage<any> | null;
|
|
22
|
+
tabSize: number;
|
|
23
|
+
worker: boolean | (() => Worker);
|
|
24
|
+
messages: Partial<import("./locale").CodeMessages>;
|
|
25
|
+
modelValue: string;
|
|
26
|
+
lineNumbers: boolean;
|
|
27
|
+
gutter: boolean;
|
|
28
|
+
activeLine: boolean;
|
|
29
|
+
closeBrackets: boolean;
|
|
30
|
+
matchBrackets: boolean;
|
|
31
|
+
searchable: boolean;
|
|
32
|
+
wrap: boolean;
|
|
33
|
+
minimap: boolean;
|
|
34
|
+
foldable: boolean;
|
|
35
|
+
tabIndents: boolean;
|
|
36
|
+
teleport: string | false | HTMLElement;
|
|
37
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, import("vue").HTMLAttributes>;
|
|
38
|
+
export declare const DouCodeKeys: import("dou-ui").WithInstall<import("vue").DefineComponent<import("./types").CodeKeysProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("./types").CodeKeysProps> & Readonly<{}>, {
|
|
39
|
+
keys: readonly (string | import("./types").CodeKey)[];
|
|
40
|
+
editor: (Pick<import("./types").CodeEditorExpose, "run"> & Partial<Pick<import("./types").CodeEditorExpose, "focus">>) | null;
|
|
41
|
+
messages: Partial<import("./locale").CodeMessages>;
|
|
42
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, import("vue").HTMLAttributes>;
|
|
43
|
+
export declare const DouCodeInput: import("dou-ui").WithInstall<import("vue").DefineComponent<import("./types").CodeInputProps, import("./types").CodeEditorExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
44
|
+
enter: () => any;
|
|
45
|
+
blur: (event: FocusEvent) => any;
|
|
46
|
+
focus: (event: FocusEvent) => any;
|
|
47
|
+
"update:modelValue": (value: string) => any;
|
|
48
|
+
transaction: (result: import("./index.js").CodeTransactionResult) => any;
|
|
49
|
+
}, string, import("vue").PublicProps, Readonly<import("./types").CodeInputProps> & Readonly<{
|
|
50
|
+
onEnter?: (() => any) | undefined;
|
|
51
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
52
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
53
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
54
|
+
onTransaction?: ((result: import("./index.js").CodeTransactionResult) => any) | undefined;
|
|
55
|
+
}>, {
|
|
56
|
+
keys: boolean | readonly (string | import("./types").CodeKey)[];
|
|
57
|
+
invalid: boolean;
|
|
58
|
+
language: import("./index.js").CodeLanguage<any> | null;
|
|
59
|
+
messages: Partial<import("./locale").CodeMessages>;
|
|
60
|
+
modelValue: string;
|
|
61
|
+
readonly: boolean;
|
|
62
|
+
disabled: boolean;
|
|
63
|
+
closeBrackets: boolean;
|
|
64
|
+
teleport: string | false | HTMLElement;
|
|
65
|
+
multiline: boolean;
|
|
66
|
+
autosize: {
|
|
67
|
+
minRows?: number;
|
|
68
|
+
maxRows?: number;
|
|
69
|
+
};
|
|
70
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, import("vue").HTMLAttributes>;
|
|
71
|
+
export declare const DouCodeDiff: import("dou-ui").WithInstall<import("vue").DefineComponent<import("./types").CodeDiffProps, {
|
|
72
|
+
readonly hunks: import("./index.js").CodeDiffHunk[];
|
|
73
|
+
next: () => boolean;
|
|
74
|
+
previous: () => boolean;
|
|
75
|
+
expandAll: () => boolean;
|
|
76
|
+
collapseAll: () => void;
|
|
77
|
+
readonly original: import("./types").CodeEditorExpose | undefined;
|
|
78
|
+
readonly modified: import("./types").CodeEditorExpose | undefined;
|
|
79
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
80
|
+
"update:modelValue": (value: string) => any;
|
|
81
|
+
"update:mode": (mode: "split" | "inline") => any;
|
|
82
|
+
}, string, import("vue").PublicProps, Readonly<import("./types").CodeDiffProps> & Readonly<{
|
|
83
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
84
|
+
"onUpdate:mode"?: ((mode: "split" | "inline") => any) | undefined;
|
|
85
|
+
}>, {
|
|
86
|
+
toolbar: boolean;
|
|
87
|
+
language: import("./index.js").CodeLanguage<any> | null;
|
|
88
|
+
tabSize: number;
|
|
89
|
+
messages: Partial<import("./locale").CodeMessages>;
|
|
90
|
+
mode: "split" | "inline" | "auto";
|
|
91
|
+
modelValue: string;
|
|
92
|
+
wrap: boolean;
|
|
93
|
+
extensions: import("./extension").CodeExtension[];
|
|
94
|
+
editable: boolean;
|
|
95
|
+
original: string;
|
|
96
|
+
collapseUnchanged: boolean | {
|
|
97
|
+
context?: number;
|
|
98
|
+
minLines?: number;
|
|
99
|
+
};
|
|
100
|
+
ignoreWhitespace: boolean;
|
|
101
|
+
words: boolean;
|
|
102
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, import("vue").HTMLAttributes>;
|
|
103
|
+
export { diffText } from './core/diff';
|
|
104
|
+
export type { CodeDiffHunk, CodeDiffOptions, CodeDiffPart } from './core/diff';
|
|
105
|
+
export { defaultCodeKeys } from './code-keys';
|
|
106
|
+
export { defineCodeExtension, useCodeEditor } from './extension';
|
|
107
|
+
export type { CodeDecoration, CodeDiagnostic, CodeDiagnosticAction, CodeDiagnosticSeverity, CodeExtension, CodeExtensionContext, CodeGutter, CodeGutterMarker, CodeHistoryHandler, CodeCompletion, CodeCompletionKind, CodeCompletionRequest, CodePositionRequest, CodeCompletionResult, CodeHoverResult, CodeMenuItem, CodePanel, CodeSignatureResult, CodeWidget, } from './extension';
|
|
108
|
+
export default DouCodeEditor;
|
|
109
|
+
export type { CodeDiffEmits, CodeDiffProps, CodeEditorEmits, CodeEditorExpose, CodeEditorProps, CodeInputEmits, CodeInputProps, CodeKey, CodeKeysProps, } from './types';
|
|
110
|
+
export { CodeText, splitLines } from './core/text';
|
|
111
|
+
export type { CodeLine } from './core/text';
|
|
112
|
+
export { ChangeSet } from './core/changes';
|
|
113
|
+
export type { CodeChange, CodeChangeSpec, MapAssoc } from './core/changes';
|
|
114
|
+
export { isEmptyRange, mainRange, mapSelection, normalizeSelection, rangeFrom, rangeTo, sameSelection, selectionOf, } from './core/selection';
|
|
115
|
+
export type { CodeRange, CodeSelection } from './core/selection';
|
|
116
|
+
export { CodeTransaction } from './core/transaction';
|
|
117
|
+
export type { CodeAction, CodeState, CodeTransactionMeta, CodeTransactionResult, } from './core/transaction';
|
|
118
|
+
export * as codeCommands from './core/commands';
|
|
119
|
+
export type { CodeCommand, CodeCommandTarget } from './core/commands';
|
|
120
|
+
export { defaultKeymap } from './core/keymap';
|
|
121
|
+
export { findPartner, matchBracket } from './core/brackets';
|
|
122
|
+
export type { BracketMatch } from './core/brackets';
|
|
123
|
+
export { CodeStream } from './language/stream';
|
|
124
|
+
export { copyPlain, defineCodeLanguage, languageFor, lineParts, samePlain, tokenizeLine, tokenTypes, } from './language/language';
|
|
125
|
+
export type { CodeLanguage, CodeLanguageSpec, CodeLineTokens, CodeTokenType, } from './language/language';
|
|
126
|
+
export { CodeHighlighter } from './language/highlighter';
|
|
127
|
+
export { createCodeHighlighter, highlightToHtml } from './language/to-html';
|
|
128
|
+
export { createJavaScript, javascript, jsx, tsx, typescript } from './languages/javascript';
|
|
129
|
+
export type { JavaScriptOptions, JavaScriptState } from './languages/javascript';
|
|
130
|
+
export { createCss, css, scss } from './languages/css';
|
|
131
|
+
export type { CssState } from './languages/css';
|
|
132
|
+
export { json } from './languages/json';
|
|
133
|
+
export type { JsonState } from './languages/json';
|
|
134
|
+
export { createHtml, html, vue } from './languages/html';
|
|
135
|
+
export type { HtmlState } from './languages/html';
|
|
136
|
+
export { createMarkdown, markdown } from './languages/markdown';
|
|
137
|
+
export type { MarkdownOptions, MarkdownState } from './languages/markdown';
|
|
138
|
+
export { python } from './languages/python';
|
|
139
|
+
export type { PythonState } from './languages/python';
|
|
140
|
+
export { shell } from './languages/shell';
|
|
141
|
+
export type { ShellState } from './languages/shell';
|
|
142
|
+
export { sql } from './languages/sql';
|
|
143
|
+
export type { SqlState } from './languages/sql';
|
|
144
|
+
export { yaml } from './languages/yaml';
|
|
145
|
+
export type { YamlState } from './languages/yaml';
|
|
146
|
+
export type { CodeKeyBinding, CodeKeymap } from './core/keymap';
|
|
147
|
+
export type { CodeAssistControl, CodeDiagnosticControl, CodeSearchControl } from './core/commands';
|
|
148
|
+
export { matchAfter, queryRegExp, replacementFor, searchText } from './core/search';
|
|
149
|
+
export type { CodeMatch, CodeSearchQuery, CodeSearchResult } from './core/search';
|
|
150
|
+
export { codeLocales } from './locale';
|
|
151
|
+
export type { CodeMessages } from './locale';
|
|
152
|
+
declare module 'vue' {
|
|
153
|
+
interface GlobalComponents {
|
|
154
|
+
DouCodeEditor: typeof DouCodeEditor;
|
|
155
|
+
DouCodeKeys: typeof DouCodeKeys;
|
|
156
|
+
DouCodeInput: typeof DouCodeInput;
|
|
157
|
+
DouCodeDiff: typeof DouCodeDiff;
|
|
158
|
+
}
|
|
159
|
+
}
|