From 6d5e2d2977409f23a0d0293c1a4472d1d1781dc2 Mon Sep 17 00:00:00 2001 From: Herculano Campos Date: Sun, 29 Oct 2017 16:41:19 +0200 Subject: [PATCH] fix(Entity): EntitySelectors selectIds typing error Closes #525 --- modules/entity/src/models.ts | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/modules/entity/src/models.ts b/modules/entity/src/models.ts index 7e8802261d..416bb6ae30 100644 --- a/modules/entity/src/models.ts +++ b/modules/entity/src/models.ts @@ -39,7 +39,7 @@ export type UpdateNum = { export type Update = UpdateStr | UpdateNum; export interface EntityState { - ids: any[]; + ids: string[] | number[]; entities: Dictionary; } @@ -65,24 +65,13 @@ export interface EntityStateAdapter { updateMany>(updates: Update[], state: S): S; } -export type EntitySelectorsBase = { +export type EntitySelectors = { + selectIds: (state: V) => string[] | number[]; selectEntities: (state: V) => Dictionary; selectAll: (state: V) => T[]; selectTotal: (state: V) => number; }; -export interface EntitySelectorsStr extends EntitySelectorsBase { - selectIds: (state: V) => string[]; -} - -export interface EntitySelectorsNum extends EntitySelectorsBase { - selectIds: (state: V) => number[]; -} - -export type EntitySelectors = - | EntitySelectorsNum - | EntitySelectorsStr; - export interface EntityAdapter extends EntityStateAdapter { getInitialState(): EntityState; getInitialState(state: S): EntityState & S;