Skip to content

Commit 66f9931

Browse files
committed
Expose @lezer/markdown and addMarkdownConfig
1 parent ea01daa commit 66f9931

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Add `markedit-api` to your (TypeScript) project's devDependencies:
1616
```json
1717
{
1818
"devDependencies": {
19-
"markedit-api": "https://github.com/MarkEdit-app/MarkEdit-api#v0.2.0"
19+
"markedit-api": "https://github.com/MarkEdit-app/MarkEdit-api#v0.3.0"
2020
}
2121
}
2222
```
@@ -35,12 +35,14 @@ interface MarkEdit {
3535
editorView: EditorView;
3636
// Convenient text editing interfaces.
3737
editorAPI: TextEditable;
38-
// Add an extension to MarkEdit.
39-
addExtension: (extension: Extension) => void;
4038
// CodeMirror modules used by MarkEdit.
4139
codemirror: { view, state, language, commands, search };
4240
// Lezer modules used by MarkEdit.
43-
lezer: { common, highlight, lr },
41+
lezer: { common, highlight, markdown, lr };
42+
// Add an extension to MarkEdit.
43+
addExtension: (extension: Extension) => void;
44+
// Add a Markdown config to MarkEdit.
45+
addMarkdownConfig: (config: MarkdownConfig) => void;
4446
}
4547
```
4648

markedit.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { EditorView } from '@codemirror/view';
22
import type { Extension } from '@codemirror/state';
3+
import type { MarkdownConfig } from '@lezer/markdown';
34

45
import type * as cmView from '@codemirror/view';
56
import type * as cmState from '@codemirror/state';
@@ -9,6 +10,7 @@ import type * as cmSearch from '@codemirror/search';
910

1011
import type * as lezerCommon from '@lezer/common';
1112
import type * as lezerHighlight from '@lezer/highlight';
13+
import type * as lezerMarkdown from '@lezer/markdown';
1214
import type * as lezerLr from '@lezer/lr';
1315

1416
export const MarkEdit: MarkEdit;
@@ -68,6 +70,11 @@ export interface MarkEdit {
6870
*/
6971
highlight: typeof lezerHighlight;
7072

73+
/**
74+
* The `@lezer/markdown` module.
75+
*/
76+
markdown: typeof lezerMarkdown;
77+
7178
/**
7279
* The `@lezer/lr` module.
7380
*/
@@ -79,6 +86,12 @@ export interface MarkEdit {
7986
* @param extension CodeMirror extension.
8087
*/
8188
addExtension: (extension: Extension) => void;
89+
90+
/**
91+
* Add a Markdown config to MarkEdit.
92+
* @param config Markdown config.
93+
*/
94+
addMarkdownConfig: (config: MarkdownConfig) => void;
8295
}
8396

8497
export interface TextEditable {

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "markedit-api",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"description": "Type definitions for the latest MakrEdit API.",
55
"main": "main.ts",
66
"types": "markedit.d.ts",
@@ -13,6 +13,7 @@
1313
"@codemirror/view": "^6.0.0",
1414
"@lezer/common": "^1.0.0",
1515
"@lezer/highlight": "^1.0.0",
16-
"@lezer/lr": "^1.0.0"
16+
"@lezer/lr": "^1.0.0",
17+
"@lezer/markdown": "^1.0.0"
1718
}
1819
}

0 commit comments

Comments
 (0)