Repository: dotnet/runtime
File: src/native/libs/Common/JavaScript/types/internal.ts (TypeScript)

Code before:
    HEAPU8: Uint8Array;
    HEAPU16: Uint16Array;
    HEAPU32: Uint32Array;
    HEAPF32: Float32Array;
    HEAPF64: Float64Array;

    locateFile?: (path: string, prefix?: string) => string;
    mainScriptUrlOrBlob?: string;
    ENVIRONMENT_IS_PTHREAD?: boolean;
    FS: any;
    wasmModule: WebAssembly.Instance | null;
    ready: Promise<unknown>;
    wasmExports: any;
    getWasmTableEntry(index: number): any;
    removeRunDependency(id: string): void;
    addRunDependency(id: string): void;
    safeSetTimeout(func: Function, timeout: number): number;
    runtimeKeepalivePush(): void;
    runtimeKeepalivePop(): void;
    maybeExit(): void;
    print(message: string): void;
    printErr(message: string): void;
    abort(reason: any): void;
    exitJS(status: number, implicit?: boolean | number): void;
    _emscripten_force_exit(exit_code: number): void;
    wasm_load_icu_data(ptr: number): number;
}

export interface AssetEntryInternal extends AssetEntry {
    // this could have multiple values in time, because of re-try download logic
    pendingDownloadInternal?: LoadingResource
    noCache?: boolean
    useCredentials?: boolean
    isCore?: boolean
}

export type LoaderConfigInternal = LoaderConfig & {
    linkerEnabled?: boolean,
    runtimeOptions?: string[], // array of runtime options as strings
    appendElementOnExit?: boolean
    logExitCode?: boolean
    exitOnUnhandledError?: boolean
    loadAllSatelliteResources?: boolean
    resourcesHash?: string,
};


/// A Promise<T> with a controller attached
export interface ControllablePromise<T = any> extends Promise<T> {
    __brand: "ControllablePromise"
}

Review comment (refactor):
The interface definition declares `wasm_load_icu_data` as a direct method on `Module`, but the actual usage in `src/native/corehost/browserhost/host/host.ts` line 39 calls it via `Module.ccall("wasm_load_icu_data", ...)` instead of `Module.wasm_load_icu_data(...)`. This inconsistency should be resolved:

Either:
1. Remove this line from the interface (since the function is called via `ccall`), or
2. Change the implementation to use `Module.wasm_load_icu_data(ptr)` directly instead of `Module.ccall(...)`

The pattern in this codebase appears to be that functions called via `ccall` are not added to the interface (e.g., `BrowserHost_InitializeCoreCLR`), while directly callable functions use the underscore prefix convention (e.g., `_posix_memalign`, `_free`).
```suggestion

```

Code after:
    HEAPU8: Uint8Array;
    HEAPU16: Uint16Array;
    HEAPU32: Uint32Array;
    HEAPF32: Float32Array;
    HEAPF64: Float64Array;

    locateFile?: (path: string, prefix?: string) => string;
    mainScriptUrlOrBlob?: string;
    ENVIRONMENT_IS_PTHREAD?: boolean;
    FS: any;
    wasmModule: WebAssembly.Instance | null;
    ready: Promise<unknown>;
    wasmExports: any;
    getWasmTableEntry(index: number): any;
    removeRunDependency(id: string): void;
    addRunDependency(id: string): void;
    safeSetTimeout(func: Function, timeout: number): number;
    runtimeKeepalivePush(): void;
    runtimeKeepalivePop(): void;
    maybeExit(): void;
    print(message: string): void;
    printErr(message: string): void;
    abort(reason: any): void;
    exitJS(status: number, implicit?: boolean | number): void;
    _emscripten_force_exit(exit_code: number): void;
}

export interface AssetEntryInternal extends AssetEntry {
    // this could have multiple values in time, because of re-try download logic
    pendingDownloadInternal?: LoadingResource
    noCache?: boolean
    useCredentials?: boolean
    isCore?: boolean
}

export type LoaderConfigInternal = LoaderConfig & {
    linkerEnabled?: boolean,
    runtimeOptions?: string[], // array of runtime options as strings
    appendElementOnExit?: boolean
    logExitCode?: boolean
    exitOnUnhandledError?: boolean
    loadAllSatelliteResources?: boolean
    resourcesHash?: string,
};


/// A Promise<T> with a controller attached
export interface ControllablePromise<T = any> extends Promise<T> {
    __brand: "ControllablePromise"
}