@bhsd/codemirror-mediawiki 2.1.11 → 2.1.13

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/README.md CHANGED
@@ -122,7 +122,7 @@ Get the default linting function, which can be used as the argument of [`lint`](
122
122
 
123
123
  ```js
124
124
  const linter = await cm.getLinter(); // default linter configuration
125
- const linterMediawiki = await cm.getLinter({include}); // wikilint configuration
125
+ const linterMediawiki = await cm.getLinter({include: true, i18n: 'zh-hans'}); // wikilint configuration
126
126
  const linterJavaScript = await cm.getLinter({env, parserOptions, rules}); // ESLint configuration
127
127
  const linterCSS = await cm.getLinter({rules}); // Stylelint configuration
128
128
  ```
@@ -161,19 +161,28 @@ cm.lint(doc => [
161
161
 
162
162
  *version added: 2.0.9*
163
163
 
164
- **param**: `string` the preferred [CodeMirror extensions](https://codemirror.net/docs/extensions/)
164
+ **param**: `string[] | Record<string, boolean>` the preferred [CodeMirror extensions](https://codemirror.net/docs/extensions/)
165
165
  Set the preferred CodeMirror extensions.
166
166
 
167
167
  ```js
168
168
  cm.prefer([
169
+ 'allowMultipleSelections',
169
170
  'bracketMatching',
170
171
  'closeBrackets',
171
172
  'highlightActiveLine',
172
173
  'highlightSpecialChars',
173
174
  'highlightWhitespace',
174
175
  'highlightTrailingWhitespace',
175
- 'allowMultipleSelections',
176
176
  ]);
177
+ cm.prefer({
178
+ allowMultipleSelections: false,
179
+ bracketMatching: false,
180
+ closeBrackets: false,
181
+ highlightActiveLine: false,
182
+ highlightSpecialChars: false,
183
+ highlightWhitespace: false,
184
+ highlightTrailingWhitespace: false,
185
+ });
177
186
  ```
178
187
 
179
188
  </details>
@@ -32,7 +32,7 @@ export declare class CodeMirror6 {
32
32
  * 添加扩展
33
33
  * @param names 扩展名
34
34
  */
35
- prefer(names: readonly string[]): void;
35
+ prefer(names: string[] | Record<string, boolean>): void;
36
36
  /**
37
37
  * 设置缩进
38
38
  * @param indent 缩进字符串