@bilions/search-js
Version:
Instance search UI component
49 lines (48 loc) • 954 B
TypeScript
import { SearchJSItem } from '../types';
export declare class SearchHistory {
/**
* local storage
*
* @var {Storage} db
*/
private db;
/**
* max items to store in history
*
* @var {number} maxItems
*/
private maxItems;
/**
* local storage key
*
* @var {string} storageKey
*/
private storageKey;
constructor();
/**
* get list of items store in history
*
* @returns {Array<SearchJSItem> | undefined | null}
*/
getList(): Array<SearchJSItem> | undefined | null;
/**
* clear items stored
*
* @returns {void}
*/
clear(): void;
/**
* remove item stored
*
* @param {SearchJSItem} item
* @returns {void}
*/
remove(item: SearchJSItem): void;
/**
* add item to history
*
* @param {SearchJSItem} item
* @returns {void}
*/
add(item: SearchJSItem): void;
}