npm.io
0.0.26 • Published 21h agoCLI

@await-widget/runtime

Licence
MIT
Version
0.0.26
Deps
0
Size
58 kB
Vulns
0
Weekly
0
Stars
4

Await Widget Types

TypeScript declarations for Await widgets.

What's Included

This package replaces the local paths setup used by widget templates. It provides:

  • the await module for components such as Text, Image, VStack, and Button
  • the await/jsx-runtime module for jsxImportSource
  • global Await bridge APIs such as Await, AwaitStore, and AwaitNetwork
  • the Await JSX constraints, including no native HTML intrinsic elements

Install

npm install -D @await-widget/runtime

tsconfig

{
  "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