UNPKG

1.41 kBTypeScriptView Raw
1// See docs https://codemirror.net/doc/manual.html#addon_foldgutter
2
3import "../../";
4
5declare module "../../" {
6 interface EditorConfiguration {
7 /**
8 * Provides an option foldGutter, which can be used to create a gutter with markers indicating the blocks that can be folded.
9 */
10 foldGutter?: boolean | FoldGutterOptions | undefined;
11 }
12
13 interface FoldRange {
14 from: Position;
15 to: Position;
16 }
17
18 interface FoldGutterOptions {
19 /**
20 * The CSS class of the gutter. Defaults to "CodeMirror-foldgutter". You will have to style this yourself to give it a width (and possibly a background).
21 */
22 gutter?: string | undefined;
23
24 /**
25 * A CSS class or DOM element to be used as the marker for open, foldable blocks. Defaults to "CodeMirror-foldgutter-open".
26 */
27 indicatorOpen?: string | Element | undefined;
28
29 /**
30 * A CSS class or DOM element to be used as the marker for folded blocks. Defaults to "CodeMirror-foldgutter-folded".
31 */
32 indicatorFolded?: string | Element | undefined;
33
34 /*
35 * The range-finder function to use when determining whether something can be folded.
36 * When not given, CodeMirror.fold.auto will be used as default.
37 */
38 rangeFinder?: (cm: Editor, pos: Position) => FoldRange | undefined;
39 }
40}