@tsed/engines 7.83.3 → 8.0.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/lib/esm/components/AtplEngine.js.map +1 -1
  2. package/lib/esm/components/BracketEngine.js.map +1 -1
  3. package/lib/esm/components/DotEngine.js.map +1 -1
  4. package/lib/esm/components/DustEngine.js +2 -2
  5. package/lib/esm/components/DustEngine.js.map +1 -1
  6. package/lib/esm/components/EctEngine.js.map +1 -1
  7. package/lib/esm/components/EjsEngine.js.map +1 -1
  8. package/lib/esm/components/Engine.js.map +1 -1
  9. package/lib/esm/components/HamlCoffeeEngine.js.map +1 -1
  10. package/lib/esm/components/HamlEngine.js.map +1 -1
  11. package/lib/esm/components/HamletEngine.js.map +1 -1
  12. package/lib/esm/components/HandlebarsEngine.js.map +1 -1
  13. package/lib/esm/components/HoganEngine.js.map +1 -1
  14. package/lib/esm/components/HtmlingEngine.js.map +1 -1
  15. package/lib/esm/components/JazzEngine.js.map +1 -1
  16. package/lib/esm/components/JqtplEngine.js.map +1 -1
  17. package/lib/esm/components/JustEngine.js.map +1 -1
  18. package/lib/esm/components/LiquorEngine.js.map +1 -1
  19. package/lib/esm/components/LodashEngine.js.map +1 -1
  20. package/lib/esm/components/MoteEngine.js.map +1 -1
  21. package/lib/esm/components/MustacheEngine.js.map +1 -1
  22. package/lib/esm/components/NunjucksEngine.js +0 -1
  23. package/lib/esm/components/NunjucksEngine.js.map +1 -1
  24. package/lib/esm/components/PlatesEngine.js.map +1 -1
  25. package/lib/esm/components/PugEngine.js.map +1 -1
  26. package/lib/esm/components/RactiveEngine.js.map +1 -1
  27. package/lib/esm/components/ReactEngine.js +2 -2
  28. package/lib/esm/components/ReactEngine.js.map +1 -1
  29. package/lib/esm/components/SlmEngine.js.map +1 -1
  30. package/lib/esm/components/SquirrellyEngine.js.map +1 -1
  31. package/lib/esm/components/SwigEngine.js.map +1 -1
  32. package/lib/esm/components/TemplayedEngine.js.map +1 -1
  33. package/lib/esm/components/TwigEngine.js.map +1 -1
  34. package/lib/esm/components/TwingEngine.js +1 -1
  35. package/lib/esm/components/TwingEngine.js.map +1 -1
  36. package/lib/esm/components/UnderscoreEngine.js.map +1 -1
  37. package/lib/esm/components/VashEngine.js.map +1 -1
  38. package/lib/esm/components/VelocityEngine.js.map +1 -1
  39. package/lib/esm/components/WalrusEngine.js.map +1 -1
  40. package/lib/esm/registries/EnginesContainer.js +1 -4
  41. package/lib/esm/registries/EnginesContainer.js.map +1 -1
  42. package/lib/esm/utils/cache.js +1 -1
  43. package/lib/esm/utils/cache.js.map +1 -1
  44. package/lib/esm/utils/getEngines.js.map +1 -1
  45. package/package.json +28 -27
  46. package/.nycrc +0 -26
  47. package/lib/cjs/components/AtplEngine.js +0 -13
  48. package/lib/cjs/components/AtplEngine.js.map +0 -1
  49. package/lib/cjs/components/BracketEngine.js +0 -18
  50. package/lib/cjs/components/BracketEngine.js.map +0 -1
  51. package/lib/cjs/components/DotEngine.js +0 -20
  52. package/lib/cjs/components/DotEngine.js.map +0 -1
  53. package/lib/cjs/components/DustEngine.js +0 -60
  54. package/lib/cjs/components/DustEngine.js.map +0 -1
  55. package/lib/cjs/components/EctEngine.js +0 -27
  56. package/lib/cjs/components/EctEngine.js.map +0 -1
  57. package/lib/cjs/components/EjsEngine.js +0 -13
  58. package/lib/cjs/components/EjsEngine.js.map +0 -1
  59. package/lib/cjs/components/Engine.js +0 -62
  60. package/lib/cjs/components/Engine.js.map +0 -1
  61. package/lib/cjs/components/HamlCoffeeEngine.js +0 -13
  62. package/lib/cjs/components/HamlCoffeeEngine.js.map +0 -1
  63. package/lib/cjs/components/HamlEngine.js +0 -19
  64. package/lib/cjs/components/HamlEngine.js.map +0 -1
  65. package/lib/cjs/components/HamletEngine.js +0 -19
  66. package/lib/cjs/components/HamletEngine.js.map +0 -1
  67. package/lib/cjs/components/HandlebarsEngine.js +0 -25
  68. package/lib/cjs/components/HandlebarsEngine.js.map +0 -1
  69. package/lib/cjs/components/HoganEngine.js +0 -21
  70. package/lib/cjs/components/HoganEngine.js.map +0 -1
  71. package/lib/cjs/components/HtmlingEngine.js +0 -17
  72. package/lib/cjs/components/HtmlingEngine.js.map +0 -1
  73. package/lib/cjs/components/JazzEngine.js +0 -17
  74. package/lib/cjs/components/JazzEngine.js.map +0 -1
  75. package/lib/cjs/components/JqtplEngine.js +0 -17
  76. package/lib/cjs/components/JqtplEngine.js.map +0 -1
  77. package/lib/cjs/components/JustEngine.js +0 -27
  78. package/lib/cjs/components/JustEngine.js.map +0 -1
  79. package/lib/cjs/components/LiquorEngine.js +0 -13
  80. package/lib/cjs/components/LiquorEngine.js.map +0 -1
  81. package/lib/cjs/components/LodashEngine.js +0 -20
  82. package/lib/cjs/components/LodashEngine.js.map +0 -1
  83. package/lib/cjs/components/MoteEngine.js +0 -13
  84. package/lib/cjs/components/MoteEngine.js.map +0 -1
  85. package/lib/cjs/components/MustacheEngine.js +0 -16
  86. package/lib/cjs/components/MustacheEngine.js.map +0 -1
  87. package/lib/cjs/components/NunjucksEngine.js +0 -56
  88. package/lib/cjs/components/NunjucksEngine.js.map +0 -1
  89. package/lib/cjs/components/PlatesEngine.js +0 -19
  90. package/lib/cjs/components/PlatesEngine.js.map +0 -1
  91. package/lib/cjs/components/PugEngine.js +0 -21
  92. package/lib/cjs/components/PugEngine.js.map +0 -1
  93. package/lib/cjs/components/RactiveEngine.js +0 -37
  94. package/lib/cjs/components/RactiveEngine.js.map +0 -1
  95. package/lib/cjs/components/ReactEngine.js +0 -137
  96. package/lib/cjs/components/ReactEngine.js.map +0 -1
  97. package/lib/cjs/components/SlmEngine.js +0 -13
  98. package/lib/cjs/components/SlmEngine.js.map +0 -1
  99. package/lib/cjs/components/SquirrellyEngine.js +0 -23
  100. package/lib/cjs/components/SquirrellyEngine.js.map +0 -1
  101. package/lib/cjs/components/SwigEngine.js +0 -21
  102. package/lib/cjs/components/SwigEngine.js.map +0 -1
  103. package/lib/cjs/components/TemplayedEngine.js +0 -16
  104. package/lib/cjs/components/TemplayedEngine.js.map +0 -1
  105. package/lib/cjs/components/TwigEngine.js +0 -28
  106. package/lib/cjs/components/TwigEngine.js.map +0 -1
  107. package/lib/cjs/components/TwingEngine.js +0 -29
  108. package/lib/cjs/components/TwingEngine.js.map +0 -1
  109. package/lib/cjs/components/UnderscoreEngine.js +0 -28
  110. package/lib/cjs/components/UnderscoreEngine.js.map +0 -1
  111. package/lib/cjs/components/VashEngine.js +0 -35
  112. package/lib/cjs/components/VashEngine.js.map +0 -1
  113. package/lib/cjs/components/VelocityEngine.js +0 -18
  114. package/lib/cjs/components/VelocityEngine.js.map +0 -1
  115. package/lib/cjs/components/WalrusEngine.js +0 -17
  116. package/lib/cjs/components/WalrusEngine.js.map +0 -1
  117. package/lib/cjs/decorators/viewEngine.js +0 -11
  118. package/lib/cjs/decorators/viewEngine.js.map +0 -1
  119. package/lib/cjs/index.js +0 -46
  120. package/lib/cjs/index.js.map +0 -1
  121. package/lib/cjs/package.json +0 -3
  122. package/lib/cjs/registries/EnginesContainer.js +0 -29
  123. package/lib/cjs/registries/EnginesContainer.js.map +0 -1
  124. package/lib/cjs/utils/cache.js +0 -163
  125. package/lib/cjs/utils/cache.js.map +0 -1
  126. package/lib/cjs/utils/getEngines.js +0 -47
  127. package/lib/cjs/utils/getEngines.js.map +0 -1
  128. package/lib/esm/package.json +0 -3
  129. package/lib/types-esm/components/AtplEngine.d.ts +0 -3
  130. package/lib/types-esm/components/BracketEngine.d.ts +0 -4
  131. package/lib/types-esm/components/DotEngine.d.ts +0 -5
  132. package/lib/types-esm/components/DustEngine.d.ts +0 -7
  133. package/lib/types-esm/components/EctEngine.d.ts +0 -5
  134. package/lib/types-esm/components/EjsEngine.d.ts +0 -3
  135. package/lib/types-esm/components/Engine.d.ts +0 -24
  136. package/lib/types-esm/components/HamlCoffeeEngine.d.ts +0 -3
  137. package/lib/types-esm/components/HamlEngine.d.ts +0 -4
  138. package/lib/types-esm/components/HamletEngine.d.ts +0 -4
  139. package/lib/types-esm/components/HandlebarsEngine.d.ts +0 -5
  140. package/lib/types-esm/components/HoganEngine.d.ts +0 -4
  141. package/lib/types-esm/components/HtmlingEngine.d.ts +0 -4
  142. package/lib/types-esm/components/JazzEngine.d.ts +0 -4
  143. package/lib/types-esm/components/JqtplEngine.d.ts +0 -4
  144. package/lib/types-esm/components/JustEngine.d.ts +0 -5
  145. package/lib/types-esm/components/LiquorEngine.d.ts +0 -3
  146. package/lib/types-esm/components/LodashEngine.d.ts +0 -5
  147. package/lib/types-esm/components/MoteEngine.d.ts +0 -3
  148. package/lib/types-esm/components/MustacheEngine.d.ts +0 -4
  149. package/lib/types-esm/components/NunjucksEngine.d.ts +0 -5
  150. package/lib/types-esm/components/PlatesEngine.d.ts +0 -4
  151. package/lib/types-esm/components/PugEngine.d.ts +0 -5
  152. package/lib/types-esm/components/RactiveEngine.d.ts +0 -5
  153. package/lib/types-esm/components/ReactEngine.d.ts +0 -21
  154. package/lib/types-esm/components/SlmEngine.d.ts +0 -3
  155. package/lib/types-esm/components/SquirrellyEngine.d.ts +0 -4
  156. package/lib/types-esm/components/SwigEngine.d.ts +0 -4
  157. package/lib/types-esm/components/TemplayedEngine.d.ts +0 -4
  158. package/lib/types-esm/components/TwigEngine.d.ts +0 -5
  159. package/lib/types-esm/components/TwingEngine.d.ts +0 -5
  160. package/lib/types-esm/components/UnderscoreEngine.d.ts +0 -6
  161. package/lib/types-esm/components/VashEngine.d.ts +0 -5
  162. package/lib/types-esm/components/VelocityEngine.d.ts +0 -4
  163. package/lib/types-esm/components/WalrusEngine.d.ts +0 -4
  164. package/lib/types-esm/decorators/viewEngine.d.ts +0 -2
  165. package/lib/types-esm/index.d.ts +0 -42
  166. package/lib/types-esm/registries/EnginesContainer.d.ts +0 -15
  167. package/lib/types-esm/utils/cache.d.ts +0 -40
  168. package/lib/types-esm/utils/getEngines.d.ts +0 -9
