first commit
This commit is contained in:
commit
d69d3b7033
21 changed files with 1142 additions and 0 deletions
5
types/bun.d.ts
vendored
Normal file
5
types/bun.d.ts
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
import type { Server } from "bun";
|
||||
|
||||
declare global {
|
||||
type BunServer = Server;
|
||||
}
|
38
types/config.d.ts
vendored
Normal file
38
types/config.d.ts
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
type Environment = {
|
||||
port: number;
|
||||
host: string;
|
||||
development: boolean;
|
||||
};
|
||||
|
||||
type RedisConfig = {
|
||||
host: string;
|
||||
port: number;
|
||||
username?: string;
|
||||
password?: string;
|
||||
};
|
||||
|
||||
type IBooruDefaults = {
|
||||
search: string;
|
||||
random: string;
|
||||
id: string | [string, string];
|
||||
};
|
||||
|
||||
type IBooruConfigMap = {
|
||||
[key: string]: {
|
||||
enabled: boolean;
|
||||
name: string;
|
||||
aliases: string[];
|
||||
endpoint: string;
|
||||
functions: IBooruDefaults;
|
||||
auth?: Record<string, string>;
|
||||
};
|
||||
};
|
||||
|
||||
type IBooruConfig = {
|
||||
enabled: boolean;
|
||||
name: string;
|
||||
aliases: string[];
|
||||
endpoint: string;
|
||||
functions: IBooruDefaults;
|
||||
auth?: Record<string, string>;
|
||||
};
|
9
types/logger.d.ts
vendored
Normal file
9
types/logger.d.ts
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
type ILogMessagePart = { value: string; color: string };
|
||||
|
||||
type ILogMessageParts = {
|
||||
level: ILogMessagePart;
|
||||
filename: ILogMessagePart;
|
||||
readableTimestamp: ILogMessagePart;
|
||||
message: ILogMessagePart;
|
||||
[key: string]: ILogMessagePart;
|
||||
};
|
20
types/routes.d.ts
vendored
Normal file
20
types/routes.d.ts
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
type RouteDef = {
|
||||
method: string;
|
||||
accepts: string | null;
|
||||
returns: string;
|
||||
needsBody?: "multipart" | "json";
|
||||
};
|
||||
|
||||
type Query = Record<string, string>;
|
||||
type Params = Record<string, string>;
|
||||
|
||||
type RouteModule = {
|
||||
handler: (
|
||||
request: Request,
|
||||
server: BunServer,
|
||||
requestBody: unknown,
|
||||
query: Query,
|
||||
params: Params,
|
||||
) => Promise<Response> | Response;
|
||||
routeDef: RouteDef;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue