diff --git a/CHANGELOG.md b/CHANGELOG.md index 50db637..2af5adf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- Fixed for TypeScript 5.5. + ## v2.11.2 - Fixed handling `unknown` incorrectly. (Fix [#36](https://github.com/g-plane/typed-query-selector/issues/36)) diff --git a/parser.d.ts b/parser.d.ts index fe812c9..d64495e 100644 --- a/parser.d.ts +++ b/parser.d.ts @@ -120,7 +120,7 @@ export type ParseSelector< I extends string, Fallback extends Element = Element, > = ParseSelectorToTagNames extends string - ? ExpandAnd, Fallback> extends Element + ? ExpandAnd, Fallback> extends Fallback ? ExpandAnd, Fallback> : Fallback : Fallback diff --git a/parser.test.ts b/parser.test.ts index bd78f1b..a6ab931 100644 --- a/parser.test.ts +++ b/parser.test.ts @@ -360,3 +360,8 @@ declare function delegate< Selector extends string, TElement extends Element = ParseSelector, >(selector: Selector): void + +declare function fetchDom< + Selector extends string, + TElement extends HTMLElement = ParseSelector, +>(selector: Selector): Promise