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