@await-widget/runtime 0.0.6 → 0.0.8

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/types/bridge.d.ts CHANGED
@@ -1,158 +1,158 @@
1
1
  type AwaitNetworkResponse = {
2
- code: number;
3
- data: string;
2
+ code: number;
3
+ data: string;
4
4
  };
5
5
  export declare function setTimeout(
6
- callback: (...args: unknown[]) => void,
7
- ms: number,
6
+ callback: (...args: unknown[]) => void,
7
+ ms: number,
8
8
  ): unknown;
9
9
  export declare function clearTimeout(timerID: unknown): void;
10
10
  export declare function setInterval(
11
- callback: (...args: unknown[]) => void,
12
- ms: number,
11
+ callback: (...args: unknown[]) => void,
12
+ ms: number,
13
13
  ): unknown;
14
14
  export declare function sleep(ms: number): Promise<void>;
15
15
  export declare function clearInterval(timerID: unknown): void;
16
16
  export declare function print(...args: unknown[]): void;
17
17
  export declare const console: {
18
- log(...args: unknown[]): void;
18
+ log(...args: unknown[]): void;
19
19
  };
20
20
  export declare const AwaitClipboard: {
21
- set(value: string): void;
21
+ set(value: string): void;
22
22
  };
23
23
  type AwaitNetworkConfig = {
24
- method?: string;
25
- headers?: Record<string, string>;
26
- body?: Encodable;
24
+ method?: string;
25
+ headers?: Record<string, string>;
26
+ body?: Encodable;
27
27
  };
28
28
  type AwaitFoufouConfig = {
29
- method?: string;
30
- image?: string;
31
- oauthToken?: string;
32
- oauthTokenSecret?: string;
33
- consumerKey?: string;
34
- consumerSecret?: string;
35
- username?: string;
36
- password?: string;
37
- parameters?: Record<string, string | number | boolean>;
29
+ method?: string;
30
+ image?: string;
31
+ oauthToken?: string;
32
+ oauthTokenSecret?: string;
33
+ consumerKey?: string;
34
+ consumerSecret?: string;
35
+ username?: string;
36
+ password?: string;
37
+ parameters?: Record<string, string | number | boolean>;
38
38
  };
39
39
  export declare const AwaitNetwork: {
40
- request(
41
- urlString: string,
42
- config?: AwaitNetworkConfig,
43
- ): Promise<AwaitNetworkResponse>;
44
- fanfou(urlString: string, config?: AwaitFoufouConfig): Promise<unknown>;
40
+ request(
41
+ urlString: string,
42
+ config?: AwaitNetworkConfig,
43
+ ): Promise<AwaitNetworkResponse>;
44
+ fanfou(urlString: string, config?: AwaitFoufouConfig): Promise<unknown>;
45
45
  };
46
46
  export declare const AwaitWeather: {
47
- get(config?: AwaitWeatherConfig): Promise<AwaitWeatherResult | undefined>;
47
+ get(config?: AwaitWeatherConfig): Promise<AwaitWeatherResult | undefined>;
48
48
  };
49
49
  export declare const AwaitHealth: {
50
- get(): Promise<AwaitHealthInfo | undefined>;
50
+ get(): Promise<AwaitHealthInfo | undefined>;
51
51
  };
52
52
  export declare const AwaitLocation: {
53
- get(config?: AwaitLocationConfig): Promise<AwaitLocationInfo | undefined>;
53
+ get(config?: AwaitLocationConfig): Promise<AwaitLocationInfo | undefined>;
54
54
  };
55
55
  export declare const AwaitCalendar: {
56
- get(config?: AwaitCalendarConfig): Promise<AwaitCalendarItem[] | undefined>;
56
+ get(config?: AwaitCalendarConfig): Promise<AwaitCalendarItem[] | undefined>;
57
57
  };
58
58
  export declare const AwaitReminder: {
59
- get(config?: AwaitReminderConfig): Promise<AwaitReminderItem[] | undefined>;
59
+ get(config?: AwaitReminderConfig): Promise<AwaitReminderItem[] | undefined>;
60
60
  };
61
61
  export declare const AwaitSystem: {
62
- get(): AwaitSystemInfo;
62
+ get(): AwaitSystemInfo;
63
63
  };
64
64
  export declare const AwaitAlarm: {
65
- schedule(config: AwaitAlarmScheduleConfig): Promise<string>;
66
- cancel(id: string): any;
65
+ schedule(config: AwaitAlarmScheduleConfig): Promise<string>;
66
+ cancel(id: string): any;
67
67
  };
68
68
  export declare const AwaitMedia: {
69
- nowPlayingMedia(config?: AwaitNowPlayingConfig): Promise<AwaitNowPlayingInfo>;
70
- mediaPlayerCommand(
71
- command: AwaitMusicPlayerCommand,
72
- config?: AwaitMediaPlayConfig,
73
- ): Promise<void>;
69
+ nowPlayingMedia(config?: AwaitNowPlayingConfig): Promise<AwaitNowPlayingInfo>;
70
+ mediaPlayerCommand(
71
+ command: AwaitMusicPlayerCommand,
72
+ config?: AwaitMediaPlayConfig,
73
+ ): Promise<void>;
74
74
  };
