UNPKG

mongoose-management

Version:
40 lines (39 loc) 2.02 kB
import Prompts from '../../prompts'; import ColumnDataset, { optionsType } from '../dataset/column'; import * as main from './columnMain'; import { dataColumnType, OptionalValues } from '../../types'; export declare type answersType = OptionalValues<Pick<dataColumnType, optionsType>> & { options: optionsType[]; }; export declare type choiceOptionsType = { name: string; short: string; value: keyof answersType; checked: boolean | undefined; }; export declare const call: (prompts: Prompts, answersMain: main.answersType, column?: ColumnDataset | undefined) => Promise<answersType>; export declare const getQuestions: (answersMain: main.answersType, column?: ColumnDataset | undefined) => readonly any[]; export declare const evaluation: (answers: answersType) => (column: ColumnDataset) => ColumnDataset; export declare const getColumnOptionsTypeAny: (answersMain: main.answersType, column?: ColumnDataset | undefined) => { choices: choiceOptionsType[]; questions: any[]; }; export declare const getColumnOptionsTypeString: (answersMain: main.answersType, column?: ColumnDataset | undefined) => { choices: choiceOptionsType[]; questions: any[]; }; export declare const getColumnOptionsTypeNumber: (answersMain: main.answersType, column?: ColumnDataset | undefined) => { choices: choiceOptionsType[]; questions: any[]; }; export declare const whenCommon: (type: "match" | "trim" | "max" | "required" | "default" | "type" | "lowercase" | "uppercase" | "enum" | "minLength" | "maxLength" | "min" | "options") => ({ options }: { options: string[]; }) => boolean; export declare const validateOptions: (v: string[]) => true | "Either \"lowercase\" or \"uppercase\" can be selected!"; export declare const validateMaxLength: (v: string, { minLength }: { minLength?: string | undefined; }) => string | true; export declare const validateMax: (v: string, { min }: { min?: string | undefined; }) => string | true; export declare const filterEnum: (value: string) => string;