Revert "-.-"

This reverts commit 945832b6c28f5cbdb808d2b5168333bab4074c09.
This commit is contained in:
Flummi 2025-03-19 12:57:19 +01:00
parent 945832b6c2
commit b6757715e3
3 changed files with 1 additions and 54 deletions

View File

@ -10,7 +10,6 @@
"keywords": [],
"author": "Flummi",
"license": "ISC",
"types": "types/index.d.ts",
"type": "module",
"devDependencies": {
"@types/node": "^22.13.10",

View File

@ -7,10 +7,7 @@
"rootDir": "./src",
"strict": true,
"esModuleInterop": true,
"removeComments": true,
"types": [
"node"
]
"removeComments": true
},
"include": ["src"],
"exclude": ["node_modules"]

49
types/index.d.ts vendored
View File

@ -1,49 +0,0 @@
import { Handler } from "../src/types.d.js";
declare class Flummpress {
constructor();
router: Router;
tpl: Template;
middleware: Handler[];
use(plugin: Router | Template | Handler): this;
listen(...args: any[]): this;
}
declare class Router {
importRoutesFromPath(p: string, tpl?: Template | false): Promise<this>;
group(basePath: string | RegExp, callback: (methods: {
get: (path: string | RegExp, ...handlers: Handler[]) => void;
post: (path: string | RegExp, ...handlers: Handler[]) => void;
put: (path: string | RegExp, ...handlers: Handler[]) => void;
delete: (path: string | RegExp, ...handlers: Handler[]) => void;
patch: (path: string | RegExp, ...handlers: Handler[]) => void;
}) => void): this;
use(obj: Router | Template): void;
get(path: string | RegExp, ...handlers: Handler[]): this;
post(path: string | RegExp, ...handlers: Handler[]): this;
head(path: string | RegExp, ...handlers: Handler[]): this;
put(path: string | RegExp, ...handlers: Handler[]): this;
delete(path: string | RegExp, ...handlers: Handler[]): this;
patch(path: string | RegExp, ...handlers: Handler[]): this;
static(options: { dir?: string; route?: RegExp }): this;
getRoute(path: string, method: string): { path: string | RegExp; methods: { [method: string]: Handler[] } } | undefined;
}
declare class Template {
setDebug(debug: boolean): void;
setViews(views: string): void;
setGlobals(globals: Record<string, any>): void;
setCache(cache: boolean): void;
render(file: string, data?: Record<string, any>, locals?: Record<string, any>): string;
escape(str: string): string;
getMtime(file: string): number;
}
export { Flummpress, Router, Template };
export default Flummpress;