Vue OpenAPI Query Documentation
    Preparing search index...

    Type Alias Mutable<T>

    Mutable: T extends (infer E)[]
        ? Mutable<E>[]
        : T extends readonly (infer E)[]
            ? Mutable<E>[]
            : T extends object
                ? T extends ((...args: never[]) => unknown)
                | Date
                | Blob
                | File
                    ? T
                    : { -readonly [K in keyof T]: Mutable<T[K]> }
                : T

    Deep-strip all TypeScript readonly modifiers from T, recursing into nested objects and arrays (including readonly arrays).

    Direction semantics — response shape → mutable store shape. openapi-typescript emits readonly on every property derived from a spec readOnly: true marker. Mutable<T> removes those modifiers so response types can be stored in reactive state (Vue ref/reactive, Pinia stores) without TypeScript complaining about mutation.

    Unlike Writable, Mutable keeps all properties — it only removes the readonly modifier, not the keys themselves.

    Type Parameters

    • T
    import type { Mutable, RequireAll } from '@qualisero/openapi-endpoint'
    import type { components } from './openapi-types'

    // Pinia store state — fully mutable, all fields present:
    type PetState = Mutable<RequireAll<components['schemas']['Pet']>>
    • Writable — excludes readOnly keys for request types
    • RequireAll — response presence policy (deep-require)