Aller au contenu principal

Emscripten

Other WebAssembly declarations, for compatibility with older versions of Typescript

Index

Namespaces

FS

FS:

FSNode

FSNode:

constructor

  • new FSNode(parent: FSNode, name: string, mode: number, rdev: number): FSNode
  • Parameters

    • parent: FSNode
    • name: string
    • mode: number
    • rdev: number

    Returns FSNode

id

id: number

readonlyisDevice

isDevice: boolean

readonlyisFolder

isFolder: boolean

mode

mode: number

mount

mount: Mount

optionalmounted

mounted?: Mount

name

name: string

parent

parent: FSNode

rdev

rdev: number

read

read: boolean

readMode

readMode: number

write

write: boolean

writeMode

writeMode: number

FSStream

FSStream:

constructor

  • new FSStream(): FSStream
  • Returns FSStream

flags

flags: number

readonlyisAppend

isAppend: boolean

readonlyisRead

isRead: boolean

readonlyisWrite

isWrite: boolean

object

object: FSNode

position

position: number

Analyze

Analyze:

error

error: Error

exists

exists: boolean

isRoot

isRoot: boolean

name

name: string

object

object: FSNode

parentExists

parentExists: boolean

parentObject

parentObject: FSNode

parentPath

parentPath: string

path

path: string

ErrnoError

ErrnoError:

code

code: string

errno

errno: number

name

name: ErronoError

Lookup

Lookup:

node

node: FSNode

path

path: string

Mount

Mount:

mountpoint

mountpoint: string

mounts

mounts: Mount[]

opts

opts: object

root

root: FSNode

type

allocate

  • allocate(stream: FSStream, offset: number, length: number): void
  • Parameters

    • stream: FSStream
    • offset: number
    • length: number

    Returns void

analyzePath

  • analyzePath(path: string, dontResolveLastLink?: boolean): Analyze
  • Parameters

    • path: string
    • optionaldontResolveLastLink: boolean

    Returns Analyze

chdir

  • chdir(path: string): void
  • Parameters

    • path: string

    Returns void

chmod

  • chmod(path: string, mode: number, dontFollow?: boolean): void
  • Parameters

    • path: string
    • mode: number
    • optionaldontFollow: boolean

    Returns void

chown

  • chown(path: string, uid: number, gid: number, dontFollow?: boolean): void
  • Parameters

    • path: string
    • uid: number
    • gid: number
    • optionaldontFollow: boolean

    Returns void

close

  • close(stream: FSStream): void
  • Parameters

    • stream: FSStream

    Returns void

createDataFile

  • createDataFile(parent: string | FSNode, name: string, data: ArrayBufferView, canRead: boolean, canWrite: boolean, canOwn: boolean): FSNode
  • Parameters

    • parent: string | FSNode
    • name: string
    • data: ArrayBufferView
    • canRead: boolean
    • canWrite: boolean
    • canOwn: boolean

    Returns FSNode

createLazyFile

  • createLazyFile(parent: string | FSNode, name: string, url: string, canRead: boolean, canWrite: boolean): FSNode
  • Parameters

    • parent: string | FSNode
    • name: string
    • url: string
    • canRead: boolean
    • canWrite: boolean

    Returns FSNode

createPreloadedFile

  • createPreloadedFile(parent: string | FSNode, name: string, url: string, canRead: boolean, canWrite: boolean, onload?: () => void, onerror?: () => void, dontCreateFile?: boolean, canOwn?: boolean): void
  • Parameters

    • parent: string | FSNode
    • name: string
    • url: string
    • canRead: boolean
    • canWrite: boolean
    • optionalonload: () => void
    • optionalonerror: () => void
    • optionaldontCreateFile: boolean
    • optionalcanOwn: boolean

    Returns void

cwd

  • cwd(): string
  • Returns string

fchmod

  • fchmod(fd: number, mode: number): void
  • Parameters

    • fd: number
    • mode: number

    Returns void

fchown

  • fchown(fd: number, uid: number, gid: number): void
  • Parameters

    • fd: number
    • uid: number
    • gid: number

    Returns void

ftruncate

  • ftruncate(fd: number, len: number): void
  • Parameters

    • fd: number
    • len: number

    Returns void

