From ad30dc660ff4c20d627190bb4b787f0b763afd3b Mon Sep 17 00:00:00 2001 From: Christopher Deutsch Date: Fri, 4 May 2018 15:50:44 -0500 Subject: [PATCH] Add missing `open` parameter to `onSetOpen`, which is pretty important if you use it. (#25519) Add missing `defaultSidebarWidth` prop. Declare `sidebar` as a more restrictive/accurate type. --- types/react-sidebar/index.d.ts | 7 ++++--- types/react-sidebar/react-sidebar-tests.tsx | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/types/react-sidebar/index.d.ts b/types/react-sidebar/index.d.ts index 24684c4c76..da6d9e0f79 100644 --- a/types/react-sidebar/index.d.ts +++ b/types/react-sidebar/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-sidebar 2.2 +// Type definitions for react-sidebar 2.3 // Project: https://github.com/balloob/react-sidebar#readme // Definitions by: Jeroen Vervaeke // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,15 +8,16 @@ import { Component } from "react"; export interface SidebarProps { contentClassName?: string; + defaultSidebarWidth?: number; docked?: boolean; dragToggleDistance?: number; - onSetOpen?(): void; + onSetOpen?(open: boolean): void; open?: boolean; overlayClassName?: string; pullRight?: boolean; rootClassName?: string; shadow?: boolean; - sidebar?: any; + sidebar?: React.ReactNode; sidebarClassName?: string; styles?: SidebarStyles; transitions?: boolean; diff --git a/types/react-sidebar/react-sidebar-tests.tsx b/types/react-sidebar/react-sidebar-tests.tsx index 491bd3fb4f..caeaa3c37d 100644 --- a/types/react-sidebar/react-sidebar-tests.tsx +++ b/types/react-sidebar/react-sidebar-tests.tsx @@ -9,11 +9,12 @@ const sidebarStyle: SidebarStyles = { const sidebar1 = ( {}} + onSetOpen={(open: boolean) => { }} >

Content