ExpectedTypeGuard<T>
One value a schema accepts, described by a type guard and by what it expects, for the issue message.
Import:
import type { ExpectedTypeGuard } from '@mnaoumov/typescript-lib/api-contract';Signature:
export interface ExpectedTypeGuard<T>Properties
| Property | Type | Description |
|---|---|---|
| expected | string | What the value should have been, phrased to follow "Expected", e.g. 'a string'. |
| typeGuard | (value: unknown) => value is T | Decides whether the value is acceptable. |
Links to this page:
- ApiContractSchemaBuilders
- ArgumentTypeGuards
- arrayGuard
- BOOLEAN_GUARD
- createExpectedTypeGuard
- CreateTypeGuardSchemaParams
- instanceOfGuard
- literalGuard
- nullableGuard
- NUMBER_GUARD
- objectGuard
- optionalGuard
- OptionGuards
- optionsGuard
- PropertyGuards
- STRING_ARRAY_GUARD
- STRING_GUARD
- UNDEFINED_GUARD
- unionGuard