From 003587516c7de257cbf17659733a2f78e7ea427c Mon Sep 17 00:00:00 2001 From: KhoaHTD Date: Thu, 2 May 2024 22:13:26 +0700 Subject: [PATCH] chore: update index.d.ts --- index.d.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/index.d.ts b/index.d.ts index ed2f348..069aa9f 100644 --- a/index.d.ts +++ b/index.d.ts @@ -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 { @@ -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(key: string): T; + get(path: string | RegExp, ...handler: Array): 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;