75
75
  export declare const AwaitStore: {
76
- get<T>(key: string): T | undefined;
77
- num(key: string, defaultValue?: number): number;
78
- bool(key: string, defaultValue?: boolean): boolean;
79
- string(key: string, defaultValue?: string): string;
80
- array<T>(key: string, defaultValue?: T[]): T[];
81
- delete(key: string): void;
82
- set(key: string, value: Encodable): void;
76
+ get<T>(key: string): T | undefined;
77
+ num(key: string, defaultValue?: number): number;
78
+ bool(key: string, defaultValue?: boolean): boolean;
79
+ string(key: string, defaultValue?: string): string;
80
+ array<T>(key: string, defaultValue?: T[]): T[];
81
+ delete(key: string): void;
82
+ set(key: string, value: Encodable): void;
83
83
  };
84
84
  export declare const AwaitFile: {
85
- files(path: string): string[];
86
- readJSON(path: string): unknown;
87
- readText(path: string): string | undefined;
88
- fileSize(path: string): number | undefined;
89
- readTextByPage(
90
- path: string,
91
- page: number,
92
- pageSize: number,
93
- ): string | undefined;
94
- readTextByPages(
95
- path: string,
96
- pages: number[],
97
- pageSize: number,
98
- ): Array<string | undefined>;
99
- saveUIRenderImage(path: string, value: NativeView): void;
85
+ files(path: string): string[];
86
+ readJSON(path: string): unknown;
87
+ readText(path: string): string | undefined;
88
+ fileSize(path: string): number | undefined;
89
+ readTextByPage(
90
+ path: string,
91
+ page: number,
92
+ pageSize: number,
93
+ ): string | undefined;
94
+ readTextByPages(
95
+ path: string,
96
+ pages: number[],
97
+ pageSize: number,
98
+ ): Array<string | undefined>;
99
+ saveUIRenderImage(path: string, value: NativeView): void;
100
100
  };
101
101
  export declare const AwaitAudio: {
102
- readonly isPlayingNote: boolean;
103
- setAudioSession(active: boolean, option?: AudioOption): void;
104
- reinstallInstruments(): void;
105
- playAudio(url: string, config?: AudioConfig): void;
106
- pauseAudio(): void;
107
- playMidi(url: string, config?: AudioConfig): void;
108
- stopMidi(): void;
109
- replayMidi(config?: AudioConfig): void;
110
- recordMidi(): void;
111
- buildSoundFont(config: SoundFontBuildConfig): Promise<SoundFontBuildResult>;
112
- compressSoundFont(
113
- config: SoundFontCompressConfig,
114
- ): Promise<SoundFontBuildResult>;
115
- playNote(notes: number[] | number, config?: AudioConfig): void;
102
+ readonly isPlayingNote: boolean;
103
+ setAudioSession(active: boolean, option?: AudioOption): void;
104
+ reinstallInstruments(): void;
105
+ playAudio(url: string, config?: AudioConfig): void;
106
+ pauseAudio(): void;
107
+ playMidi(url: string, config?: AudioConfig): void;
108
+ stopMidi(): void;
109
+ replayMidi(config?: AudioConfig): void;
110
+ recordMidi(): void;
111
+ buildSoundFont(config: SoundFontBuildConfig): Promise<SoundFontBuildResult>;
112
+ compressSoundFont(
113
+ config: SoundFontCompressConfig,
114
+ ): Promise<SoundFontBuildResult>;
115
+ playNote(notes: number[] | number, config?: AudioConfig): void;
116
116
  };
117
117
  export declare const AwaitUI: {
118
- readonly displayScale: number;
119
- haptic(type: string): void;
118
+ readonly displayScale: number;
119
+ haptic(type: string): void;
120
120
  };
121
121
  type AwaitDefineConfig<Intents, T extends Record<string, unknown>> = {
122
- widget: (entry: WidgetEntry<T>) => NativeView;
123
- widgetTimeline?: (
124
- context: TimelineContext,
125
- ) => Timeline<T> | Promise<Timeline<T>>;
126
- widgetIntents?: {
127
- [IntentKey in keyof Intents]: Intents[IntentKey] extends (
128
- ...args: infer IntentArguments
129
- ) => void
130
- ? IntentArguments extends Encodable[]
131
- ? Intents[IntentKey]
132
- : never
133
- : never;
134
- };
122
+ widget: (entry: WidgetEntry<T>) => NativeView;
123
+ widgetTimeline?: (
124
+ context: TimelineContext,
125
+ ) => Timeline<T> | Promise<Timeline<T>>;
126
+ widgetIntents?: {
127
+ [IntentKey in keyof Intents]: Intents[IntentKey] extends (
128
+ ...args: infer IntentArguments
129
+ ) => void
130
+ ? IntentArguments extends Encodable[]
131
+ ? Intents[IntentKey]
132
+ : never
133
+ : never;
134
+ };
135
135
  };
