types for react

This commit is contained in:
Richard Ramos 2020-03-09 11:06:28 -04:00
parent 433300aa62
commit 75cd97ebe9
2 changed files with 23 additions and 0 deletions

View File

@ -24,6 +24,7 @@
"url": "https://github.com/embarklabs/subspace/issues" "url": "https://github.com/embarklabs/subspace/issues"
}, },
"license": "MIT", "license": "MIT",
"types": "types/index.d.ts",
"main": "./lib/index.js", "main": "./lib/index.js",
"module": "./module/index.js", "module": "./module/index.js",
"scripts": { "scripts": {

22
packages/react/types/index.d.ts vendored Normal file
View File

@ -0,0 +1,22 @@
import Web3 from "web3";
import React from 'react';
import Subspace from "@embarklabs/subspace"
export interface SubspaceProviderProps {
web3: Web3;
children: React.ReactNode;
}
export const SubspaceProvider: React.Component<SubspaceProviderProps>;
export class observe extends React.Component<P> {}
export default function useSubspace(): Subspace;
interface withSubspaceProps {
subspace: Subspace;
}
export class withSubspace extends React.Component<P & withSubspace> {
constructor(WrappedComponent: ReactNode);
}