-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from Phala-Network/feat-run-phatjs
Using phatjs wasm in async runtime
- Loading branch information
Showing
9 changed files
with
691 additions
and
467 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 |
---|---|---|
|
@@ -9,3 +9,4 @@ | |
/tmp | ||
node_modules | ||
oclif.manifest.json | ||
.npmrc |
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
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
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,36 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
*/ | ||
export function start(): void; | ||
/** | ||
* Get the version of the runtime. | ||
* @returns {Promise<string>} | ||
*/ | ||
export function version(): Promise<string>; | ||
/** | ||
* Run a script. | ||
* | ||
* # Arguments | ||
* - `args` - a list of arguments to pass to the runtime, including the script name and arguments. | ||
* | ||
* # Example | ||
* | ||
* ```js | ||
* const result = await run(["phatjs", "-c", "console.log(scriptArgs)", "--", "Hello, world!"]); | ||
* console.log(result); | ||
* ``` | ||
* @param {(string)[]} args | ||
* @returns {Promise<any>} | ||
*/ | ||
export function run(args: (string)[]): Promise<any>; | ||
/** | ||
* Set a hook for the runtime. | ||
* | ||
* # Available hooks | ||
* - `fetch` - a function that takes a `Request` object and returns a `Response` object. | ||
* @param {string} hook_name | ||
* @param {any} hook_value | ||
*/ | ||
export function setHook(hook_name: string, hook_value: any): void; | ||
export function init(): void; |
Oops, something went wrong.