diff --git a/types/react-add-to-calendar/index.d.ts b/types/react-add-to-calendar/index.d.ts new file mode 100644 index 0000000000..be22b1638a --- /dev/null +++ b/types/react-add-to-calendar/index.d.ts @@ -0,0 +1,35 @@ +// Type definitions for react-add-to-calendar 0.1 +// Project: https://github.com/jasonsalzman/react-add-to-calendar +// Definitions by: Konstantin Lebedev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from "react"; + +export interface AddToCalendarEvent { + title?: string; + description?: string; + location?: string; + startTime?: string | Date; + endTime?: string | Date; +} + +export interface AddToCalendarProps { + buttonClassClosed?: string; + buttonClassOpen?: string; + buttonLabel?: string; + buttonTemplate?: any; + buttonIconClass?: string; + useFontAwesomeIcons?: boolean; + buttonWrapperClass?: string; + displayItemIcons?: boolean; + optionsOpen?: boolean; + dropdownClass?: string; + event: AddToCalendarEvent; + listItems?: any[]; + rootClass?: string; +} + +declare const ReactAddToCalendar: React.ComponentClass; + +export default ReactAddToCalendar; diff --git a/types/react-add-to-calendar/react-add-to-calendar-tests.tsx b/types/react-add-to-calendar/react-add-to-calendar-tests.tsx new file mode 100644 index 0000000000..36fea0f86f --- /dev/null +++ b/types/react-add-to-calendar/react-add-to-calendar-tests.tsx @@ -0,0 +1,34 @@ +import AddToCalendar from "react-add-to-calendar"; +import * as React from "react"; + +const sampleEvent = { + title: 'Sample Event', + description: 'This is the sample event provided as an example only', + location: 'Portland, OR', + startTime: '2016-09-16T20:15:00-04:00', + endTime: '2016-09-16T21:45:00-04:00' +}; + +const AddToCalendarRequiredOptions: JSX.Element = ( + +); + +const AddToCalendarAllOptions: JSX.Element = ( + +); diff --git a/types/react-add-to-calendar/tsconfig.json b/types/react-add-to-calendar/tsconfig.json new file mode 100644 index 0000000000..91eb28e5a5 --- /dev/null +++ b/types/react-add-to-calendar/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react", + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "react-add-to-calendar-tests.tsx" + ] +} diff --git a/types/react-add-to-calendar/tslint.json b/types/react-add-to-calendar/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-add-to-calendar/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }