From a8d9ddeecbcef92f7300b723ca76a834dd35753c Mon Sep 17 00:00:00 2001 From: parkerziegler Date: Tue, 15 Oct 2019 17:03:39 -0700 Subject: [PATCH] Add TypeScript definitions. --- index.d.ts | 10 ++++++++++ package.json | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..782aa75 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,10 @@ +declare module 'react-ssr-prepass' { + type Visitor = ( + element: React.ElementType, + instance?: React.Component + ) => void | Promise + + function ssrPrepass(node: React.ReactNode, visitor?: Visitor): Promise + + export = ssrPrepass +} diff --git a/package.json b/package.json index 4fde1ab..dffa95c 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,10 @@ "files": [ "index.js", "index.js.flow", - "dist" + "dist", + "index.d.ts" ], + "types": "index.d.ts", "scripts": { "prepublishOnly": "run-s build", "build": "rollup -c rollup.config.js",