Skip to content

Commit 6fcfcf4

Browse files
committed
Add saveDocument and closeDocument
1 parent 7591d7f commit 6fcfcf4

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Add `markedit-api` to your (TypeScript) project's devDependencies:
1919
```json
2020
{
2121
"devDependencies": {
22-
"markedit-api": "https://github.com/MarkEdit-app/MarkEdit-api#v0.21.0"
22+
"markedit-api": "https://github.com/MarkEdit-app/MarkEdit-api#v0.22.0"
2323
}
2424
}
2525
```

index.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,18 @@ export interface MarkEdit {
131131
*/
132132
onEditorReady(listener: (editorView: EditorView) => void): void;
133133

134+
/**
135+
* Save the current document to disk.
136+
* @returns True if the document was successfully saved.
137+
*/
138+
saveDocument(): Promise<boolean>;
139+
140+
/**
141+
* Close the current document.
142+
* @returns True if the document was successfully closed.
143+
*/
144+
closeDocument(): Promise<boolean>;
145+
134146
/**
135147
* Open a file in the file system.
136148
* @param path The file path. It must be one that the app can access. See the [wiki](https://github.com/MarkEdit-app/MarkEdit/wiki/Customization#grant-folder-access) for more details.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "markedit-api",
3-
"version": "0.21.0",
3+
"version": "0.22.0",
44
"description": "Type definitions for the latest MakrEdit API.",
55
"main": "./index.cjs",
66
"module": "./index.js",

0 commit comments

Comments
 (0)