执行过npm install命令的vue-element-admin源码
康凯
2022-05-20 aa4c235a8ca67ea8b731f90c951a465e92c0a865
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Type definitions for CodeMirror
// Project: https://github.com/marijnh/CodeMirror
// Definitions by: Nikolaj Kappler <https://github.com/nkappler>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
 
// See docs https://codemirror.net/doc/manual.html#addon_comment
 
// Todo: add 'toggleComment' command, once command type definitions exist in main definitions
 
import * as CodeMirror from "codemirror";
 
declare module "codemirror" {
 
    interface Editor {
        /** Tries to uncomment the current selection, and if that fails, line-comments it. */
        toggleComment(options?: CommentOptions): void;
        /** Set the lines in the given range to be line comments. Will fall back to `blockComment` when no line comment style is defined for the mode. */
        lineComment(from: Position, to: Position, options?: CommentOptions): void;
        /** Wrap the code in the given range in a block comment. Will fall back to `lineComment` when no block comment style is defined for the mode. */
        blockComment(from: Position, to: Position, options?: CommentOptions): void;
        /** Try to uncomment the given range. Returns `true` if a comment range was found and removed, `false` otherwise. */
        uncomment(from: Position, to: Position, options?: CommentOptions): boolean;
    }
 
    interface CommentOptions {
        /** Override the [comment string properties](https://codemirror.net/doc/manual.html#mode_comment) of the mode with custom comment strings. */
        blockCommentStart?: string;
        /** Override the [comment string properties](https://codemirror.net/doc/manual.html#mode_comment) of the mode with custom comment strings. */
        blockCommentEnd?: string;
        /** Override the [comment string properties](https://codemirror.net/doc/manual.html#mode_comment) of the mode with custom comment strings. */
        blockCommentLead?: string;
        /** Override the [comment string properties](https://codemirror.net/doc/manual.html#mode_comment) of the mode with custom comment strings. */
        lineComment?: string;
        /** A string that will be inserted after opening and leading markers, and before closing comment markers. Defaults to a single space. */
        padding?: string;
        /** Whether, when adding line comments, to also comment lines that contain only whitespace. */
        commentBlankLines?: boolean;
        /** When adding line comments and this is turned on, it will align the comment block to the current indentation of the first line of the block. */
        indent?: boolean;
        /** When block commenting, this controls whether the whole lines are indented, or only the precise range that is given. Defaults to `true`. */
        fullLines?: boolean;
    }
}