@await-widget/runtime 0.0.5 → 0.0.7
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/package.json +4 -2
- package/types/await.d.ts +200 -192
- package/types/bridge.d.ts +121 -121
- package/types/index.d.ts +2 -1
- package/types/jsx.d.ts +2 -2
- package/types/meta.d.ts +414 -0
- package/types/model.d.ts +274 -0
- package/types/prop.d.ts +183 -513
- package/types/global.d.ts +0 -282
package/types/bridge.d.ts
CHANGED
|
@@ -1,158 +1,158 @@
|
|
|
1
1
|
type AwaitNetworkResponse = {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
code: number;
|
|
3
|
+
data: string;
|
|
4
4
|
};
|
|
5
5
|
export declare function setTimeout(
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
12
|
-
|
|
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
|
-
|
|
18
|
+
log(...args: unknown[]): void;
|
|
19
19
|
};
|
|
20
20
|
export declare const AwaitClipboard: {
|
|
21
|
-
|
|
21
|
+
set(value: string): void;
|
|
22
22
|
};
|
|
23
23
|
type AwaitNetworkConfig = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
method?: string;
|
|
25
|
+
headers?: Record<string, string>;
|
|
26
|
+
body?: Encodable;
|
|
27
27
|
};
|
|
28
28
|
type AwaitFoufouConfig = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
47
|
+
get(config?: AwaitWeatherConfig): Promise<AwaitWeatherResult | undefined>;
|
|
48
48
|
};
|
|
49
49
|
export declare const AwaitHealth: {
|
|
50
|
-
|
|
50
|
+
get(): Promise<AwaitHealthInfo | undefined>;
|
|
51
51
|
};
|
|
52
52
|
export declare const AwaitLocation: {
|
|
53
|
-
|
|
53
|
+
get(config?: AwaitLocationConfig): Promise<AwaitLocationInfo | undefined>;
|
|
54
54
|
};
|
|
55
55
|
export declare const AwaitCalendar: {
|
|
56
|
-
|
|
56
|
+
get(config?: AwaitCalendarConfig): Promise<AwaitCalendarItem[] | undefined>;
|
|
57
57
|
};
|
|
58
58
|
export declare const AwaitReminder: {
|
|
59
|
-
|
|
59
|
+
get(config?: AwaitReminderConfig): Promise<AwaitReminderItem[] | undefined>;
|
|
60
60
|
};
|
|
61
61
|
export declare const AwaitSystem: {
|
|
62
|
-
|
|
62
|
+
get(): AwaitSystemInfo;
|
|
63
63
|
};
|
|
64
64
|
export declare const AwaitAlarm: {
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
schedule(config: AwaitAlarmScheduleConfig): Promise<string>;
|
|
66
|
+
cancel(id: string): any;
|
|
67
67
|
};
|
|
68
68
|
export declare const AwaitMedia: {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
|
|
119
|
-
|
|
118
|
+
readonly displayScale: number;
|
|
119
|
+
haptic(type: string): void;
|
|
120
120
|
};
|
|
121
121
|
type AwaitDefineConfig<Intents, T extends Record<string, unknown>> = {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
|
|
149
|
+
start(bundleId: string): any;
|
|
150
150
|
};
|
|
151
151
|
export declare const AwaitEnv: {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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
package/types/jsx.d.ts
CHANGED