tool2agent API Documentation - v0.0.0
    Preparing search index...

    Type Alias DynamicInput<InputSchema, DynamicFields>

    DynamicInput: { [FieldName in DynamicFields]?: z.infer<InputSchema>[FieldName] } & {
        [FieldName in Exclude<keyof z.infer<InputSchema>, DynamicFields>]: z.infer<
            InputSchema,
        >[FieldName]
    }

    Creates a type where dynamic fields are optional and static fields remain required, inferred from a Zod schema.

    Type Parameters

    • InputSchema extends z.ZodObject<z.ZodRawShape>

      The Zod object schema defining the input structure.

    • DynamicFields extends keyof z.infer<InputSchema>

      The keys of the inferred input type that are dynamic (can be provided incrementally).

    const schema = z.object({ name: z.string(), age: z.number(), email: z.string() });
    type Dynamic = DynamicInput<typeof schema, 'email'>;
    // Result: { name: string; age: number; email?: string }