diff --git a/packages/alert-dialog/index.d.ts b/packages/alert-dialog/index.d.ts index e507217f7..4a40c9639 100644 --- a/packages/alert-dialog/index.d.ts +++ b/packages/alert-dialog/index.d.ts @@ -2,9 +2,9 @@ declare module "@reach/alert-dialog" { import { DialogProps, DialogContentProps } from "@reach/dialog"; type AlertDialogProps = { - isOpen: boolean; - onDismiss: () => void; - leastDestructiveRef: React.RefObject; + isOpen?: boolean; + onDismiss?: () => void; + leastDestructiveRef?: React.RefObject; children: React.ReactNode; } & DialogProps; diff --git a/packages/component-component/index.d.ts b/packages/component-component/index.d.ts index 8ffa347f6..70ff26910 100644 --- a/packages/component-component/index.d.ts +++ b/packages/component-component/index.d.ts @@ -13,7 +13,7 @@ declare module "@reach/component-component" { type Refs = { [key: string]: React.RefObject }; - type StateProps = Pick, "state" | "props">; + type StateProps = Pick, "state" | "props">; export type ComponentProps = { initialState?: S; @@ -22,11 +22,13 @@ declare module "@reach/component-component" { getRefs?(): Refs; didMount?(args: Args & Refs): void; didUpdate?(args: Args & Refs & { prevProps: P; prevState: S }): void; - willUnmount?(args: StateProps & Refs): void; + willUnmount?(args: StateProps & Refs): void; getSnapshotBeforeUpdate?( - args: StateProps & Refs & { prevProps: P; prevState: S } + args: StateProps & Refs & { prevProps: P; prevState: S } ): any; - shouldUpdate?(args: StateProps & { nextProps: P; nextState: S }): boolean; + shouldUpdate?( + args: StateProps & { nextProps: P; nextState: S } + ): boolean; children?( args: Args & Refs ): Args & Refs | React.ReactNode | null; diff --git a/packages/dialog/index.d.ts b/packages/dialog/index.d.ts index 3f9ff415f..ad340e085 100644 --- a/packages/dialog/index.d.ts +++ b/packages/dialog/index.d.ts @@ -1,6 +1,6 @@ declare module "@reach/dialog" { - type DialogProps = { - isOpen: boolean; + export type DialogProps = { + isOpen?: boolean; onDismiss?: () => void; children: React.ReactNode; } & HTMLDivElement; diff --git a/packages/portal/index.d.ts b/packages/portal/index.d.ts index f65b2137d..f4506d63d 100644 --- a/packages/portal/index.d.ts +++ b/packages/portal/index.d.ts @@ -1,7 +1,7 @@ declare module "@reach/portal" { type PortalProps = { + type?: string; children: React.ReactNode; - type: string; }; export const Portal: React.SFC; diff --git a/packages/rect/index.d.ts b/packages/rect/index.d.ts index ecfab2e8d..e9747122f 100644 --- a/packages/rect/index.d.ts +++ b/packages/rect/index.d.ts @@ -1,5 +1,5 @@ declare module "@reach/rect" { - type IClientRect = { + interface IClientRect { x: number; y: number; width: number; @@ -8,12 +8,12 @@ declare module "@reach/rect" { right: number; bottom: number; left: number; - }; + } type IRectProps = { + observe?: boolean; + onChange?: (rect: IClientRect) => void; children: React.ReactNode; - observe: boolean; - onChange: (rect: IClientRect) => void; }; const Rect: React.SFC;