0.1.0-alpha.1 • Published 3 months ago
@superfaceai/map-std v0.1.0-alpha.1
Website | Get Started | Documentation | GitHub Discussions | Twitter | Support
Superface OneSDK Map standard library
Types for development against the OneSDK map standard library.
Setup
To setup an environment for language support when developing tools:
npm install @superfaceai/map-std
To define a usecase define a new type in a TypeScript example.profile.ts
file:
/// <reference types="@superface/map-std" />
type Example = Usecase<{
safety: 'safe'
input: {
/** Id of the thing to fetch. */
id: AnyValue
}
result: { name: string }
error: { title: AnyValue, detail?: AnyValue }
}>;
Then develop a map with type support:
/// <reference types="@superface/map-std" />
/// <reference path="./example.profile.ts" />
// @ts-check
/** @type {Example} */
var Example = ({ input, parameters, services }) => {
return { name: "hardcoded example" }
}
For more examples see examples in OneSDK repository.
License
OneSDK is licensed under the MIT License.
© 2023 Superface s.r.o.