1.3.5 • Published 7 months ago

@types/frecency v1.3.5

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

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.

1.3.5

7 months ago

1.3.4

7 months ago

1.3.3

8 months ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

5 years ago