Type Alias BaseType<Tinput, InternalItemsTypeChange, InternalKeysTypeChange>
BaseType<Tinput, InternalItemsTypeChange, InternalKeysTypeChange>: IsPrimitive<Tinput> extends true ? Tinput : Tinput extends (infer Titem)[] ? ChangeType<InternalItemsTypeChange, Titem>[] : Tinput extends IArguments ? IArguments : Tinput extends TypedArray ? TypedArrayExact<Tinput> : Tinput extends Generator<infer Titem> ? Generator<ChangeType<InternalItemsTypeChange, Titem>> : Tinput extends AsyncGenerator<infer Titem> ? AsyncGenerator<ChangeType<InternalItemsTypeChange, Titem>> : Tinput extends MapIteratorEntries<infer Tkey, infer Titem> ? IterableIterator<[Tkey, ChangeType<InternalItemsTypeChange, Titem>]> : Tinput extends SetIteratorEntries<infer Titem> ? IterableIterator<[ChangeType<(...
), (...
)>, ChangeType<(...
), (...
)>]> : Tinput extends MapIteratorValues<infer Titem> ? MapIteratorValues<ChangeType<(...
), (...
)>> : Tinput extends SetIteratorValues<(...
)> ? SetIteratorValues<(...
)> : (...
) extends (...
) ? (...
) : (...
)
Returns the BaseType of the Tinput, i.e the base type without extra props, but maintaining the same type, including the Type of any Nested values.
Optionally, you can pass TypeChange to change the type of the BaseType's Nested values (or in case of Primitives, the type of the returned value itself). Eg a Tinput = Array<'foo'> will return Array<'bar'> if you use
BaseType<Tinput, 'bar'>
, it will returnArray<'bar'>
,changing the Nested values type to 'bar'.It's used to exclude the BaseType props from the instance props and calculate what to return when
map()
-ing values.