Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f9ea4e5

Browse files
golorodenarmandabric
authored andcommitted
feat(typescript): Add TypeScript declaration file. (#475)
1 parent ed41315 commit f9ea4e5

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

‎index.d.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
declare module 'react-element-to-jsx-string' {
2+
import { ReactNode } from 'react';
3+
4+
interface ReactElementToJSXStringOptions {
5+
displayName?: (element: ReactNode) => string;
6+
filterProps?: string[];
7+
showDefaultProps?: boolean;
8+
showFunctions?: boolean;
9+
functionValue?: (fn: any) => any;
10+
tabStop?: number;
11+
useBooleanShorthandSyntax?: boolean;
12+
maxInlineAttributesLineLength?: number;
13+
sortProps?: boolean;
14+
useFragmentShortSyntax?: boolean;
15+
}
16+
17+
const reactElementToJSXString: (element: ReactNode, options?: ReactElementToJSXStringOptions) => string;
18+
export = reactElementToJSXString;
19+
}

‎package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"main": "dist/cjs/index.js",
66
"module": "dist/esm/index.js",
77
"browser": "dist/cjs/index.js",
8+
"types": "index.d.ts",
89
"scripts": {
910
"build": "rollup -c",
1011
"build:flow": "flow-copy-source -v --ignore=*.spec.js src/ dist/cjs",

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /