ParameterizedContext<StateT = DefaultState, CustomT = DefaultContext>
This is the start of defining a generic type. StateT
and CustomT
are placeholders which you can fill in with any type you like, though if you don't fill them in it will use DefaultState
and DefaultContext
.
For example, if you create a ParameterizedContext<{ foo: string }, { bar: number }>
, then StateT
is becomes { foo: string }
everywhere in the type and CustomT
becomes { bar: number }
ExtendableContext & {
state: StateT;
} & CustomT;
This means that it has all of the properties of ExtendableContext, plus a state property who's type is StateT
, plus all of the properties of CustomT
.
So continuing the example from above, if StateT
is { foo: string }
and CustomT
is { bar: number }
, then this type is the following
{
// ... imagine all the properties of ExtendableContext being here (i don't know what they are)
state: { foo: string },
bar: number,
}