getPath

  • getPath(node: FSNode): string
  • Parameters

    • node: FSNode

    Returns string

init

  • init(input: null | () => null | number, output: null | (c: number) => any, error: null | (c: number) => any): void
  • Parameters

    • input: null | () => null | number
    • output: null | (c: number) => any
    • error: null | (c: number) => any

    Returns void

ioctl

  • ioctl(stream: FSStream, cmd: any, arg: any): any
  • Parameters

    • stream: FSStream
    • cmd: any
    • arg: any

    Returns any

isBlkdev

  • isBlkdev(mode: number): boolean
  • Parameters

    • mode: number

    Returns boolean

isChrdev

  • isChrdev(mode: number): boolean
  • Parameters

    • mode: number

    Returns boolean

isDir

  • isDir(mode: number): boolean
  • Parameters

    • mode: number

    Returns boolean

isFIFO

  • isFIFO(mode: number): boolean
  • Parameters

    • mode: number

    Returns boolean

isFile

  • isFile(mode: number): boolean
  • Parameters

    • mode: number

    Returns boolean

isLink

  • isLink(mode: number): boolean
  • Parameters

    • mode: number

    Returns boolean

isSocket

  • isSocket(mode: number): boolean
  • Parameters

    • mode: number

    Returns boolean

lchmod

  • lchmod(path: string, mode: number): void
  • Parameters

    • path: string
    • mode: number

    Returns void

lchown

  • lchown(path: string, uid: number, gid: number): void
  • Parameters

    • path: string
    • uid: number
    • gid: number

    Returns void

llseek

  • llseek(stream: FSStream, offset: number, whence: number): any
  • Parameters

    • stream: FSStream
    • offset: number
    • whence: number

    Returns any

lookupPath

  • lookupPath(path: string, opts: any): Lookup
  • Parameters

    • path: string
    • opts: any

    Returns Lookup

lstat

  • lstat(path: string): any
  • Parameters

    • path: string

    Returns any

major

  • major(dev: number): number
  • Parameters

    • dev: number

    Returns number

makedev

  • makedev(ma: number, mi: number): number
  • Parameters

    • ma: number
    • mi: number

    Returns number

minor

  • minor(dev: number): number
  • Parameters

    • dev: number

    Returns number

mkdev

  • mkdev(path: string, mode?: number, dev?: number): any
  • Parameters

    • path: string
    • optionalmode: number
    • optionaldev: number

    Returns any

mkdir

  • mkdir(path: string, mode?: number): any
  • Parameters

    • path: string
    • optionalmode: number

    Returns any

mmap

  • mmap(stream: FSStream, buffer: ArrayBufferView, offset: number, length: number, position: number, prot: number, flags: number): any
  • Parameters

    • stream: FSStream
    • buffer: ArrayBufferView
    • offset: number
    • length: number
    • position: number
    • prot: number
    • flags: number

    Returns any

mount

open

  • open(path: string, flags: string, mode?: number, fd_start?: number, fd_end?: number): FSStream
  • Parameters

    • path: string
    • flags: string
    • optionalmode: number
    • optionalfd_start: number
    • optionalfd_end: number

    Returns FSStream

read

  • read(stream: FSStream, buffer: ArrayBufferView, offset: number, length: number, position?: number): number
  • Parameters

    • stream: FSStream
    • buffer: ArrayBufferView
    • offset: number
    • length: number
    • optionalposition: number

    Returns number

readFile

  • readFile(path: string, opts: { encoding: binary; flags?: string }): Uint8Array
  • readFile(path: string, opts: { encoding: utf8; flags?: string }): string
  • readFile(path: string, opts?: { flags?: string }): Uint8Array
  • Parameters

    • path: string
    • opts: { encoding: binary; flags?: string }

    Returns Uint8Array

readdir

  • readdir(path: string): any
  • Parameters

    • path: string

    Returns any

readlink

  • readlink(path: string): string
  • Parameters

    • path: string

    Returns string

registerDevice

  • registerDevice(dev: number, ops: any): void
  • Parameters

    • dev: number
    • ops: any

    Returns void

rename

  • rename(old_path: string, new_path: string): void
  • Parameters

    • old_path: string
    • new_path: string

    Returns void

