diff options
author | 2023-10-02 15:18:29 -0700 | |
---|---|---|
committer | 2023-10-02 15:18:29 -0700 | |
commit | 08bf8b8ad1beb7529685ecd67ebc95fdd4352ffa (patch) | |
tree | 180e256e25363ff90dbbb65f39d309d5b030cd6e | |
parent | 0c3c57cc35503d90768620fa8ec2c4d1ad5cca52 (diff) | |
download | bun-08bf8b8ad1beb7529685ecd67ebc95fdd4352ffa.tar.gz bun-08bf8b8ad1beb7529685ecd67ebc95fdd4352ffa.tar.zst bun-08bf8b8ad1beb7529685ecd67ebc95fdd4352ffa.zip |
Add Bun.TOML to types (#6161)
-rw-r--r-- | packages/bun-types/bun.d.ts | 13 | ||||
-rw-r--r-- | packages/bun-types/tests/bun.test-d.ts | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/packages/bun-types/bun.d.ts b/packages/bun-types/bun.d.ts index 9b2d314e8..d8d8fd204 100644 --- a/packages/bun-types/bun.d.ts +++ b/packages/bun-types/bun.d.ts @@ -70,6 +70,19 @@ declare module "bun" { options?: { PATH?: string; cwd?: string }, ): string | null; + interface TOML { + /** + * Parse a TOML string into a JavaScript object. + * + * @param {string} command The name of the executable or script + * @param {string} options.PATH Overrides the PATH environment variable + * @param {string} options.cwd Limits the search to a particular directory in which to searc + * + */ + parse(input: string): object; + } + export const TOML: TOML; + export type Serve<WebSocketDataType = undefined> = | ServeOptions | TLSServeOptions diff --git a/packages/bun-types/tests/bun.test-d.ts b/packages/bun-types/tests/bun.test-d.ts index 03301c13d..cd5a40eca 100644 --- a/packages/bun-types/tests/bun.test-d.ts +++ b/packages/bun-types/tests/bun.test-d.ts @@ -41,3 +41,6 @@ import * as tsd from "tsd"; env: { ...process.env, dummy: "" }, }); } +{ + Bun.TOML.parse("asdf = asdf"); +} |