feat(fs): add stat API for markdown file validation (#774)

Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
Yifan
2026-04-01 10:18:05 +03:00
committed by GitHub
co-authored by Bohdan Triapitsyn
parent 0e70422835
commit 14fc741cc9
7 changed files with 140 additions and 9 deletions
+10
View File
@@ -71,6 +71,16 @@ export const createVSCodeFilesAPI = (): FilesAPI => ({
};
},
async statFile(path: string): Promise<{ path: string; isFile: boolean; size: number }> {
const target = normalizePath(path);
const data = await sendBridgeMessage<{ path?: string; isFile?: boolean; size?: number }>('api:fs:stat', { path: target });
return {
path: typeof data?.path === 'string' ? normalizePath(data.path) : target,
isFile: Boolean(data?.isFile),
size: typeof data?.size === 'number' ? data.size : 0,
};
},
async delete(path: string): Promise<{ success: boolean }> {
const target = normalizePath(path);
const data = await sendBridgeMessage<{ success: boolean }>('api:fs:delete', { path: target });