UNPKG

shelving

Version:

Toolkit for using data in JavaScript.

14 lines (13 loc) 567 B
import type { Sourceable } from "../util/source.js"; import type { SchemaOptions } from "./Schema.js"; import { Schema } from "./Schema.js"; /** Allowed options for `ThroughSchama` */ export interface ThroughSchemaOptions<T> extends SchemaOptions { source: Schema<T>; } /** Schema that passes through to a source schema. */ export declare abstract class ThroughSchema<T> extends Schema<T> implements Sourceable<Schema<T>> { readonly source: Schema<T>; constructor({ source, ...options }: ThroughSchemaOptions<T>); validate(unsafeValue: unknown): T; }