@await-widget/runtime
v0.0.6
Published
TypeScript declarations for Await widgets.
Readme
Await Widget Types
TypeScript declarations for Await widgets.
This package replaces the local paths setup used by widget templates. It provides:
- the
awaitmodule for components such asText,Image,VStack, andButton - the
await/jsx-runtimemodule forjsxImportSource - global Await bridge APIs such as
Await,AwaitStore, andAwaitNetwork - the Await JSX constraints, including no native HTML intrinsic elements
Install
npm install -D @await-widget/runtimetsconfig
{
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "await",
"types": ["@await-widget/runtime"]
}
}After that, widget source can keep importing components from await:
import { Text, VStack } from "await";
function widget() {
return (
<VStack>
<Text value="Hello, Await" />
</VStack>
);
}
Await.define({
widget,
});License
MIT
