@naturalcycles/nodejs-lib
Version:
Standard library for Node.js
42 lines (41 loc) • 2.3 kB
TypeScript
import { AnySchemaTyped, ArraySchemaTyped, BooleanSchemaTyped, ObjectSchemaTyped, StringSchemaTyped } from './joi.model';
export declare const booleanSchema: BooleanSchemaTyped;
export declare const stringSchema: import("./joi.extensions").ExtendedStringSchema;
export declare const numberSchema: import("./joi.extensions").ExtendedNumberSchema;
export declare const integerSchema: import("./joi.extensions").ExtendedNumberSchema;
export declare const dateStringSchema: import("./joi.extensions").ExtendedStringSchema;
export declare const binarySchema: import("@hapi/joi").BinarySchema;
export declare const urlSchema: (scheme?: string | string[]) => StringSchemaTyped;
export declare function arraySchema<T>(items?: AnySchemaTyped<T, T>): ArraySchemaTyped<T>;
export declare function objectSchema<IN, OUT = IN>(schema?: {
[key in keyof Partial<IN>]: AnySchemaTyped<IN[key]>;
}): ObjectSchemaTyped<IN, OUT>;
export declare const anySchema: import("@hapi/joi").AnySchema;
export declare const anyObjectSchema: import("@hapi/joi").ObjectSchema;
/**
* [a-z0-9_]*
* 6-16 length
*/
export declare const idSchema: import("./joi.extensions").ExtendedStringSchema;
/**
* `_` should NOT be allowed to be able to use slug-ids as part of natural ids with `_` separator.
*/
export declare const SLUG_PATTERN: RegExp;
/**
* "Slug" - a valid URL, filename, etc.
*/
export declare const slugSchema: import("./joi.extensions").ExtendedStringSchema;
export declare const unixTimestampSchema: import("./joi.extensions").ExtendedNumberSchema;
export declare const verSchema: import("./joi.extensions").ExtendedNumberSchema;
/**
* Be careful, by default emailSchema does TLD validation. To disable it - use `stringSchema.email({tld: false}).lowercase()`
*/
export declare const emailSchema: import("./joi.extensions").ExtendedStringSchema;
/**
* Pattern is simplified for our use, it's not a canonical SemVer.
*/
export declare const SEM_VER_PATTERN: RegExp;
export declare const semVerSchema: import("./joi.extensions").ExtendedStringSchema;
export declare const userAgentSchema: import("./joi.extensions").ExtendedStringSchema;
export declare const utcOffsetSchema: import("./joi.extensions").ExtendedNumberSchema;
export declare const ipAddressSchema: import("./joi.extensions").ExtendedStringSchema;