Vana SDK - v2.2.2
    Preparing search index...

    Type Alias PartialExcept<T, K>

    PartialExcept: Partial<T> & Pick<T, K>

    Makes all properties in T optional except for those in K

    Type Parameters

    • T
    • K extends keyof T

    This utility type is useful when you want to create a variant of an interface where most properties are optional, but specific properties remain required. Commonly used for update operations where only certain fields must be provided.

    interface User {
    id: string;
    name: string;
    email: string;
    age: number;
    }

    // Only 'id' is required, all other properties are optional
    type UserUpdate = PartialExcept<User, 'id'>;

    const update: UserUpdate = {
    id: '123', // Required
    name: 'John' // Optional
    // email and age are also optional
    };