mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-19 18:01:31 +00:00
Document the purpose of most files
This commit is contained in:
15
src/glue/binaryen-c.d.ts
vendored
15
src/glue/binaryen-c.d.ts
vendored
@ -1,14 +1,7 @@
|
||||
/*
|
||||
|
||||
Binaryen's C-API.
|
||||
|
||||
The WebAssembly version of the compiler will be linked against Binaryen
|
||||
compiled to WebAssembly with these functions present in the binary while the
|
||||
JS version calls them on the global object.
|
||||
|
||||
see: https://github.com/WebAssembly/binaryen/blob/master/src/binaryen-c.h
|
||||
|
||||
*/
|
||||
/**
|
||||
* @file TypeScript definitions for Binaryen's C-API.
|
||||
* @see https://github.com/WebAssembly/binaryen/blob/master/src/binaryen-c.h
|
||||
*/
|
||||
|
||||
declare function _malloc(size: usize): usize;
|
||||
declare function _free(ptr: usize): void;
|
||||
|
4
src/glue/js/binaryen.d.ts
vendored
4
src/glue/js/binaryen.d.ts
vendored
@ -1,2 +1,6 @@
|
||||
/**
|
||||
* @file Definitions for linking Binaryen with AssemblyScript.
|
||||
*/
|
||||
|
||||
declare function allocate_memory(size: usize): usize;
|
||||
declare function free_memory(ptr: usize): void;
|
||||
|
@ -1,3 +1,7 @@
|
||||
/**
|
||||
* @file Glue code for linking Binaryen with AssemblyScript.
|
||||
*/
|
||||
|
||||
// Copy Binaryen exports to global scope
|
||||
|
||||
const binaryen = global.Binaryen || require("binaryen");
|
||||
|
4
src/glue/js/i64.d.ts
vendored
4
src/glue/js/i64.d.ts
vendored
@ -1,3 +1,7 @@
|
||||
/**
|
||||
* @file I64 definitions for JavaScript.
|
||||
*/
|
||||
|
||||
declare type I64 = { __Long__: true }; // opaque
|
||||
|
||||
declare function i64_new(lo: i32, hi?: i32): I64;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* @file I64 implementation for JavaScript using long.js.
|
||||
* @see https://github.com/dcodeIO/long.js
|
||||
*/
|
||||
|
||||
const Long = global.Long || require("long");
|
||||
|
||||
global.i64_new = function(lo, hi) {
|
||||
|
@ -1,3 +1,7 @@
|
||||
/**
|
||||
* @file JavaScript glue code.
|
||||
*/
|
||||
|
||||
import "../../../std/portable";
|
||||
import "./binaryen";
|
||||
import "./i64";
|
||||
|
4
src/glue/js/node.d.ts
vendored
4
src/glue/js/node.d.ts
vendored
@ -1,2 +1,6 @@
|
||||
/**
|
||||
* @file Definitions for running JavaScript under node.js.
|
||||
*/
|
||||
|
||||
declare const global: any;
|
||||
declare function require(name: string): any;
|
||||
|
@ -1,3 +1,7 @@
|
||||
/**
|
||||
* @file I64 wrapper for WebAssembly.
|
||||
*/
|
||||
|
||||
type I64 = i64;
|
||||
|
||||
@global
|
||||
|
@ -1 +1,5 @@
|
||||
/**
|
||||
* @file WebAssembly glue code.
|
||||
*/
|
||||
|
||||
import "./i64";
|
||||
|
Reference in New Issue
Block a user