Files
netrunner-backend/frontend/vendor/cyberhack/cyberhack.d.ts
T
nineap 0927053f4a Fix Docker build: vendor the cyberhack wasm bundle instead of a cross-repo file: path
CI build failed with ENOENT on /Cyberhack/pkg: package.json pointed the
"cyberhack" dependency at "file:../../Cyberhack/pkg", a path outside this
repo's own directory tree entirely. That only ever resolved on a
developer machine that happened to have a sibling checkout of the
Cyberhack repo — Docker's build context is confined to this repo, and CI
never checks out Cyberhack in the first place, so pnpm install had
nothing to link against.

There's no npm registry publish set up for that package, so vendor the
already-built wasm-pack output directly into frontend/vendor/cyberhack
(committed) and point the dependency at "file:./vendor/cyberhack" instead
— a path inside the build context. Dockerfile now copies frontend/vendor
before pnpm install so the file: resolution actually has something to
link to. Verified with a `docker build --no-cache` end-to-end.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-04 15:45:05 +07:00

64 lines
3.3 KiB
TypeScript

/* tslint:disable */
/* eslint-disable */
/**
* Точка входа, которую дергает JS-обертка (`Cyberhack.tsx`) после
* инициализации wasm-модуля. Монтирует `CyberHackGame` в DOM-элемент
* с указанным `element_id`, распарсив конфиг из JSON-строки.
*/
export function initCyberHack(element_id: string, config_json: string): void;
/**
* `#[wasm_bindgen(start)]` запускает эту функцию автоматически сразу после
* загрузки wasm-модуля — то есть при каждом `init()` из JS, а не только
* в `trunk serve`. `Renderer::with_props` без `with_root` монтирует
* компонент в `document.body`. Это используется для локальной отладки
* через `trunk serve` (см. `npm run dev`), но означает, что у любого
* потребителя npm-пакета эта debug-игра тоже отрендерится в body в
* дополнение к игре, смонтированной через `initCyberHack`.
*/
export function run_app(): void;
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
export interface InitOutput {
readonly memory: WebAssembly.Memory;
readonly initCyberHack: (a: number, b: number, c: number, d: number) => [number, number];
readonly run_app: () => void;
readonly wasm_bindgen__convert__closures_____invoke__h5564e0922a8ef97b: (a: number, b: number, c: any) => [number, number];
readonly wasm_bindgen__convert__closures________invoke__h4320859e087f83c8: (a: number, b: number, c: any) => void;
readonly wasm_bindgen__convert__closures_____invoke__h48aa713ae3e44284: (a: number, b: number) => void;
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 __externref_table_alloc: () => number;
readonly __wbindgen_externrefs: WebAssembly.Table;
readonly __externref_drop_slice: (a: number, b: number) => void;
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
readonly __externref_table_dealloc: (a: number) => void;
readonly __wbindgen_start: () => void;
}
export type SyncInitInput = BufferSource | WebAssembly.Module;
/**
* Instantiates the given `module`, which can either be bytes or
* a precompiled `WebAssembly.Module`.
*
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
*
* @returns {InitOutput}
*/
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
/**
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
* for everything else, calls `WebAssembly.instantiate` directly.
*
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
*
* @returns {Promise<InitOutput>}
*/
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;