unifi-client
Version:
NodeJs client for Unifi products (https://www.ui.com/)
29 lines (28 loc) • 1.47 kB
TypeScript
/// <reference types="node" />
export type MustBeNullable<T> = null extends T ? T : undefined extends T ? T : never;
export declare class Validate {
static mail(mail: string): boolean;
static uuid(uuid: string): boolean;
static mac(address: string): boolean;
static hexColor(color: string): boolean;
static isString(value: unknown): value is string;
static isNumber(value: unknown): value is number;
static isFunction(value: unknown): value is Function;
static isObject(value: unknown): value is object;
static isNull(value: unknown): value is null;
static isUndefined(value: unknown): value is undefined;
static isDefinedNotNull<T>(value: unknown): value is NonNullable<MustBeNullable<T>>;
static isBoolean(value: unknown): value is boolean;
static isRegExp(value: unknown): value is RegExp;
static isError(value: unknown): value is Error;
static isDate(value: unknown, acceptTimestamp?: boolean): value is Date;
static isBuffer(value: unknown): value is Buffer;
static isSymbol(value: unknown): value is symbol;
static implementsTKeys<T>(obj: unknown, keys: Array<keyof T>): obj is T;
/**
* Return a boolean depending on the string . ("true", "y", "yes", "oui", "on" return true, else it's return false)
* @param str -the string
* @param strict - return null instead of false if not in list
*/
static stringToBoolean(str: string, strict?: boolean): boolean | null;
}