UNPKG

2.91 kBTypeScriptView Raw
1import { SavedDBEntity } from '@naturalcycles/js-lib';
2import { AlternativesSchemaTyped, AnySchemaTyped, ArraySchemaTyped, BooleanSchemaTyped, ObjectSchemaTyped, StringSchemaTyped } from './joi.model';
3export declare const booleanSchema: BooleanSchemaTyped;
4export declare const booleanDefaultToFalseSchema: BooleanSchemaTyped;
5export declare const stringSchema: import("./string.extensions").ExtendedStringSchema;
6export declare const numberSchema: import("./number.extensions").ExtendedNumberSchema;
7export declare const integerSchema: import("./number.extensions").ExtendedNumberSchema;
8export declare const percentageSchema: import("./number.extensions").ExtendedNumberSchema;
9export declare const dateStringSchema: import("./string.extensions").ExtendedStringSchema;
10export declare const binarySchema: import("joi").BinarySchema;
11export declare const urlSchema: (scheme?: string | string[]) => StringSchemaTyped;
12export declare function arraySchema<T>(items?: AnySchemaTyped<T, T>): ArraySchemaTyped<T>;
13export declare function objectSchema<IN, OUT = IN>(schema?: {
14 [key in keyof Partial<IN>]: AnySchemaTyped<IN[key]>;
15}): ObjectSchemaTyped<IN, OUT>;
16export declare function oneOfSchema<T = any>(...schemas: AnySchemaTyped<any>[]): AlternativesSchemaTyped<T>;
17export declare const anySchema: import("joi").AnySchema;
18export declare const anyObjectSchema: import("joi").ObjectSchema<any>;
19/**
20 * [a-zA-Z0-9_]*
21 * 6-64 length
22 */
23export declare const idSchema: import("./string.extensions").ExtendedStringSchema;
24/**
25 * `_` should NOT be allowed to be able to use slug-ids as part of natural ids with `_` separator.
26 */
27export declare const SLUG_PATTERN: RegExp;
28/**
29 * "Slug" - a valid URL, filename, etc.
30 */
31export declare const slugSchema: import("./string.extensions").ExtendedStringSchema;
32export declare const unixTimestampSchema: import("./number.extensions").ExtendedNumberSchema;
33export declare const verSchema: import("./number.extensions").ExtendedNumberSchema;
34/**
35 * Be careful, by default emailSchema does TLD validation. To disable it - use `stringSchema.email({tld: false}).lowercase()`
36 */
37export declare const emailSchema: import("./string.extensions").ExtendedStringSchema;
38/**
39 * Pattern is simplified for our use, it's not a canonical SemVer.
40 */
41export declare const SEM_VER_PATTERN: RegExp;
42export declare const semVerSchema: import("./string.extensions").ExtendedStringSchema;
43export declare const userAgentSchema: import("./string.extensions").ExtendedStringSchema;
44export declare const utcOffsetSchema: import("./number.extensions").ExtendedNumberSchema;
45export declare const ipAddressSchema: import("./string.extensions").ExtendedStringSchema;
46export declare const baseDBEntitySchema: ObjectSchemaTyped<Partial<SavedDBEntity<string>>, Partial<SavedDBEntity<string>>>;
47export declare const savedDBEntitySchema: ObjectSchemaTyped<SavedDBEntity<string>, SavedDBEntity<string>>;