aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jake Boone <jakeboone02@gmail.com> 2023-04-07 15:16:21 -0700
committerGravatar GitHub <noreply@github.com> 2023-04-07 15:16:21 -0700
commit4978a6b74d1e2427db4b0636626a5d0277c5c392 (patch)
tree0034128f8ffb3c37473f613fbe070d1ab1196de7
parent35b279a4bbcf13e6a86a020de4c9f178ed5080a1 (diff)
downloadbun-4978a6b74d1e2427db4b0636626a5d0277c5c392.tar.gz
bun-4978a6b74d1e2427db4b0636626a5d0277c5c392.tar.zst
bun-4978a6b74d1e2427db4b0636626a5d0277c5c392.zip
Add TSConfig object type to TranspilerOptions interface (#2545)
-rw-r--r--packages/bun-types/bun.d.ts22
1 files changed, 21 insertions, 1 deletions
diff --git a/packages/bun-types/bun.d.ts b/packages/bun-types/bun.d.ts
index 07777169f..4454f5452 100644
--- a/packages/bun-types/bun.d.ts
+++ b/packages/bun-types/bun.d.ts
@@ -741,6 +741,26 @@ declare module "bun" {
strict?: boolean,
): boolean;
+ /**
+ * tsconfig.json options supported by Bun
+ */
+ interface TSConfig {
+ extends?: string;
+ compilerOptions?: {
+ paths?: Record<string, string[]>;
+ baseUrl?: string;
+ /** "preserve" is not supported yet */
+ jsx?: "preserve" | "react" | "react-jsx" | "react-jsxdev" | "react-native";
+ jsxFactory?: string;
+ jsxFragmentFactory?: string;
+ jsxImportSource?: string;
+ useDefineForClassFields?: boolean;
+ importsNotUsedAsValues?: "remove" | "preserve" | "error";
+ /** moduleSuffixes is not supported yet */
+ moduleSuffixes?: any;
+ };
+ }
+
export interface TranspilerOptions {
/**
* Replace key with value. Value must be a JSON string.
@@ -763,7 +783,7 @@ declare module "bun" {
* Use this to set a custom JSX factory, fragment, or import source
* For example, if you want to use Preact instead of React. Or if you want to use Emotion.
*/
- tsconfig?: string;
+ tsconfig?: string | TSConfig;
/**
* Replace an import statement with a macro.