@kosatyi/ejs 0.0.67 → 0.0.68
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 +2 -2
- package/types/global.d.ts +103 -0
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "EJS Templates",
|
|
4
4
|
"homepage": "https://github.com/kosatyi/ejs",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.68",
|
|
7
7
|
"main": "dist/cjs/index.js",
|
|
8
8
|
"module": "dist/esm/index.js",
|
|
9
9
|
"browser": "dist/umd/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
23
|
"dist",
|
|
24
|
-
"
|
|
24
|
+
"types"
|
|
25
25
|
],
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "rollup -c",
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
export namespace ejs {
|
|
3
|
+
/**
|
|
4
|
+
* extend layout with blocks in current template file
|
|
5
|
+
* @param layout
|
|
6
|
+
*/
|
|
7
|
+
function extend(layout: string): any
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* define block with custom **name** and callback
|
|
11
|
+
* @param name
|
|
12
|
+
* @param [callback]
|
|
13
|
+
*/
|
|
14
|
+
function block(name: string, callback?: Function): any
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* set property in current scope
|
|
18
|
+
* @param path
|
|
19
|
+
* @param value
|
|
20
|
+
*/
|
|
21
|
+
function set(path: string, value: any): any
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* get property in current scope
|
|
25
|
+
* @param path
|
|
26
|
+
* @param defaults
|
|
27
|
+
*/
|
|
28
|
+
function get(path: string, defaults?: any): any
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* import macro from file **path** and set to current scope **name** property
|
|
32
|
+
* @param path
|
|
33
|
+
* @param name
|
|
34
|
+
*/
|
|
35
|
+
function use(path: string, name: string): any
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* define macro function with custom **name**
|
|
39
|
+
* @param name
|
|
40
|
+
* @param callback
|
|
41
|
+
*/
|
|
42
|
+
function macro(name: string, callback: any): any
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* call macro function
|
|
46
|
+
* @param name
|
|
47
|
+
* @param props
|
|
48
|
+
* @param callback
|
|
49
|
+
*/
|
|
50
|
+
function call(name: string, props?: object, callback?: any): any
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* asynchronous template execution
|
|
54
|
+
* @param promise
|
|
55
|
+
* @param callback
|
|
56
|
+
*/
|
|
57
|
+
function async(promise: Promise<any>, callback?: any): any
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* asynchronous template execution
|
|
61
|
+
* @param callback
|
|
62
|
+
*/
|
|
63
|
+
function fn(callback: Function): any
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* @param {string} tag
|
|
68
|
+
* @param {object} attrs
|
|
69
|
+
* @param {function} content
|
|
70
|
+
*/
|
|
71
|
+
function el(tag: string, attrs?: object, content?: any): any
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* buffer output
|
|
75
|
+
* @param args
|
|
76
|
+
*/
|
|
77
|
+
function echo(...args: any[]): any
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* append rendered template from file
|
|
81
|
+
* @param path
|
|
82
|
+
* @param data
|
|
83
|
+
* @param cx
|
|
84
|
+
*/
|
|
85
|
+
function include(path: string, data?: object, cx?: boolean): any
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
* @param value
|
|
90
|
+
* @param callback
|
|
91
|
+
*/
|
|
92
|
+
function each(value: any, callback: Function): any
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* define block with custom **name** and callback
|
|
96
|
+
* @param {string} name
|
|
97
|
+
* @param {object} [props]
|
|
98
|
+
*/
|
|
99
|
+
function ui(name: string, props?: object): any
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export = global
|