Skip to content

PredictEntityKeysReturnType

PredictEntityKeysReturnType<TCount, TSalts> = [TSalts] extends [readonly SaltInput[]] ? { -readonly [Index in keyof TSalts]: PredictedEntityKey } : Repeat<PredictedEntityKey, TCount>

Defined in: src/actions/public/predictEntityKeys.ts:63

The keys a batch would mint, in batch order, each paired with its salt.

The length follows the request whenever it is known statically: a literal count, or a salts tuple, gives a fixed-length tuple; a count computed at runtime gives a plain array.

TSalts is wrapped in a tuple to stop the conditional distributing over it. Left naked, the readonly SaltInput[] | undefined default would take both branches and union a tuple with an array, which widens the length straight back to number.

TCount extends number = number

TSalts extends readonly SaltInput[] | undefined = readonly SaltInput[] | undefined