Skip to content
This repository was archived by the owner on Sep 7, 2022. It is now read-only.

Commit 9e2ca42

Browse files
authored
Merge pull request #57 from webcomponents/add-types
fix: Add TypeScript declarations.
2 parents 0e32cb6 + 7507beb commit 9e2ca42

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"description": "Use custom elements in your React components without resorting to hacks.",
44
"main": "dist/index.js",
55
"jsnext:main": "src/index.js",
6+
"types": "src/index.d.ts",
67
"repository": {
78
"type": "git",
89
"url": "https://github.com/skatejs/react-integration.git"

src/index.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import React from 'react';
2+
3+
type CustomElementCtor = { new(...args: any[]): HTMLElement };
4+
type ReactComponentCtor = { new(...args: any[]): React.Component<any, any> };
5+
type Options = { React?: any, ReactDOM?: any };
6+
export default function (CustomElement: CustomElementCtor, opts: Options = {}): ReactComponentCtor;

0 commit comments

Comments
 (0)