rmdir

  • rmdir(path: string): void
  • Parameters

    • path: string

    Returns void

stat

  • stat(path: string, dontFollow?: boolean): any
  • Parameters

    • path: string
    • optionaldontFollow: boolean

    Returns any

symlink

  • symlink(oldpath: string, newpath: string): any
  • Parameters

    • oldpath: string
    • newpath: string

    Returns any

syncfs

  • syncfs(populate: boolean, callback: (e: any) => any): void
  • syncfs(callback: (e: any) => any, populate?: boolean): void
  • Parameters

    • populate: boolean
    • callback: (e: any) => any

    Returns void

truncate

  • truncate(path: string, len: number): void
  • Parameters

    • path: string
    • len: number

    Returns void

unlink

  • unlink(path: string): void
  • Parameters

    • path: string

    Returns void

unmount

  • unmount(mountpoint: string): void
  • Parameters

    • mountpoint: string

    Returns void

utime

  • utime(path: string, atime: number, mtime: number): void
  • Parameters

    • path: string
    • atime: number
    • mtime: number

    Returns void

write

  • write(stream: FSStream, buffer: ArrayBufferView, offset: number, length: number, position?: number, canOwn?: boolean): number
  • Parameters

    • stream: FSStream
    • buffer: ArrayBufferView
    • offset: number
    • length: number
    • optionalposition: number
    • optionalcanOwn: boolean

    Returns number

writeFile

  • writeFile(path: string, data: string | ArrayBufferView, opts?: { flags?: string }): void
  • Parameters

    • path: string
    • data: string | ArrayBufferView
    • optionalopts: { flags?: string }

    Returns void

Interfaces

CCallOpts

CCallOpts:

optionalasync

async?: boolean

EmscriptenModule

EmscriptenModule:

FAST_MEMORY

FAST_MEMORY: number

FHEAP

FHEAP: Float64Array

HEAP

HEAP: Int32Array

HEAP16

HEAP16: Int16Array

HEAP32

HEAP32: Int32Array

HEAP64

HEAP64: BigInt64Array

HEAP8

HEAP8: Int8Array

HEAPF32

HEAPF32: Float32Array

HEAPF64

HEAPF64: Float64Array

HEAPU16

HEAPU16: Uint16Array

HEAPU32

HEAPU32: Uint32Array

HEAPU64

HEAPU64: BigUint64Array

HEAPU8

HEAPU8: Uint8Array

IHEAP

IHEAP: Int32Array

TOTAL_MEMORY

TOTAL_MEMORY: number

TOTAL_STACK

TOTAL_STACK: number

arguments

arguments: string[]

environment

environment: EnvironmentType

filePackagePrefixURL

filePackagePrefixURL: string

logReadFiles

logReadFiles: boolean

noExitRuntime

noExitRuntime: boolean

noInitialRun

noInitialRun: boolean

onAbort

onAbort: (what: any) => void

Type declaration

    • (what: any): void
    • Parameters

      • what: any

      Returns void

onRuntimeInitialized

onRuntimeInitialized: () => void

Type declaration

    • (): void
    • Returns void

postRun

postRun: () => void[]

preInit

preInit: () => void[]

preRun

preRun: () => void[]

preinitializedWebGLContext

preinitializedWebGLContext: WebGLRenderingContext

preloadedAudios

preloadedAudios: any

preloadedImages

preloadedImages: any

wasmBinary

wasmBinary: ArrayBuffer

_free

  • _free(ptr: number): void
  • Parameters

    • ptr: number

    Returns void

_malloc

  • _malloc(size: number): number
  • Parameters

    • size: number

    Returns number

addOnExit

  • addOnExit(cb: () => any): void
  • Parameters

    • cb: () => any

    Returns void

addOnInit

  • addOnInit(cb: () => any): void
  • Parameters

    • cb: () => any

    Returns void

addOnPostRun

  • addOnPostRun(cb: () => any): void
  • Parameters

    • cb: () => any

    Returns void

addOnPreMain

  • addOnPreMain(cb: () => any): void
  • Parameters

    • cb: () => any

    Returns void

addOnPreRun

  • addOnPreRun(cb: () => any): void
  • Parameters

    • cb: () => any

    Returns void

