UNPKG

@prefecthq/prefect-ui-library

Version:

This library is the Vue and Typescript component library for [Prefect 2](https://github.com/PrefectHQ/prefect) and [Prefect Cloud 2](https://www.prefect.io/cloud/). _The components and utilities in this project are not meant to be used independently_.

34 lines (33 loc) 2.26 kB
import { ValidationRule } from '@prefecthq/vue-compositions'; export type ValidationMethod = (value: unknown) => true | string | Promise<true | string>; export type ValidationMethodFactory = (property: string) => ValidationMethod; export type WithMessageArgs = [validationFactory: ValidationMethodFactory, message: string]; export declare function isWithMessageArgs(value: ValidationMethodFactory | WithMessageArgs): value is WithMessageArgs; export declare function withMessage(validationFactory: ValidationMethodFactory, message: string): ValidationMethod; export declare function fieldRules(property: string, ...rules: (ValidationMethodFactory | WithMessageArgs)[]): ValidationMethod[]; export declare const all: (factory: ValidationMethodFactory) => ValidationMethodFactory; export declare const isRequired: ValidationMethodFactory; export declare const isValidIf: (condition: (value: unknown) => boolean | Promise<boolean>) => ValidationMethodFactory; export declare const isRequiredIf: (condition: (value: unknown) => boolean | Promise<boolean>) => ValidationMethodFactory; export declare const isEmail: ValidationMethodFactory; export declare const areEmails: ValidationMethodFactory; export declare const isLessThan: (max: number) => ValidationMethodFactory; export declare const isLessThanOrEqual: (max: number) => ValidationMethodFactory; export declare const isGreaterThan: (min: number) => ValidationMethodFactory; export declare const isGreaterThanOrEqual: (min: number) => ValidationMethodFactory; export declare const isBefore: (max: Date, { time: showTime }?: { time?: boolean | undefined; }) => ValidationMethodFactory; export declare const isBeforeOrEqual: (max: Date, { time: showTime }?: { time?: boolean | undefined; }) => ValidationMethodFactory; export declare const isAfter: (min: Date, { time: showTime }?: { time?: boolean | undefined; }) => ValidationMethodFactory; export declare const isAfterOrEqual: (min: Date, { time: showTime }?: { time?: boolean | undefined; }) => ValidationMethodFactory; export declare const isJson: ValidationMethodFactory; export declare const isHandle: ValidationMethodFactory; export declare const isSnakeCase: ValidationRule<unknown>; export declare const isSlug: ValidationRule<unknown>;