nexusframework 0.3.0-beta.72 → 0.3.0-beta.74
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/LICENSE.md +55 -55
- package/README.md +12 -12
- package/about/index.json +5 -5
- package/about/index.nhp +4 -4
- package/icon.png +0 -0
- package/index.d.ts +12 -15
- package/index.js +94 -81
- package/index.js.map +1 -1
- package/index.ts +101 -89
- package/indexOfSkeleton.nhp +133 -133
- package/legacySkeleton.nhp +22 -22
- package/loader/overlay.css +1 -1
- package/loader/overlay.html +25 -25
- package/loader/overlay.scss +152 -152
- package/package.json +102 -89
- package/scripts/es5/compat.js +101 -0
- package/scripts/es5/compat.js.map +1 -0
- package/scripts/es5/compat.min.js +2 -0
- package/scripts/es5/compat.min.js.map +1 -0
- package/scripts/es5/loader.js +0 -0
- package/scripts/es5/loader.js.map +0 -0
- package/scripts/es5/loader.min.js +1 -1
- package/scripts/es5/loader.min.js.map +0 -0
- package/scripts/es5/nexusframeworkclient.js +1092 -1103
- package/scripts/es5/nexusframeworkclient.js.map +1 -1
- package/scripts/es5/nexusframeworkclient.min.js +1 -1
- package/scripts/es5/nexusframeworkclient.min.js.map +1 -1
- package/scripts/es6/compat.js +65 -0
- package/scripts/es6/compat.js.map +1 -0
- package/scripts/es6/compat.min.js +2 -0
- package/scripts/es6/compat.min.js.map +1 -0
- package/scripts/es6/loader.js +0 -0
- package/scripts/es6/loader.js.map +0 -0
- package/scripts/es6/loader.min.js +1 -1
- package/scripts/es6/loader.min.js.map +0 -0
- package/scripts/es6/nexusframeworkclient.js +1026 -1049
- package/scripts/es6/nexusframeworkclient.js.map +1 -1
- package/scripts/es6/nexusframeworkclient.min.js +1 -1
- package/scripts/es6/nexusframeworkclient.min.js.map +1 -1
- package/scripts/index.d.ts +259 -251
- package/scripts/src/compat.ts +62 -0
- package/scripts/src/loader.ts +385 -385
- package/scripts/src/nexusframeworkclient.ts +1163 -1185
- package/scripts/tsconfig.json +11 -11
- package/src/cli.d.ts +1 -0
- package/src/cli.js +102 -102
- package/src/cli.js.map +1 -1
- package/src/cli.ts +101 -101
- package/src/compileScripts.d.ts +2 -2
- package/src/compileScripts.js +145 -145
- package/src/compileScripts.js.map +1 -1
- package/src/compileScripts.ts +153 -153
- package/src/nexusframework.d.ts +177 -168
- package/src/nexusframework.js +3578 -3422
- package/src/nexusframework.js.map +1 -1
- package/src/nexusframework.ts +3631 -3473
- package/templates/basic/package.json +3 -3
- package/templates/basic/www/skeleton.nhp +1 -1
- package/templates/bootstrap/package.json +2 -2
- package/templates/bootstrap/www/skeleton.nhp +1 -1
- package/templates/bootstrap-material-design/package.json +2 -2
- package/templates/bootstrap-material-design/www/skeleton.nhp +1 -1
- package/tsconfig.json +25 -22
- package/types.d.ts +612 -564
package/src/nexusframework.d.ts
CHANGED
|
@@ -1,168 +1,177 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
private
|
|
34
|
-
private
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
readonly
|
|
48
|
-
readonly
|
|
49
|
-
readonly
|
|
50
|
-
readonly
|
|
51
|
-
readonly
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
private
|
|
55
|
-
private
|
|
56
|
-
private
|
|
57
|
-
private
|
|
58
|
-
private
|
|
59
|
-
private
|
|
60
|
-
private
|
|
61
|
-
private
|
|
62
|
-
private
|
|
63
|
-
private
|
|
64
|
-
private
|
|
65
|
-
private
|
|
66
|
-
private
|
|
67
|
-
private
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
*
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
*
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
*
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
1
|
+
import { User, APIEncoder, ResponseLocals, StaticMountOptions, Renderer, PageSystemSkeleton, MountOptions, ImageResizerOptions, MappedRequestHandler, RequestHandler, RequestHandlerEntry, ExistsRequestHandler, RouteRequestHandler, AccessRequestHandler, RequestHandlerChildEntry, Request, Response } from "../types";
|
|
2
|
+
import { Application } from "express";
|
|
3
|
+
import socket_io = require("socket.io");
|
|
4
|
+
import express = require("express");
|
|
5
|
+
import events = require("events");
|
|
6
|
+
import http = require("http");
|
|
7
|
+
import nhp = require("nhp");
|
|
8
|
+
type Template = InstanceType<typeof nhp.Template>;
|
|
9
|
+
declare const Template: typeof nhp.Template;
|
|
10
|
+
export declare class LeafRequestHandler implements RequestHandlerEntry {
|
|
11
|
+
leaf: boolean;
|
|
12
|
+
handle: RequestHandler<any, any>;
|
|
13
|
+
constructor(handler: RequestHandler<any, any>, actuallyLeaf?: boolean);
|
|
14
|
+
children(): RequestHandlerChildEntry[];
|
|
15
|
+
childPaths(): any;
|
|
16
|
+
childAt(path: string, createIfNotExists?: boolean): RequestHandlerChildEntry;
|
|
17
|
+
setChild(path: string, handler: RequestHandlerChildEntry, createIfNotExists?: boolean): void;
|
|
18
|
+
view(type?: string): string;
|
|
19
|
+
setView(filename: string, type?: string): void;
|
|
20
|
+
index(): RequestHandlerEntry;
|
|
21
|
+
setIndex(index: RequestHandlerEntry): void;
|
|
22
|
+
routeHandler(): RouteRequestHandler<any, any>;
|
|
23
|
+
accessHandler(): AccessRequestHandler<any, any>;
|
|
24
|
+
existsHandler(): ExistsRequestHandler<any, any>;
|
|
25
|
+
setRouteHandler(index: RouteRequestHandler<any, any>): void;
|
|
26
|
+
setAccessHandler(index: AccessRequestHandler<any, any>): void;
|
|
27
|
+
setExistsHandler(index: ExistsRequestHandler<any, any>): void;
|
|
28
|
+
destroy(): void;
|
|
29
|
+
}
|
|
30
|
+
export declare class NHPRequestHandler extends LeafRequestHandler {
|
|
31
|
+
private impl;
|
|
32
|
+
private views;
|
|
33
|
+
private exists;
|
|
34
|
+
private access;
|
|
35
|
+
constructor(impl: RequestHandler<any, any>, redirect?: boolean);
|
|
36
|
+
view(type?: string): string;
|
|
37
|
+
setView(filename: string, type?: string): void;
|
|
38
|
+
accessHandler(): AccessRequestHandler<any, any>;
|
|
39
|
+
existsHandler(): ExistsRequestHandler<any, any>;
|
|
40
|
+
setAccessHandler(index: AccessRequestHandler<any, any>): void;
|
|
41
|
+
setExistsHandler(index: ExistsRequestHandler<any, any>): void;
|
|
42
|
+
}
|
|
43
|
+
export declare function createExtendedRequestHandler(): MappedRequestHandler;
|
|
44
|
+
export declare class NexusFramework extends events.EventEmitter {
|
|
45
|
+
readonly nhp: nhp;
|
|
46
|
+
readonly prefix: string;
|
|
47
|
+
readonly app: Application;
|
|
48
|
+
readonly server: http.Server;
|
|
49
|
+
readonly io?: socket_io.Server;
|
|
50
|
+
readonly logger: nulllogger.INullLogger;
|
|
51
|
+
static readonly apiencoders: {
|
|
52
|
+
[index: string]: APIEncoder<User, ResponseLocals<User>>;
|
|
53
|
+
};
|
|
54
|
+
private socketIOGuests;
|
|
55
|
+
private socketIOSetup;
|
|
56
|
+
private replacements;
|
|
57
|
+
private apis;
|
|
58
|
+
private versions;
|
|
59
|
+
private cookieParser;
|
|
60
|
+
private prestack;
|
|
61
|
+
private mounts;
|
|
62
|
+
private stack;
|
|
63
|
+
private default;
|
|
64
|
+
private renderoptions;
|
|
65
|
+
private afterbody;
|
|
66
|
+
private footer;
|
|
67
|
+
private header;
|
|
68
|
+
private loaderEnabled;
|
|
69
|
+
private multerInstance;
|
|
70
|
+
private logging;
|
|
71
|
+
constructor(app?: Application, server?: http.Server, logger?: nulllogger.INullLogger, prefix?: string, nhpoptions?: Object);
|
|
72
|
+
enableLoader(): void;
|
|
73
|
+
disableLoader(): void;
|
|
74
|
+
/**
|
|
75
|
+
* Push a named version into the array of versions and add a new resource replacement.
|
|
76
|
+
* The resource replacer can be accessed via `version_{{name}}`
|
|
77
|
+
*/
|
|
78
|
+
addVersion(version: string, name: string): void;
|
|
79
|
+
addReplacement(regex: RegExp, replacement: string | Function): void;
|
|
80
|
+
enableSignedCookies(secret: any): void;
|
|
81
|
+
installAfterBodyRenderer(renderer: Renderer): void;
|
|
82
|
+
installFooterRenderer(renderer: Renderer): void;
|
|
83
|
+
installHeaderRenderer(renderer: Renderer): void;
|
|
84
|
+
installAPI(ext: string, encoder: APIEncoder<User, ResponseLocals<User>>): void;
|
|
85
|
+
enableAPIs(encoders: string[]): void;
|
|
86
|
+
enableLogging(): void;
|
|
87
|
+
/**
|
|
88
|
+
* Set the skeleton to use for legacy browsers.
|
|
89
|
+
* By default NexusFramework displays a Not Supported message.
|
|
90
|
+
*
|
|
91
|
+
* This includes IE below version 10,
|
|
92
|
+
* Chrome below version 4,
|
|
93
|
+
* Firefox below version 3,
|
|
94
|
+
* Safari below version 3.1 and
|
|
95
|
+
* Opera below version 3.5.
|
|
96
|
+
*/
|
|
97
|
+
setLegacySkeleton(val: string | Template): void;
|
|
98
|
+
setIndexOfSkeleton(val: string | Template): void;
|
|
99
|
+
setSkeleton(val: string | Template): void;
|
|
100
|
+
setPageSystemSkeleton(val: string | PageSystemSkeleton): void;
|
|
101
|
+
setErrorDocument(code: number | "*", page?: string): void;
|
|
102
|
+
mountScripts(mpath?: string): void;
|
|
103
|
+
mountAbout(mpath?: string, opts?: MountOptions): void;
|
|
104
|
+
setupPageSystem(): void;
|
|
105
|
+
setupIO(path?: string, withPageSystem?: boolean, guestsToo?: boolean): string;
|
|
106
|
+
/**
|
|
107
|
+
* Mount a NHP page system.
|
|
108
|
+
*
|
|
109
|
+
* @param wwwpath The web path
|
|
110
|
+
* @param fspath The filesystem path
|
|
111
|
+
* @param options The optional mount options
|
|
112
|
+
*/
|
|
113
|
+
mount(webpath: string, fspath: string, options?: MountOptions): RequestHandlerEntry;
|
|
114
|
+
mountImageResizer(webpath: string, imagefile: string, options?: ImageResizerOptions): RequestHandlerEntry;
|
|
115
|
+
/**
|
|
116
|
+
* Mount a directory.
|
|
117
|
+
*
|
|
118
|
+
* @param webpath The web path
|
|
119
|
+
* @param fspath The filesystem path
|
|
120
|
+
* @param options The mount options
|
|
121
|
+
*/
|
|
122
|
+
mountStatic(webpath: string, fspath: string, options?: StaticMountOptions): RequestHandlerEntry;
|
|
123
|
+
/**
|
|
124
|
+
* Set a request handler for the specified path.
|
|
125
|
+
* Replaces any existing request handler.
|
|
126
|
+
*
|
|
127
|
+
* @param path The path
|
|
128
|
+
* @param handler The request handler
|
|
129
|
+
* @param leaf Whether or not this handler is a leaf, or branch
|
|
130
|
+
*/
|
|
131
|
+
mountHandler(webpath: string, handler: RequestHandler<any, any>, leaf?: boolean): RequestHandlerEntry;
|
|
132
|
+
/**
|
|
133
|
+
* Set the default handler, its the handler that gets used when no mounts take the request.
|
|
134
|
+
*/
|
|
135
|
+
setDefaultHandler(handler: RequestHandlerEntry): void;
|
|
136
|
+
/**
|
|
137
|
+
* Start listening on a specific port.
|
|
138
|
+
*/
|
|
139
|
+
listen(port: number, callbackOrHost?: string | Function, callback?: Function): void;
|
|
140
|
+
/**
|
|
141
|
+
* NexusFork compatible handler.
|
|
142
|
+
*/
|
|
143
|
+
handle(req: Request<any>, res: Response<any, any>, next: (err?: Error) => void): void;
|
|
144
|
+
/**
|
|
145
|
+
* Push middleware to the end of the stack.
|
|
146
|
+
*/
|
|
147
|
+
pushMiddleware(middleware: RequestHandler<any, any>, pre?: boolean): void;
|
|
148
|
+
/**
|
|
149
|
+
* Unshift middleware onto the beginning of the stack.
|
|
150
|
+
*/
|
|
151
|
+
unshiftMiddleware(middleware: RequestHandler<any, any>, pre?: boolean): void;
|
|
152
|
+
/**
|
|
153
|
+
* Alias for pushMiddleware
|
|
154
|
+
*/
|
|
155
|
+
use: (middleware: RequestHandler<any, any>) => void;
|
|
156
|
+
runMiddleware(req: Request<any>, res: Response<any, any>, next: (err?: Error) => void): void;
|
|
157
|
+
/**
|
|
158
|
+
* Process the incoming request
|
|
159
|
+
*/
|
|
160
|
+
process(req: Request<any>, res: Response<any, any>, next: (err?: Error) => void): void;
|
|
161
|
+
upgrade(req: Request<User>, res: Response<User, ResponseLocals<User>>, next: (err?: Error) => void): void;
|
|
162
|
+
static nexusforkUpgrade(req: express.Request, res: express.Response): void;
|
|
163
|
+
/**
|
|
164
|
+
* Express compatible handler
|
|
165
|
+
*/
|
|
166
|
+
__express(req: express.Request, res: express.Response, next: express.NextFunction): void;
|
|
167
|
+
static expressUpgradeRequest(req: http.IncomingMessage, onPrototype?: boolean): void;
|
|
168
|
+
static expressUpgradeResponse(res: http.ServerResponse, onPrototype?: boolean): void;
|
|
169
|
+
static expressUpgrade(req: http.IncomingMessage, res: http.ServerResponse, onPrototype?: boolean): void;
|
|
170
|
+
/**
|
|
171
|
+
* HTTP compatible handler
|
|
172
|
+
*/
|
|
173
|
+
__http(req: http.IncomingMessage, res: http.ServerResponse, next: express.NextFunction): void;
|
|
174
|
+
close(cb?: Function): void;
|
|
175
|
+
isIOSetup(): boolean;
|
|
176
|
+
}
|
|
177
|
+
export {};
|