Skip to content

Commit

Permalink
fix: declaration type #288
Browse files Browse the repository at this point in the history
  • Loading branch information
shahabyazdi committed May 18, 2024
1 parent d8bc6a9 commit 2e25a62
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Prevent showing the week of the next month [#294](https://github.com/shahabyazdi/react-multi-date-picker/issues/294)

- Better type support for TypeScript
- MapDaysProps added to the index.d.ts [#288](https://github.com/shahabyazdi/react-multi-date-picker/issues/288)

# 4.5.0

Expand Down
18 changes: 12 additions & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ declare module "react-multi-date-picker" {
? DateObject[]
: DateObject[][];

export type MapDaysProps<
Multiple extends boolean = false,
Range extends boolean = false
> = {
date: DateObject;
today: DateObject;
selectedDate: TValue<Multiple, Range>;
currentMonth: DateObject["month"];
isSameDate(arg1: DateObject, arg2: DateObject): boolean;
};

export type HeaderItem =
| "MONTH_YEAR"
| "YEAR_MONTH"
Expand Down Expand Up @@ -241,12 +252,7 @@ declare module "react-multi-date-picker" {
* }}
* />
*/
mapDays?(object: {
date: DateObject;
selectedDate: TValue<Multiple, Range>;
currentMonth: object;
isSameDate(arg1: DateObject, arg2: DateObject): boolean;
}):
mapDays?(props: MapDaysProps<Multiple, Range>):
| (HTMLAttributes<HTMLSpanElement> & {
disabled?: boolean;
hidden?: boolean;
Expand Down

0 comments on commit 2e25a62

Please sign in to comment.