Fixed types according to linting errors and updated to import all of react since it is type import

This commit is contained in:
vikram-gsu
2019-04-11 21:31:50 -04:00
parent cf9021a7b3
commit ccfe9263f8
2 changed files with 23 additions and 23 deletions

View File

@@ -4,38 +4,38 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import React from 'react';
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,
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>{}
};
declare class Tab extends React.Component<TabProps, any>{};
type TabType = React.Element<Tab> | React.Element<Tab>[]
type TabType = React.Element<Tab> | Array<React.Element<Tab>>;
interface SidebarProps {
id: string,
collapsed: boolean,
position: Position,
selected: string,
closeIcon?: Icon,
onClose?:() => void,
onOpen?: () => void,
id: string;
collapsed: boolean;
position: Position;
selected: string;
closeIcon?: Icon;
onClose?:() => void;
onOpen?: () => void;
children: TabType
}
};
declare class Sidebar extends React.Component<SidebarProps, any>{}
declare class Sidebar extends React.Component<SidebarProps, any>{};
export {Tab, Sidebar}
export {Tab, Sidebar};

View File

@@ -1,5 +1,5 @@
import * as React from 'react';
import {Sidebar, Tab} from 'react-leaflet-sidebarv2';
import { Sidebar, Tab } from 'react-leaflet-sidebarv2';
const MySidebar = (
<Sidebar