|
1 | 1 | import * as fs from 'fs' |
2 | 2 | import * as path from 'path' |
3 | 3 |
|
| 4 | +import { IFiles, Stat } from './Interfaces' |
4 | 5 | import { Log, Logger } from './Logger' |
5 | 6 |
|
6 | | -export interface Stat { |
7 | | - dir: boolean |
8 | | - file: boolean |
9 | | - filename: string |
10 | | -} |
11 | | - |
12 | 7 | class InternalFiles { |
13 | 8 | private readonly log: Log = Logger('chest:files') |
14 | 9 |
|
@@ -145,23 +140,4 @@ class InternalFiles { |
145 | 140 | } |
146 | 141 | } |
147 | 142 |
|
148 | | -export interface Files { |
149 | | - basename(filepath: string): string |
150 | | - deepdirs(rootpath: string): Promise<string[]> |
151 | | - deepfiles(rootpath: string): Promise<string[]> |
152 | | - exists(filepath: string): Promise<boolean> |
153 | | - ext(filepath: string): string |
154 | | - extensionless(filename: string): string |
155 | | - join(...args: string[]): string |
156 | | - json<T>(filepath: string): Promise<T> |
157 | | - readfile(filepath: string): Promise<Buffer> |
158 | | - listdirs(filepath: string): Promise<string[]> |
159 | | - listfiles(filepath: string): Promise<string[]> |
160 | | - mkdir(filepath: string): Promise<void> |
161 | | - save<T>(filepath: string, data: T): Promise<void> |
162 | | - statfile(filepath: string): Promise<fs.Stats> |
163 | | - statfiles(filepath: string): Promise<Stat[]> |
164 | | - writefile(filepath: string, data: any): Promise<void> |
165 | | -} |
166 | | - |
167 | | -export const Files: Files = new InternalFiles() |
| 143 | +export const Files: IFiles = new InternalFiles() |
0 commit comments