Skip to content

@caoergou/windows-xp / index / XPFsApi

接口:XPFsApi ​

定义于:src/components/XPBridge.tsx:30

从桌面外部驱动文件系统(#115)。路径为绝对路径。

属性 ​

createFile ​

createFile: (path, node?) => void

定义于:src/components/XPBridge.tsx:36

在指定路径创建文件/文件夹。node.type 默认为 'file'。

参数 ​

path ​

string[]

node? ​

Partial<FileNode>

返回值 ​

void


deleteFile ​

deleteFile: (path) => void

定义于:src/components/XPBridge.tsx:38

删除指定路径的文件或文件夹。

参数 ​

path ​

string[]

返回值 ​

void


exists ​

exists: (path) => boolean

定义于:src/components/XPBridge.tsx:42

指定路径是否存在节点。

参数 ​

path ​

string[]

返回值 ​

boolean


getNode ​

getNode: (path) => FileNode | null

定义于:src/components/XPBridge.tsx:40

返回指定路径的原始节点,若不存在则返回 null。

参数 ​

path ​

string[]

返回值 ​

FileNode | null


readFile ​

readFile: (path) => string | null

定义于:src/components/XPBridge.tsx:32

读取文件节点的文本内容;若缺失或不是文本文件则返回 null。

参数 ​

path ​

string[]

返回值 ​

string | null


unlockNode ​

unlockNode: (path) => void

定义于:src/components/XPBridge.tsx:44

持久化地清除节点的 locked 标志。

参数 ​

path ​

string[]

返回值 ​

void


writeFile ​

writeFile: (path, content) => void

定义于:src/components/XPBridge.tsx:34

设置文件节点的内容(会持久化)。

参数 ​

path ​

string[]

content ​

string

返回值 ​

void