1 |
|
2 | import { MultipartFileContract } from '@ioc:Adonis/Core/BodyParser';
|
3 |
|
4 |
|
5 |
|
6 | export declare class SizeValidator {
|
7 | private file;
|
8 | private maximumAllowedLimit?;
|
9 | private bytesLimit;
|
10 | validated: boolean;
|
11 | |
12 |
|
13 |
|
14 | get maxLimit(): number | string | undefined;
|
15 | set maxLimit(limit: number | string | undefined);
|
16 | constructor(file: MultipartFileContract);
|
17 | /**
|
18 | * Reporting error to the file
|
19 | */
|
20 | private reportError;
|
21 | /**
|
22 | * Validating file size while it is getting streamed. We only mark
|
23 | * the file as `validated` when it's validation fails. Otherwise
|
24 | * we keep re-validating the file as we receive more data.
|
25 | */
|
26 | private validateWhenGettingStreamed;
|
27 | /**
|
28 | * We have the final file size after the stream has been consumed. At this
|
29 | * stage we always mark `validated = true`.
|
30 | */
|
31 | private validateAfterConsumed;
|
32 | /**
|
33 | * Validate the file size
|
34 | */
|
35 | validate(): void;
|
36 | }
|