@tinyhttp/res
Advanced tools
Comparing version 2.0.16 to 2.0.17
/// <reference types="node" /> | ||
import { ServerResponse as S } from 'http'; | ||
declare type Res = Pick<S, 'getHeader' | 'setHeader'>; | ||
import { ServerResponse as Res } from 'http'; | ||
export declare const append: <Response_1 extends Res = Res>(res: Response_1) => (field: string, value: string | number | string[]) => Response_1; | ||
export {}; |
/// <reference types="node" /> | ||
import { IncomingMessage as I, ServerResponse as S } from 'http'; | ||
import { IncomingMessage as Req, ServerResponse as Res } from 'http'; | ||
import * as cookie from '@tinyhttp/cookie'; | ||
declare type Res = Pick<S, 'setHeader' | 'getHeader'>; | ||
export declare const setCookie: <Request_1 extends I = I, Response_1 extends Res = Res>(req: Request_1 & { | ||
export declare const setCookie: <Request_1 extends Req = Req, Response_1 extends Res = Res>(req: Request_1 & { | ||
secret?: string | string[]; | ||
@@ -10,3 +9,2 @@ }, res: Response_1) => (name: string, value: string | Record<string, unknown>, options?: cookie.SerializeOptions & Partial<{ | ||
}>) => Response_1; | ||
export declare const clearCookie: <Request_1 extends I = I, Response_1 extends Res = Res>(req: Request_1, res: Response_1) => (name: string, options?: cookie.SerializeOptions) => Response_1; | ||
export {}; | ||
export declare const clearCookie: <Request_1 extends Req = Req, Response_1 extends Res = Res>(req: Request_1, res: Response_1) => (name: string, options?: cookie.SerializeOptions) => Response_1; |
/// <reference types="node" /> | ||
import { IncomingMessage as I, ServerResponse as S } from 'http'; | ||
import { IncomingMessage as Req, ServerResponse as Res } from 'http'; | ||
import type { SendFileOptions } from '@tinyhttp/send'; | ||
@@ -8,6 +8,4 @@ export declare type DownloadOptions = SendFileOptions & Partial<{ | ||
declare type Callback = (err?: any) => void; | ||
declare type Req = Pick<I, 'headers'>; | ||
declare type Res = Pick<S, 'setHeader' | 'statusCode' | 'writeHead'> & NodeJS.WritableStream; | ||
export declare const download: <Request_1 extends Req = Req, Response_1 extends Res = Res>(req: Request_1, res: Response_1) => (path: string, filename?: string | Callback, options?: DownloadOptions | Callback, cb?: Callback) => Response_1; | ||
export declare const attachment: <Response_1 extends Pick<S, "setHeader" | "getHeader"> = Pick<S, "setHeader" | "getHeader">>(res: Response_1) => (filename?: string) => Response_1; | ||
export declare const attachment: <Response_1 extends Res>(res: Response_1) => (filename?: string) => Response_1; | ||
export {}; |
/// <reference types="node" /> | ||
import { IncomingMessage as I } from 'http'; | ||
import type { Res } from './redirect.js'; | ||
import { IncomingMessage as Req, ServerResponse as Res } from 'http'; | ||
export declare type FormatProps = { | ||
@@ -13,4 +12,3 @@ default?: () => void; | ||
declare type next = (err?: FormatError) => void; | ||
declare type Req = Pick<I, 'headers'>; | ||
export declare const formatResponse: <Request_1 extends Req = Req, Response_1 extends Res = Res, Next extends next = next>(req: Request_1, res: Response_1, next: Next) => (obj: FormatProps) => Response_1; | ||
export {}; |
/// <reference types="node" /> | ||
import { IncomingMessage as I, ServerResponse as S } from 'http'; | ||
declare type Res = Pick<S, 'setHeader' | 'getHeader'>; | ||
declare type Req = Pick<I, 'headers'>; | ||
import { IncomingMessage as Req, ServerResponse as Res } from 'http'; | ||
export declare const setHeader: <Response_1 extends Res = Res>(res: Response_1) => (field: string | Record<string, string | number | string[]>, val?: string | number | readonly string[]) => Response_1; | ||
@@ -13,2 +11,1 @@ export declare const setLocationHeader: <Request_1 extends Req = Req, Response_1 extends Res = Res>(req: Request_1, res: Response_1) => (url: string) => Response_1; | ||
export declare const setContentType: <Response_1 extends Res = Res>(res: Response_1) => (type: string) => Response_1; | ||
export {}; |
/// <reference types="node" /> | ||
import { IncomingMessage as I, ServerResponse as S } from 'http'; | ||
declare type Req = Pick<I, 'headers' | 'method'>; | ||
export declare type Res = Pick<S, 'setHeader' | 'statusCode' | 'getHeader' | 'end'>; | ||
import { IncomingMessage as Req, ServerResponse as Res } from 'http'; | ||
declare type next = (err?: any) => void; | ||
export declare const redirect: <Request_1 extends Req = Req, Response_1 extends Res = Res, Next extends next = next>(req: Request_1, res: Response_1, next: Next) => (url: string, status?: number) => Response_1; | ||
export {}; |
{ | ||
"name": "@tinyhttp/res", | ||
"version": "2.0.16", | ||
"version": "2.0.17", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "response extensions for tinyhttp", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13877
267