UNPKG

ts-extras

Version:

Essential utilities for TypeScript projects

17 lines (12 loc) 499 B
import { type Writable } from 'type-fest'; /** Cast the given value to be [`Writable`](https://github.com/sindresorhus/type-fest/blob/main/source/writable.d.ts). This is useful because of a [TypeScript limitation](https://github.com/microsoft/TypeScript/issues/45618#issuecomment-908072756). @example ``` import {asWritable} from 'ts-extras'; const writableContext = asWritable((await import('x')).context); ``` @category General */ export declare function asWritable<T>(value: T): Writable<T>;