Skip to content

Commit

Permalink
chore: update index.d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
htdangkhoa committed May 2, 2024
1 parent b638686 commit a8ac6ed
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ declare module 'pure-http' {
body?: any;

header(name: string): undefined | string | string[];

app: IPureHttpServer | IPureHttpSecureServer;
}

export interface IRequestHttp extends http.IncomingMessage, IRequest {}
Expand Down Expand Up @@ -269,9 +271,14 @@ declare module 'pure-http' {
stale?: boolean;
}

export interface IPureHttpServer extends net.Server, IRouter {}
export interface ILocals {
set(key: string, value: any): this;
get<T = any>(key: string): T;
}

export interface IPureHttpServer extends net.Server, IRouter, ILocals {}

export interface IPureHttpSecureServer extends tls.Server, IRouter {}
export interface IPureHttpSecureServer extends tls.Server, IRouter, ILocals {}

export interface IOptions {
server?: net.Server | tls.Server;
Expand Down

0 comments on commit a8ac6ed

Please sign in to comment.