-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
62 lines (57 loc) · 2.13 KB
/
index.d.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
55
56
57
58
59
60
61
62
// Type definitions for eryn 0.3
// Definitions by UnexomWid <https://uw.exom.dev>
type Hook = (content: Buffer, origin:
'plaintext'
| 'template'
| 'void'
| 'comment'
| 'conditional'
| 'else_conditional'
| 'loop_iterator'
| 'loop_iterable'
| 'component_path'
| 'component_context') => Buffer;
interface ErynOptions {
bypassCache?: boolean,
throwOnEmptyContent?: boolean,
throwOnMissingEntry?: boolean,
throwOnCompileDirError?: boolean,
ignoreBlankPlaintext?: boolean,
logRenderTime?: boolean,
enableDeepCloning?: boolean,
cloneIterators?: boolean,
debugDumpOSH?: boolean,
mode?: "normal" | "strict",
workingDirectory?: string,
templateEscape?: string,
templateStart?: string,
templateEnd?: string,
bodyEnd?: string,
commentStart?: string,
commentEnd?: string,
voidTemplate?: string,
conditionalStart?: string,
elseStart?: string,
elseConditionalStart?: string,
invertedConditionalStart?: string,
loopStart?: string,
loopSeparator?: string,
loopReverse?: string,
componentStart?: string,
componentSeparator?: string,
componentSelf?: string,
compileHook?: Hook
}
declare class ErynBinding {
constructor(options: ErynOptions | undefined);
compile(filePath: string): void;
compileDir(dirPath: string, filters: string[]): void;
compileString(alias: string, str: string): void;
express(path: string, context: any, callback: (error: any, rendered: string) => void): void;
render(filePath: string, context: any, shared: any): Buffer;
renderString(alias: string, context: any, shared: any): Buffer;
renderStringUncached(src: string, context: any, shared: any): Buffer;
setOptions(options: ErynOptions): void;
}
declare function eryn(options: ErynOptions | undefined): ErynBinding;
export = eryn;