feat: init
This commit is contained in:
1367
node_modules/fzf/dist/fzf.es.js
generated
vendored
Normal file
1367
node_modules/fzf/dist/fzf.es.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
7
node_modules/fzf/dist/fzf.umd.js
generated
vendored
Normal file
7
node_modules/fzf/dist/fzf.umd.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
15
node_modules/fzf/dist/types/algo.d.ts
generated
vendored
Normal file
15
node_modules/fzf/dist/types/algo.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Slab } from "./slab";
|
||||
import { Rune } from "./runes";
|
||||
export interface Result {
|
||||
start: number;
|
||||
end: number;
|
||||
score: number;
|
||||
}
|
||||
export declare const SCORE_MATCH = 16, SCORE_GAP_START = -3, SCORE_GAP_EXTENTION = -1, BONUS_BOUNDARY: number, BONUS_NON_WORD: number, BONUS_CAMEL_123: number, BONUS_CONSECUTIVE: number, BONUS_FIRST_CHAR_MULTIPLIER = 2;
|
||||
export type AlgoFn = (caseSensitive: boolean, normalize: boolean, forward: boolean, input: Rune[], pattern: Rune[], withPos: boolean, slab: Slab | null) => [Result, Set<number> | null];
|
||||
export declare const fuzzyMatchV2: AlgoFn;
|
||||
export declare const fuzzyMatchV1: AlgoFn;
|
||||
export declare const exactMatchNaive: AlgoFn;
|
||||
export declare const prefixMatch: AlgoFn;
|
||||
export declare const suffixMatch: AlgoFn;
|
||||
export declare const equalMatch: AlgoFn;
|
||||
4
node_modules/fzf/dist/types/char.d.ts
generated
vendored
Normal file
4
node_modules/fzf/dist/types/char.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import { Rune } from "./runes";
|
||||
export declare const isWhitespace: (rune: Rune) => boolean;
|
||||
export declare const whitespacesAtStart: (runes: Rune[]) => number;
|
||||
export declare const whitespacesAtEnd: (runes: Rune[]) => number;
|
||||
10
node_modules/fzf/dist/types/extended.d.ts
generated
vendored
Normal file
10
node_modules/fzf/dist/types/extended.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { AlgoFn } from "./algo";
|
||||
import { buildPatternForExtendedMatch } from "./pattern";
|
||||
import { Rune } from "./runes";
|
||||
type Offset = [number, number];
|
||||
export declare function computeExtendedMatch(text: Rune[], pattern: ReturnType<typeof buildPatternForExtendedMatch>, fuzzyAlgo: AlgoFn, forward: boolean): {
|
||||
offsets: Offset[];
|
||||
totalScore: number;
|
||||
allPos: Set<number>;
|
||||
};
|
||||
export {};
|
||||
41
node_modules/fzf/dist/types/finders.d.ts
generated
vendored
Normal file
41
node_modules/fzf/dist/types/finders.d.ts
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
import { AlgoFn } from "./algo";
|
||||
import { Rune } from "./runes";
|
||||
import { FzfResultItem, BaseOptions, SyncOptions, AsyncOptions, Tiebreaker, Token, Selector } from "./types";
|
||||
export type ArrayElement<ArrayType extends readonly unknown[]> = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;
|
||||
type SortAttrs<U> = {
|
||||
sort?: true;
|
||||
tiebreakers?: Tiebreaker<U>[];
|
||||
} | {
|
||||
sort: false;
|
||||
};
|
||||
type BaseOptsToUse<U> = Omit<Partial<BaseOptions<U>>, "sort" | "tiebreakers"> & SortAttrs<U>;
|
||||
type BaseOptionsTuple<U> = U extends string ? [options?: BaseOptsToUse<U>] : [options: BaseOptsToUse<U> & {
|
||||
selector: Selector<U>;
|
||||
}];
|
||||
export declare abstract class BaseFinder<L extends ReadonlyArray<any>> {
|
||||
runesList: Rune[][];
|
||||
items: L;
|
||||
readonly opts: BaseOptions<ArrayElement<L>>;
|
||||
algoFn: AlgoFn;
|
||||
constructor(list: L, ...optionsTuple: BaseOptionsTuple<ArrayElement<L>>);
|
||||
}
|
||||
export type SyncOptsToUse<U> = BaseOptsToUse<U> & Partial<Pick<SyncOptions<U>, "match">>;
|
||||
export type SyncOptionsTuple<U> = U extends string ? [options?: SyncOptsToUse<U>] : [options: SyncOptsToUse<U> & {
|
||||
selector: Selector<U>;
|
||||
}];
|
||||
export declare class SyncFinder<L extends ReadonlyArray<any>> extends BaseFinder<L> {
|
||||
readonly opts: SyncOptions<ArrayElement<L>>;
|
||||
constructor(list: L, ...optionsTuple: SyncOptionsTuple<ArrayElement<L>>);
|
||||
find(query: string): FzfResultItem<ArrayElement<L>>[];
|
||||
}
|
||||
export type AsyncOptsToUse<U> = BaseOptsToUse<U> & Partial<Pick<AsyncOptions<U>, "match">>;
|
||||
export type AsyncOptionsTuple<U> = U extends string ? [options?: AsyncOptsToUse<U>] : [options: AsyncOptsToUse<U> & {
|
||||
selector: Selector<U>;
|
||||
}];
|
||||
export declare class AsyncFinder<L extends ReadonlyArray<any>> extends BaseFinder<L> {
|
||||
readonly opts: AsyncOptions<ArrayElement<L>>;
|
||||
token: Token;
|
||||
constructor(list: L, ...optionsTuple: AsyncOptionsTuple<ArrayElement<L>>);
|
||||
find(query: string): Promise<FzfResultItem<ArrayElement<L>>[]>;
|
||||
}
|
||||
export {};
|
||||
22
node_modules/fzf/dist/types/main.d.ts
generated
vendored
Normal file
22
node_modules/fzf/dist/types/main.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import { SyncFinder, AsyncFinder } from "./finders";
|
||||
import type { ArrayElement, SyncOptionsTuple, SyncOptsToUse, AsyncOptionsTuple, AsyncOptsToUse } from "./finders";
|
||||
import type { SyncOptions, AsyncOptions } from "./types";
|
||||
export type { FzfResultItem, Selector, Tiebreaker } from "./types";
|
||||
export * from "./matchers";
|
||||
export * from "./tiebreakers";
|
||||
export type FzfOptions<U = string> = U extends string ? SyncOptsToUse<U> : SyncOptsToUse<U> & {
|
||||
selector: SyncOptions<U>["selector"];
|
||||
};
|
||||
export declare class Fzf<L extends ReadonlyArray<any>> {
|
||||
private finder;
|
||||
find: SyncFinder<L>["find"];
|
||||
constructor(list: L, ...optionsTuple: SyncOptionsTuple<ArrayElement<L>>);
|
||||
}
|
||||
export type AsyncFzfOptions<U = string> = U extends string ? AsyncOptsToUse<U> : AsyncOptsToUse<U> & {
|
||||
selector: AsyncOptions<U>["selector"];
|
||||
};
|
||||
export declare class AsyncFzf<L extends ReadonlyArray<any>> {
|
||||
private finder;
|
||||
find: AsyncFinder<L>["find"];
|
||||
constructor(list: L, ...optionsTuple: AsyncOptionsTuple<ArrayElement<L>>);
|
||||
}
|
||||
6
node_modules/fzf/dist/types/matchers.d.ts
generated
vendored
Normal file
6
node_modules/fzf/dist/types/matchers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { SyncFinder, AsyncFinder } from "./finders";
|
||||
import { FzfResultItem, Token } from "./types";
|
||||
export declare function basicMatch<U>(this: SyncFinder<ReadonlyArray<U>>, query: string): FzfResultItem<U>[];
|
||||
export declare function extendedMatch<U>(this: SyncFinder<ReadonlyArray<U>>, query: string): FzfResultItem<U>[];
|
||||
export declare function asyncBasicMatch<U>(this: AsyncFinder<ReadonlyArray<U>>, query: string, token: Token): Promise<FzfResultItem<U>[]>;
|
||||
export declare function asyncExtendedMatch<U>(this: AsyncFinder<ReadonlyArray<U>>, query: string, token: Token): Promise<FzfResultItem<U>[]>;
|
||||
2
node_modules/fzf/dist/types/normalize.d.ts
generated
vendored
Normal file
2
node_modules/fzf/dist/types/normalize.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import { Rune } from "./runes";
|
||||
export declare function normalizeRune(rune: Rune): Rune;
|
||||
5
node_modules/fzf/dist/types/numerics.d.ts
generated
vendored
Normal file
5
node_modules/fzf/dist/types/numerics.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export type Int16 = Int16Array[0];
|
||||
export type Int32 = Int32Array[0];
|
||||
export declare function toShort(number: number): Int16;
|
||||
export declare function toInt(number: number): Int32;
|
||||
export declare function maxInt16(num1: number, num2: number): number;
|
||||
36
node_modules/fzf/dist/types/pattern.d.ts
generated
vendored
Normal file
36
node_modules/fzf/dist/types/pattern.d.ts
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
import { Rune } from "./runes";
|
||||
import { Casing } from "./types";
|
||||
export declare enum TermType {
|
||||
Fuzzy = 0,
|
||||
Exact = 1,
|
||||
Prefix = 2,
|
||||
Suffix = 3,
|
||||
Equal = 4
|
||||
}
|
||||
export declare const termTypeMap: {
|
||||
0: import("./algo").AlgoFn;
|
||||
1: import("./algo").AlgoFn;
|
||||
2: import("./algo").AlgoFn;
|
||||
3: import("./algo").AlgoFn;
|
||||
4: import("./algo").AlgoFn;
|
||||
};
|
||||
interface Term {
|
||||
typ: TermType;
|
||||
inv: boolean;
|
||||
text: Rune[];
|
||||
caseSensitive: boolean;
|
||||
normalize: boolean;
|
||||
}
|
||||
type TermSet = Term[];
|
||||
export declare function buildPatternForExtendedMatch(fuzzy: boolean, caseMode: Casing, normalize: boolean, str: string): {
|
||||
str: string;
|
||||
termSets: TermSet[];
|
||||
sortable: boolean;
|
||||
cacheable: boolean;
|
||||
fuzzy: boolean;
|
||||
};
|
||||
export declare const buildPatternForBasicMatch: (query: string, casing: Casing, normalize: boolean) => {
|
||||
queryRunes: number[];
|
||||
caseSensitive: boolean;
|
||||
};
|
||||
export {};
|
||||
4
node_modules/fzf/dist/types/runes.d.ts
generated
vendored
Normal file
4
node_modules/fzf/dist/types/runes.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import { Int32 } from "./numerics";
|
||||
export type Rune = Int32;
|
||||
export declare const strToRunes: (str: string) => number[];
|
||||
export declare const runesToStr: (runes: Rune[]) => string;
|
||||
5
node_modules/fzf/dist/types/slab.d.ts
generated
vendored
Normal file
5
node_modules/fzf/dist/types/slab.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export interface Slab {
|
||||
i16: Int16Array;
|
||||
i32: Int32Array;
|
||||
}
|
||||
export declare const slab: Slab;
|
||||
3
node_modules/fzf/dist/types/tiebreakers.d.ts
generated
vendored
Normal file
3
node_modules/fzf/dist/types/tiebreakers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { FzfResultItem, Selector } from "./types";
|
||||
export declare function byLengthAsc<U>(a: FzfResultItem<U>, b: FzfResultItem<U>, selector: Selector<U>): number;
|
||||
export declare function byStartAsc<U>(a: FzfResultItem<U>, b: FzfResultItem<U>): number;
|
||||
138
node_modules/fzf/dist/types/types.d.ts
generated
vendored
Normal file
138
node_modules/fzf/dist/types/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,138 @@
|
||||
import type { Result } from "./algo";
|
||||
import type { SyncFinder, AsyncFinder } from "./finders";
|
||||
export interface Token {
|
||||
cancelled: boolean;
|
||||
}
|
||||
export type Casing = "smart-case" | "case-sensitive" | "case-insensitive";
|
||||
export interface FzfResultItem<U = string> extends Result {
|
||||
item: U;
|
||||
positions: Set<number>;
|
||||
}
|
||||
export type Selector<U> = BaseOptions<U>["selector"];
|
||||
export type Tiebreaker<U> = (a: FzfResultItem<U>, b: FzfResultItem<U>, selector: Selector<U>) => number;
|
||||
export interface BaseOptions<U> {
|
||||
/**
|
||||
* If `limit` is 32, top 32 items that matches your query will be returned.
|
||||
* By default all matched items are returned.
|
||||
*
|
||||
* @defaultValue `Infinity`
|
||||
*/
|
||||
limit: number;
|
||||
/**
|
||||
* For each item in the list, target a specific property of the item to search for.
|
||||
*/
|
||||
selector: (v: U) => string;
|
||||
/**
|
||||
* Defines what type of case sensitive search you want.
|
||||
*
|
||||
* @defaultValue `"smart-case"`
|
||||
*/
|
||||
casing: Casing;
|
||||
/**
|
||||
* If true, FZF will try to remove diacritics from list items.
|
||||
* This is useful if the list contains items with diacritics but
|
||||
* you want to query with plain A-Z letters.
|
||||
*
|
||||
* @example
|
||||
* Zoë → Zoe
|
||||
* blessèd → blessed
|
||||
*
|
||||
* @defaultValue `true`
|
||||
*/
|
||||
normalize: boolean;
|
||||
/**
|
||||
* Fuzzy algo to choose. Each algo has their own advantages, see here:
|
||||
* https://github.com/junegunn/fzf/blob/4c9cab3f8ae7b55f7124d7c3cf7ac6b4cc3db210/src/algo/algo.go#L5
|
||||
* If asssigned `false`, an exact match will be made instead of a fuzzy one.
|
||||
*
|
||||
* @defaultValue `"v2"`
|
||||
*/
|
||||
fuzzy: "v1" | "v2" | false;
|
||||
/**
|
||||
* A list of functions that act as fallback and help to
|
||||
* sort result entries when the score between two entries is tied.
|
||||
*
|
||||
* Consider a tiebreaker to be a [JS array sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)
|
||||
* compare function with an added third argument which is `options.selector`.
|
||||
*
|
||||
* If multiple tiebreakers are given, they are evaluated left to right until
|
||||
* one breaks the tie.
|
||||
*
|
||||
* Note that tiebreakers cannot be used if `sort=false`.
|
||||
*
|
||||
* FZF ships with these tiebreakers:
|
||||
* - `byLengthAsc`
|
||||
* - `byStartAsc`
|
||||
*
|
||||
* @defaultValue `[]`
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* function byLengthAsc(a, b, selector) {
|
||||
* return selector(a.item).length - selector(b.item).length;
|
||||
* }
|
||||
*
|
||||
* const fzf = new Fzf(list, { tiebreakers: [byLengthAsc] })
|
||||
* ```
|
||||
* This will result in following result entries having same score sorted like this:
|
||||
* FROM TO
|
||||
* axaa axaa
|
||||
* bxbbbb bxbbbb
|
||||
* cxcccccccccc dxddddddd
|
||||
* dxddddddd cxcccccccccc
|
||||
*/
|
||||
tiebreakers: Tiebreaker<U>[];
|
||||
/**
|
||||
* If `true`, result items will be sorted in descending order by their score.
|
||||
*
|
||||
* If `false`, result items won't be sorted and tiebreakers won't affect the
|
||||
* sort order either. In this case, the items are returned in the same order
|
||||
* as they are in the input list.
|
||||
*
|
||||
* @defaultValue `true`
|
||||
*/
|
||||
sort: boolean;
|
||||
/**
|
||||
* If `false`, matching will be done from backwards.
|
||||
*
|
||||
* @defaultValue `true`
|
||||
*
|
||||
* @example
|
||||
* /breeds/pyrenees when queried with "re"
|
||||
* with forward=true : /b**re**eds/pyrenees
|
||||
* with forward=false : /breeds/py**re**nees
|
||||
*
|
||||
* Doing forward=false is useful, for example, if one needs to match a file
|
||||
* path and they prefer querying for the file name over directory names
|
||||
* present in the path.
|
||||
*/
|
||||
forward: boolean;
|
||||
}
|
||||
export type SyncOptions<U> = BaseOptions<U> & {
|
||||
/**
|
||||
* A function that is responsible for matching list items with the query.
|
||||
*
|
||||
* We ship with two match functions - `basicMatch` and `extendedMatch`.
|
||||
*
|
||||
* If `extendedMatch` is used, you can add special patterns to narrow down your search.
|
||||
* To read about how they can be used, see [this section](https://github.com/junegunn/fzf/tree/7191ebb615f5d6ebbf51d598d8ec853a65e2274d#search-syntax).
|
||||
* For a quick glance, see [this piece](https://github.com/junegunn/fzf/blob/764316a53d0eb60b315f0bbcd513de58ed57a876/src/pattern.go#L12-L19).
|
||||
*
|
||||
* @defaultValue `basicMatch`
|
||||
*/
|
||||
match: (this: SyncFinder<ReadonlyArray<U>>, query: string) => FzfResultItem<U>[];
|
||||
};
|
||||
export type AsyncOptions<U> = BaseOptions<U> & {
|
||||
/**
|
||||
* A function that is responsible for matching list items with the query.
|
||||
*
|
||||
* We ship with two match functions - `asyncBasicMatch` and `asyncExtendedMatch`.
|
||||
*
|
||||
* If `asyncExtendedMatch` is used, you can add special patterns to narrow down your search.
|
||||
* To read about how they can be used, see [this section](https://github.com/junegunn/fzf/tree/7191ebb615f5d6ebbf51d598d8ec853a65e2274d#search-syntax).
|
||||
* For a quick glance, see [this piece](https://github.com/junegunn/fzf/blob/764316a53d0eb60b315f0bbcd513de58ed57a876/src/pattern.go#L12-L19).
|
||||
*
|
||||
* @defaultValue `asyncBasicMatch`
|
||||
*/
|
||||
match: (this: AsyncFinder<ReadonlyArray<U>>, query: string, token: Token) => Promise<FzfResultItem<U>[]>;
|
||||
};
|
||||
Reference in New Issue
Block a user