/** * Official Type definitions for LemonadeJS plugins * https://lemonadejs.com * Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped */ declare function Calendar(el: HTMLElement, options?: Calendar.Options): Calendar.Instance; declare namespace Calendar { interface Options { /** Calendar type. Use picker for a responsive modal, auto to automatic detect screen size and open between default or picker. */ type?: 'default' | 'auto' | 'picker' | 'inline'; /** Date format. Excel like format dd/mm/yyyy */ format?: string; /** Range picker */ range?: boolean; /** Value */ value?: number | string; /** Calendar value will be a excel-like number or a ISO string. Default false */ numeric?: boolean; /** Show Footer. Default: true **/ footer?: boolean; /** Show hour and minute picker **/ time?: boolean; /** Show grid mode. Default: false */ grid?: boolean; /** Placeholder */ placeholder?: string; /** Disabled. Default false **/ disabled?: boolean; /** Starting day. From 0-6 where zero is Sunday and six is Saturday */ startingDay?: number; /** Valid range **/ validRange?: number[] | string[]; /** Calendar events data */ data?: Array<{date: string, [key: string]: any}>; /** Update view on mouse wheel. Default: true */ wheel?: boolean; /** Bind the calendar to na HTML input element */ input?: HTMLInputElement | 'auto'; /** Create events and assing the calendar classes for the input. Default true */ initInput?: boolean; /** Change value event */ onchange?: (self: object, value: string) => void; /** Update view event */ onupdate?: (self: object, value: string) => void; /** Close event */ onclose?: (self: object, origin: string) => void; /** Open event */ onopen?: (self: object) => void; /** React dedicated onChange event */ onChange?: (e: Event) => void; } interface Instance { /** Calendar type */ type?: 'default' | 'auto' | 'picker' | 'inline'; /** Date format */ format: string; /** Range picker */ range: boolean; /** Value */ value: number | string; /** Calendar value will be a excel-like number or a ISO string. Default false */ numeric: boolean; /** Footer. Default: true **/ footer: boolean; /** Show hour and minute picker **/ time: boolean; /** Show grid mode. Default: false */ grid: boolean; /** Placeholder */ placeholder: string; /** Disabled. Default false **/ disabled: boolean; /** Update view on mouse wheel. Default: true */ wheel: boolean; /** Bind the calendar to na HTML input element */ input: HTMLElement; /** Open the calendar modal */ open: () => void; /** Open the calendar modal */ close: (options?: object) => void; /** Calendar is closed */ isClosed?: () => boolean; /** Change the view */ setView: (view: 'days' | 'months' | 'years') => void; /** Go to the next month or year depending on the view */ next?: () => void; /** Go to the previous month or year depending on the view */ prev?: () => void; /** Reset the calendar value and close the modal when applicable */ reset?: () => void; /** Get the current calendar value */ getValue?: () => string | number; /** Set the current calendar value. Use number for Excel like numbers */ setValue?: (value: string | number) => void; /** Accept the selected value on the calendar */ update?: () => void; } } export default Calendar;