-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Based on - [Module API](https://emscripten.org/docs/api_reference/module.html) - [TS definition](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/emscripten/index.d.ts) - inspection of printed module - [class definition](https://github.com/CommE2E/comm/blob/097020a6acb44f45b8ecd692b37c57a1ab32b2bf/native/cpp/CommonCpp/DatabaseManagers/CommQueryExecutor.h#L7) Depends on D8544 Test Plan: `flow` Reviewers: michal, tomek Reviewed By: michal Subscribers: ashoat Differential Revision: https://phab.comm.dev/D8545
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// @flow | ||
|
||
declare export class CommQueryExecutor { | ||
static testDBOperation: () => string; | ||
} | ||
|
||
export type CommQueryExecutorType = typeof CommQueryExecutor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// @flow | ||
|
||
import type { CommQueryExecutorType } from './comm-query-executor.js'; | ||
import type { FS } from './file-system.js'; | ||
|
||
interface WebAssembly$Module {} | ||
|
||
type Emscripten$EnvironmentType = 'WEB' | 'NODE' | 'SHELL' | 'WORKER'; | ||
|
||
type Emscripten$WebAssemblyImports = $ReadOnlyArray<{ | ||
+name: string, | ||
+kind: string, | ||
}>; | ||
|
||
type Emscripten$WebAssemblyExports = $ReadOnlyArray<{ | ||
+module: string, | ||
+name: string, | ||
+kind: string, | ||
}>; | ||
|
||
declare export class EmscriptenModule { | ||
print(str: string): void; | ||
printErr(str: string): void; | ||
arguments: string[]; | ||
environment: Emscripten$EnvironmentType; | ||
preInit: () => void | $ReadOnlyArray<() => void>; | ||
preRun: $ReadOnlyArray<() => void>; | ||
postRun: () => void | $ReadOnlyArray<() => void>; | ||
onAbort: { | ||
(what: mixed): void, | ||
}; | ||
onRuntimeInitialized: () => void; | ||
preinitializedWebGLContext: WebGLRenderingContext; | ||
noInitialRun: boolean; | ||
noExitRuntime: boolean; | ||
logReadFiles: boolean; | ||
filePackagePrefixURL: string; | ||
wasmBinary: ArrayBuffer; | ||
destroy(object: { +[key: string]: mixed }): void; | ||
getPreloadedPackage( | ||
remotePackageName: string, | ||
remotePackageSize: number, | ||
): ArrayBuffer; | ||
instantiateWasm( | ||
imports: Emscripten$WebAssemblyImports, | ||
successCallback: (module: WebAssembly$Module) => void, | ||
): Emscripten$WebAssemblyExports; | ||
locateFile(url: string, scriptDirectory?: string): string; | ||
onCustomMessage(event: MessageEvent): void; | ||
HEAP: Int32Array; | ||
IHEAP: Int32Array; | ||
FHEAP: Float64Array; | ||
HEAP8: Int8Array; | ||
HEAP16: Int16Array; | ||
HEAP32: Int32Array; | ||
HEAPU8: Uint8Array; | ||
HEAPU16: Uint16Array; | ||
HEAPU32: Uint32Array; | ||
HEAPF32: Float32Array; | ||
HEAPF64: Float64Array; | ||
TOTAL_STACK: number; | ||
TOTAL_MEMORY: number; | ||
FAST_MEMORY: number; | ||
_malloc(size: number): number; | ||
_free(ptr: number): void; | ||
|
||
FS: FS; | ||
|
||
CommQueryExecutor: CommQueryExecutorType; | ||
} |