@naturalcycles/nodejs-lib
Version:
Standard library for Node.js
43 lines (42 loc) • 2.38 kB
TypeScript
/// <reference types="hapi__joi" />
import { AnySchemaTyped, ArraySchemaTyped, BooleanSchemaTyped, ObjectSchemaTyped, StringSchemaTyped } from './joi.model';
export declare const booleanSchema: BooleanSchemaTyped;
export declare const stringSchema: import("./string.extensions").ExtendedStringSchema;
export declare const numberSchema: import("./number.extensions").ExtendedNumberSchema;
export declare const integerSchema: import("./number.extensions").ExtendedNumberSchema;
export declare const dateStringSchema: import("./string.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<any>;
/**
* [a-z0-9_]*
* 6-16 length
*/
export declare const idSchema: import("./string.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("./string.extensions").ExtendedStringSchema;
export declare const unixTimestampSchema: import("./number.extensions").ExtendedNumberSchema;
export declare const verSchema: import("./number.extensions").ExtendedNumberSchema;
/**
* Be careful, by default emailSchema does TLD validation. To disable it - use `stringSchema.email({tld: false}).lowercase()`
*/
export declare const emailSchema: import("./string.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("./string.extensions").ExtendedStringSchema;
export declare const userAgentSchema: import("./string.extensions").ExtendedStringSchema;
export declare const utcOffsetSchema: import("./number.extensions").ExtendedNumberSchema;
export declare const ipAddressSchema: import("./string.extensions").ExtendedStringSchema;