import type { TSchema, SchemaOptions } from '../schema/index'; import type { TupleToUnion, Evaluate } from '../helpers/index'; import { type TRecursive } from '../recursive/index'; import { type TComputed } from '../computed/index'; import { type TIntersect } from '../intersect/index'; import { type TLiteral, type TLiteralValue } from '../literal/index'; import { type TObject, type TProperties } from '../object/index'; import { type TUnion } from '../union/index'; import { type TMappedKey, type TMappedResult } from '../mapped/index'; import { type TRef } from '../ref/index'; import { type TIndexPropertyKeys } from '../indexed/index'; import { type TPickFromMappedKey } from './pick-from-mapped-key'; import { type TPickFromMappedResult } from './pick-from-mapped-result'; type TFromIntersect = Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromIntersect]> : Result; type TFromUnion = Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromUnion]> : Result; type TFromProperties> = (Evaluate>); type TFromObject<_Type extends TObject, Keys extends PropertyKey[], Properties extends TProperties, MappedProperties extends TProperties = TFromProperties, Result extends TSchema = TObject> = Result; type TUnionFromPropertyKeys = (PropertyKeys extends [infer Key extends PropertyKey, ...infer Rest extends PropertyKey[]] ? Key extends TLiteralValue ? TUnionFromPropertyKeys]> : TUnionFromPropertyKeys : TUnion); export type TPickResolve = (Type extends TRecursive ? TRecursive> : Type extends TIntersect ? TIntersect> : Type extends TUnion ? TUnion> : Type extends TObject ? TFromObject : TObject<{}>); type TResolvePropertyKeys = Key extends TSchema ? TIndexPropertyKeys : Key; type TResolveTypeKey = Key extends PropertyKey[] ? TUnionFromPropertyKeys : Key; export type TPick = (Type extends TMappedResult ? TPickFromMappedResult> : Key extends TMappedKey ? TPickFromMappedKey : [ IsTypeRef, IsKeyRef ] extends [true, true] ? TComputed<'Pick', [Type, TResolveTypeKey]> : [ IsTypeRef, IsKeyRef ] extends [false, true] ? TComputed<'Pick', [Type, TResolveTypeKey]> : [ IsTypeRef, IsKeyRef ] extends [true, false] ? TComputed<'Pick', [Type, TResolveTypeKey]> : TPickResolve>); /** `[Json]` Constructs a type whose keys are picked from the given type */ export declare function Pick(type: Type, key: readonly [...Key], options?: SchemaOptions): TPick; /** `[Json]` Constructs a type whose keys are picked from the given type */ export declare function Pick(type: Type, key: Key, options?: SchemaOptions): TPick; export {};