Installation
npm install --save @types/frecency
Summary
This package contains type definitions for frecency (https://github.com/mixmaxhq/frecency#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/frecency.
index.d.ts
// TypeScript Version: 2.3
export type idAttrFn = (result: string) => string;
export default class Frecency<T = any> {
constructor(constructOpts: {
key: string;
idAttribute?: string | idAttrFn | undefined;
timeStampsLimit?: number | undefined;
recentSelectionsLimit?: number | undefined;
storageProvider?: object | undefined;
exactQueryMatchWeight?: number | undefined;
subQueryMatchWeight?: number | undefined;
recentSelectionsMatchWeight?: number | undefined;
});
save: (arg: { searchQuery: T; selectedId: string }) => void;
sort:
| ((arg: { searchQuery: T; results: T[] }) => T[])
| ((arg: {
searchQuery: T;
results: T[];
keepScores?: boolean | undefined;
}) => Array<T & { _frecencyScore?: number | undefined }>);
}
Additional Details
- Last updated: Tue, 07 Nov 2023 03:09:37 GMT
- Dependencies: none
Credits
These definitions were written by swyx.