Skip to content

Commit

Permalink
updated typing and jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
danmolloy committed Jun 5, 2024
1 parent b0fedcd commit 4f49279
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ declare global {
type MonthCalendarProps = {
selectedDate: Date
setSelectedDate: (arg: Date) => void
events?: EventObject[]
events?: {
startTime: Date
title: string
id: string
}[]
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"registry": "https://npm.pkg.github.com/@danmolloy"
},
"name": "react-diary",
"version": "1.0.7",
"version": "1.0.8",
"main": "dist/cjs/index.js",
"types": "dist/index.d.ts",
"module": "dist/esm/index.js",
Expand Down
8 changes: 8 additions & 0 deletions src/components/monthCalendar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ const getCalendarWeeks = (firstOfMonth: DateTime): DateTime[] => {
return weekArr
}

/**
* MonthCalendar Component
*
* @param {Date} selectedDate - The currently selected date.
* @param {Function} setSelectedDate - Function to set the selected date.
* @param {EventObject[]} [events] - Optional array of events.
*
*/
export default function MonthCalendar(props: MonthCalendarProps): JSX.Element {
const { selectedDate, setSelectedDate, events } = props;
//const [localDate, setLocalDate] = useState<DateTime>(DateTime.now())
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"emitDeclarationOnly": true,
"sourceMap": true,
"outDir": "dist",
"declarationDir": "types",
"declarationDir": "./dist/types", //"types",

/* Interop Constraints */
"allowSyntheticDefaultImports": true,
Expand Down

0 comments on commit 4f49279

Please sign in to comment.