declare
This commit is contained in:
		
							
								
								
									
										17
									
								
								dist/index.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								dist/index.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
				
			|||||||
 | 
					import Router from "./router.js";
 | 
				
			||||||
 | 
					import Tpl from "./template.js";
 | 
				
			||||||
 | 
					import { Handler } from "./types.js";
 | 
				
			||||||
 | 
					export { Router, Tpl };
 | 
				
			||||||
 | 
					export default class Flummpress {
 | 
				
			||||||
 | 
					    private server?;
 | 
				
			||||||
 | 
					    router: Router;
 | 
				
			||||||
 | 
					    tpl: Tpl;
 | 
				
			||||||
 | 
					    middleware: Handler[];
 | 
				
			||||||
 | 
					    constructor();
 | 
				
			||||||
 | 
					    use(plugin: Router | Tpl | Handler): this;
 | 
				
			||||||
 | 
					    private processPipeline;
 | 
				
			||||||
 | 
					    listen(...args: any[]): this;
 | 
				
			||||||
 | 
					    private parseRequest;
 | 
				
			||||||
 | 
					    private readBody;
 | 
				
			||||||
 | 
					    private createResponse;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										26
									
								
								dist/router.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								dist/router.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
				
			|||||||
 | 
					import Tpl from "./template.js";
 | 
				
			||||||
 | 
					import { Handler } from "./types.js";
 | 
				
			||||||
 | 
					export default class Router {
 | 
				
			||||||
 | 
					    private routes;
 | 
				
			||||||
 | 
					    private tpl?;
 | 
				
			||||||
 | 
					    private mimes;
 | 
				
			||||||
 | 
					    constructor();
 | 
				
			||||||
 | 
					    importRoutesFromPath(p: string, tpl?: Tpl | false): Promise<this>;
 | 
				
			||||||
 | 
					    group(basePath: string | RegExp, callback: (methods: any) => void): this;
 | 
				
			||||||
 | 
					    private combinePaths;
 | 
				
			||||||
 | 
					    use(obj: Router | Tpl): void;
 | 
				
			||||||
 | 
					    get(path: string | RegExp, ...callback: Handler[]): this;
 | 
				
			||||||
 | 
					    post(path: string | RegExp, ...callback: Handler[]): this;
 | 
				
			||||||
 | 
					    head(path: string | RegExp, ...callback: Handler[]): this;
 | 
				
			||||||
 | 
					    put(path: string | RegExp, ...callback: Handler[]): this;
 | 
				
			||||||
 | 
					    delete(path: string | RegExp, ...callback: Handler[]): this;
 | 
				
			||||||
 | 
					    patch(path: string | RegExp, ...callback: Handler[]): this;
 | 
				
			||||||
 | 
					    private registerRoute;
 | 
				
			||||||
 | 
					    getRoute(path: string, method: string): any;
 | 
				
			||||||
 | 
					    private sortRoutes;
 | 
				
			||||||
 | 
					    private readMimes;
 | 
				
			||||||
 | 
					    static({ dir, route }: {
 | 
				
			||||||
 | 
					        dir?: string;
 | 
				
			||||||
 | 
					        route?: RegExp;
 | 
				
			||||||
 | 
					    }): this;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										18
									
								
								dist/template.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								dist/template.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
				
			|||||||
 | 
					export default class Template {
 | 
				
			||||||
 | 
					    private views;
 | 
				
			||||||
 | 
					    private globals;
 | 
				
			||||||
 | 
					    private cache;
 | 
				
			||||||
 | 
					    private templates;
 | 
				
			||||||
 | 
					    private debug;
 | 
				
			||||||
 | 
					    constructor();
 | 
				
			||||||
 | 
					    setDebug(debug: boolean): void;
 | 
				
			||||||
 | 
					    setViews(views: string): void;
 | 
				
			||||||
 | 
					    setGlobals(globals: Record<string, any>): void;
 | 
				
			||||||
 | 
					    setCache(cache: boolean): void;
 | 
				
			||||||
 | 
					    private readdir;
 | 
				
			||||||
 | 
					    private getTemplate;
 | 
				
			||||||
 | 
					    render(file: string, data?: Record<string, any>, locals?: Record<string, any>): string;
 | 
				
			||||||
 | 
					    escape(str: string): string;
 | 
				
			||||||
 | 
					    forEach(o: any, f: (value: any, key: string | number) => void): void;
 | 
				
			||||||
 | 
					    getMtime(file: string): number;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -7,7 +7,8 @@
 | 
				
			|||||||
    "rootDir": "./src",
 | 
					    "rootDir": "./src",
 | 
				
			||||||
    "strict": true,
 | 
					    "strict": true,
 | 
				
			||||||
    "esModuleInterop": true,
 | 
					    "esModuleInterop": true,
 | 
				
			||||||
    "removeComments": true
 | 
					    "removeComments": true,
 | 
				
			||||||
 | 
					    "declaration": true
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "include": ["src"],
 | 
					  "include": ["src"],
 | 
				
			||||||
  "exclude": ["node_modules"]
 | 
					  "exclude": ["node_modules"]
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user