type PlainType<T = any> = Record<string, T>

type ExtractRecordValue<T> = T extends Record<any, infer V> ? V : never
type ExtractArrayValue<T> = T extends Array<infer V> ? V : never

type Without<T, U> = {
  [P in Exclude<keyof T, keyof U>]?: never
}

type OnlyOne<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U

type Mutable<T> = {
  -readonly [K in keyof T]: T[K]
}

type AssignKeys<U, Y = object> = {
  [K in keyof U]: K extends keyof Y ? Y[K] : U[K]
} & Y

type Optional<U, K extends keyof U> = {
  [P in K]?: U[K]
} & Omit<U, K>

type PartRequire<U, K extends keyof U> = {
  [P in K]-?: U[K]
} & Omit<U, K>
