File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed
Expand file tree Collapse file tree 3 files changed +38
-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.7 .0"
22+ "markedit-api" : " https://github.com/MarkEdit-app/MarkEdit-api#v0.8 .0"
2323 }
2424}
2525```
@@ -46,6 +46,10 @@ interface MarkEdit {
4646 onEditorReady(listener : (editorView : EditorView ) => void ): void ;
4747 // Get information of the current file.
4848 getFileInfo(): Promise <FileInfo | undefined >;
49+ // Get all items from the native pasteboard.
50+ getPasteboardItems(): Promise <PasteboardItem []>;
51+ // Get the string from the native pasteboard.
52+ getPasteboardString(): Promise <string | undefined >;
4953 // Add an extension to MarkEdit.
5054 addExtension(extension : Extension ): void ;
5155 // Add a Markdown config to MarkEdit.
Original file line number Diff line number Diff line change @@ -103,6 +103,18 @@ export interface MarkEdit {
103103 */
104104 getFileInfo ( ) : Promise < FileInfo | undefined > ;
105105
106+ /**
107+ * Get all items from the native pasteboard.
108+ * @returns The items from the native (general) pasteboard.
109+ */
110+ getPasteboardItems ( ) : Promise < PasteboardItem [ ] > ;
111+
112+ /**
113+ * Get the string from the native pasteboard.
114+ * @returns The string from the native (general) pasteboard, if applicable.
115+ */
116+ getPasteboardString ( ) : Promise < string | undefined > ;
117+
106118 /**
107119 * Add an extension to MarkEdit.
108120 * @param extension CodeMirror extension.
@@ -226,6 +238,26 @@ export type FileInfo = {
226238 modificationDate : Date ;
227239} ;
228240
241+ /**
242+ * Represents a native pasteboard item.
243+ */
244+ export type PasteboardItem = {
245+ /**
246+ * Type name, such as `public.utf8-plain-text`.
247+ */
248+ type : string ;
249+
250+ /**
251+ * Base64 representation of the pasteboard data.
252+ */
253+ data : string ;
254+
255+ /**
256+ * String representation of the pasteboard data, if applicable.
257+ */
258+ string ?: string ;
259+ } ;
260+
229261/**
230262 * Represents a portion of text.
231263 */
Original file line number Diff line number Diff line change 11{
22 "name" : " markedit-api" ,
3- "version" : " 0.7 .0" ,
3+ "version" : " 0.8 .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