diff --git a/types/react-leaflet-sidebarv2/index.d.ts b/types/react-leaflet-sidebarv2/index.d.ts new file mode 100644 index 0000000000..b9be2afb0a --- /dev/null +++ b/types/react-leaflet-sidebarv2/index.d.ts @@ -0,0 +1,42 @@ +// Type definitions for react-leaflet-sidebarv2 0.6 +// Project: https://github.com/condense/react-leaflet-sidebarv2 +// Definitions by: Vikram Pareddy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from 'react'; + +type Icon = string | React.ElementType; +type Anchor = 'top' | 'bottom'; +type Position = 'left' | 'right'; + +interface TabProps { + id: string; + header: string; + icon: Icon; + anchor?: Anchor; + disabled?: boolean; + onClose?: () => void; + closeIcon?: Icon; + position?: Position; + active?: boolean; +} + +declare class Tab extends React.Component {} + +type TabType = React.ReactElement | Array>; + +interface SidebarProps { + id: string; + collapsed: boolean; + position: Position; + selected: string; + closeIcon?: Icon; + onClose?: () => void; + onOpen?: () => void; + children: TabType; +} + +declare class Sidebar extends React.Component {} + +export { Tab, Sidebar }; diff --git a/types/react-leaflet-sidebarv2/react-leaflet-sidebarv2-tests.tsx b/types/react-leaflet-sidebarv2/react-leaflet-sidebarv2-tests.tsx new file mode 100644 index 0000000000..ccb2df3fea --- /dev/null +++ b/types/react-leaflet-sidebarv2/react-leaflet-sidebarv2-tests.tsx @@ -0,0 +1,25 @@ +import * as React from 'react'; +import { Sidebar, Tab } from 'react-leaflet-sidebarv2'; + +const MySidebar = ( + + + No place like home! + + + In Settings. + + + ); diff --git a/types/react-leaflet-sidebarv2/tsconfig.json b/types/react-leaflet-sidebarv2/tsconfig.json new file mode 100644 index 0000000000..a052e3f930 --- /dev/null +++ b/types/react-leaflet-sidebarv2/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-leaflet-sidebarv2-tests.tsx" + ] +} diff --git a/types/react-leaflet-sidebarv2/tslint.json b/types/react-leaflet-sidebarv2/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-leaflet-sidebarv2/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }