UNPKG

shelving

Version:

Toolkit for using data in JavaScript.

17 lines (16 loc) 773 B
import type { FileTypes } from "../util/file.js"; import { StringSchema, type StringSchemaOptions } from "./StringSchema.js"; /** Allowed options for `FileSchema` */ export interface FileSchemaOptions extends StringSchemaOptions { readonly types?: FileTypes | undefined; } /** Validate a file name matching one or more extensions. */ export declare class FileSchema extends StringSchema { readonly types: FileTypes | undefined; constructor({ one, title, types, ...options }: FileSchemaOptions); validate(unsafeValue?: unknown): string; } /** Valid file, e.g. `file.txt` */ export declare const FILE: FileSchema; /** Valid optional file, e.g. `file.txt`, or `null` */ export declare const NULLABLE_FILE: import("./NullableSchema.js").NullableSchema<string>;