Skip to content

Commit

Permalink
Separate ValidateData interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnesfield committed Mar 25, 2024
1 parent 8e34b80 commit feb1b4e
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions src/core/core.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,28 @@ export interface Options {
/**
* Validate arguments after they are saved for this option or command.
* Return a boolean or throw an error manually.
* @param data Node data.
* @param data Validate data.
* @return A validate error is thrown when `false` is returned.
*/
validate?(data: {
/**
* The parsed argument.
*/
raw: string | null;
/**
* The arguments for this node.
*/
args: string[];
/**
* The options for this node.
*/
options: Options;
}): boolean;
validate?(data: ValidateData): boolean;
}

/**
* Validate data.
*/
export interface ValidateData {
/**
* The parsed argument.
*/
raw: string | null;
/**
* The arguments for this node.
*/
args: string[];
/**
* The options for this node.
*/
options: Options;
}

/**
Expand Down

0 comments on commit feb1b4e

Please sign in to comment.