From db59d133e54046262c7c137ef5fab730d4299526 Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Fri, 2 Aug 2019 18:02:39 -0500 Subject: [PATCH] [express-mung] Add exports to types (#37302) --- types/express-mung/index.d.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/types/express-mung/index.d.ts b/types/express-mung/index.d.ts index ec3fe0788c..7c6a93600a 100644 --- a/types/express-mung/index.d.ts +++ b/types/express-mung/index.d.ts @@ -9,16 +9,18 @@ import { Request, Response, RequestHandler, ErrorRequestHandler } from "express"; -// Shut off automatic exporting, strict-export-declare-modifiers lint rule -export {}; +export type Transform = (body: {}, request: Request, response: Response) => any; +export type TransformAsync = (body: {}, request: Request, response: Response) => PromiseLike; +export type TransformHeader = (request: Request, response: Response) => any; +export type TransformHeaderAsync = (request: Request, response: Response) => PromiseLike; +export type TransformChunk = ( + chunk: string | Buffer, + encoding: string | null, + request: Request, + response: Response +) => string | Buffer; -type Transform = (body: {}, request: Request, response: Response) => any; -type TransformAsync = (body: {}, request: Request, response: Response) => PromiseLike; -type TransformHeader = (request: Request, response: Response) => any; -type TransformHeaderAsync = (request: Request, response: Response) => PromiseLike; -type TransformChunk = (chunk: string | Buffer, encoding: string | null, request: Request, response: Response) => string | Buffer; - -interface Options { +export interface Options { mungError: boolean; }