@types/frecency
TypeScript icon, indicating that this package has built-in type declarations

1.3.5 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/frecency

Weekly Downloads

132

Version

1.3.5

License

MIT

Unpacked Size

4.23 kB

Total Files

5

Last publish

Collaborators

  • types