@await-widget/runtime 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +54 -0
- package/ambient.d.ts +203 -0
- package/global.d.ts +1 -0
- package/index.d.ts +7 -0
- package/jsx-runtime.d.ts +1 -0
- package/package.json +63 -0
- package/runtime/await.d.ts +192 -0
- package/runtime/bridge.d.ts +187 -0
- package/runtime/jsx-runtime.d.ts +1 -0
- package/types/global.d.ts +281 -0
- package/types/jsx.d.ts +4 -0
- package/types/prop.d.ts +569 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Await Widget contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Await Widget Types
|
|
2
|
+
|
|
3
|
+
TypeScript declarations for Await widgets.
|
|
4
|
+
|
|
5
|
+
This package replaces the local `paths` setup used by widget templates. It provides:
|
|
6
|
+
|
|
7
|
+
- the `await` module for components such as `Text`, `Image`, `VStack`, and `Button`
|
|
8
|
+
- the `await/jsx-runtime` module for `jsxImportSource`
|
|
9
|
+
- global Await bridge APIs such as `Await`, `AwaitStore`, and `AwaitNetwork`
|
|
10
|
+
- the Await JSX constraints, including no native HTML intrinsic elements
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npm install -D @await-widget/runtime
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## tsconfig
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"compilerOptions": {
|
|
23
|
+
"jsx": "react-jsx",
|
|
24
|
+
"jsxImportSource": "await",
|
|
25
|
+
"types": ["@await-widget/runtime"]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
After that, widget source can keep importing components from `await`:
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import { Text, VStack } from "await";
|
|
34
|
+
|
|
35
|
+
function widget() {
|
|
36
|
+
return (
|
|
37
|
+
<VStack>
|
|
38
|
+
<Text value="Hello, Await" />
|
|
39
|
+
</VStack>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
Await.define({
|
|
44
|
+
widget,
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Why `types` Is Still Needed
|
|
49
|
+
|
|
50
|
+
Ordinary npm packages are not automatically loaded as global type packages. TypeScript only auto-loads packages under `node_modules/@types/*`, unless the project restricts `compilerOptions.types`.
|
|
51
|
+
|
|
52
|
+
This package keeps the real module name as `await` while publishing under `@await-widget/runtime`, so projects should add `"types": ["@await-widget/runtime"]`.
|
|
53
|
+
|
|
54
|
+
If this is later published as a true `@types/await` package, the global declarations can be auto-loaded in projects that do not override `compilerOptions.types`. `jsxImportSource` still has to be configured as `await`.
|
package/ambient.d.ts
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/// <reference path="./types/global.d.ts" />
|
|
2
|
+
/// <reference path="./types/prop.d.ts" />
|
|
3
|
+
/// <reference path="./types/jsx.d.ts" />
|
|
4
|
+
/// <reference path="./runtime/bridge.d.ts" />
|
|
5
|
+
|
|
6
|
+
declare module "await" {
|
|
7
|
+
export const Fragment: ({
|
|
8
|
+
children,
|
|
9
|
+
}: {
|
|
10
|
+
children: NativeView;
|
|
11
|
+
}) => NativeView;
|
|
12
|
+
export const jsx: (
|
|
13
|
+
create: (props: Props) => NativeView,
|
|
14
|
+
props: Props,
|
|
15
|
+
) => NativeView;
|
|
16
|
+
export function VStack(
|
|
17
|
+
props: VStackValue &
|
|
18
|
+
ID &
|
|
19
|
+
Mods & {
|
|
20
|
+
children?: NativeView;
|
|
21
|
+
},
|
|
22
|
+
): NativeView;
|
|
23
|
+
export function HStack(
|
|
24
|
+
props: HStackValue &
|
|
25
|
+
ID &
|
|
26
|
+
Mods & {
|
|
27
|
+
children?: NativeView;
|
|
28
|
+
},
|
|
29
|
+
): NativeView;
|
|
30
|
+
export function ZStack(
|
|
31
|
+
props: ZStackValue &
|
|
32
|
+
ID &
|
|
33
|
+
Mods & {
|
|
34
|
+
children?: NativeView;
|
|
35
|
+
},
|
|
36
|
+
): NativeView;
|
|
37
|
+
export function Link(
|
|
38
|
+
props: LinkValue &
|
|
39
|
+
ID &
|
|
40
|
+
Mods & {
|
|
41
|
+
children?: NativeView;
|
|
42
|
+
},
|
|
43
|
+
): NativeView;
|
|
44
|
+
export function Button(
|
|
45
|
+
props: ButtonValue &
|
|
46
|
+
ID &
|
|
47
|
+
Mods & {
|
|
48
|
+
children?: NativeView;
|
|
49
|
+
},
|
|
50
|
+
): NativeView;
|
|
51
|
+
export function Color(
|
|
52
|
+
props: ColorValue &
|
|
53
|
+
ID &
|
|
54
|
+
Mods & {
|
|
55
|
+
children?: never;
|
|
56
|
+
},
|
|
57
|
+
): NativeView;
|
|
58
|
+
export function Text(
|
|
59
|
+
props: TextValue &
|
|
60
|
+
ID &
|
|
61
|
+
Mods & {
|
|
62
|
+
children?: NativeView;
|
|
63
|
+
},
|
|
64
|
+
): NativeView;
|
|
65
|
+
export function Time(
|
|
66
|
+
props: TimeValue &
|
|
67
|
+
ID &
|
|
68
|
+
Mods & {
|
|
69
|
+
children?: never;
|
|
70
|
+
},
|
|
71
|
+
): NativeView;
|
|
72
|
+
export function Image(
|
|
73
|
+
props: ImageValue &
|
|
74
|
+
ID &
|
|
75
|
+
Mods & {
|
|
76
|
+
children?: never;
|
|
77
|
+
},
|
|
78
|
+
): NativeView;
|
|
79
|
+
export function Icon(
|
|
80
|
+
props: IconValue &
|
|
81
|
+
ID &
|
|
82
|
+
Mods & {
|
|
83
|
+
children?: never;
|
|
84
|
+
},
|
|
85
|
+
): NativeView;
|
|
86
|
+
export function Svg(
|
|
87
|
+
props: SvgValue &
|
|
88
|
+
ID &
|
|
89
|
+
Mods & {
|
|
90
|
+
children?: never;
|
|
91
|
+
},
|
|
92
|
+
): NativeView;
|
|
93
|
+
export function RoundedRectangle(
|
|
94
|
+
props: RoundedRectangleValue &
|
|
95
|
+
ShapeValue &
|
|
96
|
+
ID &
|
|
97
|
+
Mods & {
|
|
98
|
+
children?: never;
|
|
99
|
+
},
|
|
100
|
+
): NativeView;
|
|
101
|
+
export function UnevenRoundedRectangle(
|
|
102
|
+
props: UnevenRoundedRectangleValue &
|
|
103
|
+
ShapeValue &
|
|
104
|
+
ID &
|
|
105
|
+
Mods & {
|
|
106
|
+
children?: never;
|
|
107
|
+
},
|
|
108
|
+
): NativeView;
|
|
109
|
+
export function Rectangle(
|
|
110
|
+
props: ShapeValue &
|
|
111
|
+
ID &
|
|
112
|
+
Mods & {
|
|
113
|
+
children?: never;
|
|
114
|
+
},
|
|
115
|
+
): NativeView;
|
|
116
|
+
export function Sector(
|
|
117
|
+
props: SectorValue &
|
|
118
|
+
ShapeValue &
|
|
119
|
+
ID &
|
|
120
|
+
Mods & {
|
|
121
|
+
children?: never;
|
|
122
|
+
},
|
|
123
|
+
): NativeView;
|
|
124
|
+
export function Ellipse(
|
|
125
|
+
props: ShapeValue &
|
|
126
|
+
ID &
|
|
127
|
+
Mods & {
|
|
128
|
+
children?: never;
|
|
129
|
+
},
|
|
130
|
+
): NativeView;
|
|
131
|
+
export function Circle(
|
|
132
|
+
props: ShapeValue &
|
|
133
|
+
ID &
|
|
134
|
+
Mods & {
|
|
135
|
+
children?: never;
|
|
136
|
+
},
|
|
137
|
+
): NativeView;
|
|
138
|
+
export function Polygon(
|
|
139
|
+
props: PolygonValue &
|
|
140
|
+
ShapeValue &
|
|
141
|
+
ID &
|
|
142
|
+
Mods & {
|
|
143
|
+
children?: never;
|
|
144
|
+
},
|
|
145
|
+
): NativeView;
|
|
146
|
+
export function Diamond(
|
|
147
|
+
props: ShapeValue &
|
|
148
|
+
ID &
|
|
149
|
+
Mods & {
|
|
150
|
+
children?: never;
|
|
151
|
+
},
|
|
152
|
+
): NativeView;
|
|
153
|
+
export function Capsule(
|
|
154
|
+
props: CapsuleValue &
|
|
155
|
+
ShapeValue &
|
|
156
|
+
ID &
|
|
157
|
+
Mods & {
|
|
158
|
+
children?: never;
|
|
159
|
+
},
|
|
160
|
+
): NativeView;
|
|
161
|
+
export function Spacer(
|
|
162
|
+
props: SpacerValue &
|
|
163
|
+
ID &
|
|
164
|
+
Mods & {
|
|
165
|
+
children?: never;
|
|
166
|
+
},
|
|
167
|
+
): NativeView;
|
|
168
|
+
export function Group(
|
|
169
|
+
props: ID &
|
|
170
|
+
Mods & {
|
|
171
|
+
children?: NativeView;
|
|
172
|
+
},
|
|
173
|
+
): NativeView;
|
|
174
|
+
export function Modifier(
|
|
175
|
+
props: ID &
|
|
176
|
+
Mods & {
|
|
177
|
+
children?: never;
|
|
178
|
+
},
|
|
179
|
+
): NativeView;
|
|
180
|
+
export function EmptyView(
|
|
181
|
+
props: ID &
|
|
182
|
+
Mods & {
|
|
183
|
+
children?: never;
|
|
184
|
+
},
|
|
185
|
+
): NativeView;
|
|
186
|
+
export function FullButton(
|
|
187
|
+
props: ButtonValue &
|
|
188
|
+
ID &
|
|
189
|
+
Mods & {
|
|
190
|
+
children?: never;
|
|
191
|
+
},
|
|
192
|
+
): NativeView;
|
|
193
|
+
export function Stamp(
|
|
194
|
+
props: ID &
|
|
195
|
+
Mods & {
|
|
196
|
+
children?: never;
|
|
197
|
+
},
|
|
198
|
+
): NativeView;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
declare module "await\/jsx-runtime" {
|
|
202
|
+
export { Fragment, jsx, jsx as jsxs } from "await";
|
|
203
|
+
}
|
package/global.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference path="./index.d.ts" />
|
package/index.d.ts
ADDED
package/jsx-runtime.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Fragment, jsx, jsx as jsxs } from "./runtime/await.js";
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@await-widget/runtime",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "TypeScript declarations for Await widgets.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "LitoMore",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"files": [
|
|
9
|
+
"runtime",
|
|
10
|
+
"types",
|
|
11
|
+
"ambient.d.ts",
|
|
12
|
+
"index.d.ts",
|
|
13
|
+
"global.d.ts",
|
|
14
|
+
"jsx-runtime.d.ts"
|
|
15
|
+
],
|
|
16
|
+
"types": "./index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./index.d.ts"
|
|
20
|
+
},
|
|
21
|
+
"./global": {
|
|
22
|
+
"types": "./global.d.ts"
|
|
23
|
+
},
|
|
24
|
+
"./jsx-runtime": {
|
|
25
|
+
"types": "./jsx-runtime.d.ts"
|
|
26
|
+
},
|
|
27
|
+
"./runtime/await": {
|
|
28
|
+
"types": "./runtime/await.d.ts"
|
|
29
|
+
},
|
|
30
|
+
"./runtime/bridge": {
|
|
31
|
+
"types": "./runtime/bridge.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./types/global": {
|
|
34
|
+
"types": "./types/global.d.ts"
|
|
35
|
+
},
|
|
36
|
+
"./types/prop": {
|
|
37
|
+
"types": "./types/prop.d.ts"
|
|
38
|
+
},
|
|
39
|
+
"./types/jsx": {
|
|
40
|
+
"types": "./types/jsx.d.ts"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"typesVersions": {
|
|
44
|
+
"*": {
|
|
45
|
+
"global": [
|
|
46
|
+
"global.d.ts"
|
|
47
|
+
],
|
|
48
|
+
"jsx-runtime": [
|
|
49
|
+
"jsx-runtime.d.ts"
|
|
50
|
+
],
|
|
51
|
+
"*": [
|
|
52
|
+
"index.d.ts"
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"test": "tsc --noEmit -p test/tsconfig.json",
|
|
58
|
+
"pack:dry": "npm --cache .npm-cache pack --dry-run"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"typescript": "^6.0.2"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
export declare const Fragment: ({
|
|
2
|
+
children,
|
|
3
|
+
}: {
|
|
4
|
+
children: NativeView;
|
|
5
|
+
}) => NativeView;
|
|
6
|
+
export declare const jsx: (
|
|
7
|
+
create: (props: Props) => NativeView,
|
|
8
|
+
props: Props,
|
|
9
|
+
) => NativeView;
|
|
10
|
+
export declare function VStack(
|
|
11
|
+
props: VStackValue &
|
|
12
|
+
ID &
|
|
13
|
+
Mods & {
|
|
14
|
+
children?: NativeView;
|
|
15
|
+
},
|
|
16
|
+
): NativeView;
|
|
17
|
+
export declare function HStack(
|
|
18
|
+
props: HStackValue &
|
|
19
|
+
ID &
|
|
20
|
+
Mods & {
|
|
21
|
+
children?: NativeView;
|
|
22
|
+
},
|
|
23
|
+
): NativeView;
|
|
24
|
+
export declare function ZStack(
|
|
25
|
+
props: ZStackValue &
|
|
26
|
+
ID &
|
|
27
|
+
Mods & {
|
|
28
|
+
children?: NativeView;
|
|
29
|
+
},
|
|
30
|
+
): NativeView;
|
|
31
|
+
export declare function Link(
|
|
32
|
+
props: LinkValue &
|
|
33
|
+
ID &
|
|
34
|
+
Mods & {
|
|
35
|
+
children?: NativeView;
|
|
36
|
+
},
|
|
37
|
+
): NativeView;
|
|
38
|
+
export declare function Button(
|
|
39
|
+
props: ButtonValue &
|
|
40
|
+
ID &
|
|
41
|
+
Mods & {
|
|
42
|
+
children?: NativeView;
|
|
43
|
+
},
|
|
44
|
+
): NativeView;
|
|
45
|
+
export declare function Color(
|
|
46
|
+
props: ColorValue &
|
|
47
|
+
ID &
|
|
48
|
+
Mods & {
|
|
49
|
+
children?: never;
|
|
50
|
+
},
|
|
51
|
+
): NativeView;
|
|
52
|
+
export declare function Text(
|
|
53
|
+
props: TextValue &
|
|
54
|
+
ID &
|
|
55
|
+
Mods & {
|
|
56
|
+
children?: NativeView;
|
|
57
|
+
},
|
|
58
|
+
): NativeView;
|
|
59
|
+
export declare function Time(
|
|
60
|
+
props: TimeValue &
|
|
61
|
+
ID &
|
|
62
|
+
Mods & {
|
|
63
|
+
children?: never;
|
|
64
|
+
},
|
|
65
|
+
): NativeView;
|
|
66
|
+
export declare function Image(
|
|
67
|
+
props: ImageValue &
|
|
68
|
+
ID &
|
|
69
|
+
Mods & {
|
|
70
|
+
children?: never;
|
|
71
|
+
},
|
|
72
|
+
): NativeView;
|
|
73
|
+
export declare function Icon(
|
|
74
|
+
props: IconValue &
|
|
75
|
+
ID &
|
|
76
|
+
Mods & {
|
|
77
|
+
children?: never;
|
|
78
|
+
},
|
|
79
|
+
): NativeView;
|
|
80
|
+
export declare function Svg(
|
|
81
|
+
props: SvgValue &
|
|
82
|
+
ID &
|
|
83
|
+
Mods & {
|
|
84
|
+
children?: never;
|
|
85
|
+
},
|
|
86
|
+
): NativeView;
|
|
87
|
+
export declare function RoundedRectangle(
|
|
88
|
+
props: RoundedRectangleValue &
|
|
89
|
+
ShapeValue &
|
|
90
|
+
ID &
|
|
91
|
+
Mods & {
|
|
92
|
+
children?: never;
|
|
93
|
+
},
|
|
94
|
+
): NativeView;
|
|
95
|
+
export declare function UnevenRoundedRectangle(
|
|
96
|
+
props: UnevenRoundedRectangleValue &
|
|
97
|
+
ShapeValue &
|
|
98
|
+
ID &
|
|
99
|
+
Mods & {
|
|
100
|
+
children?: never;
|
|
101
|
+
},
|
|
102
|
+
): NativeView;
|
|
103
|
+
export declare function Rectangle(
|
|
104
|
+
props: ShapeValue &
|
|
105
|
+
ID &
|
|
106
|
+
Mods & {
|
|
107
|
+
children?: never;
|
|
108
|
+
},
|
|
109
|
+
): NativeView;
|
|
110
|
+
export declare function Sector(
|
|
111
|
+
props: SectorValue &
|
|
112
|
+
ShapeValue &
|
|
113
|
+
ID &
|
|
114
|
+
Mods & {
|
|
115
|
+
children?: never;
|
|
116
|
+
},
|
|
117
|
+
): NativeView;
|
|
118
|
+
export declare function Ellipse(
|
|
119
|
+
props: ShapeValue &
|
|
120
|
+
ID &
|
|
121
|
+
Mods & {
|
|
122
|
+
children?: never;
|
|
123
|
+
},
|
|
124
|
+
): NativeView;
|
|
125
|
+
export declare function Circle(
|
|
126
|
+
props: ShapeValue &
|
|
127
|
+
ID &
|
|
128
|
+
Mods & {
|
|
129
|
+
children?: never;
|
|
130
|
+
},
|
|
131
|
+
): NativeView;
|
|
132
|
+
export declare function Polygon(
|
|
133
|
+
props: PolygonValue &
|
|
134
|
+
ShapeValue &
|
|
135
|
+
ID &
|
|
136
|
+
Mods & {
|
|
137
|
+
children?: never;
|
|
138
|
+
},
|
|
139
|
+
): NativeView;
|
|
140
|
+
export declare function Diamond(
|
|
141
|
+
props: ShapeValue &
|
|
142
|
+
ID &
|
|
143
|
+
Mods & {
|
|
144
|
+
children?: never;
|
|
145
|
+
},
|
|
146
|
+
): NativeView;
|
|
147
|
+
export declare function Capsule(
|
|
148
|
+
props: CapsuleValue &
|
|
149
|
+
ShapeValue &
|
|
150
|
+
ID &
|
|
151
|
+
Mods & {
|
|
152
|
+
children?: never;
|
|
153
|
+
},
|
|
154
|
+
): NativeView;
|
|
155
|
+
export declare function Spacer(
|
|
156
|
+
props: SpacerValue &
|
|
157
|
+
ID &
|
|
158
|
+
Mods & {
|
|
159
|
+
children?: never;
|
|
160
|
+
},
|
|
161
|
+
): NativeView;
|
|
162
|
+
export declare function Group(
|
|
163
|
+
props: ID &
|
|
164
|
+
Mods & {
|
|
165
|
+
children?: NativeView;
|
|
166
|
+
},
|
|
167
|
+
): NativeView;
|
|
168
|
+
export declare function Modifier(
|
|
169
|
+
props: ID &
|
|
170
|
+
Mods & {
|
|
171
|
+
children?: never;
|
|
172
|
+
},
|
|
173
|
+
): NativeView;
|
|
174
|
+
export declare function EmptyView(
|
|
175
|
+
props: ID &
|
|
176
|
+
Mods & {
|
|
177
|
+
children?: never;
|
|
178
|
+
},
|
|
179
|
+
): NativeView;
|
|
180
|
+
export declare function FullButton(
|
|
181
|
+
props: ButtonValue &
|
|
182
|
+
ID &
|
|
183
|
+
Mods & {
|
|
184
|
+
children?: never;
|
|
185
|
+
},
|
|
186
|
+
): NativeView;
|
|
187
|
+
export declare function Stamp(
|
|
188
|
+
props: ID &
|
|
189
|
+
Mods & {
|
|
190
|
+
children?: never;
|
|
191
|
+
},
|
|
192
|
+
): NativeView;
|