diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..bbf1cc2 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,3 @@ +export function setForm(event: Event): void; +export function restoreResumableFields(id: string, options?: {keyPrefix?: string}): void; +export function persistResumableFields(id: string, options?: {selector?: string, keyPrefix?: string}): void; diff --git a/package.json b/package.json index b0d780e..47da59b 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "Annotate fields to be persisted on navigation away from the current page.", "main": "dist/session-resume.umd.js", "module": "dist/session-resume.esm.js", + "types": "index.d.ts", "repository": "github/session-resume", "scripts": { "build": "rollup -c && cp session-resume.js.flow dist/session-resume.esm.js.flow && cp session-resume.js.flow dist/session-resume.umd.js.flow", @@ -15,7 +16,8 @@ "prepublishOnly": "npm run build" }, "files": [ - "dist" + "dist", + "index.d.ts" ], "keywords": [], "author": "",