@tsed/platform-views 6.95.6 → 6.95.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/platform-views",
|
|
3
|
-
"version": "6.95.
|
|
3
|
+
"version": "6.95.10",
|
|
4
4
|
"description": "Views module for Ts.ED Framework",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -23,19 +23,19 @@
|
|
|
23
23
|
"tslib": "2.2.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@tsed/core": "6.95.
|
|
27
|
-
"@tsed/di": "6.95.
|
|
26
|
+
"@tsed/core": "6.95.10",
|
|
27
|
+
"@tsed/di": "6.95.10",
|
|
28
28
|
"@tsed/engines": "^1.1.5",
|
|
29
|
-
"@tsed/exceptions": "6.95.
|
|
30
|
-
"@tsed/schema": "6.95.
|
|
29
|
+
"@tsed/exceptions": "6.95.10",
|
|
30
|
+
"@tsed/schema": "6.95.10",
|
|
31
31
|
"@types/consolidate": "0.14.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@tsed/core": "^6.95.
|
|
35
|
-
"@tsed/di": "^6.95.
|
|
34
|
+
"@tsed/core": "^6.95.10",
|
|
35
|
+
"@tsed/di": "^6.95.10",
|
|
36
36
|
"@tsed/engines": "^1.1.5",
|
|
37
|
-
"@tsed/exceptions": "^6.95.
|
|
38
|
-
"@tsed/schema": "^6.95.
|
|
37
|
+
"@tsed/exceptions": "^6.95.10",
|
|
38
|
+
"@tsed/schema": "^6.95.10"
|
|
39
39
|
},
|
|
40
40
|
"repository": "https://github.com/tsedio/tsed",
|
|
41
41
|
"bugs": {
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Use a view and sends the rendered HTML string to the client. Optional parameter:
|
|
3
|
-
*
|
|
4
|
-
* * viewOptions, an object whose properties define local variables for the view.
|
|
5
|
-
*
|
|
6
|
-
* The view argument is a string that is the file path of the view file to render.
|
|
7
|
-
* This can be an absolute path, or a path relative to the views setting.
|
|
8
|
-
* If the path does not contain a file extension, then the view engine setting determines the file extension.
|
|
9
|
-
* If the path does contain a file extension, then Express will load the module for the specified template engine (via require())
|
|
10
|
-
* and render it using the loaded module’s __express function.
|
|
11
|
-
*
|
|
12
|
-
* For more information, see [Using template engines with Express](http://expressjs.com/guide/using-template-engines.html).
|
|
13
|
-
*
|
|
14
|
-
* > NOTE: The view argument performs file system operations like reading a file from disk and evaluating Node.js modules,
|
|
15
|
-
* and as so for security reasons should not contain input from the end-user.
|
|
16
|
-
*
|
|
17
|
-
* @param path Relative path to the view file.
|
|
18
|
-
* @param options Additional options
|
|
19
|
-
* @decorator
|
|
20
|
-
* @operation
|
|
21
|
-
* @response
|
|
22
|
-
*/
|
|
23
|
-
export declare function View(path: string, options?: Object): MethodDecorator;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { BaseContext } from "@tsed/di";
|
|
2
|
-
export declare const PLATFORM_VIEWS_EXTENSIONS: {
|
|
3
|
-
atpl: string;
|
|
4
|
-
bracket: string;
|
|
5
|
-
dot: string;
|
|
6
|
-
dust: string;
|
|
7
|
-
ect: string;
|
|
8
|
-
ejs: string;
|
|
9
|
-
haml: string;
|
|
10
|
-
"haml-coffee": string;
|
|
11
|
-
hamlet: string;
|
|
12
|
-
hbs: string;
|
|
13
|
-
handlebars: string;
|
|
14
|
-
hogan: string;
|
|
15
|
-
htmling: string;
|
|
16
|
-
jazz: string;
|
|
17
|
-
jqtpl: string;
|
|
18
|
-
just: string;
|
|
19
|
-
kernel: string;
|
|
20
|
-
liquid: string;
|
|
21
|
-
liquor: string;
|
|
22
|
-
lodash: string;
|
|
23
|
-
mote: string;
|
|
24
|
-
mustache: string;
|
|
25
|
-
nunjucks: string;
|
|
26
|
-
plates: string;
|
|
27
|
-
pug: string;
|
|
28
|
-
qejs: string;
|
|
29
|
-
ractive: string;
|
|
30
|
-
razor: string;
|
|
31
|
-
jsx: string;
|
|
32
|
-
slm: string;
|
|
33
|
-
squirelly: string;
|
|
34
|
-
swig: string;
|
|
35
|
-
teacup: string;
|
|
36
|
-
templayed: string;
|
|
37
|
-
toffee: string;
|
|
38
|
-
twig: string;
|
|
39
|
-
underscore: string;
|
|
40
|
-
vash: string;
|
|
41
|
-
velocityjs: string;
|
|
42
|
-
walrus: string;
|
|
43
|
-
whiskers: string;
|
|
44
|
-
};
|
|
45
|
-
export declare type PlatformViewsExtensionsTypes = Record<string, string>;
|
|
46
|
-
export interface PlatformViewsEngineOptions extends Record<string, unknown> {
|
|
47
|
-
requires?: any;
|
|
48
|
-
}
|
|
49
|
-
export interface PlatformRenderOptions extends Record<string, unknown> {
|
|
50
|
-
$ctx: BaseContext;
|
|
51
|
-
}
|
|
52
|
-
export interface PlatformViewEngine {
|
|
53
|
-
options: PlatformViewsEngineOptions;
|
|
54
|
-
render(path: string, options: PlatformRenderOptions): Promise<string>;
|
|
55
|
-
}
|
|
56
|
-
export interface PlatformViewsSettings {
|
|
57
|
-
disabled?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Views directory.
|
|
60
|
-
*/
|
|
61
|
-
root?: string;
|
|
62
|
-
/**
|
|
63
|
-
* Enable cache. Ts.ED enable cache in PRODUCTION profile by default.
|
|
64
|
-
*/
|
|
65
|
-
cache?: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Provide extensions mapping to match the expected engines.
|
|
68
|
-
*/
|
|
69
|
-
extensions?: Partial<PlatformViewsExtensionsTypes>;
|
|
70
|
-
/**
|
|
71
|
-
* Default view engine extension.
|
|
72
|
-
* Allow omitting extension when using View decorator or render method.
|
|
73
|
-
*/
|
|
74
|
-
viewEngine?: string;
|
|
75
|
-
/**
|
|
76
|
-
* Options mapping for each engine.
|
|
77
|
-
*/
|
|
78
|
-
options?: Record<string, PlatformViewsEngineOptions>;
|
|
79
|
-
}
|
|
80
|
-
declare global {
|
|
81
|
-
namespace TsED {
|
|
82
|
-
interface Configuration {
|
|
83
|
-
/**
|
|
84
|
-
* Object to configure Views engines with Consolidate. See more on [View engine](/docs/template-engine.md).
|
|
85
|
-
*/
|
|
86
|
-
views: PlatformViewsSettings;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
package/lib/cjs/index.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Env } from "@tsed/core";
|
|
2
|
-
import { PlatformViewEngine, PlatformViewsEngineOptions, PlatformViewsExtensionsTypes } from "../domain/PlatformViewsSettings";
|
|
3
|
-
/**
|
|
4
|
-
* @platform
|
|
5
|
-
*/
|
|
6
|
-
export declare class PlatformViews {
|
|
7
|
-
#private;
|
|
8
|
-
env: Env;
|
|
9
|
-
readonly root: string;
|
|
10
|
-
readonly cache: boolean;
|
|
11
|
-
readonly disabled: string;
|
|
12
|
-
readonly viewEngine: string;
|
|
13
|
-
protected extensionsOptions: PlatformViewsExtensionsTypes;
|
|
14
|
-
protected engineOptions: Record<string, PlatformViewsEngineOptions>;
|
|
15
|
-
$onInit(): Promise<void>;
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated
|
|
18
|
-
*/
|
|
19
|
-
loadFromConsolidate(): Promise<void>;
|
|
20
|
-
loadFromTsedEngines(): Promise<void>;
|
|
21
|
-
getEngines(): {
|
|
22
|
-
extension: string;
|
|
23
|
-
engine: PlatformViewEngine;
|
|
24
|
-
}[];
|
|
25
|
-
registerEngine(engineType: string, engine: PlatformViewEngine): this;
|
|
26
|
-
getEngine(type: string): PlatformViewEngine | undefined;
|
|
27
|
-
getEngineOptions(engineType: string): PlatformViewsEngineOptions;
|
|
28
|
-
render(viewPath: string, options?: any): Promise<string>;
|
|
29
|
-
protected getExtension(viewPath: string): string;
|
|
30
|
-
protected resolve(viewPath: string): {
|
|
31
|
-
path: string;
|
|
32
|
-
extension: string;
|
|
33
|
-
};
|
|
34
|
-
}
|