destroy

  • destroy(object: object): void
  • Parameters

    • object: object

    Returns void

getPreloadedPackage

  • getPreloadedPackage(remotePackageName: string, remotePackageSize: number): ArrayBuffer
  • Parameters

    • remotePackageName: string
    • remotePackageSize: number

    Returns ArrayBuffer

instantiateWasm

  • instantiateWasm(imports: Imports, successCallback: (module: Instance) => void): undefined | Exports
  • Parameters

    • imports: Imports
    • successCallback: (module: Instance) => void

    Returns undefined | Exports

locateFile

  • locateFile(url: string, scriptDirectory: string): string
  • Parameters

    • url: string
    • scriptDirectory: string

    Returns string

onCustomMessage

  • onCustomMessage(event: MessageEvent<any>): void
  • Parameters

    • event: MessageEvent<any>

    Returns void

print

  • print(str: string): void
  • Parameters

    • str: string

    Returns void

printErr

  • printErr(str: string): void
  • Parameters

    • str: string

    Returns void

FileSystemType

FileSystemType:

mount

  • mount(mount: Mount): FSNode
  • Parameters

    • mount: Mount

    Returns FSNode

syncfs

  • syncfs(mount: Mount, populate: () => unknown, done: (err?: null | number) => unknown): void
  • Parameters

    • mount: Mount
    • populate: () => unknown
    • done: (err?: null | number) => unknown

    Returns void

RootFS

RootFS:

FSNode

FSNode: never

FSStream

FSStream: never

allocate

allocate: (stream: FSStream, offset: number, length: number) => void

Type declaration

    • (stream: FSStream, offset: number, length: number): void
    • Parameters

      • stream: FSStream
      • offset: number
      • length: number

      Returns void

analyzePath

analyzePath: (path: string, dontResolveLastLink?: boolean) => Analyze

Type declaration

    • (path: string, dontResolveLastLink?: boolean): Analyze
    • Parameters

      • path: string
      • optionaldontResolveLastLink: boolean

      Returns Analyze

chdir

chdir: (path: string) => void

Type declaration

    • (path: string): void
    • Parameters

      • path: string

      Returns void

chmod

chmod: (path: string, mode: number, dontFollow?: boolean) => void

Type declaration

    • (path: string, mode: number, dontFollow?: boolean): void
    • Parameters

      • path: string
      • mode: number
      • optionaldontFollow: boolean

      Returns void

chown

chown: (path: string, uid: number, gid: number, dontFollow?: boolean) => void

Type declaration

    • (path: string, uid: number, gid: number, dontFollow?: boolean): void
    • Parameters

      • path: string
      • uid: number
      • gid: number
      • optionaldontFollow: boolean

      Returns void

close

close: (stream: FSStream) => void

Type declaration

    • (stream: FSStream): void
    • Parameters

      • stream: FSStream

      Returns void

createDataFile

createDataFile: (parent: string | FSNode, name: string, data: ArrayBufferView, canRead: boolean, canWrite: boolean, canOwn: boolean) => FSNode

Type declaration

    • (parent: string | FSNode, name: string, data: ArrayBufferView, canRead: boolean, canWrite: boolean, canOwn: boolean): FSNode
    • Parameters

      • parent: string | FSNode
      • name: string
      • data: ArrayBufferView
      • canRead: boolean
      • canWrite: boolean
      • canOwn: boolean

      Returns FSNode

createLazyFile

createLazyFile: (parent: string | FSNode, name: string, url: string, canRead: boolean, canWrite: boolean) => FSNode

Type declaration

    • (parent: string | FSNode, name: string, url: string, canRead: boolean, canWrite: boolean): FSNode
    • Parameters

      • parent: string | FSNode
      • name: string
      • url: string
      • canRead: boolean
      • canWrite: boolean

      Returns FSNode

createPreloadedFile

createPreloadedFile: (parent: string | FSNode, name: string, url: string, canRead: boolean, canWrite: boolean, onload?: () => void, onerror?: () => void, dontCreateFile?: boolean, canOwn?: boolean) => void

