@uplink-protocol/calendar-controller
Version:
Flexible calendar and time picker API supporting both calendar, date-picker, and time-picker integrations for any JavaScript framework or library
44 lines (43 loc) • 1.59 kB
TypeScript
import type { CalendarOptions } from "../interfaces";
import type { CalendarControllerBindings } from "./calendar-controller-bindings.type";
import type { CalendarControllerMethods } from "./calendar-controller-methods.type";
import type { CalendarControllerEvents } from "./calendar-controller-events.type";
/**
* Complete Calendar Controller Interface
* Combines all the above interfaces into a single comprehensive type
*/
export interface TypedCalendarController {
/** Reactive state bindings */
bindings: CalendarControllerBindings;
/** Available methods */
methods: CalendarControllerMethods;
/** Event emitters */
events: CalendarControllerEvents;
/** Calendar configuration options */
options?: CalendarOptions;
selectDate(yearOrDate: number | Date, month?: number, day?: number): void;
goToNextMonth(): void;
goToPreviousMonth(): void;
goToNextYear(): void;
goToPreviousYear(): void;
clearSelection(): void;
setRangeSelectionMode(isRange: boolean): void;
/** Selected date range with flexible property access */
selectedDateRange: {
start: Date | null;
end: Date | null;
startDate: Date | null;
endDate: Date | null;
};
}
/**
* Factory Function Type
* Type for the CalendarController factory function
*/
export type CalendarControllerFactory = (options?: CalendarOptions) => TypedCalendarController;
/**
* Calendar Controller Instance Type
* Type for the CalendarControllerClass instance
*/
export interface CalendarControllerInstance extends TypedCalendarController {
}