diff options
author | 2023-05-10 05:08:22 -0700 | |
---|---|---|
committer | 2023-05-10 05:08:22 -0700 | |
commit | 5b2c3fe4400befb69de3dd32b20634cd4b8bc70b (patch) | |
tree | b79672f105d44f8714a19530fc299c6066b00575 | |
parent | 53a198f2f7508f1573ec0cdcc6da3267f0fa454e (diff) | |
download | bun-5b2c3fe4400befb69de3dd32b20634cd4b8bc70b.tar.gz bun-5b2c3fe4400befb69de3dd32b20634cd4b8bc70b.tar.zst bun-5b2c3fe4400befb69de3dd32b20634cd4b8bc70b.zip |
clarify the types more
-rw-r--r-- | packages/bun-types/bun.d.ts | 23 | ||||
-rw-r--r-- | packages/bun-types/globals.d.ts | 2 |
2 files changed, 22 insertions, 3 deletions
diff --git a/packages/bun-types/bun.d.ts b/packages/bun-types/bun.d.ts index 0afe45bed..27d933988 100644 --- a/packages/bun-types/bun.d.ts +++ b/packages/bun-types/bun.d.ts @@ -999,12 +999,31 @@ declare module "bun" { path: string; loader: Loader; hash: string | null; - kind: "chunk" | "asset" | "entry-point"; + kind: "entry-point" | "chunk"; sourcemap: BuildArtifact | null; } + interface SourceMapBuildArtifact extends Blob { + path: string; + loader: Loader; + hash: null; + kind: "sourecemap"; + sourcemap: null; + } + + interface AssetBuildArtifact extends Blob { + path: string; + loader: Loader; + hash: string; + kind: "asset"; + sourcemap: null; + } + function build(config: BuildConfig): Promise<{ - outputs: Map<string, BuildArtifact>; + outputs: Map< + string, + BuildArtifact | AssetBuildArtifact | SourceMapBuildArtifact + >; logs: Array<BuildError | ResolveError>; }>; diff --git a/packages/bun-types/globals.d.ts b/packages/bun-types/globals.d.ts index ebe62bf30..8413d2540 100644 --- a/packages/bun-types/globals.d.ts +++ b/packages/bun-types/globals.d.ts @@ -652,7 +652,7 @@ declare class Blob implements BlobInterface { formData(): Promise<FormData>; type: string; - size: number; + readonly size: number; } interface ResponseInit { |