Skip to content

Commit

Permalink
feat(typescript): Add TypeScript declaration file. (#475)
Browse files Browse the repository at this point in the history
  • Loading branch information
goloroden authored and armandabric committed Dec 29, 2019
1 parent ed41315 commit f9ea4e5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
declare module 'react-element-to-jsx-string' {
import { ReactNode } from 'react';

interface ReactElementToJSXStringOptions {
displayName?: (element: ReactNode) => string;
filterProps?: string[];
showDefaultProps?: boolean;
showFunctions?: boolean;
functionValue?: (fn: any) => any;
tabStop?: number;
useBooleanShorthandSyntax?: boolean;
maxInlineAttributesLineLength?: number;
sortProps?: boolean;
useFragmentShortSyntax?: boolean;
}

const reactElementToJSXString: (element: ReactNode, options?: ReactElementToJSXStringOptions) => string;
export = reactElementToJSXString;
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"browser": "dist/cjs/index.js",
"types": "index.d.ts",
"scripts": {
"build": "rollup -c",
"build:flow": "flow-copy-source -v --ignore=*.spec.js src/ dist/cjs",
Expand Down

0 comments on commit f9ea4e5

Please sign in to comment.