-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
49 lines (37 loc) · 1.42 KB
/
index.d.ts
File metadata and controls
49 lines (37 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Created on the basis of http://www.typescriptlang.org/docs/handbook/declaration-files/templates/module-d-ts.html
export type LogFunction = (...args: any[]) => void;
export interface Logger {
error: LogFunction;
info?: LogFunction;
log: LogFunction;
[field: string]: unknown;
}
export type LoggerSetting = Logger | boolean | null | undefined | 0;
export interface GetFileContentEnv {
data: any;
dir: string;
dirPath: string;
filePath: string;
logger: Logger;
}
export type GetFileContent =
| (() => unknown)
| ((file: string) => unknown)
| ((file: string, env: GetFileContentEnv, ...args: any[]) => unknown);
export type CreateFileSet = Record<string, unknown>;
export interface CreateFileSettings {
context?: object;
data?: any;
dir?: string;
logger?: LoggerSetting;
}
export function createFile(fileSet: CreateFileSet | string, settings?: CreateFileSettings): Record<string, string | Error> | undefined;
export interface CopyFileSettings {
dir?: string;
logger?: LoggerSetting;
sourceDir?: string;
}
export type PartialCopyFile = (destFile: string, settings?: CopyFileSettings) => void;
export function copyFile(sourceFile: string): PartialCopyFile;
export function copyFile(sourceFile: string, destFile: string, settings?: CopyFileSettings): void;
export function copyFile(sourceFile: string, destFile?: string, settings?: CopyFileSettings): PartialCopyFile | void;