Skip to content
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

Add information about additional files generated by wasm-pack build. #292

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
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
18 changes: 13 additions & 5 deletions src/game-of-life/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ and it should have these contents:
pkg/
├── package.json
├── README.md
├── wasm_game_of_life_bg.js
├── wasm_game_of_life_bg.wasm
├── wasm_game_of_life_bg.wasm.d.ts
├── wasm_game_of_life.d.ts
└── wasm_game_of_life.js
```
Expand Down Expand Up @@ -147,12 +149,18 @@ export function greet() {
}
```

### `wasm-game-of-life/pkg/wasm_game_of_life.d.ts`
### `wasm-game-of-life/pkg/wasm_game_of_life_bg.js`

The `.d.ts` file contains [TypeScript][] type declarations for the JavaScript
glue. If you are using TypeScript, you can have your calls into WebAssembly
functions type checked, and your IDE can provide autocompletions and
suggestions! If you aren't using TypeScript, you can safely ignore this file.
This `_bg.js` file contains shim code that allows the `_bg.wasm` code to be
required as a module in Node.js.

### `wasm-game-of-life/pkg/wasm_game_of_life.d.ts` and `wasm-game-of-life/pkg/wasm_game_of_life_bg.wasm.d.ts`

These `.d.ts` files contain [TypeScript][] type declarations for the JavaScript
glue and the wasm code. If you are using TypeScript, you can have your calls
into WebAssembly functions type checked, and your IDE can provide
autocompletions and suggestions! If you aren't using TypeScript, you can safely
ignore these files.

```typescript
export function greet(): void;
Expand Down