Type declaration

    • (parent: string | FSNode, name: string, url: string, canRead: boolean, canWrite: boolean, onload?: () => void, onerror?: () => void, dontCreateFile?: boolean, canOwn?: boolean): void
    • Parameters

      • parent: string | FSNode
      • name: string
      • url: string
      • canRead: boolean
      • canWrite: boolean
      • optionalonload: () => void
      • optionalonerror: () => void
      • optionaldontCreateFile: boolean
      • optionalcanOwn: boolean

      Returns void

cwd

cwd: () => string

Type declaration

    • (): string
    • Returns string

fchmod

fchmod: (fd: number, mode: number) => void

Type declaration

    • (fd: number, mode: number): void
    • Parameters

      • fd: number
      • mode: number

      Returns void

fchown

fchown: (fd: number, uid: number, gid: number) => void

Type declaration

    • (fd: number, uid: number, gid: number): void
    • Parameters

      • fd: number
      • uid: number
      • gid: number

      Returns void

filesystems

filesystems: Record<string, FileSystemType>

ftruncate

ftruncate: (fd: number, len: number) => void

Type declaration

    • (fd: number, len: number): void
    • Parameters

      • fd: number
      • len: number

      Returns void

getPath

getPath: (node: FSNode) => string

Type declaration

    • (node: FSNode): string
    • Parameters

      • node: FSNode

      Returns string

init

init: (input: null | () => null | number, output: null | (c: number) => any, error: null | (c: number) => any) => void

Type declaration

    • (input: null | () => null | number, output: null | (c: number) => any, error: null | (c: number) => any): void
    • Parameters

      • input: null | () => null | number
      • output: null | (c: number) => any
      • error: null | (c: number) => any

      Returns void

ioctl

ioctl: (stream: FSStream, cmd: any, arg: any) => any

Type declaration

    • (stream: FSStream, cmd: any, arg: any): any
    • Parameters

      • stream: FSStream
      • cmd: any
      • arg: any

      Returns any

isBlkdev

isBlkdev: (mode: number) => boolean

Type declaration

    • (mode: number): boolean
    • Parameters

      • mode: number

      Returns boolean

isChrdev

isChrdev: (mode: number) => boolean

Type declaration

    • (mode: number): boolean
    • Parameters

      • mode: number

      Returns boolean

isDir

isDir: (mode: number) => boolean

Type declaration

    • (mode: number): boolean
    • Parameters

      • mode: number

      Returns boolean

isFIFO

isFIFO: (mode: number) => boolean

Type declaration

    • (mode: number): boolean
    • Parameters

      • mode: number

      Returns boolean

isFile

isFile: (mode: number) => boolean

Type declaration

    • (mode: number): boolean
    • Parameters

      • mode: number

      Returns boolean

isLink

isLink: (mode: number) => boolean

Type declaration

    • (mode: number): boolean
    • Parameters

      • mode: number

      Returns boolean

isSocket

isSocket: (mode: number) => boolean

Type declaration

    • (mode: number): boolean
    • Parameters

      • mode: number

      Returns boolean

lchmod

lchmod: (path: string, mode: number) => void

Type declaration

    • (path: string, mode: number): void
    • Parameters

      • path: string
      • mode: number

      Returns void

lchown

lchown: (path: string, uid: number, gid: number) => void

Type declaration

    • (path: string, uid: number, gid: number): void
    • Parameters

      • path: string
      • uid: number
      • gid: number

      Returns void

llseek

llseek: (stream: FSStream, offset: number, whence: number) => any

Type declaration

    • (stream: FSStream, offset: number, whence: number): any
    • Parameters

      • stream: FSStream
      • offset: number
      • whence: number

      Returns any

lookupPath

lookupPath: (path: string, opts: any) => Lookup & (path: string, opts?: any) => Lookup

lstat

lstat: (path: string) => any

Type declaration

    • (path: string): any
    • Parameters

      • path: string

      Returns any

major

major: (dev: number) => number

Type declaration

    • (dev: number): number
    • Parameters

      • dev: number

      Returns number

makedev

makedev: (ma: number, mi: number) => number

Type declaration

    • (ma: number, mi: number): number
    • Parameters

      • ma: number
      • mi: number

      Returns number

minor

minor: (dev: number) => number

Type declaration

    • (dev: number): number
    • Parameters

      • dev: number

      Returns number

mkdev

