File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed
Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff 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.6 .0"
22+ "markedit-api" : " https://github.com/MarkEdit-app/MarkEdit-api#v0.7 .0"
2323 }
2424}
2525```
@@ -44,6 +44,8 @@ interface MarkEdit {
4444 lezer: { common, highlight, markdown, lr };
4545 // Get notified when the editor is initialized.
4646 onEditorReady(listener : (editorView : EditorView ) => void ): void ;
47+ // Get information of the current file.
48+ getFileInfo(): Promise <FileInfo | undefined >;
4749 // Add an extension to MarkEdit.
4850 addExtension(extension : Extension ): void ;
4951 // Add a Markdown config to MarkEdit.
Original file line number Diff line number Diff line change @@ -97,6 +97,12 @@ export interface MarkEdit {
9797 */
9898 onEditorReady ( listener : ( editorView : EditorView ) => void ) : void ;
9999
100+ /**
101+ * Get information of the current file.
102+ * @returns The file information, or undefined for unsaved new drafts.
103+ */
104+ getFileInfo ( ) : Promise < FileInfo | undefined > ;
105+
100106 /**
101107 * Add an extension to MarkEdit.
102108 * @param extension CodeMirror extension.
@@ -210,6 +216,16 @@ export interface TextEditable {
210216 redo ( ) : void ;
211217}
212218
219+ /**
220+ * Information of a file in the file system.
221+ */
222+ export type FileInfo = {
223+ filePath : string ;
224+ fileSize : number ;
225+ creationDate : Date ;
226+ modificationDate : Date ;
227+ } ;
228+
213229/**
214230 * Represents a portion of text.
215231 */
Original file line number Diff line number Diff line change 11{
22 "name" : " markedit-api" ,
3- "version" : " 0.6 .0" ,
3+ "version" : " 0.7 .0" ,
44 "description" : " Type definitions for the latest MakrEdit API." ,
55 "main" : " main.ts" ,
66 "types" : " markedit.d.ts" ,
You can’t perform that action at this time.
0 commit comments