/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow strict-local * @format */ // See https://github.com/facebook/hermes/blob/master/tools/emhermesc/emhermesc.cpp declare function cwrap( 'hermesCompileToBytecode', string, Array, ): (number, number, string, number, number) => Buffer; declare function cwrap( 'hermesCompileResult_getError', string, Array, ): Buffer => ?Error; declare function cwrap( 'hermesCompileResult_getBytecodeAddr', string, Array, ): Buffer => number; declare function cwrap( 'hermesCompileResult_getBytecodeSize', string, Array, ): Buffer => number; declare function cwrap( 'hermesCompileResult_free', string, Array, ): Buffer => void; declare function ccall( 'hermesGetProperties', string, Array, Array, ): string; type HermescInterface = { cwrap: typeof cwrap, ccall: typeof ccall, _malloc: number => number, HEAP8: Buffer, _free: number => void, }; declare function hermesc(options: { noInitialRun: boolean, noExitRuntime: boolean, print: () => void, printErr: () => void, }): HermescInterface; declare module.exports: typeof hermesc;