initial commit

This commit is contained in:
creations 2025-05-01 13:53:38 -04:00
commit 44077f3ccd
Signed by: creations
GPG key ID: 8F553AA4320FC711
14 changed files with 461 additions and 0 deletions

14
types/bun.d.ts vendored Normal file
View file

@ -0,0 +1,14 @@
import type { Server } from "bun";
type Query = Record<string, string>;
type Params = Record<string, string>;
declare global {
type BunServer = Server;
interface ExtendedRequest extends Request {
startPerf: number;
query: Query;
params: Params;
}
}

5
types/config.d.ts vendored Normal file
View file

@ -0,0 +1,5 @@
type Environment = {
port: number;
host: string;
development: boolean;
};

9
types/logger.d.ts vendored Normal file
View file

@ -0,0 +1,9 @@
type ILogMessagePart = { value: string; color: string };
type ILogMessageParts = {
level: ILogMessagePart;
filename: ILogMessagePart;
readableTimestamp: ILogMessagePart;
message: ILogMessagePart;
[key: string]: ILogMessagePart;
};

15
types/routes.d.ts vendored Normal file
View file

@ -0,0 +1,15 @@
type RouteDef = {
method: string | string[];
accepts: string | null | string[];
returns: string;
needsBody?: "multipart" | "json";
};
type RouteModule = {
handler: (
request: Request | ExtendedRequest,
requestBody: unknown,
server: BunServer,
) => Promise<Response> | Response;
routeDef: RouteDef;
};