UNPKG

@visulima/tsconfig

Version:

Find and/or parse the tsconfig.json file from a directory path.

25 lines (24 loc) 1.5 kB
import type { WriteJsonOptions } from "@visulima/fs"; import type { TsConfigJson } from "type-fest"; /** * An asynchronous function that writes the provided TypeScript configuration object to a tsconfig.json file. * @param tsConfig The TypeScript configuration object to write. The type of `tsConfig` is `TsConfigJson`. * @param options Optional. The write options and the current working directory. The type of `options` is an * intersection type of `WriteOptions` and a Record type with an optional `cwd` key of type `string`. * @returns A `Promise` that resolves when the tsconfig.json file has been written. * The return type of function is `Promise&lt;void>`. */ export declare const writeTsConfig: (tsConfig: TsConfigJson, options?: WriteJsonOptions & { cwd?: URL | string; }) => Promise<void>; /** * A function that writes the provided TypeScript configuration object to a tsconfig.json file. * @param tsConfig The TypeScript configuration object to write. The type of `tsConfig` is `TsConfigJson`. * @param options Optional. The write options and the current working directory. The type of `options` is an * intersection type of `WriteOptions` and a Record type with an optional `cwd` key of type `string`. * @returns A `Promise` that resolves when the tsconfig.json file has been written. * The return type of function is `Promise&lt;void>`. */ export declare const writeTsConfigSync: (tsConfig: TsConfigJson, options?: WriteJsonOptions & { cwd?: URL | string; }) => void;