mkdev: (path: string, mode?: number, dev?: number) => any

Type declaration

    • (path: string, mode?: number, dev?: number): any
    • Parameters

      • path: string
      • optionalmode: number
      • optionaldev: number

      Returns any

mkdir

mkdir: (path: string, mode?: number) => any

Type declaration

    • (path: string, mode?: number): any
    • Parameters

      • path: string
      • optionalmode: number

      Returns any

mmap

mmap: (stream: FSStream, buffer: ArrayBufferView, offset: number, length: number, position: number, prot: number, flags: number) => any

Type declaration

    • (stream: FSStream, buffer: ArrayBufferView, offset: number, length: number, position: number, prot: number, flags: number): any
    • Parameters

      • stream: FSStream
      • buffer: ArrayBufferView
      • offset: number
      • length: number
      • position: number
      • prot: number
      • flags: number

      Returns any

mount

mount: (type: FileSystemType, opts: any, mountpoint: string) => any

Type declaration

open

open: (path: string, flags: string, mode?: number, fd_start?: number, fd_end?: number) => FSStream

Type declaration

    • (path: string, flags: string, mode?: number, fd_start?: number, fd_end?: number): FSStream
    • Parameters

      • path: string
      • flags: string
      • optionalmode: number
      • optionalfd_start: number
      • optionalfd_end: number

      Returns FSStream

read

read: (stream: FSStream, buffer: ArrayBufferView, offset: number, length: number, position?: number) => number

Type declaration

    • (stream: FSStream, buffer: ArrayBufferView, offset: number, length: number, position?: number): number
    • Parameters

      • stream: FSStream
      • buffer: ArrayBufferView
      • offset: number
      • length: number
      • optionalposition: number

      Returns number

readFile

readFile: { (path: string, opts: { encoding: binary; flags?: string }): Uint8Array; (path: string, opts: { encoding: utf8; flags?: string }): string; (path: string, opts?: { flags?: string }): Uint8Array }

Type declaration

    • (path: string, opts: { encoding: binary; flags?: string }): Uint8Array
    • (path: string, opts: { encoding: utf8; flags?: string }): string
    • (path: string, opts?: { flags?: string }): Uint8Array
    • Parameters

      • path: string
      • opts: { encoding: binary; flags?: string }

      Returns Uint8Array

    • Parameters

      • path: string
      • opts: { encoding: utf8; flags?: string }

      Returns string

    • Parameters

      • path: string
      • optionalopts: { flags?: string }

      Returns Uint8Array

readdir

readdir: (path: string) => any

Type declaration

    • (path: string): any
    • Parameters

      • path: string

      Returns any

readlink

readlink: (path: string) => string

Type declaration

    • (path: string): string
    • Parameters

      • path: string

      Returns string

registerDevice

registerDevice: (dev: number, ops: any) => void

Type declaration

    • (dev: number, ops: any): void
    • Parameters

      • dev: number
      • ops: any

      Returns void

rename

rename: (old_path: string, new_path: string) => void

Type declaration

    • (old_path: string, new_path: string): void
    • Parameters

      • old_path: string
      • new_path: string

      Returns void

rmdir

rmdir: (path: string) => void

Type declaration

    • (path: string): void
    • Parameters

      • path: string

      Returns void

stat

stat: (path: string, dontFollow?: boolean) => any

Type declaration

    • (path: string, dontFollow?: boolean): any
    • Parameters

      • path: string
      • optionaldontFollow: boolean

      Returns any

symlink

symlink: (oldpath: string, newpath: string) => any

Type declaration

    • (oldpath: string, newpath: string): any
    • Parameters

      • oldpath: string
      • newpath: string

      Returns any

syncfs

syncfs: { (populate: boolean, callback: (e: any) => any): void; (callback: (e: any) => any, populate?: boolean): void }

Type declaration

    • (populate: boolean, callback: (e: any) => any): void
    • (callback: (e: any) => any, populate?: boolean): void
    • Parameters

      • populate: boolean
      • callback: (e: any) => any

      Returns void

    • Parameters

      • callback: (e: any) => any
      • optionalpopulate: boolean

      Returns void

truncate

truncate: (path: string, len: number) => void

