@bhsd/codemirror-mediawiki 3.5.0 → 3.5.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.
@@ -236,7 +236,7 @@ export class CodeMirror6 {
236
236
  }
237
237
  }
238
238
  return diagnostics;
239
- }, source.delay ? { delay: source.delay } : undefined)),
239
+ })),
240
240
  lintGutter(),
241
241
  keymap.of(lintKeymap),
242
242
  optionalFunctions.statusBar(this, lintSources[0].fixer),
@@ -4,11 +4,16 @@ import type { Language } from '@codemirror/language';
4
4
  import type { Diagnostic } from '@codemirror/lint';
5
5
  import type { Option, LiveOption } from './linter';
6
6
  export type LintSource = ((state: EditorState) => Diagnostic[] | Promise<Diagnostic[]>) & {
7
- delay?: number;
8
7
  fixer?: (doc: Text, rule?: string) => string | Promise<string>;
9
8
  };
10
9
  export type LintSources = LintSource | [LintSource] | [LintSource, LintSource];
11
10
  export type LintSourceGetter = (opt?: Option | LiveOption, view?: EditorView, nestedMWLanguage?: Language) => LintSource | Promise<LintSource>;
11
+ /**
12
+ * 获取Linter选项
13
+ * @param opt Linter选项
14
+ * @param runtime 是否为运行时选项
15
+ */
16
+ export declare const getOpt: (opt: Option | LiveOption, runtime?: boolean) => Option | Promise<Option>;
12
17
  export declare const getWikiLintSource: LintSourceGetter;
13
18
  export declare const getJsLintSource: LintSourceGetter;
14
19
  export declare const getCssLintSource: LintSourceGetter;
@@ -9,7 +9,7 @@ import { posToIndex } from './hover';
9
9
  * @param opt Linter选项
10
10
  * @param runtime 是否为运行时选项
11
11
  */
12
- const getOpt = (opt, runtime) => typeof opt === 'function' ? opt(runtime) : opt;
12
+ export const getOpt = (opt, runtime) => typeof opt === 'function' ? opt(runtime) : opt;
13
13
  /**
14
14
  * 获取指定行列的位置
15
15
  * @param doc 文档