typescript.ts 451 B

12345678910111213
  1. export const mutable = <T extends readonly any[] | Record<string, unknown>>(val: T) => val as Mutable<typeof val>
  2. export type Mutable<T> = { -readonly [P in keyof T]: T[P] }
  3. export type HTMLElementCustomized<T> = HTMLElement & T
  4. /**
  5. * @deprecated stop to use null
  6. * @see {@link https://github.com/sindresorhus/meta/discussions/7}
  7. */
  8. export type Nullable<T> = T | null
  9. export type Arrayable<T> = T | T[]
  10. export type Awaitable<T> = Promise<T> | T