Type declaration

    • (path: string, len: number): void
    • Parameters

      • path: string
      • len: number

      Returns void

unlink

unlink: (path: string) => void

Type declaration

    • (path: string): void
    • Parameters

      • path: string

      Returns void

unmount

unmount: (mountpoint: string) => void

Type declaration

    • (mountpoint: string): void
    • Parameters

      • mountpoint: string

      Returns void

utime

utime: (path: string, atime: number, mtime: number) => void

Type declaration

    • (path: string, atime: number, mtime: number): void
    • Parameters

      • path: string
      • atime: number
      • mtime: number

      Returns void

write

write: (stream: FSStream, buffer: ArrayBufferView, offset: number, length: number, position?: number, canOwn?: boolean) => number

Type declaration

    • (stream: FSStream, buffer: ArrayBufferView, offset: number, length: number, position?: number, canOwn?: boolean): number
    • Parameters

      • stream: FSStream
      • buffer: ArrayBufferView
      • offset: number
      • length: number
      • optionalposition: number
      • optionalcanOwn: boolean

      Returns number

writeFile

writeFile: (path: string, data: string | ArrayBufferView, opts?: { flags?: string }) => void

Type declaration

    • (path: string, data: string | ArrayBufferView, opts?: { flags?: string }): void
    • Parameters

      • path: string
      • data: string | ArrayBufferView
      • optionalopts: { flags?: string }

      Returns void

mkdirTree

  • mkdirTree(path: string): void
  • Parameters

    • path: string

    Returns void

Type Aliases

CFloatType

CFloatType: float | double

CIntType

CIntType: i8 | i16 | i32 | i64

CPointerType

CPointerType: i8* | i16* | i32* | i64* | float* | double* | *

CType

EmscriptenModuleFactory

EmscriptenModuleFactory<T>: (moduleOverrides?: Partial<T>) => Promise<T>

Type declaration

    • (moduleOverrides?: Partial<T>): Promise<T>
    • A factory function is generated when setting the MODULARIZE build option to 1 in your Emscripten build. It return a Promise that resolves to an initialized, ready-to-call EmscriptenModule instance.

      By default, the factory function will be named Module. It’s recommended to use the EXPORT_ES6 option, in which the factory function will be the default export. If used without EXPORT_ES6, the factory function will be a global variable. You can rename the variable using the EXPORT_NAME build option. It’s left to you to export any global variables as needed in your application’s types.


      Parameters

      • optionalmoduleOverrides: Partial<T>

        Default properties for the initialized module.

      Returns Promise<T>

EnvironmentType

EnvironmentType: WEB | NODE | SHELL | WORKER

FileSystemInstance

FileSystemInstance: NamespaceToInstance<typeof FS> & { lookupPath: any; mkdirTree: any }

JSType

JSType: number | string | array | boolean

TypeCompatibleWithC

TypeCompatibleWithC: number | string | any[] | boolean

Variables

constALLOC_DYNAMIC

ALLOC_DYNAMIC: number

constALLOC_NONE

ALLOC_NONE: number

constALLOC_NORMAL

ALLOC_NORMAL: number

constALLOC_STACK

ALLOC_STACK: number

constALLOC_STATIC

ALLOC_STATIC: number

constIDBFS

constMEMFS

constNODEFS

Functions

UTF16ToString

  • UTF16ToString(ptr: number): string
  • Parameters

    • ptr: number

    Returns string

UTF32ToString

  • UTF32ToString(ptr: number): string
  • Parameters

    • ptr: number

    Returns string

UTF8ToString

  • UTF8ToString(ptr: number, maxBytesToRead?: number): string
  • Parameters

    • ptr: number
    • optionalmaxBytesToRead: number

    Returns string

addFunction

  • addFunction(func: (...args: any[]) => any, signature?: string): number
  • Parameters

    • func: (...args: any[]) => any
    • optionalsignature: string

    Returns number

addRunDependency

  • addRunDependency(id: any): void
  • Parameters

    • id: any

    Returns void

allocate

  • allocate(slab: number | ArrayBufferView | number[], types: CType | CType[], allocator: number, ptr?: number): number
  • Parameters

    • slab: number | ArrayBufferView | number[]
    • types: CType | CType[]
    • allocator: number
    • optionalptr: number

    Returns number

