Skip to content

Commit 07a9acf

Browse files
committed
rename generic to avoid conflict
1 parent a114a44 commit 07a9acf

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

packages/toolkit/src/entities/models.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { UncheckedIndexedAccess } from '../uncheckedindexed'
22
import type { Draft } from 'immer'
33
import type { PayloadAction } from '../createAction'
44
import type { GetSelectorsOptions } from './state_selectors'
5-
import type { CastAny, Id as Compute } from '../tsHelpers'
5+
import type { CastAny, Id } from '../tsHelpers'
66
import type { CaseReducerDefinition } from '../createSlice'
77
import type { CaseReducer } from '../createReducer'
88

@@ -163,22 +163,24 @@ export interface EntityStateAdapter<T, Id extends EntityId> {
163163
export type EntitySelectors<
164164
T,
165165
V,
166-
Id extends EntityId,
166+
IdType extends EntityId,
167167
Single extends string = '',
168168
Plural extends string = DefaultPlural<Single>,
169169
> = Compute<
170170
{
171-
[K in `select${Capitalize<Single>}Ids`]: (state: V) => Id[]
171+
[K in `select${Capitalize<Single>}Ids`]: (state: V) => IdType[]
172172
} & {
173-
[K in `select${Capitalize<Single>}Entities`]: (state: V) => Record<Id, T>
173+
[K in `select${Capitalize<Single>}Entities`]: (
174+
state: V,
175+
) => Record<IdType, T>
174176
} & {
175177
[K in `selectAll${Capitalize<Plural>}`]: (state: V) => T[]
176178
} & {
177179
[K in `selectTotal${Capitalize<Plural>}`]: (state: V) => number
178180
} & {
179181
[K in `select${Capitalize<Single>}ById`]: (
180182
state: V,
181-
id: Id,
183+
id: IdType,
182184
) => Compute<UncheckedIndexedAccess<T>>
183185
}
184186
>

0 commit comments

Comments
 (0)