index.d.ts 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. import { TimeUnit } from 'ngx-bootstrap/chronos';
  2. export declare type BsDatepickerViewMode = 'day' | 'month' | 'year';
  3. /** *************** */
  4. export interface NavigationViewModel {
  5. monthTitle: string;
  6. yearTitle: string;
  7. hideLeftArrow?: boolean;
  8. hideRightArrow?: boolean;
  9. disableLeftArrow?: boolean;
  10. disableRightArrow?: boolean;
  11. }
  12. export interface CalendarCellViewModel {
  13. date: Date;
  14. label: string;
  15. isDisabled?: boolean;
  16. isHovered?: boolean;
  17. isSelected?: boolean;
  18. }
  19. /** *************** */
  20. export interface DayViewModel extends CalendarCellViewModel {
  21. isOtherMonthHovered?: boolean;
  22. isOtherMonth?: boolean;
  23. isInRange?: boolean;
  24. isSelectionStart?: boolean;
  25. isSelectionEnd?: boolean;
  26. isToday?: boolean;
  27. customClasses?: string;
  28. monthIndex?: number;
  29. weekIndex?: number;
  30. dayIndex?: number;
  31. }
  32. export interface WeekViewModel {
  33. days: DayViewModel[];
  34. isHovered?: boolean;
  35. }
  36. export interface DaysCalendarViewModel extends NavigationViewModel {
  37. weeks: WeekViewModel[];
  38. month: Date;
  39. weekNumbers: string[];
  40. weekdays: string[];
  41. }
  42. /** *************** */
  43. export interface MonthsCalendarViewModel extends NavigationViewModel {
  44. months: CalendarCellViewModel[][];
  45. }
  46. /** *************** */
  47. export interface YearsCalendarViewModel extends NavigationViewModel {
  48. years: CalendarCellViewModel[][];
  49. }
  50. /** *************** */
  51. /** *************** */
  52. export interface DaysCalendarModel {
  53. daysMatrix: Date[][];
  54. month: Date;
  55. }
  56. /** *************** */
  57. export interface MonthViewOptions {
  58. width?: number;
  59. height?: number;
  60. firstDayOfWeek?: number;
  61. }
  62. /** *************** */
  63. export interface DatepickerFormatOptions {
  64. locale: string;
  65. monthTitle: string;
  66. yearTitle: string;
  67. dayLabel: string;
  68. monthLabel: string;
  69. yearLabel: string;
  70. weekNumbers: string;
  71. }
  72. export interface DatepickerRenderOptions {
  73. showWeekNumbers?: boolean;
  74. displayMonths?: number;
  75. }
  76. export interface DatepickerDateCustomClasses {
  77. date: Date;
  78. classes: string[];
  79. }
  80. /** *************** */
  81. /** *************** */
  82. export declare enum BsNavigationDirection {
  83. UP = 0,
  84. DOWN = 1
  85. }
  86. export interface BsNavigationEvent {
  87. direction?: BsNavigationDirection;
  88. step?: TimeUnit;
  89. }
  90. export interface BsViewNavigationEvent {
  91. unit?: TimeUnit;
  92. viewMode: BsDatepickerViewMode;
  93. }
  94. export interface CellHoverEvent {
  95. cell: CalendarCellViewModel;
  96. isHovered: boolean;
  97. }