forked from creations/profilePage
first commit
This commit is contained in:
commit
b11c87a506
26 changed files with 1782 additions and 0 deletions
14
types/bun.d.ts
vendored
Normal file
14
types/bun.d.ts
vendored
Normal 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;
|
||||
}
|
||||
}
|
10
types/config.d.ts
vendored
Normal file
10
types/config.d.ts
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
type Environment = {
|
||||
port: number;
|
||||
host: string;
|
||||
development: boolean;
|
||||
};
|
||||
|
||||
type LanyardConfig = {
|
||||
userId: string;
|
||||
instance: string;
|
||||
};
|
3
types/ejs.d.ts
vendored
Normal file
3
types/ejs.d.ts
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
interface EjsTemplateData {
|
||||
[key: string]: string | number | boolean | object | undefined | null;
|
||||
}
|
72
types/lanyard.d.ts
vendored
Normal file
72
types/lanyard.d.ts
vendored
Normal file
|
@ -0,0 +1,72 @@
|
|||
interface DiscordUser {
|
||||
id: string;
|
||||
username: string;
|
||||
avatar: string;
|
||||
discriminator: string;
|
||||
clan?: string | null;
|
||||
avatar_decoration_data?: {
|
||||
sku_id: string;
|
||||
asset: string;
|
||||
expires_at: string | null;
|
||||
};
|
||||
bot: boolean;
|
||||
global_name: string;
|
||||
primary_guild?: string | null;
|
||||
collectibles?: {
|
||||
enabled: boolean;
|
||||
disabled: boolean;
|
||||
};
|
||||
display_name: string;
|
||||
public_flags: number;
|
||||
}
|
||||
|
||||
interface Activity {
|
||||
id: string;
|
||||
name: string;
|
||||
type: number;
|
||||
state: string;
|
||||
created_at: number;
|
||||
}
|
||||
|
||||
interface SpotifyData {
|
||||
track_id: string;
|
||||
album_id: string;
|
||||
album_name: string;
|
||||
artist_name: string;
|
||||
track_name: string;
|
||||
}
|
||||
|
||||
interface Kv {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
interface LanyardData {
|
||||
kv: Kv;
|
||||
discord_user: DiscordUser;
|
||||
activities: Activity[];
|
||||
discord_status: string;
|
||||
active_on_discord_web: boolean;
|
||||
active_on_discord_desktop: boolean;
|
||||
active_on_discord_mobile: boolean;
|
||||
listening_to_spotify?: boolean;
|
||||
spotify?: SpotifyData;
|
||||
spotify_status: string;
|
||||
active_on_spotify: boolean;
|
||||
active_on_xbox: boolean;
|
||||
active_on_playstation: boolean;
|
||||
}
|
||||
|
||||
type LanyardSuccess = {
|
||||
success: true;
|
||||
data: LanyardData;
|
||||
};
|
||||
|
||||
type LanyardError = {
|
||||
success: false;
|
||||
error: {
|
||||
code: string;
|
||||
message: string;
|
||||
};
|
||||
};
|
||||
|
||||
type LanyardResponse = LanyardSuccess | LanyardError;
|
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;
|
||||
};
|
15
types/routes.d.ts
vendored
Normal file
15
types/routes.d.ts
vendored
Normal 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;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue