-
Notifications
You must be signed in to change notification settings - Fork 2
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 #120 from superfaceai/feat/typescript_profiles
feat: support TypeScript profiles
- Loading branch information
Showing
22 changed files
with
213 additions
and
170 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
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
/// <reference types="@superface/map-std" /> | ||
/// <reference path="./wasm-sdk.example.profile.ts" /> | ||
// @ts-check | ||
|
||
const manifest = { | ||
profile: 'wasm-sdk/[email protected]', | ||
provider: 'localhost' | ||
}; | ||
|
||
// var to hoist it like a function would be | ||
// can't be a function because then the type annotation doesn't work | ||
/** @type {Usecase<{ safety: 'safe', input: { id: AnyValue }, result: { url: AnyValue, method: AnyValue, query: AnyValue, headers: AnyValue }, error: { title: string, detail: string } }>} */ | ||
// var to hoist it like a function would be - can't be a function because then the type annotation doesn't work | ||
/** @type {Example} */ | ||
var Example = ({ input, parameters, services }) => { | ||
// @ts-ignore | ||
__ffi.unstable.printDebug('Input:', input); | ||
|
This file was deleted.
Oops, something went wrong.
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 @@ | ||
/// <reference types="@superface/map-std" /> | ||
type Example = Usecase<{ | ||
safety: 'safe' | ||
input: { id: AnyValue } | ||
result: { url: AnyValue, method: AnyValue, query: AnyValue, headers: AnyValue } | ||
error: { title: AnyValue, detail?: AnyValue } | ||
}>; |
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
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
export { App, AsyncMutex } from './app.js'; | ||
export { App } from './app.js'; | ||
export * from './error.js'; | ||
export { HandleMap } from './handle_map.js'; | ||
export type { FileSystem, Network, Persistence, TextCoder, Timers, WasiContext } from './interfaces.js'; | ||
export { SecurityValuesMap } from './security.js'; | ||
export * from './wasm.js'; | ||
export type { SecurityValuesMap } from './security.js'; | ||
export { HandleMap, AsyncMutex, corePathURL } from './lib/index.js'; |
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
Oops, something went wrong.