34 lines
551 B
TypeScript
34 lines
551 B
TypeScript
|
|
export type DirEntry = {
|
||
|
|
name: string
|
||
|
|
path: string
|
||
|
|
kind: 'file' | 'dir'
|
||
|
|
}
|
||
|
|
|
||
|
|
export type ListDirResult = {
|
||
|
|
entries: DirEntry[]
|
||
|
|
error?: string
|
||
|
|
}
|
||
|
|
|
||
|
|
export type OpenFileResult = {
|
||
|
|
canceled: boolean
|
||
|
|
path?: string
|
||
|
|
content?: string
|
||
|
|
}
|
||
|
|
|
||
|
|
export type SaveDialogResult = {
|
||
|
|
canceled: boolean
|
||
|
|
path?: string
|
||
|
|
}
|
||
|
|
|
||
|
|
export type OpenFolderResult = {
|
||
|
|
canceled: boolean
|
||
|
|
path?: string
|
||
|
|
}
|
||
|
|
|
||
|
|
/** `url` 为可写入 Markdown 的 `file://` 绝对地址(已编码)。 */
|
||
|
|
export type OpenImageResult = {
|
||
|
|
canceled: boolean
|
||
|
|
url?: string
|
||
|
|
path?: string
|
||
|
|
}
|