From f7f1b604443c030afe29d1059b90f72c69afe081 Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Wed, 9 Nov 2022 15:40:40 -0800 Subject: Add bun-types, add typechecking, add `child_process` types (#1475) * Add bun-types to packages * Improve typing * Fix types in tests * Fix dts tests * Run formatter * Fix all type errors * Add strict mode, fix type errors * Add ffi changes * Move workflows to root * Add workflows * Remove labeler * Add child_process types * Fix synthetic defaults issue * Remove docs * Move scripts * Run prettier * Include examples in typechecking * captureStackTrace types * moved captureStackTrace types to globals * Address reviews Co-authored-by: Colin McDonnell Co-authored-by: Dylan Conway --- src/api/demo/lib/api.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/api/demo/lib/api.ts') diff --git a/src/api/demo/lib/api.ts b/src/api/demo/lib/api.ts index 455c73290..d06bfd35b 100644 --- a/src/api/demo/lib/api.ts +++ b/src/api/demo/lib/api.ts @@ -152,7 +152,7 @@ export class Bun { Bun.wasm_source = await globalThis.WebAssembly.instantiateStreaming( fetch(url), - { env: Bun[wasm_imports_sym], wasi_snapshot_preview1: Wasi } + { env: Bun[wasm_imports_sym], wasi_snapshot_preview1: Wasi }, ); const res = Bun.wasm_exports.init(); @@ -209,7 +209,7 @@ export class Bun { ".json": Loader.json, }[path.extname(file_name)], }, - bb + bb, ); const data = bb.toUint8Array(); @@ -225,7 +225,11 @@ export class Bun { return response; } - static scan(content: Uint8Array | string, file_name: string, loader: Loader) { + static scan( + content: Uint8Array | string, + file_name: string, + loader?: Loader, + ) { if (!Bun.has_initialized) { throw "Please run await Bun.init(wasm_url) before using this."; } @@ -262,7 +266,7 @@ export class Bun { ".json": Loader.json, }[path.extname(file_name)], }, - bb + bb, ); const data = bb.toUint8Array(); -- cgit v1.2.3