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",