react-google-calendar icon indicating copy to clipboard operation
react-google-calendar copied to clipboard

Support Typescript

Open Rendydendimara opened this issue 3 years ago • 1 comments

Is this ilbrary type support for Typescript? How do I do the setup.

Rendydendimara avatar Apr 26 '21 04:04 Rendydendimara

Hi! Currently it doesn't support typescript. I am not very familiar with typescript, but I will look into supporting it. If you are more familiar with it/want to do it yourself, you are welcome to make a pull request for it.

ericz1803 avatar May 03 '21 04:05 ericz1803

Hello, @ericz1803 I added this typing to myself and it's works

react-google-calendar.d.ts

declare module '@ericz1803/react-google-calendar' {
    import * as React from 'react';

    declare class Calendar extends React.Component<CalendarProps> {}

    export interface CalendarProps {
        calendars: {
            calendarId: string,
            color?: string,
        }[],
        apiKey: string,
        showFooter?: boolean,
        showArrow?: boolean,
        styles?: object,
        language?: string
    }

    export default Calendar;
}

BTW, showFooter in your Calendar.propTypes isn't really required

artygrand avatar Nov 01 '22 04:11 artygrand