From 640f5a42a17ffae062f527ac7a0db5a27a48a929 Mon Sep 17 00:00:00 2001 From: Armand Abric Date: Tue, 21 Jan 2020 08:23:43 +0100 Subject: [PATCH] fix: Fix TypeScript type declaration - Export the react-element-to-jsx-string options type - Fix the `filterProps` parameters --- index.d.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index c2bc46a02..d6c28cd7c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,9 +1,11 @@ declare module 'react-element-to-jsx-string' { import { ReactNode } from 'react'; + type FilterPropsFunction = (value: any, key: string) => boolean + interface ReactElementToJSXStringOptions { displayName?: (element: ReactNode) => string; - filterProps?: string[]; + filterProps?: string[] | FilterPropsFunction; showDefaultProps?: boolean; showFunctions?: boolean; functionValue?: (fn: any) => any; @@ -15,5 +17,8 @@ declare module 'react-element-to-jsx-string' { } const reactElementToJSXString: (element: ReactNode, options?: ReactElementToJSXStringOptions) => string; - export = reactElementToJSXString; + + export { ReactElementToJSXStringOptions as Options }; + + export default reactElementToJSXString; }