Skip to content

Commit

Permalink
types: add vest.reset and vest.get types (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
ealush authored Aug 28, 2020
1 parent e7d7ed2 commit c1846d1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions packages/vest/src/vest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,35 @@ declare module 'vest' {
only: IOnly;
skip: ISkip;

/**
* Retrieves current validation state.
* @param suiteName Suite name.
*
* @example
*
* vest.get('user_form');
*
*/
get: (suiteName: string) => DraftResult;

/**
* Resets suite state to its initial - unvalidated state.
* @param suiteName Suite name.
*
* @example
*
* vest.reset('user_form');
*
*/
reset: (suiteName: string) => void;

/**
* Runs a stateless validation suite.
* @param suiteName Unique suite name.
* @param tests Suite body.
*
* @example
*
* const res = validate('form_name', () => {
* // your tests go here
* });
Expand Down Expand Up @@ -393,6 +417,8 @@ declare module 'vest' {
skip,
only,
group,
reset,
get,
}: Vest;

export {
Expand All @@ -406,6 +432,8 @@ declare module 'vest' {
skip,
only,
group,
reset,
get,
};

const vest: Vest;
Expand Down

0 comments on commit c1846d1

Please sign in to comment.