@@ -1,163 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var _a;
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.readPartials = exports.read = exports.cache = exports.clearCache = exports.getFromCache = exports.setToCache = exports.setEngine = exports.importEngine = exports.getCachedEngine = exports.requires = void 0;
28
- const node_path_1 = require("node:path");
29
- const promises_1 = require("node:fs/promises");
30
- const readCache = new Map();
31
- const cacheStore = new Map();
32
- exports.requires = new Map();
33
- function getCachedEngine(name, toName = name) {
34
- const mdl = exports.requires.get(toName) || {};
35
- return mdl.default || mdl;
36
- }
37
- exports.getCachedEngine = getCachedEngine;
38
- async function importEngine(name, toName = name) {
39
- if (!exports.requires.has(toName)) {
40
- await setEngine(name, toName);
41
- }
42
- return getCachedEngine(toName);
43
- }
44
- exports.importEngine = importEngine;
45
- async function setEngine(name, toName = name) {
46
- const mdl = await (_a = name, Promise.resolve().then(() => __importStar(require(_a))));
47
- exports.requires.set(toName, mdl);
48
- }
49
- exports.setEngine = setEngine;
50
- function setToCache(key, value) {
51
- readCache.set(key, value);
52
- }
53
- exports.setToCache = setToCache;
54
- function getFromCache(key) {
55
- return readCache.get(key);
56
- }
57
- exports.getFromCache = getFromCache;
58
- /**
59
- * Clear the cache.
60
- *
61
- * @api public
62
- */
63
- const clearCache = () => {
64
- readCache.clear();
65
- cacheStore.clear();
66
- };
67
- exports.clearCache = clearCache;
68
- /**
69
- * Conditionally cache `compiled` template based
70
- * on the `options` filename and `.cache` boolean.
71
- *
72
- * @param {Object} options
73
- * @param {Function} compiled
74
- * @return {Function}
75
- */
76
- function cache(options, compiled) {
77
- // cachable
78
- if (compiled && options.filename && options.cache) {
79
- readCache.delete(options.filename);
80
- cacheStore.set(options.filename, compiled);
81
- return compiled;
82
- }
83
- // check cache
84
- if (options.filename && options.cache) {
85
- return cacheStore.get(options.filename);
86
- }
87
- return compiled;
88
- }
89
- exports.cache = cache;
90
- /**
91
- * Read `path` with `options` with
92
- * callback `(err, str)`. When `options.cache`
93
- * is true the template string will be cached.
94
- *
95
- * @param path
96
- * @param {String} options
97
- */
98
- async function read(path, options) {
99
- let str = readCache.get(path);
100
- // cached (only if cached is a string and not a compiled template function)
101
- if (options.cache && str && typeof str === "string") {
102
- return str;
103
- }
104
- // read
105
- str = await (0, promises_1.readFile)(path, "utf8");
106
- // remove extraneous utf8 BOM marker
107
- str = str.replace(/^\uFEFF/, "");
108
- if (options.cache) {
109
- readCache.set(path, str);
110
- }
111
- return str;
112
- }
113
- exports.read = read;
114
- /**
115
- * Read `path` with `options` with
116
- * callback `(err, str)`. When `options.cache`
117
- * is true the partial string will be cached.
118
- *
119
- * @param path
120
- * @param {String} options
121
- * @api private
122
- */
123
- function readPartials(path, options) {
124
- if (!options.partials) {
125
- return Promise.resolve();
126
- }
127
- const keys = Object.keys(options.partials);
128
- const partials = {};
129
- return new Promise((resolve, reject) => {
130
- async function next(index) {
131
- if (index === keys.length) {
132
- return resolve(partials);
133
- }
134
- const key = keys[index];
135
- const partialPath = options.partials[key];
136
- if (partialPath === undefined || partialPath === null || partialPath === false) {
137
- return next(++index);
138
- }
139
- let file;
140
- if ((0, node_path_1.isAbsolute)(partialPath)) {
141
- if ((0, node_path_1.extname)(partialPath) !== "") {
142
- file = partialPath;
143
- }
144
- else {
145
- file = (0, node_path_1.join)(partialPath + (0, node_path_1.extname)(path));
146
- }
147
- }
148
- else {
149
- file = (0, node_path_1.join)((0, node_path_1.dirname)(path), partialPath + (0, node_path_1.extname)(path));
150
- }
151
- try {
152
- partials[key] = await read(file, options);
153
- next(++index);
154
- }
155
- catch (err) {
156
- reject(err);
157
- }
158
- }
159
- next(0);
160
- });
161
- }
162
- exports.readPartials = readPartials;
163
- //# sourceMappingURL=cache.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/utils/cache.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAA6D;AAC7D,+CAA0C;AAE1C,MAAM,SAAS,GAAwB,IAAI,GAAG,EAAE,CAAC;AACjD,MAAM,UAAU,GAAqB,IAAI,GAAG,EAAE,CAAC;AAElC,QAAA,QAAQ,GAAqB,IAAI,GAAG,EAAE,CAAC;AAEpD,SAAgB,eAAe,CAAC,IAAY,EAAE,SAAiB,IAAI;IACjE,MAAM,GAAG,GAAG,gBAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAEvC,OAAO,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC;AAC5B,CAAC;AAJD,0CAIC;AAEM,KAAK,UAAU,YAAY,CAAC,IAAY,EAAE,SAAiB,IAAI;IACpE,IAAI,CAAC,gBAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;QACzB,MAAM,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KAC/B;IAED,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAND,oCAMC;AAEM,KAAK,UAAU,SAAS,CAAC,IAAY,EAAE,SAAiB,IAAI;IACjE,MAAM,GAAG,GAAG,YAAa,IAAI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,EAAE,EAAE;oBAC/B,IAAI,GAAG,WAAW,CAAC;iBACpB;qBAAM;oBACL,IAAI,GAAG,IAAA,gBAAI,EAAC,WAAW,GAAG,IAAA,mBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;iBAC1C;aACF;iBAAM;gBACL,IAAI,GAAG,IAAA,gBAAI,EAAC,IAAA,mBAAO,EAAC,IAAI,CAAC,EAAE,WAAW,GAAG,IAAA,mBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;aACzD;YAED,IAAI;gBACF,QAAQ,CAAC,GAAG,CAAC,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBAC1C,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;aACf;YAAC,OAAO,GAAG,EAAE;gBACZ,MAAM,CAAC,GAAG,CAAC,CAAC;aACb;QACH,CAAC;QAED,IAAI,CAAC,CAAC,CAAC,CAAC;IACV,CAAC,CAAC,CAAC;AACL,CAAC;AA1CD,oCA0CC"}
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEngines = exports.getEngine = void 0;
4
- const EnginesContainer_js_1 = require("../registries/EnginesContainer.js");
5
- const callbackify = async (fn, cb) => {
6
- try {
7
- const html = await fn();
8
- cb && cb(null, html);
9
- return html;
10
- }
11
- catch (er) {
12
- if (cb) {
13
- cb(er);
14
- }
15
- else {
16
- throw er;
17
- }
18
- }
19
- };
20
- function getEngine(name) {
21
- const cb = async (path, options, cb) => {
22
- const engine = EnginesContainer_js_1.engines.get(name);
23
- await engine.$onInit();
24
- return callbackify(() => engine.renderFile(path, options), cb);
25
- };
26
- cb.render = async (template, options, cb) => {
27
- const engine = EnginesContainer_js_1.engines.get(name);
28
- await engine.$onInit();
29
- return callbackify(() => engine.render(template, options), cb);
30
- };
31
- return cb;
32
- }
33
- exports.getEngine = getEngine;
34
- let localEngines;
35
- function getEngines() {
36
- localEngines =
37
- localEngines ||
38
- EnginesContainer_js_1.engines.getSupportedEngines().reduce((acc, key) => {
39
- return {
40
- ...acc,
41
- [key]: getEngine(key)
42
- };
43
- }, {});
44
- return localEngines;
45
- }
46
- exports.getEngines = getEngines;
47
- //# sourceMappingURL=getEngines.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getEngines.js","sourceRoot":"","sources":["../../../src/utils/getEngines.ts"],"names":[],"mappings":";;;AACA,2EAA0D;AAW1D,MAAM,WAAW,GAAG,KAAK,EAAE,EAAO,EAAE,EAAmB,EAAE,EAAE;IACzD,IAAI;QACF,MAAM,IAAI,GAAG,MAAM,EAAE,EAAE,CAAC;QACxB,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC;KACb;IAAC,OAAO,EAAE,EAAE;QACX,IAAI,EAAE,EAAE;YACN,EAAE,CAAC,EAAE,CAAC,CAAC;SACR;aAAM;YACL,MAAM,EAAE,CAAC;SACV;KACF;AACH,CAAC,CAAC;AAEF,SAAgB,SAAS,CAAC,IAAY;IACpC,MAAM,EAAE,GAAG,KAAK,EAAE,IAAY,EAAE,OAAY,EAAE,EAAmB,EAAE,EAAE;QACnE,MAAM,MAAM,GAAG,6BAAO,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;QAClC,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;QAEvB,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;IACjE,CAAC,CAAC;IAEF,EAAE,CAAC,MAAM,GAAG,KAAK,EAAE,QAAgB,EAAE,OAAsB,EAAE,EAAkB,EAAE,EAAE;QACjF,MAAM,MAAM,GAAG,6BAAO,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;QAClC,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;QAEvB,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;IACjE,CAAC,CAAC;IAEF,OAAO,EAAS,CAAC;AACnB,CAAC;AAhBD,8BAgBC;AAED,IAAI,YAAiB,CAAC;AAEtB,SAAgB,UAAU;IACxB,YAAY;QACV,YAAY;YACZ,6BAAO,CAAC,mBAAmB,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;gBAChD,OAAO;oBACL,GAAG,GAAG;oBACN,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC;iBACtB,CAAC;YACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAET,OAAO,YAAY,CAAC;AACtB,CAAC;AAXD,gCAWC"}
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }
@@ -1,3 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class AtplEngine extends Engine {
3
- }
@@ -1,4 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class BracketEngine extends Engine {
3
- protected $compile(template: string, options: any): any;
4
- }
@@ -1,5 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class DotEngine extends Engine {
3
- getSettings(options: any): any;
4
- protected $compile(template: string, options: any): any;
5
- }
@@ -1,7 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class DustEngine extends Engine {
3
- private views;
4
- private ext;
5
- configure(options: any): void;
6
- protected $compile(template: string, options: any): any;
7
- }
@@ -1,5 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class EctEngine extends Engine {
3
- protected $compile(template: string, options: any): (options: any) => any;
4
- protected $compileFile(file: string, options: any): Promise<(options: any) => any>;
5
- }
@@ -1,3 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class EjsEngine extends Engine {
3
- }
@@ -1,24 +0,0 @@
1
- export interface ViewEngineOptions {
2
- requires?: string | string[];
3
- }
4
- export interface EngineOptions {
5
- cache?: boolean;
6
- [otherOptions: string]: any;
7
- }
8
- export declare class Engine {
9
- readonly name: string;
10
- readonly options: ViewEngineOptions;
11
- protected driverName: string;
12
- constructor(name: string, options: ViewEngineOptions);
13
- get engine(): any;
14
- $onInit(): Promise<void>;
15
- compile(template: string, options: EngineOptions): any;
16
- compileFile(file: string, options: EngineOptions): any;
17
- render(template: string, options: EngineOptions): Promise<any>;
18
- renderFile(file: string, options: EngineOptions): Promise<any>;
19
- protected readPartials(file: string, options: EngineOptions): Promise<EngineOptions>;
20
- protected $cacheOptions(template: string, options: EngineOptions, fromFile?: boolean): EngineOptions;
21
- protected $compile(template: string, options: EngineOptions): (options: EngineOptions) => Promise<string>;
22
- protected $compileFile(file: string, options: EngineOptions): Promise<(options: EngineOptions) => Promise<string>>;
23
- protected importEngine(name: string, options: ViewEngineOptions): Promise<void>;
24
- }
@@ -1,3 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class HamlCoffeeEngine extends Engine {
3
- }
@@ -1,4 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class HamlEngine extends Engine {
3
- protected $compile(template: string, options: any): (options: any) => Promise<any>;
4
- }
@@ -1,4 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class HamletEngine extends Engine {
3
- protected $compile(template: string, options: any): (options: any) => Promise<any>;
4
- }
@@ -1,5 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class HandlebarsEngine extends Engine {
3
- protected configure(options: any): void;
4
- protected $compile(template: string, options: any): any;
5
- }
@@ -1,4 +0,0 @@
1
- import { Engine, EngineOptions } from "./Engine.js";
2
- export declare class HoganEngine extends Engine {
3
- protected $compile(template: string, options: EngineOptions): (options: EngineOptions) => any;
4
- }
@@ -1,4 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class HtmlingEngine extends Engine {
3
- protected $compile(template: string): (options: any) => any;
4
- }
@@ -1,4 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class JazzEngine extends Engine {
3
- protected $compile(template: string, options: any): (options: any) => Promise<string>;
4
- }
@@ -1,4 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class JqtplEngine extends Engine {
3
- protected $compile(template: string, options: any): (options: any) => any;
4
- }
@@ -1,5 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class JustEngine extends Engine {
3
- protected $compile(template: string, options: any): (options: any) => any;
4
- protected $compileFile(file: string, options: any): Promise<(options: any) => any>;
5
- }
@@ -1,3 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class LiquorEngine extends Engine {
3
- }
@@ -1,5 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class LodashEngine extends Engine {
3
- render(template: string, options: any): any;
4
- protected $compile(template: string, options: any): any;
5
- }
@@ -1,3 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class MoteEngine extends Engine {
3
- }
@@ -1,4 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class MustacheEngine extends Engine {
3
- protected $compile(template: string, options: any): (options: any) => any;
4
- }
@@ -1,5 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class NunjucksEngine extends Engine {
3
- protected configure(options: any): any;
4
- protected $compile(template: string, options: any): (options: any) => any;
5
- }
@@ -1,4 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class PlatesEngine extends Engine {
3
- protected $compile(template: string, options: any): (options: any) => any;
4
- }
@@ -1,5 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class PugEngine extends Engine {
3
- protected $compile(template: string, options: any): any;
4
- protected $compileFile(file: string, options: any): any;
5
- }
@@ -1,5 +0,0 @@
1
- import { Engine, EngineOptions } from "./Engine.js";
2
- export declare class RactiveEngine extends Engine {
3
- protected $compile(template: string, options: EngineOptions): (options: EngineOptions) => any;
4
- protected clean(options: any): any;
5
- }
@@ -1,21 +0,0 @@
1
- import { Engine, EngineOptions, ViewEngineOptions } from "./Engine.js";
2
- export declare class ReactEngine extends Engine {
3
- constructor(name: string, options: ViewEngineOptions);
4
- $onInit(): Promise<void>;
5
- get babel(): any;
6
- get reactDOM(): any;
7
- protected patchRequire(): void;
8
- protected configure(options: EngineOptions): {
9
- base: any;
10
- enableCache: boolean | undefined;
11
- isNonStatic: any;
12
- };
13
- protected $compile(template: string, options: EngineOptions): () => any;
14
- protected $compileFile(file: string, options: EngineOptions): Promise<() => any>;
15
- protected renderWithBase(key: string, base: any, enableCache: undefined | boolean, options: EngineOptions): any;
16
- protected transformFileSync(filename: string): any;
17
- protected transform(src: string): any;
18
- protected requireReact(module: any, filename: string): any;
19
- protected requireReactString(src: string, filename?: string): any;
20
- protected reactBaseTmpl(data: any, options: any): any;
21
- }
@@ -1,3 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class SlmEngine extends Engine {
3
- }
@@ -1,4 +0,0 @@
1
- import { Engine, EngineOptions } from "./Engine.js";
2
- export declare class SquirrellyEngine extends Engine {
3
- protected $compile(template: string, options: EngineOptions): (options: EngineOptions) => any;
4
- }
@@ -1,4 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class SwigEngine extends Engine {
3
- protected $compile(template: string, options: any): (options: any) => Promise<string>;
4
- }
@@ -1,4 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class TemplayedEngine extends Engine {
3
- protected $compile(template: string, options: any): any;
4
- }
@@ -1,5 +0,0 @@
1
- import { Engine, EngineOptions } from "./Engine.js";
2
- export declare class TwigEngine extends Engine {
3
- protected $cacheOptions(template: string, options: any): any;
4
- protected $compile(template: string, options: EngineOptions): (options: EngineOptions) => any;
5
- }
@@ -1,5 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class TwingEngine extends Engine {
3
- private instance;
4
- protected $compile(template: string, options: any): (options: any) => Promise<string>;
5
- }
@@ -1,6 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class UnderscoreEngine extends Engine {
3
- render(template: string, options: any): Promise<string>;
4
- protected $cacheOptions(template: string, options: any): any;
5
- protected $compile(template: string, options: any): (options: any) => Promise<string>;
6
- }
@@ -1,5 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class VashEngine extends Engine {
3
- compile(template: string, options: any): (options: any) => Promise<string>;
4
- render(template: string, options: any): Promise<string>;
5
- }
@@ -1,4 +0,0 @@
1
- import { Engine, EngineOptions } from "./Engine.js";
2
- export declare class VelocityEngine extends Engine {
3
- protected $compile(template: string, options: EngineOptions): (options: EngineOptions) => Promise<any>;
4
- }
@@ -1,4 +0,0 @@
1
- import { Engine } from "./Engine.js";
2
- export declare class WalrusEngine extends Engine {
3
- protected $compile(template: string, options: any): (options: any) => any;
4
- }
@@ -1,2 +0,0 @@
1
- import { ViewEngineOptions } from "../components/Engine.js";
2
- export declare function ViewEngine(name: string, options?: ViewEngineOptions): ClassDecorator;
@@ -1,42 +0,0 @@
1
- /**
2
- * @file Automatically generated by @tsed/barrels.
3
- */
4
- export * from "./components/AtplEngine.js";
5
- export * from "./components/BracketEngine.js";
6
- export * from "./components/DotEngine.js";
7
- export * from "./components/DustEngine.js";
8
- export * from "./components/EctEngine.js";
9
- export * from "./components/EjsEngine.js";
10
- export * from "./components/Engine.js";
11
- export * from "./components/HamlCoffeeEngine.js";
12
- export * from "./components/HamlEngine.js";
13
- export * from "./components/HamletEngine.js";
14
- export * from "./components/HandlebarsEngine.js";
15
- export * from "./components/HoganEngine.js";
16
- export * from "./components/HtmlingEngine.js";
17
- export * from "./components/JazzEngine.js";
18
- export * from "./components/JqtplEngine.js";
19
- export * from "./components/JustEngine.js";
20
- export * from "./components/LiquorEngine.js";
21
- export * from "./components/LodashEngine.js";
22
- export * from "./components/MoteEngine.js";
23
- export * from "./components/MustacheEngine.js";
24
- export * from "./components/NunjucksEngine.js";
25
- export * from "./components/PlatesEngine.js";
26
- export * from "./components/PugEngine.js";
27
- export * from "./components/RactiveEngine.js";
28
- export * from "./components/ReactEngine.js";
29
- export * from "./components/SlmEngine.js";
30
- export * from "./components/SquirrellyEngine.js";
31
- export * from "./components/SwigEngine.js";
32
- export * from "./components/TemplayedEngine.js";
33
- export * from "./components/TwigEngine.js";
34
- export * from "./components/TwingEngine.js";
35
- export * from "./components/UnderscoreEngine.js";
36
- export * from "./components/VashEngine.js";
37
- export * from "./components/VelocityEngine.js";
38
- export * from "./components/WalrusEngine.js";
39
- export * from "./decorators/viewEngine.js";
40
- export * from "./registries/EnginesContainer.js";
41
- export * from "./utils/cache.js";
42
- export * from "./utils/getEngines.js";
@@ -1,15 +0,0 @@
1
- import { Engine, ViewEngineOptions } from "../components/Engine.js";
2
- export interface EngineProvider {
3
- name: string;
4
- useClass: typeof Engine;
5
- instance?: Engine;
6
- options: ViewEngineOptions;
7
- }
8
- export declare class EnginesContainer {
9
- #private;
10
- has(key: string | typeof Engine): boolean;
11
- get(key: string | typeof Engine): Engine | undefined;
12
- set(key: typeof Engine, provider: EngineProvider): void;
13
- getSupportedEngines(): string[];
14
- }
15
- export declare const engines: EnginesContainer;
@@ -1,40 +0,0 @@
1
- export declare const requires: Map<string, any>;
2
- export declare function getCachedEngine(name: string, toName?: string): any;
3
- export declare function importEngine(name: string, toName?: string): Promise<any>;
4
- export declare function setEngine(name: string, toName?: string): Promise<void>;
5
- export declare function setToCache(key: string, value: any): void;
6
- export declare function getFromCache(key: string): string | undefined;
7
- /**
8
- * Clear the cache.
9
- *
10
- * @api public
11
- */
12
- export declare const clearCache: () => void;
13
- /**
14
- * Conditionally cache `compiled` template based
15
- * on the `options` filename and `.cache` boolean.
16
- *
17
- * @param {Object} options
18
- * @param {Function} compiled
19
- * @return {Function}
20
- */
21
- export declare function cache(options: any, compiled?: any): any;
22
- /**
23
- * Read `path` with `options` with
24
- * callback `(err, str)`. When `options.cache`
25
- * is true the template string will be cached.
26
- *
27
- * @param path
28
- * @param {String} options
29
- */
30
- export declare function read(path: string, options: any): Promise<string>;
31
- /**
32
- * Read `path` with `options` with
33
- * callback `(err, str)`. When `options.cache`
34
- * is true the partial string will be cached.
35
- *
36
- * @param path
37
- * @param {String} options
38
- * @api private
39
- */
40
- export declare function readPartials(path: string, options: any): Promise<Record<string, string> | void>;
@@ -1,9 +0,0 @@
1
- export type RenderCallback = (err: Error | null, str?: string | any) => any;
2
- export interface EngineFunction {
3
- (path: string, options: any, cb: RenderCallback): void;
4
- (path: string, options: any): Promise<string>;
5
- render(template: string, options: any, cb: RenderCallback): void;
6
- render(template: string, options: any): Promise<string>;
7
- }
8
- export declare function getEngine(name: string): EngineFunction;
9
- export declare function getEngines(): Record<string, EngineFunction>;