@types/emscripten
Advanced tools
Comparing version 1.39.7 to 1.39.8
@@ -17,10 +17,10 @@ // Type definitions for Emscripten 1.39.16 | ||
interface FileSystemType {} | ||
type EnvironmentType = 'WEB' | 'NODE' | 'SHELL' | 'WORKER'; | ||
type EnvironmentType = "WEB" | "NODE" | "SHELL" | "WORKER"; | ||
type JSType = '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 CIntType = "i8" | "i16" | "i32" | "i64"; | ||
type CFloatType = "float" | "double"; | ||
type CPointerType = "i8*" | "i16*" | "i32*" | "i64*" | "float*" | "double*" | "*"; | ||
type CType = CIntType | CFloatType | CPointerType; | ||
@@ -211,4 +211,4 @@ | ||
function ioctl(stream: FSStream, cmd: any, arg: any): any; | ||
function readFile(path: string, opts: { encoding: 'binary'; flags?: string | undefined }): Uint8Array; | ||
function readFile(path: string, opts: { encoding: 'utf8'; flags?: string | undefined }): string; | ||
function readFile(path: string, opts: { encoding: "binary"; flags?: string | undefined }): Uint8Array; | ||
function readFile(path: string, opts: { encoding: "utf8"; flags?: string | undefined }): string; | ||
function readFile(path: string, opts?: { flags?: string | undefined }): Uint8Array; | ||
@@ -261,22 +261,20 @@ function writeFile(path: string, data: string | ArrayBufferView, opts?: { flags?: string | undefined }): void; | ||
// https://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html | ||
type StringToType<R extends any> = R extends Emscripten.JSType | ||
? { | ||
number: number; | ||
string: string; | ||
array: number[] | string[] | boolean[] | Uint8Array | Int8Array; | ||
boolean: boolean; | ||
null: null; | ||
type StringToType<R extends any> = R extends Emscripten.JSType ? { | ||
number: number; | ||
string: string; | ||
array: number[] | string[] | boolean[] | Uint8Array | Int8Array; | ||
boolean: boolean; | ||
null: null; | ||
}[R] | ||
: never; | ||
: never; | ||
type ArgsToType<T extends Array<Emscripten.JSType | null>> = Extract< | ||
{ | ||
[P in keyof T]: StringToType<T[P]>; | ||
}, | ||
any[] | ||
{ | ||
[P in keyof T]: StringToType<T[P]>; | ||
}, | ||
any[] | ||
>; | ||
type ReturnToType<R extends Emscripten.JSType | null> = R extends null | ||
? null | ||
: StringToType<Exclude<R, null>>; | ||
type ReturnToType<R extends Emscripten.JSType | null> = R extends null ? null | ||
: StringToType<Exclude<R, null>>; | ||
@@ -298,20 +296,20 @@ // Below runtime function/variable declarations are exportable by | ||
declare function cwrap< | ||
I extends Array<Emscripten.JSType | null> | [], | ||
R extends Emscripten.JSType | null | ||
I extends Array<Emscripten.JSType | null> | [], | ||
R extends Emscripten.JSType | null, | ||
>( | ||
ident: string, | ||
returnType: R, | ||
argTypes: I, | ||
opts?: Emscripten.CCallOpts | ||
ident: string, | ||
returnType: R, | ||
argTypes: I, | ||
opts?: Emscripten.CCallOpts, | ||
): (...arg: ArgsToType<I>) => ReturnToType<R>; | ||
declare function ccall< | ||
I extends Array<Emscripten.JSType | null> | [], | ||
R extends Emscripten.JSType | null | ||
I extends Array<Emscripten.JSType | null> | [], | ||
R extends Emscripten.JSType | null, | ||
>( | ||
ident: string, | ||
returnType: R, | ||
argTypes: I, | ||
args: ArgsToType<I>, | ||
opts?: Emscripten.CCallOpts | ||
ident: string, | ||
returnType: R, | ||
argTypes: I, | ||
args: ArgsToType<I>, | ||
opts?: Emscripten.CCallOpts, | ||
): ReturnToType<R>; | ||
@@ -318,0 +316,0 @@ |
{ | ||
"name": "@types/emscripten", | ||
"version": "1.39.7", | ||
"version": "1.39.8", | ||
"description": "TypeScript definitions for Emscripten", | ||
@@ -38,4 +38,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/emscripten", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "aae8dbde0a25348f932176ab766ddb3ca12e43a6a846863ff0df5a7796e81724", | ||
"typeScriptVersion": "4.3" | ||
"typesPublisherContentHash": "aad5474fdc37f2851dc55a9fe50f3e287ed349627987a31b51981a72354acb48", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Wed, 26 Jul 2023 00:03:12 GMT | ||
* Last updated: Sat, 23 Sep 2023 17:07:22 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: `ALLOC_DYNAMIC`, `ALLOC_NONE`, `ALLOC_NORMAL`, `ALLOC_STACK`, `ALLOC_STATIC`, `FS`, `IDBFS`, `MEMFS`, `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` |
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
16148
314