@types/formidable
Advanced tools
Comparing version 3.4.2 to 3.4.3
@@ -5,5 +5,5 @@ /** | ||
import { IncomingMessage } from 'http'; | ||
import { EventEmitter } from 'stream'; | ||
import { EmitData, EventData, Fields, File, Files, Options, Part, PluginFunction, DefaultOptions } from './'; | ||
import { IncomingMessage } from "http"; | ||
import { EventEmitter } from "stream"; | ||
import { DefaultOptions, EmitData, EventData, Fields, File, Files, Options, Part, PluginFunction } from "./"; | ||
@@ -20,16 +20,21 @@ declare class IncomingForm extends EventEmitter { | ||
*/ | ||
parse<FieldKey extends string, FileKey extends string>(request: IncomingMessage): Promise<[Fields<FieldKey>, Files<FileKey>]>; | ||
parse<FieldKey extends string, FileKey extends string>(request: IncomingMessage, callback?: (err: any, fields: Fields<FieldKey>, files: Files<FileKey>) => void): void; | ||
parse<FieldKey extends string, FileKey extends string>( | ||
request: IncomingMessage, | ||
): Promise<[Fields<FieldKey>, Files<FileKey>]>; | ||
parse<FieldKey extends string, FileKey extends string>( | ||
request: IncomingMessage, | ||
callback?: (err: any, fields: Fields<FieldKey>, files: Files<FileKey>) => void, | ||
): void; | ||
once(eventName: 'end', listener: () => void): this; | ||
once(eventName: 'error', listener: (err: any) => void): this; | ||
once(eventName: "end", listener: () => void): this; | ||
once(eventName: "error", listener: (err: any) => void): this; | ||
on(eventName: 'data', listener: (data: EventData) => void): this; | ||
on(eventName: 'error', listener: (err: any) => void): this; | ||
on(eventName: 'field', listener: (name: string, value: string) => void): this; | ||
on(eventName: 'fileBegin' | 'file', listener: (formName: string, file: File) => void): this; | ||
on(eventName: 'progress', listener: (bytesReceived: number, bytesExpected: number) => void): this; | ||
on(eventName: "data", listener: (data: EventData) => void): this; | ||
on(eventName: "error", listener: (err: any) => void): this; | ||
on(eventName: "field", listener: (name: string, value: string) => void): this; | ||
on(eventName: "fileBegin" | "file", listener: (formName: string, file: File) => void): this; | ||
on(eventName: "progress", listener: (bytesReceived: number, bytesExpected: number) => void): this; | ||
on(eventName: string, listener: () => void): this; | ||
emit(eventName: 'data', data: EmitData): boolean; | ||
emit(eventName: "data", data: EmitData): boolean; | ||
@@ -36,0 +41,0 @@ /** |
@@ -7,23 +7,25 @@ declare class FormidableError extends Error { | ||
declare const errors: { | ||
FormidableError: typeof FormidableError; | ||
} & Record< | ||
| "missingPlugin" | ||
| "pluginFunction" | ||
| "aborted" | ||
| "noParser" | ||
| "uninitializedParser" | ||
| "filenameNotString" | ||
| "maxFieldsSizeExceeded" | ||
| "maxFieldsExceeded" | ||
| "smallerThanMinFileSize" | ||
| "biggerThanMaxFileSize" | ||
| "noEmptyFiles" | ||
| "missingContentType" | ||
| "malformedMultipart" | ||
| "missingMultipartBoundary" | ||
| "unknownTransferEncoding", | ||
number | ||
>; | ||
declare const errors: | ||
& { | ||
FormidableError: typeof FormidableError; | ||
} | ||
& Record< | ||
| "missingPlugin" | ||
| "pluginFunction" | ||
| "aborted" | ||
| "noParser" | ||
| "uninitializedParser" | ||
| "filenameNotString" | ||
| "maxFieldsSizeExceeded" | ||
| "maxFieldsExceeded" | ||
| "smallerThanMinFileSize" | ||
| "biggerThanMaxFileSize" | ||
| "noEmptyFiles" | ||
| "missingContentType" | ||
| "malformedMultipart" | ||
| "missingMultipartBoundary" | ||
| "unknownTransferEncoding", | ||
number | ||
>; | ||
export = errors; |
@@ -224,3 +224,5 @@ // Type definitions for formidable 3.4 | ||
*/ | ||
interface FileJSON extends Pick<File, "size" | "filepath" | "originalFilename" | "mimetype" | "hash" | "newFilename"> { | ||
interface FileJSON | ||
extends Pick<File, "size" | "filepath" | "originalFilename" | "mimetype" | "hash" | "newFilename"> | ||
{ | ||
length: number; | ||
@@ -227,0 +229,0 @@ mimetype: string | null; |
{ | ||
"name": "@types/formidable", | ||
"version": "3.4.2", | ||
"version": "3.4.3", | ||
"description": "TypeScript definitions for formidable", | ||
@@ -35,4 +35,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/formidable", | ||
}, | ||
"typesPublisherContentHash": "9360371b476e2f417c95c64d7036ff7e969637437f68fcf317dbc15d086922db", | ||
"typeScriptVersion": "4.3" | ||
"typesPublisherContentHash": "2b21142c89fd078b044e75436e6b0fa27ad482b891eef69d4da6652c16af896d", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -0,3 +1,3 @@ | ||
import { PassThrough, Transform } from "stream"; | ||
import { IncomingForm, Options } from "../"; | ||
import { PassThrough, Transform } from "stream"; | ||
@@ -4,0 +4,0 @@ export class MultipartParser extends Transform { |
@@ -1,2 +0,2 @@ | ||
import { EventEmitter } from 'events'; | ||
import { EventEmitter } from "events"; | ||
import { File, FileJSON } from "./"; | ||
@@ -3,0 +3,0 @@ |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Tue, 29 Aug 2023 12:33:20 GMT | ||
* Last updated: Thu, 14 Sep 2023 15:26:41 GMT | ||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node), [@types/node:events](https://npmjs.com/package/@types/node:events) | ||
@@ -14,0 +14,0 @@ * Global values: none |
@@ -1,2 +0,2 @@ | ||
import { EventEmitter } from 'node:events'; | ||
import { EventEmitter } from "node:events"; | ||
import type { File, FileJSON } from "./index"; | ||
@@ -3,0 +3,0 @@ |
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
19456
442