mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Update types for react-sidebar 3.0.0
Added test case to check new properties are optional.
This commit is contained in:
parent
480f7557d2
commit
f327f7cc69
6
types/react-sidebar/index.d.ts
vendored
6
types/react-sidebar/index.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
// Type definitions for react-sidebar 2.3
|
||||
// Type definitions for react-sidebar 3.0
|
||||
// Project: https://github.com/balloob/react-sidebar#readme
|
||||
// Definitions by: Jeroen Vervaeke <https://github.com/jeroenvervaeke>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@ -23,6 +23,10 @@ export interface SidebarProps {
|
||||
transitions?: boolean;
|
||||
touch?: boolean;
|
||||
touchHandleWidth?: number;
|
||||
rootId?: string;
|
||||
sidebarId?: string;
|
||||
contentId?: string;
|
||||
overlayId?: string;
|
||||
}
|
||||
|
||||
export interface SidebarStyles {
|
||||
|
||||
@ -8,6 +8,24 @@ const sidebarStyle: SidebarStyles = {
|
||||
};
|
||||
|
||||
const sidebar1 = (
|
||||
<Sidebar
|
||||
defaultSidebarWidth={30}
|
||||
docked={true}
|
||||
open={true}
|
||||
sidebar={sidebar}
|
||||
styles={sidebarStyle}
|
||||
onSetOpen={(open: boolean) => { }}
|
||||
rootId="test-root-id"
|
||||
sidebarId="test-sidebar-id"
|
||||
contentId="test-content-id"
|
||||
overlayId="test-overlay-id"
|
||||
>
|
||||
<h1>Content</h1>
|
||||
</Sidebar>
|
||||
);
|
||||
|
||||
// Test id properties are optional
|
||||
const sidebar2 = (
|
||||
<Sidebar
|
||||
defaultSidebarWidth={30}
|
||||
docked={true}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user