1 |
|
2 |
|
3 |
|
4 |
|
5 | import Promise = require("bluebird");
|
6 |
|
7 | declare var cons: Consolidate;
|
8 |
|
9 | export = cons;
|
10 |
|
11 | type SupportedTemplateEngines =
|
12 | | "arc-templates"
|
13 | | "atpl"
|
14 | | "bracket"
|
15 | | "dot"
|
16 | | "dust"
|
17 | | "eco"
|
18 | | "ejs"
|
19 | | "ect"
|
20 | | "haml"
|
21 | | "haml-coffee"
|
22 | | "hamlet"
|
23 | | "handlebars"
|
24 | | "hogan"
|
25 | | "htmling"
|
26 | | "jade"
|
27 | | "jazz"
|
28 | | "jqtpl"
|
29 | | "just"
|
30 | | "liquid"
|
31 | | "liquor"
|
32 | | "lodash"
|
33 | | "marko"
|
34 | | "mote"
|
35 | | "mustache"
|
36 | | "nunjucks"
|
37 | | "plates"
|
38 | | "pug"
|
39 | | "qejs"
|
40 | | "ractive"
|
41 | | "razor"
|
42 | | "react"
|
43 | | "slm"
|
44 | | "squirrelly"
|
45 | | "swig"
|
46 | | "teacup"
|
47 | | "templayed"
|
48 | | "toffee"
|
49 | | "twig"
|
50 | | "underscore"
|
51 | | "vash"
|
52 | | "velocityjs"
|
53 | | "walrus"
|
54 | | "whiskers";
|
55 |
|
56 | type Requires = SupportedTemplateEngines | "extend" | "ReactDOM" | "babel";
|
57 |
|
58 | type ConsolidateType = {
|
59 | [engine in SupportedTemplateEngines]: RendererInterface;
|
60 | };
|
61 |
|
62 | type RequiresType = {
|
63 | [engine in Requires]: any;
|
64 | };
|
65 |
|
66 | interface Consolidate extends ConsolidateType {
|
67 | |
68 |
|
69 |
|
70 | requires: RequiresType;
|
71 |
|
72 | |
73 |
|
74 |
|
75 |
|
76 |
|
77 | clearCache(): void;
|
78 | }
|
79 |
|
80 | interface RendererInterface {
|
81 | render(path: string, fn: (err: Error, html: string) => any): any;
|
82 |
|
83 | render(
|
84 | path: string,
|
85 | options: { cache?: boolean | undefined; [otherOptions: string]: any },
|
86 | fn: (err: Error, html: string) => any,
|
87 | ): any;
|
88 |
|
89 | render(path: string, options?: { cache?: boolean | undefined; [otherOptions: string]: any }): Promise<string>;
|
90 |
|
91 | (path: string, fn: (err: Error, html: string) => any): any;
|
92 |
|
93 | (
|
94 | path: string,
|
95 | options: { cache?: boolean | undefined; [otherOptions: string]: any },
|
96 | fn: (err: Error, html: string) => any,
|
97 | ): any;
|
98 |
|
99 | (path: string, options?: { cache?: boolean | undefined; [otherOptions: string]: any }): Promise<string>;
|
100 | }
|