diff --git a/index.d.ts b/index.d.ts index cbe3deb6..e1d96cb4 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,4 @@ -declare module 'rollup-plugin-typescript' { - function typescript(): any; - export = typescript; -} +import { serializedNodeWithId } from './src/types'; + +export function snapshot(n: Document): serializedNodeWithId | null; +export function rebuild(n: serializedNodeWithId): Node | null; diff --git a/package.json b/package.json index 5944a8df..a4d87dcf 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "rrweb's component to take a snapshot of DOM, aka DOM serializer", "main": "index.js", "scripts": { - "test": "TS_NODE_FILES=true mocha -r ts-node/register test/**/*.ts", + "test": "TS_NODE_CACHE=false TS_NODE_FILES=true mocha -r ts-node/register test/**/*.ts", "compile": "rollup --config" }, "repository": { diff --git a/test.d.ts b/test.d.ts new file mode 100644 index 00000000..cbe3deb6 --- /dev/null +++ b/test.d.ts @@ -0,0 +1,4 @@ +declare module 'rollup-plugin-typescript' { + function typescript(): any; + export = typescript; +} diff --git a/test/server.ts b/test/server.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/tsconfig.json b/tsconfig.json index 6378ca69..f82e02cd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,5 +11,5 @@ }, "compileOnSave": true, "exclude": ["test"], - "include": ["src", "index.d.ts"] + "include": ["src", "test.d.ts"] }