import { type SchemaWithPick } from "https://deno.land/x/valibot@v0.41.0/src/methods/index.ts";
Schema with pick type.
Type Parameters
TKeys extends ObjectKeys<TSchema>
definition: TSchema extends ObjectSchema<infer TEntries, ErrorMessage<ObjectIssue> | undefined> | StrictObjectSchema<infer TEntries, ErrorMessage<StrictObjectIssue> | undefined> ? Omit<TSchema, "entries" | "_run" | "_types"> & { readonly entries: Pick<TEntries, TKeys[number]>; readonly _types?: { readonly input: InferObjectInput<Pick<TEntries, TKeys[number]>>; readonly output: InferObjectOutput<Pick<TEntries, TKeys[number]>>; readonly issue: Extract<InferIssue<TSchema>, { type: TSchema["type"]; }> | InferObjectIssue<Pick<TEntries, TKeys[number]>>; }; _run(dataset: Dataset<unknown, never>, config: Config<Extract<InferIssue<TSchema>, { type: TSchema["type"]; }> | InferObjectIssue<Pick<TEntries, TKeys[number]>>>): Dataset<InferObjectOutput<Pick<TEntries, TKeys[number]>>, Extract<InferIssue<TSchema>, { type: TSchema["type"]; }> | InferObjectIssue<Pick<TEntries, TKeys[number]>>>; } : TSchema extends ObjectSchemaAsync<infer TEntries, ErrorMessage<ObjectIssue> | undefined> | StrictObjectSchemaAsync<infer TEntries, ErrorMessage<StrictObjectIssue> | undefined> ? Omit<TSchema, "entries" | "_run" | "_types"> & { readonly entries: Pick<TEntries, TKeys[number]>; readonly _types?: { readonly input: InferObjectInput<Pick<TEntries, TKeys[number]>>; readonly output: InferObjectOutput<Pick<TEntries, TKeys[number]>>; readonly issue: Extract<InferIssue<TSchema>, { type: TSchema["type"]; }> | InferObjectIssue<Pick<TEntries, TKeys[number]>>; }; _run(dataset: Dataset<unknown, never>, config: Config<Extract<InferIssue<TSchema>, { type: TSchema["type"]; }> | InferObjectIssue<Pick<TEntries, TKeys[number]>>>): Promise<Dataset<InferObjectOutput<Pick<TEntries, TKeys[number]>>, Extract<InferIssue<TSchema>, { type: TSchema["type"]; }> | InferObjectIssue<Pick<TEntries, TKeys[number]>>>>; } : TSchema extends LooseObjectSchema<infer TEntries, ErrorMessage<LooseObjectIssue> | undefined> ? Omit<TSchema, "entries" | "_run" | "_types"> & { readonly entries: Pick<TEntries, TKeys[number]>; readonly _types?: { readonly input: InferObjectInput<Pick<TEntries, TKeys[number]>> & { [key: string]: unknown; }; readonly output: InferObjectOutput<Pick<TEntries, TKeys[number]>> & { [key: string]: unknown; }; readonly issue: Extract<InferIssue<TSchema>, { type: TSchema["type"]; }> | InferObjectIssue<Pick<TEntries, TKeys[number]>>; }; _run(dataset: Dataset<unknown, never>, config: Config<Extract<InferIssue<TSchema>, { type: TSchema["type"]; }> | InferObjectIssue<Pick<TEntries, TKeys[number]>>>): Dataset<InferObjectOutput<Pick<TEntries, TKeys[number]>> & { [key: string]: unknown; }, Extract<InferIssue<TSchema>, { type: TSchema["type"]; }> | InferObjectIssue<Pick<TEntries, TKeys[number]>>>; } : TSchema extends LooseObjectSchemaAsync<infer TEntries, ErrorMessage<LooseObjectIssue> | undefined> ? Omit<TSchema, "entries" | "_run" | "_types"> & { readonly entries: Pick<TEntries, TKeys[number]>; readonly _types?: { readonly input: InferObjectInput<Pick<TEntries, TKeys[number]>> & { [key: string]: unknown; }; readonly output: InferObjectOutput<Pick<TEntries, TKeys[number]>> & { [key: string]: unknown; }; readonly issue: Extract<InferIssue<TSchema>, { type: TSchema["type"]; }> | InferObjectIssue<Pick<TEntries, TKeys[number]>>; }; _run(dataset: Dataset<unknown, never>, config: Config<Extract<InferIssue<TSchema>, { type: TSchema["type"]; }> | InferObjectIssue<Pick<TEntries, TKeys[number]>>>): Promise<Dataset<InferObjectOutput<Pick<TEntries, TKeys[number]>> & { [key: string]: unknown; }, Extract<InferIssue<TSchema>, { type: TSchema["type"]; }> | InferObjectIssue<Pick<TEntries, TKeys[number]>>>>; } : TSchema extends ObjectWithRestSchema<infer TEntries, BaseSchema<unknown, unknown, BaseIssue<unknown>>, ErrorMessage<ObjectWithRestIssue> | undefined> ? Omit<TSchema, "entries" | "_run" | "_types"> & { readonly entries: Pick<TEntries, TKeys[number]>; readonly _types?: { readonly input: InferObjectInput<Pick<TEntries, TKeys[number]>> & { [key: string]: InferInput<TSchema["rest"]>; }; readonly output: InferObjectOutput<Pick<TEntries, TKeys[number]>> & { [key: string]: InferOutput<TSchema["rest"]>; }; readonly issue: Extract<InferIssue<TSchema>, { type: TSchema["type"]; }> | InferObjectIssue<Pick<TEntries, TKeys[number]>> | InferIssue<TSchema["rest"]>; }; _run(dataset: Dataset<unknown, never>, config: Config<Extract<InferIssue<TSchema>, { type: TSchema["type"]; }> | InferObjectIssue<Pick<TEntries, TKeys[number]>> | InferIssue<TSchema["rest"]>>): Dataset<InferObjectOutput<Pick<TEntries, TKeys[number]>> & { [key: string]: InferOutput<TSchema["rest"]>; }, Extract<InferIssue<TSchema>, { type: TSchema["type"]; }> | InferObjectIssue<Pick<TEntries, TKeys[number]>> | InferIssue<TSchema["rest"]>>; } : TSchema extends ObjectWithRestSchemaAsync<infer TEntries, BaseSchema<unknown, unknown, BaseIssue<unknown>>, ErrorMessage<ObjectWithRestIssue> | undefined> ? Omit<TSchema, "entries" | "_run" | "_types"> & { readonly entries: Pick<TEntries, TKeys[number]>; readonly _types?: { readonly input: InferObjectInput<Pick<TEntries, TKeys[number]>> & { [key: string]: InferInput<TSchema["rest"]>; }; readonly output: InferObjectOutput<Pick<TEntries, TKeys[number]>> & { [key: string]: InferOutput<TSchema["rest"]>; }; readonly issue: Extract<InferIssue<TSchema>, { type: TSchema["type"]; }> | InferObjectIssue<Pick<TEntries, TKeys[number]>> | InferIssue<TSchema["rest"]>; }; _run(dataset: Dataset<unknown, never>, config: Config<Extract<InferIssue<TSchema>, { type: TSchema["type"]; }> | InferObjectIssue<Pick<TEntries, TKeys[number]>> | InferIssue<TSchema["rest"]>>): Promise<Dataset<InferObjectOutput<Pick<TEntries, TKeys[number]>> & { [key: string]: InferOutput<TSchema["rest"]>; }, Extract<InferIssue<TSchema>, { type: TSchema["type"]; }> | InferObjectIssue<Pick<TEntries, TKeys[number]>> | InferIssue<TSchema["rest"]>>>; } : never