nsp-server-pages 0.0.1 → 0.0.2
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/index.d.ts +9 -7
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -15,12 +15,14 @@ declare namespace NSP {
|
|
|
15
15
|
|
|
16
16
|
type TagFn<A, T = any> = (tag: TagDef<A, T>) => NodeFn<T>;
|
|
17
17
|
|
|
18
|
-
type LoaderFn = (path: string) => Promise<
|
|
18
|
+
type LoaderFn = (path: string) => Promise<NodeFn<any>>;
|
|
19
19
|
|
|
20
20
|
type TextFlex = string | Promise<string> | (string | Promise<string>)[];
|
|
21
21
|
|
|
22
|
+
type Build<T> = (nsp: App) => (context?: T) => string | Promise<string>;
|
|
23
|
+
|
|
22
24
|
interface TagDef<A, T = any> {
|
|
23
|
-
app:
|
|
25
|
+
app: App;
|
|
24
26
|
conf: any;
|
|
25
27
|
name: string;
|
|
26
28
|
attr: AttrFn<A, T>;
|
|
@@ -41,7 +43,7 @@ declare namespace NSP {
|
|
|
41
43
|
vKey?: string;
|
|
42
44
|
|
|
43
45
|
/**
|
|
44
|
-
* variable name for
|
|
46
|
+
* variable name for App instance
|
|
45
47
|
*/
|
|
46
48
|
nspKey?: string;
|
|
47
49
|
|
|
@@ -93,13 +95,13 @@ declare namespace NSP {
|
|
|
93
95
|
|
|
94
96
|
fn(name: string): (...args: any[]) => any;
|
|
95
97
|
|
|
96
|
-
load<T>(path: string): Promise<
|
|
98
|
+
load<T>(path: string): Promise<NodeFn<T>>;
|
|
97
99
|
|
|
98
|
-
loadFile<T>(file: string): Promise<
|
|
100
|
+
loadFile<T>(file: string): Promise<NodeFn<T>>;
|
|
99
101
|
|
|
100
|
-
loadJS<T>(file: string): Promise<
|
|
102
|
+
loadJS<T>(file: string): Promise<NodeFn<T>>;
|
|
101
103
|
|
|
102
|
-
loadJSP<T>(file: string): Promise<
|
|
104
|
+
loadJSP<T>(file: string): Promise<NodeFn<T>>;
|
|
103
105
|
|
|
104
106
|
log(message: string): void;
|
|
105
107
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nsp-server-pages",
|
|
3
3
|
"description": "NSP JavaScript Server Pages for Node.js",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.2",
|
|
5
5
|
"author": "@kawanet",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/kawanet/nsp-server-pages/issues"
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
},
|
|
20
20
|
"exports": {
|
|
21
21
|
"import": {
|
|
22
|
-
"
|
|
23
|
-
"
|
|
22
|
+
"types": "./index.d.ts",
|
|
23
|
+
"default": "./index.js"
|
|
24
24
|
},
|
|
25
25
|
"require": "./cjs/index.js"
|
|
26
26
|
},
|