allocateUTF8

  • allocateUTF8(str: string): number
  • Parameters

    • str: string

    Returns number

allocateUTF8OnStack

  • allocateUTF8OnStack(str: string): number
  • Parameters

    • str: string

    Returns number

ccall

  • ccall<I, R>(ident: string, returnType: R, argTypes: I, args: Extract<{ [ P in string | number | symbol ]: StringToType<I[P]> }, any[]>, opts?: CCallOpts): ReturnToType<R>
  • Type parameters

    Parameters

    • ident: string
    • returnType: R
    • argTypes: I
    • args: Extract<{ [ P in string | number | symbol ]: StringToType<I[P]> }, any[]>
    • optionalopts: CCallOpts

    Returns ReturnToType<R>

cwrap

  • cwrap<I, R>(ident: string, returnType: R, argTypes: I, opts?: CCallOpts): (...arg: ArgsToType<I>) => ReturnToType<R>
  • Type parameters

    Parameters

    • ident: string
    • returnType: R
    • argTypes: I
    • optionalopts: CCallOpts

    Returns (...arg: ArgsToType<I>) => ReturnToType<R>

      • (...arg: ArgsToType<I>): ReturnToType<R>
      • Parameters

        • rest...arg: ArgsToType<I>

        Returns ReturnToType<R>

getValue

  • getValue(ptr: number, type: CType, noSafe?: boolean): number
  • Parameters

    • ptr: number
    • type: CType
    • optionalnoSafe: boolean

    Returns number

intArrayFromString

  • intArrayFromString(stringy: string, dontAddNull?: boolean, length?: number): number[]
  • Parameters

    • stringy: string
    • optionaldontAddNull: boolean
    • optionallength: number

    Returns number[]

intArrayToString

  • intArrayToString(array: number[]): string
  • Parameters

    • array: number[]

    Returns string

lengthBytesUTF16

  • lengthBytesUTF16(str: string): number
  • Parameters

    • str: string

    Returns number

lengthBytesUTF32

  • lengthBytesUTF32(str: string): number
  • Parameters

    • str: string

    Returns number

lengthBytesUTF8

  • lengthBytesUTF8(str: string): number
  • Parameters

    • str: string

    Returns number

removeFunction

  • removeFunction(funcPtr: number): void
  • Parameters

    • funcPtr: number

    Returns void

removeRunDependency

  • removeRunDependency(id: any): void
  • Parameters

    • id: any

    Returns void

setValue

  • setValue(ptr: number, value: any, type: CType, noSafe?: boolean): void
  • Parameters

    • ptr: number
    • value: any
    • type: CType
    • optionalnoSafe: boolean

    Returns void

stackAlloc

  • stackAlloc(size: number): number
  • Parameters

    • size: number

    Returns number

stackRestore

  • stackRestore(ptr: number): void
  • Parameters

    • ptr: number

    Returns void

stackSave

  • stackSave(): number
  • Returns number

stringToUTF16

  • stringToUTF16(str: string, outPtr: number, maxBytesToRead?: number): void
  • Parameters

    • str: string
    • outPtr: number
    • optionalmaxBytesToRead: number

    Returns void

stringToUTF32

  • stringToUTF32(str: string, outPtr: number, maxBytesToRead?: number): void
  • Parameters

    • str: string
    • outPtr: number
    • optionalmaxBytesToRead: number

    Returns void

stringToUTF8

  • stringToUTF8(str: string, outPtr: number, maxBytesToRead?: number): void
  • Parameters

    • str: string
    • outPtr: number
    • optionalmaxBytesToRead: number

    Returns void

writeArrayToMemory

  • writeArrayToMemory(array: number[], buffer: number): void
  • Parameters

    • array: number[]
    • buffer: number

    Returns void

writeAsciiToMemory

  • writeAsciiToMemory(str: string, buffer: number, dontAddNull: boolean): void
  • Parameters

    • str: string
    • buffer: number
    • dontAddNull: boolean

    Returns void

writeStringToMemory

  • writeStringToMemory(str: string, buffer: number, dontAddNull: boolean): void
  • Parameters

    • str: string
    • buffer: number
    • dontAddNull: boolean

    Returns void