Skip to content

Commit

Permalink
decorators for validations
Browse files Browse the repository at this point in the history
  • Loading branch information
iuribrindeiro committed May 12, 2019
1 parent abc33f7 commit 2cf89e2
Show file tree
Hide file tree
Showing 3 changed files with 480 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/implementation/decorators/decorators.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
export declare function required(customMessage?: string): void;
export declare function required(when?: (object: object) => boolean): void;
export declare function required(customMessage?: string, when?: (object: object) => boolean): void;
export declare function satisfiesRule(ruleName: string, customMessage?: string): void;
export declare function satisfiesRule(ruleName: string, when?: (object: object) => boolean): void;
export declare function satisfiesRule(ruleName: string, customMessage?: string, when?: (object: object) => boolean): void;
export declare function satisfies(condition: (value: any, object: object) => boolean | Promise<boolean>, customMessage?: string): void;
export declare function satisfies(condition: (value: any, object: object) => boolean | Promise<boolean>, when?: (object: object) => boolean): void;
export declare function satisfies(condition: (value: any, object: object) => boolean | Promise<boolean>, customMessage?: string, when?: (object: object) => boolean): void;
export declare function email(customMessage?: string): void;
export declare function email(when?: (object: object) => boolean): void;
export declare function email(customMessage?: string, when?: (object: object) => boolean): void;
export declare function matches(regex: RegExp, customMessage?: string): void;
export declare function matches(regex: RegExp, when?: (object: object) => boolean): void;
export declare function matches(regex: RegExp, customMessage?: string, when?: (object: object) => boolean): void;
export declare function minLength(length: number, customMessage?: string): void;
export declare function minLength(length: number, when?: (object: object) => boolean): void;
export declare function minLength(length: number, customMessage?: string, when?: (object: object) => boolean): void;
export declare function maxLength(length: number, customMessage?: string): void;
export declare function maxLength(length: number, when?: (object: object) => boolean): void;
export declare function maxLength(length: number, customMessage?: string, when?: (object: object) => boolean): void;
export declare function minItems(count: number, customMessage?: string): void;
export declare function minItems(count: number, when?: (object: object) => boolean): void;
export declare function minItems(count: number, customMessage?: string, when?: (object: object) => boolean): void;
export declare function maxItems(count: number, customMessage?: string): void;
export declare function maxItems(count: number, when?: (object: object) => boolean): void;
export declare function maxItems(count: number, customMessage?: string, when?: (object: object) => boolean): void;
export declare function min(value: number, customMessage?: string): void;
export declare function min(value: number, when?: (object: object) => boolean): void;
export declare function min(value: number, customMessage?: string, when?: (object: object) => boolean): void;
export declare function max(value: number, customMessage?: string): void;
export declare function max(value: number, when?: (object: object) => boolean): void;
export declare function max(value: number, customMessage?: string, when?: (object: object) => boolean): void;
export declare function range(min: number, max: number, customMessage?: string): void;
export declare function range(min: number, max: number, when?: (object: object) => boolean): void;
export declare function range(min: number, max: number, customMessage?: string, when?: (object: object) => boolean): void;
export declare function between(min: number, max: number, customMessage?: string): void;
export declare function between(min: number, max: number, when?: (object: object) => boolean): void;
export declare function between(min: number, max: number, customMessage?: string, when?: (object: object) => boolean): void;
export declare function equals(value: any, customMessage?: string): void;
export declare function equals(value: any, when?: (object: object) => boolean): void;
export declare function equals(value: any, customMessage?: string, when?: (object: object) => boolean): void;
export declare function displayName(customName: string): (targetClass: Object, name: string) => void;
export declare function tag(tag: string): (targetClass: Object, name: string) => void;
Loading

0 comments on commit 2cf89e2

Please sign in to comment.