/** * Compares two items for sorting. When grouped, uses group comparison before item comparison * * @param {*} a first item * @param {*} b second item * @param {*} data * @returns */ export function compare(a: any, b: any, data: any): number; /** * Search the data for existence of string in the data * * @param {List} data * @param {string} value * @returns */ export function quickSearch(data: List, value: string): object[]; /** * Create a new list * * @param {Array} data * @returns */ export function list(data: Array): List; /** * Implements a list containing data and functionality for sorting, filtering, and grouping. */ export class List { /** * Creates a List instance with initial data and default settings for keys and functions. * @param {Array} data - The initial array of objects to populate the list. */ constructor(data: Array); data: object[]; primaryKey: string; filterKey: string | undefined; sortKey: string | undefined; groupKey: string | undefined; lookup: {}; searchText: string; filterUsing: Function | undefined; sortUsing: Function | undefined; filtered: import("svelte/store").Writable; /** * Sets a primary key attribute for list items and assigns a unique identifier if not present. * * @param {string} value - The property name to be set as the primary key. * @returns {List} This list instance for method chaining. */ key(value: string): List; /** * Configures sorting by a given key and sorting function. * * @param {string} key - The property name to sort by. * @param {Function} [using=compare] - The function used to sort the list items. * @returns {List} This list instance for method chaining. */ sortBy(key: string, using?: Function): List; /** * Groups list items by a given key and maps group keys for display using an optional lookup object. * * @param {string} key - The property name to group by. * @param {object|null} [lookup=null] - An object mapping group keys to display names. * @returns {List} This list instance for method chaining. */ groupBy(key: string, lookup?: object | null): List; /** * Sets the key and function for filtering list items. * * @param {string} key - The property name to filter by. * @param {Function} [using=quickSearch] - The function used to filter the list items. * @returns {List} This list instance for method chaining. */ filterBy(key: string, using?: Function): List; /** * Sorts the list based on the configured sorting function. * * @returns {List} This list instance for method chaining. */ sort(): List; /** * Adds a new item to the list, assigning a primary key if necessary, and then sorts and refreshes the list. * * @param {object} item - The item to add to the list. * @returns {List} This list instance for method chaining. */ add(item: object): List; /** * Removes an item from the list by primary key and refreshes the list. * * @param {object} item - The item to remove from the list. * @returns {List} This list instance for method chaining. */ remove(item: object): List; /** * Modifies an existing item in the list, identified by primary key, and then sorts and refreshes the list. * * @param {object} item - The item to modify in the list. * @returns {List} This list instance for method chaining. */ modify(item: object): List; /** * Sets the text to search for in the list's items and then refreshes the list. * * @param {string} text - The text to search for. * @returns {List} This list instance for method chaining. */ search(text: string): List; /** * Refreshes the list based on current sorting, grouping, and filtering configuration. * * @returns {List} This list instance for method chaining. */ refresh(): List; /** * Gets the current state of the filtered list data. * * @returns {Array} The current filtered data of the list. */ current(): Array; }