( is: (u: unknown) => u is T, annotations?: Annotations.Declaration<T> | undefined )
| 553 | * @since 3.10.0 |
| 554 | */ |
| 555 | export function declare<T, Iso = T>( |
| 556 | is: (u: unknown) => u is T, |
| 557 | annotations?: Annotations.Declaration<T> | undefined |
| 558 | ): declare<T, Iso> { |
| 559 | return declareConstructor<T, T, Iso>()( |
| 560 | [], |
| 561 | () => (input, ast, options) => |
| 562 | is(input) ? |
| 563 | Effect.succeed(input) : |
| 564 | Effect.fail(new SchemaIssue.InvalidType(ast, input, options)), |
| 565 | annotations |
| 566 | ) |
| 567 | } |
| 568 | |
| 569 | /** |
| 570 | * Returns a schema widened to the fully-parameterized {@link Bottom} interface, |
no test coverage detected