@snowtop/ent-password
Version:
password datatype for ents
21 lines (20 loc) • 719 B
TypeScript
import { Type, Field, FieldOptions, BaseField } from "@snowtop/ent/schema";
export declare class Password extends BaseField implements Field {
type: Type;
private _cost;
private stringType;
private: boolean;
hideFromGraphQL: boolean;
sensitive: boolean;
constructor();
cost(cost: number): this;
minLen(length: number): this;
maxLen(length: number): this;
length(length: number): this;
match(pattern: string | RegExp): this;
doesNotMatch(pattern: string | RegExp): this;
validate(validator: (str: string) => boolean): this;
format(val: any): Promise<any>;
valid(val: any): boolean;
}
export declare function PasswordType(options?: FieldOptions): Password;