Skip to content

Commit f3ecb13

Browse files
committed
feat: fix Matcher types
1 parent 17da474 commit f3ecb13

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

builtin/action/submatch.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ function getContext<T, A extends string>(params: unknown): Context<T, A> {
159159
* Default submatching actions with common matchers.
160160
*/
161161
export const defaultSubmatchActions: {
162-
"sub:fzf": Action<unknown>;
163-
"sub:substring": Action<unknown>;
164-
"sub:regexp": Action<unknown>;
162+
"sub:fzf": Action<any>;
163+
"sub:substring": Action<any>;
164+
"sub:regexp": Action<any>;
165165
} = {
166166
"sub:fzf": submatch([fzf]),
167167
"sub:substring": submatch([substring]),

builtin/matcher/fzf.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ export function fzf<T>(options: Options = {}): Matcher<T> {
3838
// Split query into individual terms, ignoring empty strings
3939
const terms = query.split(/\s+/).filter((v) => v.length > 0);
4040

41-
// Function to filter items for a given term
42-
const filter = async (items: readonly IdItem<T>[], term: string) => {
41+
// deno-lint-ignore no-explicit-any
42+
const filter = async (items: readonly IdItem<any>[], term: string) => {
4343
const fzf = new AsyncFzf(items, {
4444
selector: (v) => v.value,
4545
casing,

matcher.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import { type DerivableArray, deriveArray } from "./util/derivable.ts";
1111
* @returns A matcher object containing the `match` function.
1212
*/
1313
export function defineMatcher<T>(
14-
match: (
14+
match: <V extends T>(
1515
denops: Denops,
16-
params: MatchParams<T>,
16+
params: MatchParams<V>,
1717
options: { signal?: AbortSignal },
18-
) => AsyncIterableIterator<IdItem<T>>,
18+
) => AsyncIterableIterator<IdItem<V>>,
1919
): Matcher<T> {
2020
return { match };
2121
}

0 commit comments

Comments
 (0)