From 75cd97ebe9971434bfd23a7c4c9fa2a3dc112c49 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Mon, 9 Mar 2020 11:06:28 -0400 Subject: [PATCH] types for react --- packages/react/package.json | 1 + packages/react/types/index.d.ts | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 packages/react/types/index.d.ts diff --git a/packages/react/package.json b/packages/react/package.json index a9a5268..cb5a37c 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -24,6 +24,7 @@ "url": "https://github.com/embarklabs/subspace/issues" }, "license": "MIT", + "types": "types/index.d.ts", "main": "./lib/index.js", "module": "./module/index.js", "scripts": { diff --git a/packages/react/types/index.d.ts b/packages/react/types/index.d.ts new file mode 100644 index 0000000..0f376d2 --- /dev/null +++ b/packages/react/types/index.d.ts @@ -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; + +export class observe extends React.Component

{} + +export default function useSubspace(): Subspace; + +interface withSubspaceProps { + subspace: Subspace; +} + +export class withSubspace extends React.Component

{ + constructor(WrappedComponent: ReactNode); +}