aboutsummaryrefslogtreecommitdiff
path: root/vfs/vfs.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'vfs/vfs.d.ts')
-rw-r--r--vfs/vfs.d.ts54
1 files changed, 54 insertions, 0 deletions
diff --git a/vfs/vfs.d.ts b/vfs/vfs.d.ts
new file mode 100644
index 0000000..eadc43e
--- /dev/null
+++ b/vfs/vfs.d.ts
@@ -0,0 +1,54 @@
+export interface IVfsNode {
+ name: string;
+ path: string;
+ is_dir: boolean;
+ mod_time_epoch?: number;
+ mod_time_rfc3339?: string;
+ size?: number;
+ mode?: string;
+ childs?: IVfsNode[];
+ content?: string;
+}
+export interface Response {
+ code: number;
+ message?: string;
+ data?: IVfsNode | IPathNode;
+}
+export interface VfsOptions {
+ id: string;
+ is_editable: boolean;
+ ListNodes: () => Response;
+ GetNode: (path: string) => Response;
+ UpdateNode: (node: Node) => Response;
+ DeleteNode: (node: Node) => Response;
+}
+export declare class Vfs {
+ opts: VfsOptions;
+ private el;
+ private comPath;
+ private comList;
+ private pathNode;
+ constructor(opts: VfsOptions);
+ onClickNode(this: Vfs, node: VfsNode): void;
+ onClickPath(this: Vfs, path: string): void;
+ open(node: VfsNode): void;
+}
+declare class VfsNode implements IVfsNode {
+ path: string;
+ name: string;
+ mod_time_epoch: number;
+ mod_time_rfc3339: string;
+ size: number;
+ mode: string;
+ is_dir: boolean;
+ childs: VfsNode[];
+ el: HTMLElement;
+ constructor(opts: IVfsNode, onClick: NodeClickHandler);
+ onMouseOut(t: VfsNode): void;
+ onMouseOver(t: VfsNode): void;
+}
+declare type IPathNode = {
+ [key: string]: IVfsNode;
+};
+declare type NodeClickHandler = (node: VfsNode) => void;
+export {};