/** * Utility type to check if `Type` is `never`. * * @remarks Since `never` is an empty set, the brackets are used to disable distribution over the generic type argument. * * @public */ export type _IsNever = [Type] extends [never] ? true : false; /** * Utility type to get the next value for a recursive conditional evaluation. * * @remarks Use {@link ExtractFromSet}. This type is not meant to be used by itself. * @remarks `Set` should be the full set of values to recurse over and `Current` is the set of values already evaluated. Therefore, indexing into `Set` with `Current`'s length yields the next value to evaluate. * * @public */ export type _NextValue = Set[Current['length']]; /** * Utility type to evaluate if `Type1` and `Type2` are the same. * * @remarks Do not use with unions. * @remarks Use {@link ExtractFromSet}. This type is not meant to be used by itself. * * @public */ export type _UniqueCondition = Type1 | Type2 extends Type2 ? true : false; /** * Utility type to evaluate if a recursive conditional evaluation should stop. * * @remarks Use {@link ExtractFromSet}. This type is not meant to be used by itself. * @remarks If `Set` and `Current` are the same length, then all values have been recursed upon. * * @public */ export type _Stop = Set['length'] extends Current['length'] ? true : false; /** * Utility type to evaluate if {@link _RecursivelyExtractFromSet} should continue recursion. * * @remarks Use {@link ExtractFromSet}. This type is not meant to be used by itself. * * @public */ export type _ContinueRecursivelyExtractFromSet = _Stop extends true ? never : _RecursivelyExtractFromSet; /** * Utility type to recursively evaluate if `Type` is within `Set`. * * @remarks Use {@link ExtractFromSet}. This type is not meant to be used by itself. * @remarks `Current` is used to track the recursion, which is why `CurrentValue` is added to `Current` after {@link _UniqueCondition} is evaluated. * * @public */ export type _UniqueFromSet = _UniqueCondition extends true ? CurrentValue : _ContinueRecursivelyExtractFromSet; /** * Utility type to recursively evaluate if `Type` is within `Set`. * * @remarks Use {@link ExtractFromSet}. This type is not meant to be used by itself. * * @public */ export type _RecursivelyExtractFromSet = _IsNever extends true ? never : _UniqueFromSet, Type>; /** * Utility type to extract `Type` from `Set` if and only if `Type` is in `Set`. * * @remarks If `Type` is not within `Set` then `never` is assigned. * * @public */ export type ExtractFromSet = _RecursivelyExtractFromSet; //# sourceMappingURL=ExtractFromSet.d.ts.map