monorepo part 1

This commit is contained in:
Spencer Pogorzelski 2023-08-12 11:52:31 -07:00
parent aa838cbff6
commit 2138e02613
26 changed files with 681 additions and 14437 deletions

32
protocol/src/index.ts Normal file
View file

@ -0,0 +1,32 @@
export type ObjectValues<T> = T[keyof T];
export const C2SRequestTypes = {
HTTPRequest: 0,
WSOpen: 1,
WSClose: 2,
WSSendText: 3,
WSSendBinary: 4,
} as const;
export type C2SRequestType = ObjectValues<typeof C2SRequestTypes>;
export const S2CRequestTypes = {
HTTPResponse: 0,
WSOpen: 1,
WSDataText: 2,
WSDataBinary: 3,
} as const;
export type S2CRequestType = ObjectValues<typeof S2CRequestTypes>;
export type ProtoBareHeaders = Record<string, string | string[]>;
export type HTTPRequestPayload = {
method: string;
requestHeaders: ProtoBareHeaders;
body: string | null;
remote: URL;
};
export type HTTPResponsePayload = {
status: number;
statusText: string;
headers: ProtoBareHeaders;
};