-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved validator selector & added documentaton
- Loading branch information
1 parent
a099cbb
commit 420af66
Showing
13 changed files
with
262 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,25 @@ | ||
import type { IObjectValidator } from '../objectValidator'; | ||
import type { WellKnownValidationTrigger, ValidationTrigger } from './ValidationTrigger'; | ||
import { Form } from '../../forms'; | ||
|
||
/** | ||
* Represents a callback selector for individual items when configuring collection-based triggers. | ||
* @param object The item in the collection for whom to select the triggers. | ||
* @returns Returns the validation triggers for the given object. | ||
* | ||
* @see {@linkcode WellKnownValidationTrigger} | ||
*/ | ||
export type ValidationTriggerSelector<T> = (object: T) => readonly (WellKnownValidationTrigger | ValidationTrigger)[]; | ||
export type ValidationTriggerSelector<T> = (object: T) => ValidationTriggerSet; | ||
|
||
/** | ||
* Represents a single validation trigger or a range of validation triggers that should be | ||
* configured for an individual target. | ||
* | ||
* @see {@linkcode Form.validation} | ||
* @see {@linkcode IObjectValidator} | ||
* @see {@linkcode WellKnownValidationTrigger} | ||
*/ | ||
export type ValidationTriggerSet | ||
= WellKnownValidationTrigger | ||
| ValidationTrigger | ||
| readonly (WellKnownValidationTrigger | ValidationTrigger)[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.