Skip to content

Commit

Permalink
Merge pull request #295 from htdangkhoa/feature/local-setting
Browse files Browse the repository at this point in the history
chore: update index.d.ts
  • Loading branch information
htdangkhoa committed May 2, 2024
2 parents d02d8b9 + 0035875 commit f99d382
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import net from 'net';
import tls from 'tls';
import http from 'http';
import http2 from 'http2';
import * as net from 'net';
import * as tls from 'tls';
import * as http from 'http';
import * as http2 from 'http2';

declare module 'pure-http' {
export interface ICookieSerializeOptions {
Expand Down Expand Up @@ -271,14 +271,15 @@ declare module 'pure-http' {
stale?: boolean;
}

export interface ILocals {
set(key: string, value: any): this;
export interface IApplication extends IRouter {
set(key: string, value: any): void;
get<T = any>(key: string): T;
get(path: string | RegExp, ...handler: Array<Handler>): this;
}

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

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

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

0 comments on commit f99d382

Please sign in to comment.