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