Skip to content

Commit 4fe9abf

Browse files
committed
Add MarkEdit.getDirectoryPath for standard directories
1 parent c6862c4 commit 4fe9abf

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

README.md

Lines changed: 3 additions & 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.17.0"
22+
"markedit-api": "https://github.com/MarkEdit-app/MarkEdit-api#v0.18.0"
2323
}
2424
}
2525
```
@@ -62,6 +62,8 @@ interface MarkEdit {
6262
getFileContent(path?: string): Promise<string | undefined>;
6363
// Get the information of a file.
6464
getFileInfo(path?: string): Promise<FileInfo | undefined>;
65+
// Get the path of a standard directory.
66+
getDirectoryPath(type: DirectoryType): string;
6567
// Get all items from the native pasteboard.
6668
getPasteboardItems(): Promise<PasteboardItem[]>;
6769
// Get the string from the native pasteboard.

index.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,13 @@ export interface MarkEdit {
166166
*/
167167
getFileInfo(path?: string): Promise<FileInfo | undefined>;
168168

169+
/**
170+
* Get the path of a standard directory.
171+
* @param type The directory type.
172+
* @returns The directory path.
173+
*/
174+
getDirectoryPath(type: DirectoryType): string;
175+
169176
/**
170177
* Get all items from the native pasteboard.
171178
* @returns The items from the native (general) pasteboard.
@@ -568,6 +575,11 @@ export type CreateFileOptions = {
568575
data?: string;
569576
};
570577

578+
/**
579+
* Represents standard directory types.
580+
*/
581+
export type DirectoryType = 'home' | 'documents' | 'library' | 'caches' | 'temporary';
582+
571583
/**
572584
* Represents options to show the save panel.
573585
*/

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.17.0",
3+
"version": "0.18.0",
44
"description": "Type definitions for the latest MakrEdit API.",
55
"main": "./index.cjs",
66
"module": "./index.js",

0 commit comments

Comments
 (0)