@doubao-dev/framework 0.0.38-canary-1b929937-20260722020207

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.
@@ -0,0 +1,295 @@
1
+ declare interface AIAppMetadata {
2
+ /**
3
+ *
4
+ * 豆包应用 ID
5
+ *
6
+ */
7
+ appId: string;
8
+ /**
9
+ * 应用名称
10
+ */
11
+ name?: string;
12
+ /**
13
+ * 应用描述
14
+ */
15
+ description?: string;
16
+ /**
17
+ * 应用图标
18
+ *
19
+ * 1x, 2x, 3x 分别对应 1x, 2x, 3x 倍的图标
20
+ */
21
+ icons?: Icons;
22
+ /**
23
+ * 应用关键词
24
+ */
25
+ keywords?: string[];
26
+ /**
27
+ * 应用版本
28
+ */
29
+ version?: string;
30
+ }
31
+
32
+ declare type AIPageMetadata = Omit<PageDefinition, 'entry' | 'renderType' | 'digest' | 'web'>;
33
+
34
+ declare type AIWidgetMetadata = {
35
+ /**
36
+ * The widget unique identifier
37
+ */
38
+ id: string;
39
+ /**
40
+ * widget name
41
+ */
42
+ name?: string;
43
+ /**
44
+ * Describe the characteristics of widget
45
+ */
46
+ description?: string;
47
+ /**
48
+ * Widget box type in Chat UI
49
+ */
50
+ boxType?: 'inbox' | 'full_box';
51
+ /**
52
+ * Whether add widget border
53
+ */
54
+ border?: boolean;
55
+ /**
56
+ * Keywords of things
57
+ */
58
+ keywords?: string[];
59
+ /**
60
+ * Icons
61
+ */
62
+ icons?: Icons;
63
+ /**
64
+ * Set extra widget properties
65
+ */
66
+ prop?: string;
67
+ /**
68
+ * Widget title type
69
+ * - none: 默认,无标题
70
+ * - normal: 常规标题
71
+ * - float: 浮动标题
72
+ */
73
+ titleType?: 'none' | 'normal' | 'float';
74
+ };
75
+
76
+ declare interface BaseDefinition {
77
+ /**
78
+ * Unique identifier
79
+ */
80
+ id: string;
81
+ /**
82
+ * Basic name
83
+ */
84
+ name?: string;
85
+ /**
86
+ * Describe the characteristics of things
87
+ */
88
+ description?: string;
89
+ }
90
+
91
+ /**
92
+ * 目前 BaseModuleDefinition 用于 Manifest 中的 Applet、Widget、Page 模块
93
+ */
94
+ declare interface BaseModuleDefinition extends BaseDefinition {
95
+ /**
96
+ * Keywords of things
97
+ */
98
+ keywords?: string[];
99
+ /**
100
+ * Icons
101
+ */
102
+ icons?: Icons;
103
+ /**
104
+ * Used to check widget is corrected for this package
105
+ */
106
+ digest: string;
107
+ /**
108
+ * The applet/widget properties, Used to define some limits for user
109
+ */
110
+ prop?: string;
111
+ }
112
+
113
+ export declare type DefineAppConfig = (config: DoubaoAppsAppConfig) => DoubaoAppsAppConfig;
114
+
115
+ export declare const defineAppConfig: (config: DoubaoAppsAppConfig) => DoubaoAppsMetaConfig;
116
+
117
+ export declare type DefineConfig = <Config extends DoubaoAppsConfig>(config: Config) => Config;
118
+
119
+ export declare const defineConfig: <Config extends DoubaoAppsConfig>(config: Config) => Config;
120
+
121
+ export declare type DoubaoAppsAppConfig = DoubaoAppsMetaConfig;
122
+
123
+ export declare interface DoubaoAppsBuildConfig {
124
+ resolve?: {
125
+ alias?: DoubaoAppsObject;
126
+ [key: string]: unknown;
127
+ };
128
+ /**
129
+ * Configure source file compilation.
130
+ */
131
+ source?: {
132
+ include?: unknown;
133
+ exclude?: unknown;
134
+ define?: Record<string, string>;
135
+ alias?: DoubaoAppsObject;
136
+ decorators?: unknown;
137
+ [key: string]: unknown;
138
+ };
139
+ experiments?: {
140
+ /**
141
+ * Taro experiment config.
142
+ */
143
+ taro?: TaroPluginOptions;
144
+ [key: string]: unknown;
145
+ };
146
+ [key: string]: unknown;
147
+ }
148
+
149
+ export declare interface DoubaoAppsConfig extends DoubaoAppsBuildConfig {
150
+ plugins?: DoubaoAppsPlugin[];
151
+ /**
152
+ * Debug driver used to debug applet.
153
+ */
154
+ debugDriver?: DoubaoAppsDebugDriverName;
155
+ /** Skip ADB foreground app watcher. */
156
+ skipAdbForegroundAppWatch?: boolean;
157
+ }
158
+
159
+ export declare type DoubaoAppsDebugDriverName = 'adb' | 'hdt' | 'devtools';
160
+
161
+ export declare type DoubaoAppsLegacyEntryConfig<Meta extends object> = Record<string, Meta>;
162
+
163
+ export declare interface DoubaoAppsMetaConfig extends AIAppMetadata {
164
+ /**
165
+ * Page entries and page metadata. The first page is used as the home page.
166
+ */
167
+ pages?: DoubaoAppsPageConfig;
168
+ /**
169
+ * Widget entries and widget metadata.
170
+ */
171
+ widgets?: DoubaoAppsWidgetConfig;
172
+ }
173
+
174
+ export declare type DoubaoAppsObject = Record<string, unknown>;
175
+
176
+ export declare type DoubaoAppsPageConfig = DoubaoAppsPageEntryConfig[] | DoubaoAppsLegacyEntryConfig<DoubaoAppsPageMetaConfig>;
177
+
178
+ export declare type DoubaoAppsPageEntryConfig = string | ({
179
+ entry: string;
180
+ } & DoubaoAppsPageMetaConfig);
181
+
182
+ export declare type DoubaoAppsPageMetaConfig = Omit<AIPageMetadata, 'id' | 'path' | 'description' | 'keywords'> & {
183
+ /**
184
+ * Page ID. Defaults to the entry directory name.
185
+ *
186
+ * @deprecated Page ID is not consumed by the platform. Prefer the generated default.
187
+ */
188
+ id?: string;
189
+ title?: string;
190
+ /**
191
+ * @deprecated Page description is not consumed by the platform.
192
+ */
193
+ description?: string;
194
+ /**
195
+ * @deprecated Page keywords are not consumed by the platform.
196
+ */
197
+ keywords?: string[];
198
+ /**
199
+ * Whether this page should produce a Web bundle.
200
+ */
201
+ web?: boolean;
202
+ };
203
+
204
+ export declare interface DoubaoAppsPlugin {
205
+ /**
206
+ * Plugin name.
207
+ */
208
+ name: string;
209
+ setup: (api: any) => void | Promise<void>;
210
+ }
211
+
212
+ export declare type DoubaoAppsWidgetConfig = DoubaoAppsWidgetEntryConfig[] | DoubaoAppsLegacyEntryConfig<DoubaoAppsWidgetMetaConfig>;
213
+
214
+ export declare type DoubaoAppsWidgetEntryConfig = string | ({
215
+ entry: string;
216
+ } & DoubaoAppsWidgetMetaConfig);
217
+
218
+ export declare type DoubaoAppsWidgetMetaConfig = Omit<AIWidgetMetadata, 'id'> & {
219
+ /**
220
+ * Widget ID. Defaults to the entry directory name.
221
+ */
222
+ id?: string;
223
+ name?: string;
224
+ description?: string;
225
+ boxType?: 'inbox' | 'full_box';
226
+ border?: boolean;
227
+ keywords?: string[];
228
+ icons?: Icons;
229
+ prop?: string;
230
+ titleType?: 'none' | 'normal' | 'float';
231
+ /**
232
+ * Whether this widget should produce a Web bundle.
233
+ */
234
+ web?: boolean;
235
+ };
236
+
237
+ export declare type Icons = string | Record<'1x' | '2x' | '3x', string>;
238
+
239
+ declare interface PageDefinition extends UIModuleDefinition {
240
+ /**
241
+ * The page navbar title
242
+ */
243
+ title?: string;
244
+ /**
245
+ * The page path
246
+ */
247
+ path: string;
248
+ }
249
+
250
+ export declare interface TaroPluginOptions {
251
+ /**
252
+ * Doubao app name.
253
+ */
254
+ name: string;
255
+ /**
256
+ * Doubao app ID.
257
+ */
258
+ appId: string;
259
+ /**
260
+ * Doubao app icons.
261
+ */
262
+ icons?: string;
263
+ /**
264
+ * Widget metadata config.
265
+ */
266
+ widgets?: Record<string, TaroWidgetOptions>;
267
+ }
268
+
269
+ export declare type TaroWidgetOptions = Omit<DoubaoAppsWidgetMetaConfig, 'id' | 'web'>;
270
+
271
+ declare interface UIModuleDefinition extends BaseModuleDefinition {
272
+ /**
273
+ * The applet/widget render type, used to choose the render engine
274
+ */
275
+ renderType?: 'lynx';
276
+ /**
277
+ * The view entry
278
+ */
279
+ entry: string;
280
+ /**
281
+ * Web platform view metadata.
282
+ */
283
+ web?: WebModuleDefinition;
284
+ }
285
+
286
+ export declare type UserConfig = DoubaoAppsConfig;
287
+
288
+ declare interface WebModuleDefinition {
289
+ /**
290
+ * The Web bundle entry.
291
+ */
292
+ entry: string;
293
+ }
294
+
295
+ export { }
package/dist/config.js ADDED
@@ -0,0 +1,3 @@
1
+ export const defineConfig = (config) => config;
2
+ export const defineAppConfig = (config) => config;
3
+ //# sourceMappingURL=config.js.map