1.3.5 • Published 7 months ago
@types/frecency v1.3.5
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
// Type definitions for frecency 1.3
// Project: https://github.com/mixmaxhq/frecency#readme
// Definitions by: swyx <https://github.com/sw-yx>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// 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: Sat, 14 Aug 2021 03:31:24 GMT
- Dependencies: none
- Global values: none
Credits
These definitions were written by swyx.