Type of the items.
Keys of DataSourceCapabilities the source guarantees.
function bindGrid(source: IDataSourceWith<User, "filtering" | "pagination">) {
source.filtering.addFilter(adult);
source.pagination.goToNextPage();
}
bindGrid(createDataSource(readUsers, { filtering, pagination, sorting })); // more than asked: fits
bindGrid(createDataSource(readUsers, { filtering })); // compile error: no `pagination`
// A key of the package and a custom one.
type UsersSource = IDataSourceWith<User, "filtering"> &
IDataSource<User, { distinct: DistinctExtension<User> }>;
Shortcut for an IDataSource guaranteeing some extensions of the package, named by key:
IDataSourceWith<User, "filtering" | "pagination">isIDataSource<User, { filtering: IFilterExtension<User>; pagination: IPaginationExtension<User> }>, see DataSourceCapabilities. It is the way a consumer states what it needs from a source in a signature; a record is needed only to name a custom key or an optional one, and the two compose by intersection.