mirror of
https://github.com/eggjs/egg.git
synced 2024-12-04 07:14:30 +00:00
fix(types): getFileStream options types (#3500)
This commit is contained in:
parent
40ae443429
commit
f9eea2a4da
24
index.d.ts
vendored
24
index.d.ts
vendored
@ -676,6 +676,27 @@ declare module 'egg' {
|
||||
|
||||
truncated: boolean;
|
||||
}
|
||||
|
||||
interface GetFileStreamOptions {
|
||||
requireFile?: boolean; // required file submit, default is true
|
||||
defCharset?: string;
|
||||
limits?: {
|
||||
fieldNameSize?: number;
|
||||
fieldSize?: number;
|
||||
fields?: number;
|
||||
fileSize?: number;
|
||||
files?: number;
|
||||
parts?: number;
|
||||
headerPairs?: number;
|
||||
};
|
||||
checkFile?(
|
||||
fieldname: string,
|
||||
file: any,
|
||||
filename: string,
|
||||
encoding: string,
|
||||
mimetype: string
|
||||
): void | Error;
|
||||
}
|
||||
|
||||
/**
|
||||
* KoaApplication's Context will carry the default 'cookie' property in
|
||||
@ -893,10 +914,11 @@ declare module 'egg' {
|
||||
* console.log(stream.fields);
|
||||
* ```
|
||||
* @method Context#getFileStream
|
||||
* @param {Object} options
|
||||
* @return {ReadStream} stream
|
||||
* @since 1.0.0
|
||||
*/
|
||||
getFileStream(): Promise<FileStream>;
|
||||
getFileStream(options?: GetFileStreamOptions): Promise<FileStream>;
|
||||
|
||||
/**
|
||||
* @see Responce.redirect
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user