UNPKG

@octopusdeploy/design-system-components

Version:
17 lines (16 loc) 663 B
export interface AsyncList<T> { /** Gets the ID of an item */ getItemId: (item: T) => string; /** Gets an item from any items that have been loaded */ getItemById: (id: string) => T | undefined; /** The items that have currently been loaded for the list */ loadedItems: T[]; /** Whether the list is currently loading */ isLoading: boolean; /** The error that occurred if loading failed */ error: Error | null; /** If the list has more data to be loaded, this can be used to start loading it */ loadMore?: () => void; /** Sets the filter value for the list items */ setFilterText: (text: string) => void; }