utils.d.ts 521 B

1234
  1. import type { IdSelector, Update, EntityId, DraftableEntityState } from './models';
  2. export declare function selectIdValue<T, Id extends EntityId>(entity: T, selectId: IdSelector<T, Id>): Id;
  3. export declare function ensureEntitiesArray<T, Id extends EntityId>(entities: readonly T[] | Record<Id, T>): readonly T[];
  4. export declare function splitAddedUpdatedEntities<T, Id extends EntityId>(newEntities: readonly T[] | Record<Id, T>, selectId: IdSelector<T, Id>, state: DraftableEntityState<T, Id>): [T[], Update<T, Id>[]];