UNPKG

1.4 kBTypeScriptView Raw
1export type JadeCustomFilterFunction = (text: string, options: {
2 [key: string]: boolean;
3}) => string;
4
5export interface JadeOptions {
6 filename?: string | undefined;
7 basedir?: string | undefined;
8 doctype?: string | undefined;
9 pretty?: boolean | string | undefined;
10 filters?: {
11 [key: string]: JadeCustomFilterFunction;
12 } | undefined;
13 self?: boolean | undefined;
14 debug?: boolean | undefined;
15 compileDebug?: boolean | undefined;
16 globals?: string[] | undefined;
17 cache?: boolean | undefined;
18 inlineRuntimeFunctions?: boolean | undefined;
19 name?: string | undefined;
20}
21
22export interface TemplateLocals {
23 [key: string]: any;
24}
25
26export type JadeGenerationFunction = (locals?: TemplateLocals) => string;
27
28export declare function compile(template: string, options?: JadeOptions): JadeGenerationFunction;
29export declare function compileFile(path: string, options?: JadeOptions): JadeGenerationFunction;
30export declare function compileClient(template: string, options?: JadeOptions): JadeGenerationFunction;
31export declare function compileClientWithDependenciesTracked(template: string, options?: JadeOptions): {
32 body: JadeGenerationFunction;
33 dependencies: string[];
34};
35export declare function render(template: string, options?: JadeOptions): string;
36export declare function renderFile(path: string, options?: JadeOptions): string;