136
136
  type AwaitDefineResult<Intents> = {
137
- [IntentKey in keyof Intents]: Intents[IntentKey] extends (
138
- ...args: infer IntentArguments
139
- ) => void
140
- ? (...args: IntentArguments) => IntentInfo
141
- : never;
137
+ [IntentKey in keyof Intents]: Intents[IntentKey] extends (
138
+ ...args: infer IntentArguments
139
+ ) => void
140
+ ? (...args: IntentArguments) => IntentInfo
141
+ : never;
142
142
  };
143
143
  export declare const Await: {
144
- define<Intents, T extends Record<string, unknown>>(
145
- config: AwaitDefineConfig<Intents, T>,
146
- ): AwaitDefineResult<Intents>;
144
+ define<Intents, T extends Record<string, unknown>>(
145
+ config: AwaitDefineConfig<Intents, T>,
146
+ ): AwaitDefineResult<Intents>;
147
147
  };
148
148
  export declare const AwaitLaunch: {
149
- start(bundleId: string): any;
149
+ start(bundleId: string): any;
150
150
  };
151
151
  export declare const AwaitEnv: {
152
- readonly id: string;
153
- readonly tag: number;
154
- readonly host: "app" | "widget";
155
- test(...args: unknown[]): unknown;
152
+ readonly id: string;
153
+ readonly tag: number;
154
+ readonly host: 'app' | 'widget';
155
+ test(...args: unknown[]): unknown;
156
156
  };
157
157
  type AwaitGlobal = typeof Await;
158
158
  type AwaitEnvGlobal = typeof AwaitEnv;
@@ -173,24 +173,24 @@ type AwaitFileGlobal = typeof AwaitFile;
173
173
  type AwaitAudioGlobal = typeof AwaitAudio;
174
174
  type SleepGlobal = typeof sleep;
175
175
  declare global {
176
- const Await: AwaitGlobal;
177
- const AwaitEnv: AwaitEnvGlobal;
178
- const AwaitLaunch: AwaitLaunchGlobal;
179
- const AwaitUI: AwaitUIGlobal;
180
- const AwaitClipboard: AwaitClipboardGlobal;
181
- const AwaitNetwork: AwaitNetworkGlobal;
182
- const AwaitWeather: AwaitWeatherGlobal;
183
- const AwaitHealth: AwaitHealthGlobal;
184
- const AwaitLocation: AwaitLocationGlobal;
185
- const AwaitCalendar: AwaitCalendarGlobal;
186
- const AwaitReminder: AwaitReminderGlobal;
187
- const AwaitSystem: AwaitSystemGlobal;
188
- const AwaitAlarm: AwaitAlarmGlobal;
189
- const AwaitMedia: AwaitMediaGlobal;
190
- const AwaitStore: AwaitStoreGlobal;
191
- const AwaitFile: AwaitFileGlobal;
192
- const AwaitAudio: AwaitAudioGlobal;
193
- function print(...args: unknown[]): void;
194
- const sleep: SleepGlobal;
176
+ const Await: AwaitGlobal;
177
+ const AwaitEnv: AwaitEnvGlobal;
178
+ const AwaitLaunch: AwaitLaunchGlobal;
179
+ const AwaitUI: AwaitUIGlobal;
180
+ const AwaitClipboard: AwaitClipboardGlobal;
181
+ const AwaitNetwork: AwaitNetworkGlobal;
182
+ const AwaitWeather: AwaitWeatherGlobal;
183
+ const AwaitHealth: AwaitHealthGlobal;
184
+ const AwaitLocation: AwaitLocationGlobal;
185
+ const AwaitCalendar: AwaitCalendarGlobal;
186
+ const AwaitReminder: AwaitReminderGlobal;
187
+ const AwaitSystem: AwaitSystemGlobal;
188
+ const AwaitAlarm: AwaitAlarmGlobal;
189
+ const AwaitMedia: AwaitMediaGlobal;
190
+ const AwaitStore: AwaitStoreGlobal;
191
+ const AwaitFile: AwaitFileGlobal;
192
+ const AwaitAudio: AwaitAudioGlobal;
193
+ function print(...args: unknown[]): void;
194
+ const sleep: SleepGlobal;
195
195
  }
196
196
  export {};
package/types/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- /// <reference path="./global.d.ts" />
1
+ /// <reference path="./model.d.ts" />
2
+ /// <reference path="./meta.d.ts" />
2
3
  /// <reference path="./prop.d.ts" />
3
4
  /// <reference path="./jsx.d.ts" />
4
- /// <reference path="./meta.d.ts" />
5
5
  /// <reference path="./bridge.d.ts" />
6
6
  /// <reference path="./await.d.ts" />
package/types/jsx.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  declare namespace JSX {
2
- type Element = NativeView;
3
- type IntrinsicElements = never;
2
+ type Element = NativeView;
3
+ type IntrinsicElements = never;
4
4
  }