import type { Localization } from '../locale/types'; import { type ExtractPropTypes, type PropType, type SetupContext } from 'vue'; import { type CronFormat, type Field, type Period } from '../types'; import { type UseCronSegmentReturn } from './cron-segment'; export interface CronOptions { initialValue?: string; initialPeriod?: string; locale?: string; fields?: Field[]; periods?: Period[]; customLocale?: Localization; format?: CronFormat; } export interface CronContext { segmentMap: Map; } export declare class DefaultCronOptions { locale: string; format: CronFormat; initialValue(fields: Field[]): string; fields(format: CronFormat, locale: string): Field[]; periods(format: CronFormat): Period[]; } export declare function findFirstPeriod(periods: Period[], cron: string, fields: Field[]): Period | undefined; export declare function useCron(options: CronOptions): { cron: import("vue").Ref; error: import("vue").Ref; segments: { id: string; items: import("../types").FieldItem[]; cron: import("vue").Ref; selected: import("vue").Ref; error: import("vue").Ref; select: (evt: number[]) => void; text: import("vue").Ref; prefix: import("vue").Ref; suffix: import("vue").Ref; }[]; selected: import("vue").ComputedRef<{ id: string; items: import("../types").FieldItem[]; cron: import("vue").Ref; selected: import("vue").Ref; error: import("vue").Ref; select: (evt: number[]) => void; text: import("vue").Ref; prefix: import("vue").Ref; suffix: import("vue").Ref; }[]>; period: { select: (periodId: string) => void; selected: import("vue").Ref<{ id: string; value: string[]; text?: string | undefined; } | { text: any; id: string; value: string[]; }>; items: { text: any; id: string; value: string[]; }[]; prefix: import("vue").Ref; suffix: import("vue").Ref; }; }; /** * @interface */ export type UseCronReturn = ReturnType; export declare function setupCron(props: CronCoreProps, { emit }: SetupContext<['update:model-value', 'update:period', 'error']>): UseCronReturn; export declare const cronCoreProps: () => { /** * The value of the cron expression * * @defaultValue crontab: `* * * * *`, quartz: `* * * * * *` */ modelValue: { type: StringConstructor; }; /** * The id of a period to select * * @defaultValue last entry of `CronCoreProps.periods` */ period: { type: StringConstructor; }; /** * The format of the cron expression, either crontab or quartz * * @defaultValue `crontab` */ format: { type: PropType; }; /** * The locale of the component, such as `en`, `de`, etc. * * @defaultValue `en` */ locale: { type: StringConstructor; }; /** The segments of the cron expression, such as second, minute, hour, etc. */ fields: { type: PropType; }; /** The periods to select, e.g. Every month, day, etc. */ periods: { type: PropType; }; /** The custom locale object, used to override values of the current {@link Localization} */ customLocale: { type: PropType; }; /** Number of columns in the dropdown, * e.g. the possible values of minute (0-59) will be displayed in a grid with 5 columns * * @defaultValue * ``` * { * second: 5, * minute: 5, * hour: 4, * day: 4, * } * ``` */ cols: { type: PropType>; default: () => { second: number; minute: number; hour: number; day: number; }; }; /** Disable the cron editor */ disabled: { type: BooleanConstructor; default: boolean; }; }; /** * Properties of {@link CronCore}. * These properties are shared across all cron components * * @interface */ export type CronCoreProps = Partial>>; export declare const CronCore: import("vue").DefineComponent<{ /** * The value of the cron expression * * @defaultValue crontab: `* * * * *`, quartz: `* * * * * *` */ modelValue: { type: StringConstructor; }; /** * The id of a period to select * * @defaultValue last entry of `CronCoreProps.periods` */ period: { type: StringConstructor; }; /** * The format of the cron expression, either crontab or quartz * * @defaultValue `crontab` */ format: { type: PropType; }; /** * The locale of the component, such as `en`, `de`, etc. * * @defaultValue `en` */ locale: { type: StringConstructor; }; /** The segments of the cron expression, such as second, minute, hour, etc. */ fields: { type: PropType; }; /** The periods to select, e.g. Every month, day, etc. */ periods: { type: PropType; }; /** The custom locale object, used to override values of the current {@link Localization} */ customLocale: { type: PropType; }; /** Number of columns in the dropdown, * e.g. the possible values of minute (0-59) will be displayed in a grid with 5 columns * * @defaultValue * ``` * { * second: 5, * minute: 5, * hour: 4, * day: 4, * } * ``` */ cols: { type: PropType>; default: () => { second: number; minute: number; hour: number; day: number; }; }; /** Disable the cron editor */ disabled: { type: BooleanConstructor; default: boolean; }; }, () => import("vue").VNode[] | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:model-value" | "update:period" | "error")[], "update:model-value" | "update:period" | "error", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly; }; /** * The locale of the component, such as `en`, `de`, etc. * * @defaultValue `en` */ locale: { type: StringConstructor; }; /** The segments of the cron expression, such as second, minute, hour, etc. */ fields: { type: PropType; }; /** The periods to select, e.g. Every month, day, etc. */ periods: { type: PropType; }; /** The custom locale object, used to override values of the current {@link Localization} */ customLocale: { type: PropType; }; /** Number of columns in the dropdown, * e.g. the possible values of minute (0-59) will be displayed in a grid with 5 columns * * @defaultValue * ``` * { * second: 5, * minute: 5, * hour: 4, * day: 4, * } * ``` */ cols: { type: PropType>; default: () => { second: number; minute: number; hour: number; day: number; }; }; /** Disable the cron editor */ disabled: { type: BooleanConstructor; default: boolean; }; }>> & { "onUpdate:model-value"?: ((...args: any[]) => any) | undefined; "onUpdate:period"?: ((...args: any[]) => any) | undefined; onError?: ((...args: any[]) => any) | undefined; }, { cols: Record; disabled: boolean; }, {}>; //# sourceMappingURL=cron-core.d.ts.map