-
Notifications
You must be signed in to change notification settings - Fork 0
/
transform.interface.ts
54 lines (51 loc) · 1.16 KB
/
transform.interface.ts
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
50
51
52
53
54
/**
* Processor options
*/
type ProcessorOptions = Record<string, any>;
/**
* Pre-processor
*/
export type PreProcessor<R extends object = any, O extends ProcessorOptions = any> =
| ((data: string | R, options?: Readonly<O>) => R)
| [processor: (data: string | R, options?: Readonly<O>) => R, options?: O];
/**
* Post-processor
*/
export type PostProcessor<D extends object = any, O extends ProcessorOptions = any> =
| ((content: string, data: Readonly<D>, options?: Readonly<O>) => string)
| [processor: (content: string, data: Readonly<D>, options?: Readonly<O>) => string, options?: O];
/**
* Preset
*/
export interface Preset<P extends ProcessorOptions = any> {
/**
* Pre-processors
*/
preProcessors?: PreProcessor<any, P>[];
/**
* Post-processors
*/
postProcessors?: PostProcessor<any, P>[];
/**
* Processor options
*/
processorOptions?: P;
/**
* Template file path
* [!] If `template` is set, this setting is ignored
*/
templateFile?: string;
/**
* Template string
*/
template?: string;
/**
* Output file information
*/
outputFile?: {
/**
* Output file extension
*/
ext: string;
};
}