element-plus/packages/utils/typescript.ts

13 lines
377 B
TypeScript
Raw Normal View History

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