Type Alias Options<T, E>Internal

Options: Expand<Partial<E & Pick<T, WritableKeys<T>>>>

Utility type for defining options for a given type. It allows setting the writable properties of a type.

Type Parameters

  • T

    The type to define options for.

  • E = {}

    Additional optional properties. Defaults to an empty object.

interface Server {
port: number
readonly name: string
}
type ServerOptions = Options<Server, { debug?: boolean }>
// is equivalent to:
interface ServerOptions {
port?: number
debug?: boolean
}