You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1.1 KiB
31 lines
1.1 KiB
3 years ago
|
import { preHandlerHookHandler } from 'fastify';
|
||
|
import diskStorage from './storage/disk';
|
||
|
import memoryStorage from './storage/memory';
|
||
|
import MulterError from './lib/multer-error';
|
||
|
import contentParser from './lib/content-parser';
|
||
|
import { Field, Options, FileFilter, StorageEngine } from './interfaces';
|
||
|
declare class Multer {
|
||
|
storage: StorageEngine;
|
||
|
limits: Options['limits'];
|
||
|
preservePath: Options['preservePath'];
|
||
|
fileFilter: FileFilter;
|
||
|
contentParser: typeof contentParser;
|
||
|
constructor(options: Options);
|
||
|
private _makePreHandler;
|
||
|
single(name: string): preHandlerHookHandler;
|
||
|
array(name: string, maxCount?: number): preHandlerHookHandler;
|
||
|
fields(fields: Field[]): preHandlerHookHandler;
|
||
|
none(): preHandlerHookHandler;
|
||
|
any(): preHandlerHookHandler;
|
||
|
}
|
||
|
interface MulterFactory {
|
||
|
(options?: Options | undefined): Multer;
|
||
|
contentParser: typeof contentParser;
|
||
|
diskStorage: typeof diskStorage;
|
||
|
memoryStorage: typeof memoryStorage;
|
||
|
MulterError: typeof MulterError;
|
||
|
default: MulterFactory;
|
||
|
}
|
||
|
declare const _default: MulterFactory;
|
||
|
export = _default;
|