Skip to content

Quote names containing colons in generated .d.ts #4488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Reproduce the issue in tests/reference
  • Loading branch information
lynn committed Apr 22, 2025
commit 71aaf9564a620e501747eb9e222f5e7fdb54af18
84 changes: 83 additions & 1 deletion crates/cli/tests/reference/wasm-export-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,99 @@
/* eslint-disable */
export function example(a: number, b: bigint, c: any, d: string): string;
export function example_128(a: bigint): bigint | undefined;
/**
* Handler for `console.log` invocations.
*
* If a test is currently running it takes the `args` array and stringifies
* it and appends it to the current output of the test. Otherwise it passes
* the arguments to the original `console.log` function, psased as
* `original`.
*/
export function __wbgtest_console_log(args: Array<any>): void;
/**
* Handler for `console.debug` invocations. See above.
*/
export function __wbgtest_console_debug(args: Array<any>): void;
/**
* Handler for `console.info` invocations. See above.
*/
export function __wbgtest_console_info(args: Array<any>): void;
/**
* Handler for `console.warn` invocations. See above.
*/
export function __wbgtest_console_warn(args: Array<any>): void;
/**
* Handler for `console.error` invocations. See above.
*/
export function __wbgtest_console_error(args: Array<any>): void;
export function __wbgtest_cov_dump(): Uint8Array | undefined;
/**
* Runtime test harness support instantiated in JS.
*
* The node.js entry script instantiates a `Context` here which is used to
* drive test execution.
*/
export class WasmBindgenTestContext {
free(): void;
/**
* Creates a new context ready to run tests.
*
* A `Context` is the main structure through which test execution is
* coordinated, and this will collect output and results for all executed
* tests.
*/
constructor();
/**
* Handle `--include-ignored` flag.
*/
include_ignored(include_ignored: boolean): void;
/**
* Handle filter argument.
*/
filtered_count(filtered: number): void;
/**
* Executes a list of tests, returning a promise representing their
* eventual completion.
*
* This is the main entry point for executing tests. All the tests passed
* in are the JS `Function` object that was plucked off the
* `WebAssembly.Instance` exports list.
*
* The promise returned resolves to either `true` if all tests passed or
* `false` if at least one test failed.
*/
run(tests: any[]): Promise<any>;
}

export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;

export interface InitOutput {
readonly memory: WebAssembly.Memory;
readonly example: (a: number, b: bigint, c: any, d: number, e: number) => [number, number];
readonly example_128: (a: bigint, b: bigint) => [number, bigint, bigint];
readonly __wbindgen_export_0: WebAssembly.Table;
readonly __wbgt__reference_test::example_test: (a: number) => void;
readonly __wbgtest_cov_dump: () => [number, number];
readonly __wbg_wasmbindgentestcontext_free: (a: number, b: number) => void;
readonly wasmbindgentestcontext_new: () => number;
readonly wasmbindgentestcontext_include_ignored: (a: number, b: number) => void;
readonly wasmbindgentestcontext_filtered_count: (a: number, b: number) => void;
readonly wasmbindgentestcontext_run: (a: number, b: number, c: number) => any;
readonly __wbgtest_console_log: (a: any) => void;
readonly __wbgtest_console_debug: (a: any) => void;
readonly __wbgtest_console_info: (a: any) => void;
readonly __wbgtest_console_warn: (a: any) => void;
readonly __wbgtest_console_error: (a: any) => void;
readonly __externref_table_alloc: () => number;
readonly __wbindgen_export_1: WebAssembly.Table;
readonly __wbindgen_malloc: (a: number, b: number) => number;
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
readonly __wbindgen_exn_store: (a: number) => void;
readonly __wbindgen_export_5: WebAssembly.Table;
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
readonly closure51_externref_shim: (a: number, b: number, c: any) => void;
readonly wasm_bindgen__convert__closures__invoke0_mut__h99d1e3009d33d179: (a: number, b: number) => void;
readonly closure81_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
readonly closure65_externref_shim: (a: number, b: number, c: any, d: any) => void;
readonly __wbindgen_start: () => void;
}

Expand Down
Loading