mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Added types for react-leaflet-sidebarv2
This commit is contained in:
parent
87b286543f
commit
3e9f4d543b
41
types/react-leaflet-sidebarv2/index.d.ts
vendored
Normal file
41
types/react-leaflet-sidebarv2/index.d.ts
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
// Type definitions for react-leaflet-sidebarv2
|
||||
// Project: https://github.com/condense/react-leaflet-sidebarv2
|
||||
// Definitions by: Vikram Pareddy <https://github.com/vikram-gsu>
|
||||
// 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<TabProps, any>{}
|
||||
|
||||
type TabType = React.Element<Tab> | React.Element<Tab>[]
|
||||
|
||||
interface SidebarProps {
|
||||
id: string,
|
||||
collapsed: boolean,
|
||||
position: Position,
|
||||
selected: string,
|
||||
closeIcon?: Icon,
|
||||
onClose?:() => void,
|
||||
onOpen?: () => void,
|
||||
children: TabType
|
||||
}
|
||||
|
||||
declare class Sidebar extends React.Component<SidebarProps, any>{}
|
||||
|
||||
export {Tab, Sidebar}
|
||||
@ -0,0 +1,14 @@
|
||||
import * as React from 'react';
|
||||
import {Sidebar, Tab} from 'react-leaflet-sidebarv2';
|
||||
|
||||
export const MetroSidebar = () => {
|
||||
return (
|
||||
<Sidebar id='sidebar' collapsed={false} selected={'home'} closeIcon='fa' position='right'>
|
||||
<Tab id='home' header='Home' icon='fa fa-home'>
|
||||
No place like home!
|
||||
</Tab>
|
||||
<Tab id='settings' header='Settings' icon='fa fa-cog' anchor='bottom'>
|
||||
In Settings.
|
||||
</Tab>
|
||||
</Sidebar>);
|
||||
}
|
||||
24
types/react-leaflet-sidebarv2/tsconfig.json
Normal file
24
types/react-leaflet-sidebarv2/tsconfig.json
Normal file
@ -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"
|
||||
]
|
||||
}
|
||||
1
types/react-leaflet-sidebarv2/tslint.json
Normal file
1
types/react-leaflet-sidebarv2/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user