From 071771c0e0c1274b485803a635f7112a56c629b8 Mon Sep 17 00:00:00 2001 From: MiniDigger | Martin Date: Sun, 17 Nov 2024 22:34:10 +0100 Subject: [PATCH] fix: mark createDOMPurify param as optional --- dist/purify.cjs.d.ts | 4 ++-- dist/purify.es.d.mts | 4 ++-- src/purify.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/purify.cjs.d.ts b/dist/purify.cjs.d.ts index faf4ac23..ef602d9f 100644 --- a/dist/purify.cjs.d.ts +++ b/dist/purify.cjs.d.ts @@ -206,9 +206,9 @@ declare const _default: DOMPurify; interface DOMPurify { /** - * Creates a DOMPurify instance using the given window-like object. + * Creates a DOMPurify instance using the given window-like object. Defaults to `window`. */ - (root: WindowLike): DOMPurify; + (root?: WindowLike): DOMPurify; /** * Version label, exposed for easier checks * if DOMPurify is up to date or not diff --git a/dist/purify.es.d.mts b/dist/purify.es.d.mts index 4cb7625b..62f7f7f2 100644 --- a/dist/purify.es.d.mts +++ b/dist/purify.es.d.mts @@ -206,9 +206,9 @@ declare const _default: DOMPurify; interface DOMPurify { /** - * Creates a DOMPurify instance using the given window-like object. + * Creates a DOMPurify instance using the given window-like object. Defaults to `window`. */ - (root: WindowLike): DOMPurify; + (root?: WindowLike): DOMPurify; /** * Version label, exposed for easier checks * if DOMPurify is up to date or not diff --git a/src/purify.ts b/src/purify.ts index f85aa148..4143aa27 100644 --- a/src/purify.ts +++ b/src/purify.ts @@ -1679,9 +1679,9 @@ export default createDOMPurify(); export interface DOMPurify { /** - * Creates a DOMPurify instance using the given window-like object. + * Creates a DOMPurify instance using the given window-like object. Defaults to `window`. */ - (root: WindowLike): DOMPurify; + (root?: WindowLike): DOMPurify; /** * Version label, exposed for easier checks