@types/emscripten
Advanced tools
Comparing version 1.38.0 to 1.39.0
@@ -1,5 +0,6 @@ | ||
// Type definitions for Emscripten 1.38.33 | ||
// Type definitions for Emscripten 1.39.5 | ||
// Project: http://kripken.github.io/emscripten-site/index.html | ||
// Definitions by: Kensuke Matsuzaki <https://github.com/zakki> | ||
// Periklis Tsirakidis <https://github.com/periklis> | ||
// Bumsik Kim <https://github.com/kbumsik> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -17,5 +18,11 @@ // TypeScript Version: 2.2 | ||
type EnvironmentType = "WEB" | "NODE" | "SHELL" | "WORKER"; | ||
type ValueType = "number" | "string" | "array" | "boolean"; | ||
type JSType = "number" | "string" | "array" | "boolean"; | ||
type TypeCompatibleWithC = number | string | any[] | boolean; | ||
type CIntType = 'i8' | 'i16' | 'i32' | 'i64'; | ||
type CFloatType = 'float' | 'double'; | ||
type CPointerType = 'i8*' | 'i16*' | 'i32*' | 'i64*' | 'float*' | 'double*' | '*'; | ||
type CType = CIntType | CFloatType | CPointerType; | ||
type WebAssemblyImports = Array<{ | ||
@@ -38,2 +45,22 @@ name: string; | ||
interface EmscriptenModule { | ||
/** | ||
* Initializes an EmscriptenModule object and returns it. The initialized | ||
* obejct will be passed to then(). Works only when -s MODULARIZE=1 is | ||
* enabled. This is default exported function when -s EXPORT_ES6=1 is | ||
* enabled. | ||
* https://emscripten.org/docs/getting_started/FAQ.html#how-can-i-tell-when-the-page-is-fully-loaded-and-it-is-safe-to-call-compiled-functions | ||
* @param moduleOverrides Properties of an initialized module to override. | ||
*/ | ||
(moduleOverrides?: Partial<this>): this; | ||
/** | ||
* Promise-like then() inteface. | ||
* WRANGING: Emscripten's then() is not really promise-based 'thenable'. | ||
* Don't try to use it with Promise.resolve() or in an async function | ||
* without deleting delete Module["then"] in the callback. | ||
* https://github.com/kripken/emscripten/issues/5820 | ||
* Works only when -s MODULARIZE=1 is enabled. | ||
* @param callback A callback chained from Module() with an Module instance. | ||
*/ | ||
then(callback: (module: this) => void): this; | ||
print(str: string): void; | ||
@@ -64,18 +91,2 @@ printErr(str: string): void; | ||
Runtime: any; | ||
ccall(ident: string, returnType: Emscripten.ValueType | null, argTypes: Emscripten.ValueType[], args: Emscripten.TypeCompatibleWithC[], opts?: Emscripten.CCallOpts): any; | ||
cwrap(ident: string, returnType: Emscripten.ValueType | null, argTypes: Emscripten.ValueType[], opts?: Emscripten.CCallOpts): (...args: any[]) => any; | ||
setValue(ptr: number, value: any, type: string, noSafe?: boolean): void; | ||
getValue(ptr: number, type: string, noSafe?: boolean): number; | ||
ALLOC_NORMAL: number; | ||
ALLOC_STACK: number; | ||
ALLOC_STATIC: number; | ||
ALLOC_DYNAMIC: number; | ||
ALLOC_NONE: number; | ||
allocate(slab: any, types: string | string[], allocator: number, ptr: number): number; | ||
// USE_TYPED_ARRAYS == 1 | ||
@@ -106,12 +117,2 @@ HEAP: Int32Array; | ||
// Tools | ||
intArrayFromString(stringy: string, dontAddNull?: boolean, length?: number): number[]; | ||
intArrayToString(array: number[]): string; | ||
writeStringToMemory(str: string, buffer: number, dontAddNull: boolean): void; | ||
writeArrayToMemory(array: number[], buffer: number): void; | ||
writeAsciiToMemory(str: string, buffer: number, dontAddNull: boolean): void; | ||
addRunDependency(id: any): void; | ||
removeRunDependency(id: any): void; | ||
preloadedImages: any; | ||
@@ -204,3 +205,5 @@ preloadedAudios: any; | ||
function ioctl(stream: FSStream, cmd: any, arg: any): any; | ||
function readFile(path: string, opts?: { encoding?: "binary" | "utf8"; flags?: string }): string | Uint8Array; | ||
function readFile(path: string, opts: { encoding: "binary", flags?: string }): Uint8Array; | ||
function readFile(path: string, opts: { encoding: "utf8", flags?: string }): string; | ||
function readFile(path: string, opts?: { flags?: string }): Uint8Array; | ||
function writeFile(path: string, data: string | ArrayBufferView, opts?: { flags?: string }): void; | ||
@@ -222,4 +225,9 @@ | ||
canRead: boolean, canWrite: boolean, onload?: () => void, onerror?: () => void, dontCreateFile?: boolean, canOwn?: boolean): void; | ||
function createDataFile(parent: string | FSNode, name: string, data: ArrayBufferView, canRead: boolean, canWrite: boolean): FSNode; | ||
} | ||
interface Math { | ||
imul(a: number, b: number): number; | ||
} | ||
declare var MEMFS: Emscripten.FileSystemType; | ||
@@ -229,2 +237,28 @@ declare var NODEFS: Emscripten.FileSystemType; | ||
// Below runtime function/variable declarations are exportable by | ||
// -s EXTRA_EXPORTED_RUNTIME_METHODS. You can extend or merge | ||
// EmscriptenModule interface to add runtime functions. | ||
// | ||
// For example, by using -s "EXTRA_EXPORTED_RUNTIME_METHODS=['ccall']" | ||
// You can access ccall() via Module["ccall"]. In this case, you should | ||
// extend EmscriptenModule to pass the compiler check like the following: | ||
// | ||
// interface YourOwnEmscriptenModule extends EmscriptenModule { | ||
// ccall: typeof ccall; | ||
// } | ||
// | ||
// See: https://emscripten.org/docs/getting_started/FAQ.html#why-do-i-get-typeerror-module-something-is-not-a-function | ||
declare function ccall(ident: string, returnType: Emscripten.JSType | null, argTypes: Emscripten.JSType[], args: Emscripten.TypeCompatibleWithC[], opts?: Emscripten.CCallOpts): any; | ||
declare function cwrap(ident: string, returnType: Emscripten.JSType | null, argTypes: Emscripten.JSType[], opts?: Emscripten.CCallOpts): (...args: any[]) => any; | ||
declare function setValue(ptr: number, value: any, type: Emscripten.CType, noSafe?: boolean): void; | ||
declare function getValue(ptr: number, type: Emscripten.CType, noSafe?: boolean): number; | ||
declare function allocate(slab: number[] | ArrayBufferView | number, types: Emscripten.CType | Emscripten.CType[], allocator: number, ptr?: number): number; | ||
declare function stackAlloc(size: number): number; | ||
declare function stackSave(): number; | ||
declare function stackRestore(ptr: number): void; | ||
declare function UTF8ToString(ptr: number, maxBytesToRead?: number): string; | ||
@@ -234,2 +268,3 @@ declare function stringToUTF8(str: string, outPtr: number, maxBytesToRead?: number): void; | ||
declare function allocateUTF8(str: string): number; | ||
declare function allocateUTF8OnStack(str: string): number; | ||
declare function UTF16ToString(ptr: number): string; | ||
@@ -242,4 +277,18 @@ declare function stringToUTF16(str: string, outPtr: number, maxBytesToRead?: number): void; | ||
interface Math { | ||
imul(a: number, b: number): number; | ||
} | ||
declare function intArrayFromString(stringy: string, dontAddNull?: boolean, length?: number): number[]; | ||
declare function intArrayToString(array: number[]): string; | ||
declare function writeStringToMemory(str: string, buffer: number, dontAddNull: boolean): void; | ||
declare function writeArrayToMemory(array: number[], buffer: number): void; | ||
declare function writeAsciiToMemory(str: string, buffer: number, dontAddNull: boolean): void; | ||
declare function addRunDependency(id: any): void; | ||
declare function removeRunDependency(id: any): void; | ||
declare function addFunction(func: () => any, signature?: string): number; | ||
declare function removeFunction(funcPtr: number): void; | ||
declare var ALLOC_NORMAL: number; | ||
declare var ALLOC_STACK: number; | ||
declare var ALLOC_STATIC: number; | ||
declare var ALLOC_DYNAMIC: number; | ||
declare var ALLOC_NONE: number; |
{ | ||
"name": "@types/emscripten", | ||
"version": "1.38.0", | ||
"version": "1.39.0", | ||
"description": "TypeScript definitions for Emscripten", | ||
@@ -16,6 +16,11 @@ "license": "MIT", | ||
"githubUsername": "periklis" | ||
}, | ||
{ | ||
"name": "Bumsik Kim", | ||
"url": "https://github.com/kbumsik", | ||
"githubUsername": "kbumsik" | ||
} | ||
], | ||
"main": "", | ||
"types": "index", | ||
"types": "index.d.ts", | ||
"repository": { | ||
@@ -28,4 +33,4 @@ "type": "git", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "68253f6fceb95c7d55d55205fa7ed67ee34c5ce3759e559a81d9bccfecbd28cc", | ||
"typeScriptVersion": "2.2" | ||
"typesPublisherContentHash": "499f35fee5887fbaefb5e0d64893970ff7702201d9d4f9f3e910fa80095cb3e0", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -8,10 +8,10 @@ # Installation | ||
# Details | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/emscripten | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/emscripten. | ||
Additional Details | ||
* Last updated: Fri, 09 Aug 2019 14:26:49 GMT | ||
### Additional Details | ||
* Last updated: Wed, 22 Jan 2020 00:51:32 GMT | ||
* Dependencies: none | ||
* Global values: FS, IDBFS, MEMFS, Module, NODEFS, UTF16ToString, UTF32ToString, UTF8ToString, allocateUTF8, lengthBytesUTF16, lengthBytesUTF32, lengthBytesUTF8, stringToUTF16, stringToUTF32, stringToUTF8 | ||
* Global values: `ALLOC_DYNAMIC`, `ALLOC_NONE`, `ALLOC_NORMAL`, `ALLOC_STACK`, `ALLOC_STATIC`, `FS`, `IDBFS`, `MEMFS`, `Module`, `NODEFS`, `UTF16ToString`, `UTF32ToString`, `UTF8ToString`, `addFunction`, `addRunDependency`, `allocate`, `allocateUTF8`, `allocateUTF8OnStack`, `ccall`, `cwrap`, `getValue`, `intArrayFromString`, `intArrayToString`, `lengthBytesUTF16`, `lengthBytesUTF32`, `lengthBytesUTF8`, `removeFunction`, `removeRunDependency`, `setValue`, `stackAlloc`, `stackRestore`, `stackSave`, `stringToUTF16`, `stringToUTF32`, `stringToUTF8`, `writeArrayToMemory`, `writeAsciiToMemory`, `writeStringToMemory` | ||
# Credits | ||
These definitions were written by Kensuke Matsuzaki <https://github.com/zakki>, and Periklis Tsirakidis <https://github.com/periklis>. | ||
These definitions were written by Kensuke Matsuzaki (https://github.com/zakki), Periklis Tsirakidis (https://github.com/periklis), and Bumsik Kim (https://github.com/kbumsik). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15137
246