From 3e9f4d543bf015caae8de4a2c4135374867ac33a Mon Sep 17 00:00:00 2001 From: vikram-gsu Date: Thu, 11 Apr 2019 07:22:12 -0400 Subject: [PATCH] Added types for react-leaflet-sidebarv2 --- types/react-leaflet-sidebarv2/index.d.ts | 41 +++++++++++++++++++ .../react-leaflet-sidebarv2-tests.tsx | 14 +++++++ types/react-leaflet-sidebarv2/tsconfig.json | 24 +++++++++++ types/react-leaflet-sidebarv2/tslint.json | 1 + 4 files changed, 80 insertions(+) create mode 100644 types/react-leaflet-sidebarv2/index.d.ts create mode 100644 types/react-leaflet-sidebarv2/react-leaflet-sidebarv2-tests.tsx create mode 100644 types/react-leaflet-sidebarv2/tsconfig.json create mode 100644 types/react-leaflet-sidebarv2/tslint.json diff --git a/types/react-leaflet-sidebarv2/index.d.ts b/types/react-leaflet-sidebarv2/index.d.ts new file mode 100644 index 0000000000..726ec3e18a --- /dev/null +++ b/types/react-leaflet-sidebarv2/index.d.ts @@ -0,0 +1,41 @@ +// Type definitions for react-leaflet-sidebarv2 +// Project: https://github.com/condense/react-leaflet-sidebarv2 +// Definitions by: Vikram Pareddy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import 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.Element | React.Element[] + +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} \ No newline at end of file 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..f3bc189bba --- /dev/null +++ b/types/react-leaflet-sidebarv2/react-leaflet-sidebarv2-tests.tsx @@ -0,0 +1,14 @@ +import * as React from 'react'; +import {Sidebar, Tab} from 'react-leaflet-sidebarv2'; + +export const MetroSidebar = () => { + return ( + + + 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" }