1 | /**
|
2 | * Options for function coerceDatetime
|
3 | */
|
4 | export type DateCoercionOptions = {
|
5 | dateOnly?: boolean;
|
6 | };
|
7 | /**
|
8 | * Options for function coerceInteger
|
9 | */
|
10 | export type IntegerCoercionOptions = {
|
11 | isLong?: boolean;
|
12 | };
|
13 | export declare function isEmpty(data: string): boolean;
|
14 | /**
|
15 | * A set of truthy values. A data in this set will be coerced to `true`.
|
16 | *
|
17 | * @param data - The raw data get from http request
|
18 | * @returns The corresponding coerced boolean type
|
19 | */
|
20 | export declare function isTrue(data: string): boolean;
|
21 | /**
|
22 | * A set of falsy values. A data in this set will be coerced to `false`.
|
23 | * @param data - The raw data get from http request
|
24 | * @returns The corresponding coerced boolean type
|
25 | */
|
26 | export declare function isFalse(data: string): boolean;
|
27 | /**
|
28 | * Return false for invalid date
|
29 | */
|
30 | export declare function isValidDateTime(data: Date): boolean;
|
31 | /**
|
32 | * Return true when a date follows the RFC3339 standard
|
33 | *
|
34 | * @param date - The date to verify
|
35 | */
|
36 | export declare function matchDateFormat(date: string): boolean;
|
37 | /**
|
38 | * Return the corresponding OpenAPI data type given an OpenAPI schema
|
39 | *
|
40 | * @param type - The type in an OpenAPI schema specification
|
41 | * @param format - The format in an OpenAPI schema specification
|
42 | */
|
43 | export declare function getOAIPrimitiveType(type?: string, format?: string): "object" | "binary" | "boolean" | "string" | "number" | "integer" | "array" | "float" | "double" | "byte" | "date" | "date-time" | "password" | "long" | undefined;
|