import * as _dereekb_dbx_web_calendar from '@dereekb/dbx-web/calendar'; import * as rxjs from 'rxjs'; import { Observable } from 'rxjs'; import * as _angular_core from '@angular/core'; import { Provider } from '@angular/core'; import { CalendarEvent } from 'angular-calendar'; import * as _dereekb_util from '@dereekb/util'; import { Maybe } from '@dereekb/util'; import { DateRange } from '@dereekb/date'; import { ComponentStore } from '@ngrx/component-store'; import { MatButtonToggleChange } from '@angular/material/button-toggle'; declare enum CalendarDisplayType { MONTH = "month", WEEK = "week", DAY = "day" } interface CalendarViewDateRange { readonly type: CalendarDisplayType; readonly start: Date; readonly end: Date; readonly distance: number; /** * Whether or not the min navigation date is currently visible. This implies that we're at the minimum date. */ readonly isMinDateVisible: boolean; /** * Whether or not the maximum navigation date is visible. This implies that we're at the maximum date. */ readonly isMaxDateVisible: boolean; } /** * Compares two {@link CalendarViewDateRange} values for equality by checking type, start/end dates, distance, and min/max visibility flags. * * @param a - First calendar view date range to compare. * @param b - Second calendar view date range to compare. * @returns Whether the two date ranges are considered equal. */ declare function isCalendarViewDateRangeEqual(a: CalendarViewDateRange, b: CalendarViewDateRange): boolean; interface CalendarState { /** * Calendar display mode */ readonly type: CalendarDisplayType; /** * Whether or not to show the today button. Defaults to true. */ readonly showTodayButton?: boolean; /** * Date that is selected. */ readonly date: Date; /** * Whether or not the day was tapped/set twice. */ readonly dateTappedTwice: boolean; /** * Set of calendar events. */ readonly events: CalendarEvent[]; /** * Optional navigation range limitation that limits which dates can be navigated to. */ readonly navigationRangeLimit?: Maybe>; /** * Whether or not to display the page buttons when applicable. Can only be displayed when a navigationRangeLimit is set. */ readonly showPageButtons?: boolean; } /** * Computes the visible date range for the given calendar state based on display type (month, week, or day) * and the optional navigation range limit. * * @param calendarState - The current calendar state containing display type, date, and navigation limits. * @returns The computed visible date range including start, end, distance, and min/max visibility flags. */ declare function visibleDateRangeForCalendarState(calendarState: CalendarState): CalendarViewDateRange; declare class DbxCalendarStore extends ComponentStore> { constructor(); readonly tapFirstPage: (observableOrValue?: void | Observable | undefined) => rxjs.Subscription; readonly tapNext: (observableOrValue?: void | Observable | undefined) => rxjs.Subscription; readonly tapPrevious: (observableOrValue?: void | Observable | undefined) => rxjs.Subscription; readonly tapLastPage: (observableOrValue?: void | Observable | undefined) => rxjs.Subscription; readonly showTodayButton$: Observable; readonly date$: Observable; readonly dateTappedTwice$: Observable; readonly events$: Observable[]>; /** * Returns the events that match the tapped date range state. */ readonly eventsForDateState$: Observable<{ date: Date; events: CalendarEvent[]; dateTappedTwice: boolean; }>; readonly eventsForDate$: Observable[]>; readonly visibleDateRange$: Observable; readonly visibleEvents$: Observable[]>; readonly isLookingAtToday$: Observable; readonly isLookingAtMinimumDate$: Observable; readonly isLookingAtMaximumDate$: Observable; readonly hasMultiplePages$: Observable; readonly displayType$: Observable; readonly navigationRangeLimit$: Observable>>; readonly minNavigationDate$: Observable>; readonly maxNavigationDate$: Observable>; readonly isTodayInNavigationRangeLimit$: Observable; readonly canJumpToToday$: Observable; readonly canShowPageButtons$: Observable; readonly showPageButtons$: Observable; /** * Tap a day. * * - If the same day is presented, dateTappedTwice is flipped. */ readonly tapDay: (observableOrValue: Date | Observable) => rxjs.Subscription; /** * Set all events on the calendar. */ readonly setEvents: (observableOrValue: CalendarEvent[] | Observable[]>) => rxjs.Subscription; /** * Set all events on the calendar. */ readonly setDisplayType: (observableOrValue: CalendarDisplayType | Observable) => rxjs.Subscription; /** * Sets the navigation limit. */ readonly setNavigationRangeLimit: (() => void) | ((observableOrValue: Maybe> | Observable>>) => rxjs.Subscription); readonly setShowTodayButton: (() => void) | ((observableOrValue: Maybe | Observable>) => rxjs.Subscription); readonly setShowPageButtons: (() => void) | ((observableOrValue: Maybe | Observable>) => rxjs.Subscription); static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵprov: _angular_core.ɵɵInjectableDeclaration>; } /** * Returns an updated calendar state after tapping a date. Only updates if the date differs from the current one * and falls within the navigation range limit. Toggles `dateTappedTwice` when the same day is tapped again. * * @param state - The current calendar state. * @param date - The date that was tapped. * @returns The updated calendar state reflecting the tapped date. */ declare function updateCalendarStateWithTappedDate(state: CalendarState, date: Date): CalendarState; /** * Returns an updated calendar state with a new navigation range limit. If the current date falls outside * the new range, it is clamped to fit within the limit. * * @param state - The current calendar state. * @param navigationRangeLimit - The new navigation date range limit, or undefined/null to remove the limit. * @returns The updated calendar state with the applied navigation range limit. */ declare function updateCalendarStateWithNavigationRangeLimit(state: CalendarState, navigationRangeLimit: Maybe>): CalendarState; interface DbxCalendarEvent { event: CalendarEvent; action?: string; } /** * Appends time/duration subtitles to each calendar event's title and sorts the events by start date in ascending order. * * @param events - The calendar events to prepare and sort. * @returns A new array of calendar events with updated titles, sorted by start date. */ declare function prepareAndSortCalendarEvents(events: CalendarEvent[]): CalendarEvent[]; declare class DbxCalendarComponent { readonly calendarStore: DbxCalendarStore; readonly clickEvent: _angular_core.OutputEmitterRef>; readonly viewDate$: rxjs.Observable; readonly events$: rxjs.Observable[]>; readonly activeDayIsOpen$: rxjs.Observable; readonly displayType$: rxjs.Observable<_dereekb_dbx_web_calendar.CalendarDisplayType>; readonly viewDateSignal: _angular_core.Signal; readonly eventsSignal: _angular_core.Signal[]>; readonly activeDayIsOpenSignal: _angular_core.Signal; readonly displayTypeSignal: _angular_core.Signal<_dereekb_dbx_web_calendar.CalendarDisplayType | undefined>; readonly displayTypeClassSignal: _angular_core.Signal; todayClicked(): void; nextButtonClicked(): void; previousButtonClicked(): void; dayClicked({ date }: { date: Date; }): void; eventClicked(action: string, event: CalendarEvent): void; typeToggleChanged(event: MatButtonToggleChange): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵcmp: _angular_core.ɵɵComponentDeclaration, "dbx-calendar", never, {}, { "clickEvent": "clickEvent"; }, never, never, true, never>; } declare class DbxCalendarBaseComponent { readonly calendarStore: DbxCalendarStore; readonly viewDate$: rxjs.Observable; readonly showTodayButton$: rxjs.Observable; readonly canJumpToToday$: rxjs.Observable; readonly isLookingAtMinimumDate$: rxjs.Observable; readonly isLookingAtMaximumDate$: rxjs.Observable; readonly hasMultiplePages$: rxjs.Observable; readonly showPageButtons$: rxjs.Observable; readonly activeDayIsOpen$: rxjs.Observable; readonly displayType$: rxjs.Observable<_dereekb_dbx_web_calendar.CalendarDisplayType>; readonly viewDateSignal: _angular_core.Signal; readonly showTodayButtonSignal: _angular_core.Signal; readonly canJumpToTodaySignal: _angular_core.Signal; readonly isLookingAtMinimumDateSignal: _angular_core.Signal; readonly isLookingAtMaximumDateSignal: _angular_core.Signal; readonly hasMultiplePagesSignal: _angular_core.Signal; readonly showPageButtonsSignal: _angular_core.Signal; readonly activeDayIsOpenSignal: _angular_core.Signal; readonly displayTypeSignal: _angular_core.Signal<_dereekb_dbx_web_calendar.CalendarDisplayType | undefined>; todayClicked(): void; firstPageButtonClicked(): void; nextButtonClicked(): void; previousButtonClicked(): void; lastPageButtonClicked(): void; typeToggleChanged(event: MatButtonToggleChange): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵcmp: _angular_core.ɵɵComponentDeclaration, "dbx-calendar-base", never, {}, {}, never, ["[controls]", "*"], true, never>; } /** * Provides default configuration for the DbxCalendarModule. * * @returns Providers that register the calendar with a date-fns date adapter. */ declare function provideDbxCalendar(): Provider[]; export { CalendarDisplayType, DbxCalendarBaseComponent, DbxCalendarComponent, DbxCalendarStore, isCalendarViewDateRangeEqual, prepareAndSortCalendarEvents, provideDbxCalendar, updateCalendarStateWithNavigationRangeLimit, updateCalendarStateWithTappedDate, visibleDateRangeForCalendarState }; export type { CalendarState, CalendarViewDateRange, DbxCalendarEvent };