forked from rustwasm/wasm_game_of_life
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dev]: Define explicitly types inside game logic
- Loading branch information
Takuma Kira
committed
Apr 19, 2024
1 parent
155e184
commit dd0476c
Showing
2 changed files
with
23 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
type BGModule = {} | ||
type WASMModule = { memory: WebAssembly.Memory } | ||
|
||
declare module 'wasm-game-of-life/wasm_game_of_life_bg.wasm' { | ||
export default function wasm(importObject: { './wasm_game_of_life_bg.js': any }): Promise<any> | ||
} | ||
export default function wasm(importObject: { './wasm_game_of_life_bg.js': BGModule }): Promise<WASMModule> | ||
} | ||
|
||
declare module 'wasm-game-of-life/wasm_game_of_life_bg.js' { | ||
import { Universe, Cell } from "wasm-game-of-life" | ||
|
||
function __wbg_set_wasm(wasm: WASMModule): void | ||
|
||
export { | ||
__wbg_set_wasm, | ||
Universe, | ||
Cell, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters