@await-widget/runtime 0.0.1 → 0.0.3

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/README.md CHANGED
@@ -45,10 +45,6 @@ Await.define({
45
45
  });
46
46
  ```
47
47
 
48
- ## Why `types` Is Still Needed
48
+ ## License
49
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`.
50
+ MIT
package/package.json CHANGED
@@ -1,56 +1,24 @@
1
1
  {
2
2
  "name": "@await-widget/runtime",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "TypeScript declarations for Await widgets.",
5
5
  "license": "MIT",
6
6
  "author": "LitoMore",
7
7
  "type": "module",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/await-widget/runtime.git"
11
+ },
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
8
15
  "files": [
9
- "runtime",
10
- "types",
11
- "ambient.d.ts",
12
- "index.d.ts",
13
- "global.d.ts",
14
- "jsx-runtime.d.ts"
16
+ "types/*.d.ts"
15
17
  ],
16
- "types": "./index.d.ts",
18
+ "types": "./types/index.d.ts",
17
19
  "exports": {
18
20
  ".": {
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
- ]
21
+ "types": "./types/index.d.ts"
54
22
  }
55
23
  },
56
24
  "scripts": {
@@ -1,14 +1,9 @@
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
-
1
+ /// <reference path="./global.d.ts" />
2
+ /// <reference path="./prop.d.ts" />
3
+ /// <reference path="./jsx.d.ts" />
4
+ /// <reference path="./bridge.d.ts" />
6
5
  declare module "await" {
7
- export const Fragment: ({
8
- children,
9
- }: {
10
- children: NativeView;
11
- }) => NativeView;
6
+ export const Fragment: ({ children }: { children: NativeView }) => NativeView;
12
7
  export const jsx: (
13
8
  create: (props: Props) => NativeView,
14
9
  props: Props,
@@ -198,6 +193,6 @@ declare module "await" {
198
193
  ): NativeView;
199
194
  }
200
195
 
201
- declare module "await\/jsx-runtime" {
196
+ declare module "await/jsx-runtime" {
202
197
  export { Fragment, jsx, jsx as jsxs } from "await";
203
198
  }
@@ -30,6 +30,10 @@ type AwaitFoufouConfig = {
30
30
  image?: string;
31
31
  oauthToken?: string;
32
32
  oauthTokenSecret?: string;
33
+ consumerKey?: string;
34
+ consumerSecret?: string;
35
+ username?: string;
36
+ password?: string;
33
37
  parameters?: Record<string, string | number | boolean>;
34
38
  };
35
39
  export declare const AwaitNetwork: {
@@ -0,0 +1,5 @@
1
+ /// <reference path="./global.d.ts" />
2
+ /// <reference path="./prop.d.ts" />
3
+ /// <reference path="./jsx.d.ts" />
4
+ /// <reference path="./bridge.d.ts" />
5
+ /// <reference path="./await.d.ts" />
package/types/prop.d.ts CHANGED
@@ -353,7 +353,7 @@ type LooseValues = {
353
353
  type Props = ID & Mods & LooseValues & { children?: NativeView };
354
354
  type ID = { id?: Encodable };
355
355
  type TextAlignment = "center" | "leading" | "trailing";
356
- type FontDesign = "monospaced" | "rounded" | "serif" | "default" | "";
356
+ type FontDesign = "monospaced" | "rounded" | "serif" | "default";
357
357
  type FontWeight =
358
358
  | "black"
359
359
  | 900
@@ -372,17 +372,10 @@ type FontWeight =
372
372
  | "ultraLight"
373
373
  | 100
374
374
  | "regular"
375
- | 400
376
- | "";
375
+ | 400;
377
376
 
378
377
  type Material = "regular" | "thin" | "thick" | "ultraThin" | "ultraThick";
379
- type FontWidth =
380
- | "compressed"
381
- | "condensed"
382
- | "standard"
383
- | "expanded"
384
- | ""
385
- | number;
378
+ type FontWidth = "compressed" | "condensed" | "standard" | "expanded" | number;
386
379
  type Interpolation = "none" | "low" | "medium" | "high";
387
380
  type Resizable = boolean | "stretch" | "tile";
388
381
 
@@ -391,24 +384,22 @@ type ScaleEffect =
391
384
  | { x?: number; y?: number; anchor?: UnitPoint }
392
385
  | { scale?: number; anchor?: UnitPoint }
393
386
  | number;
394
- type Font =
395
- | {
396
- name: string;
397
- size: number;
398
- wght?: number;
399
- wdth?: number;
400
- opsz?: number;
401
- slnt?: number;
402
- ital?: number;
403
-
404
- GRAD?: number;
405
- HGHT?: number;
406
- SOFT?: number;
407
-
408
- monospacedDigit?: boolean;
409
- features?: string[] | string;
410
- }
411
- | "";
387
+ type Font = {
388
+ name: string;
389
+ size: number;
390
+ wght?: number;
391
+ wdth?: number;
392
+ opsz?: number;
393
+ slnt?: number;
394
+ ital?: number;
395
+
396
+ GRAD?: number;
397
+ HGHT?: number;
398
+ SOFT?: number;
399
+
400
+ monospacedDigit?: boolean;
401
+ features?: string[] | string;
402
+ };
412
403
  type Rotation3DEffect = {
413
404
  angle: number;
414
405
  x?: number;
@@ -429,6 +420,7 @@ type Shadow = {
429
420
  y?: number;
430
421
  blur?: number;
431
422
  };
423
+ type Pattern = "dash" | "dashDot" | "dashDotDot" | "dot" | "solid";
432
424
  type BlendMode =
433
425
  | "normal"
434
426
  | "multiply"
@@ -498,11 +490,11 @@ type BaseMods = {
498
490
  disable?: boolean;
499
491
  drawingGroup?: boolean;
500
492
  fixedSize?: boolean | { horizontal?: boolean; vertical?: boolean };
501
- font?: Font;
502
- fontDesign?: FontDesign;
493
+ font?: Font | "";
494
+ fontDesign?: FontDesign | "";
503
495
  fontSize?: number;
504
- fontWeight?: FontWeight;
505
- fontWidth?: FontWidth;
496
+ fontWeight?: FontWeight | "";
497
+ fontWidth?: FontWidth | "";
506
498
  foreground?: ShapeStyle;
507
499
  frame?: Frame;
508
500
  geometryGroup?: boolean;
@@ -516,7 +508,7 @@ type BaseMods = {
516
508
  layoutPriority?: number;
517
509
  lineLimit?: number | "";
518
510
  lineSpacing?: number;
519
- lineHeight?: LineHeight;
511
+ lineHeight?: LineHeight | "";
520
512
  luminanceToAlpha?: boolean;
521
513
  mask?: NativeView;
522
514
  maxHeight?: Dimension | boolean;
@@ -543,15 +535,17 @@ type BaseMods = {
543
535
  scaleEffect?: ScaleEffect;
544
536
  shadow?: Shadow;
545
537
  sides?: number;
546
- strikethrough?: boolean;
538
+ strikethrough?: boolean | { isActive?: boolean; color?: Color };
547
539
  test?: unknown;
548
540
  textAlignment?: TextAlignment;
549
541
  tint?: ShapeStyle;
550
542
  tracking?: number;
551
- transform?: number[];
543
+ transform?: [number, number, number, number, number, number];
552
544
  transition?: Transition;
553
545
  truncationMode?: "head" | "middle" | "tail";
554
- underline?: boolean;
546
+ underline?:
547
+ | boolean
548
+ | { isActive?: boolean; pattern?: Pattern; color?: Color };
555
549
  width?: number;
556
550
  zIndex?: number;
557
551
  };
package/global.d.ts DELETED
@@ -1 +0,0 @@
1
- /// <reference path="./index.d.ts" />
package/index.d.ts DELETED
@@ -1,7 +0,0 @@
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
- /// <reference path="./ambient.d.ts" />
6
-
7
- export * from "./runtime/await.js";
package/jsx-runtime.d.ts DELETED
@@ -1 +0,0 @@
1
- export { Fragment, jsx, jsx as jsxs } from "./runtime/await.js";
@@ -1,192 +0,0 @@
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;
@@ -1 +0,0 @@
1
- export { jsx, jsx as jsxs, Fragment } from "await";