From: Glandos Date: Fri, 5 Nov 2021 09:12:50 +0000 (+0100) Subject: findOne can return null X-Git-Tag: 3.1.2~4^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F1231%2Fhead;p=svg.js.git findOne can return null This can be a breaking change. But it will also fix the contract of the method. --- diff --git a/svg.js.d.ts b/svg.js.d.ts index bfcd199..1d970b4 100644 --- a/svg.js.d.ts +++ b/svg.js.d.ts @@ -33,7 +33,7 @@ declare module "@svgdotjs/svg.js" { function dispatch(node: Node | Window, event: Event, data?: object, options?: object): Event function find(query: QuerySelector): List - function findOne(query: QuerySelector): Element + function findOne(query: QuerySelector): Element | null function getWindow(): Window; function registerWindow(win: Window, doc: Document): void; @@ -990,7 +990,7 @@ declare module "@svgdotjs/svg.js" { // prototype extend Selector in selector.js find(query: string): List - findOne(query: string): Dom + findOne(query: string): Dom | null // prototype method register in data.js data(a: string): object | string | number