* feat: 添加 Tilemap 编辑器插件和组件生命周期支持 * feat(editor-core): 添加声明式插件注册 API * feat(editor-core): 改进tiledmap结构合并tileset进tiledmapeditor * feat: 添加 editor-runtime SDK 和插件系统改进 * fix(ci): 修复SceneResourceManager里变量未使用问题
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
export interface IFileSystem {
|
|
dispose(): void;
|
|
readFile(path: string): Promise<string>;
|
|
writeFile(path: string, content: string): Promise<void>;
|
|
writeBinary(path: string, data: Uint8Array): Promise<void>;
|
|
exists(path: string): Promise<boolean>;
|
|
createDirectory(path: string): Promise<void>;
|
|
listDirectory(path: string): Promise<FileEntry[]>;
|
|
deleteFile(path: string): Promise<void>;
|
|
deleteDirectory(path: string): Promise<void>;
|
|
scanFiles(basePath: string, pattern: string): Promise<string[]>;
|
|
/**
|
|
* Convert a local file path to an asset URL that can be used in browser contexts (img src, audio src, etc.)
|
|
* @param filePath The local file path
|
|
* @returns The converted asset URL
|
|
*/
|
|
convertToAssetUrl(filePath: string): string;
|
|
}
|
|
|
|
export interface FileEntry {
|
|
name: string;
|
|
path: string;
|
|
isDirectory: boolean;
|
|
size?: number;
|
|
modified?: Date;
|
|
}
|
|
|
|
// Service identifier for DI registration
|
|
// 使用 Symbol.for 确保跨包共享同一个 Symbol
|
|
export const IFileSystemService = Symbol.for('IFileSystemService');
|