import type { PluginTypeCheckerOptions } from '@rsbuild/plugin-type-check'; import { ResolveConfig } from '@rsbuild/core'; import { SourceConfig } from '@rsbuild/core'; declare interface AIAppMetadata { /** * * 豆包应用 ID * */ appId: string; /** * 应用名称 */ name?: string; /** * 应用描述 */ description?: string; /** * 应用图标 * * 1x, 2x, 3x 分别对应 1x, 2x, 3x 倍的图标 */ icons?: string | Record<'1x' | '2x' | '3x', string>; /** * 应用关键词 */ keywords?: string[]; /** * 应用版本 */ version?: string; } declare type AIPageMetadata = Omit; declare type AIWidgetMetadata = { /** * The widget unique identifier */ id: string; /** * widget name */ name?: string; /** * Describe the characteristics of widget */ description?: string; /** * Widget box type in Chat UI */ boxType?: 'inbox' | 'full_box'; /** * Whether add widget border */ border?: boolean; /** * Keywords of things */ keywords?: string[]; /** * Icons */ icons?: string | Record<'1x' | '2x' | '3x', string>; /** * Set extra widget properties */ prop?: string; /** * Widget title type * - none: 默认,无标题 * - normal: 常规标题 * - float: 浮动标题 */ titleType?: 'none' | 'normal' | 'float'; }; declare interface BaseDefinition { /** * Unique identifier */ id: string; /** * Basic name */ name?: string; /** * Describe the characteristics of things */ description?: string; } /** * 目前 BaseModuleDefinition 用于 Manifest 中的 Applet、Widget、Page 模块 */ declare interface BaseModuleDefinition extends BaseDefinition { /** * Keywords of things */ keywords?: string[]; /** * Icons */ icons?: string | Record<'1x' | '2x' | '3x', string>; /** * Used to check widget is corrected for this package */ digest: string; /** * The applet/widget properties, Used to define some limits for user */ prop?: string; } /** * Define app/page/widget metadata in src/app.config.ts. * * @example * ```ts * // src/app.config.ts * import { defineAppConfig } from '@doubao-apps/kit'; * * export default defineAppConfig({ * appId: 'your-app-id', * name: 'Demo App', * pages: [ * { * entry: 'pages/home/index', * id: 'home-page', * title: 'Home', * description: 'The home page' * } * ], * widgets: [ * { * entry: 'widgets/card/index', * id: 'card-widget', * name: 'Card Widget', * description: 'Show card content' * } * ] * }); * ``` */ export declare const defineAppConfig: (config: DoubaoAppsMetaConfig) => DoubaoAppsMetaConfig; export declare const defineConfig: (config: DoubaoAppsBuildConfig) => DoubaoAppsBuildConfig; export declare interface DoubaoAppsBuildConfig { resolve?: Pick; /** * Configure some operations on source files for compilation */ source?: Pick; /** * Configure more on inner tools */ tools?: { tsChecker?: PluginTypeCheckerOptions; }; experiments?: { /** * taro experiment config */ taro?: TaroPluginOptions; }; } declare type DoubaoAppsLegacyEntryConfig = Record; /** * Metadata config loaded from src/app.config.ts. * * App metadata is declared at the top level. Pages and widgets use arrays to * declare entries and metadata. * * @example * ```ts * // src/app.config.ts * import { defineAppConfig } from '@doubao-apps/kit'; * * export default defineAppConfig({ * appId: 'db_xxx', * name: 'Demo App', * description: 'App description', * pages: [ * 'pages/home/index', * { * entry: 'pages/account/demo/index', * id: 'account-demo', * title: 'Account Demo', * description: 'A nested page entry' * } * ], * widgets: [ * 'widgets/summary/index', * { * entry: 'widgets/card/index', * id: 'card-widget', * name: 'Card Widget', * description: 'Show card content', * border: true * } * ] * }); * ``` */ export declare interface DoubaoAppsMetaConfig extends Omit { /** * Doubao app ID. */ appId?: string; /** * Page entries and page metadata. * * The first page is used as the home page. */ pages?: DoubaoAppsPageConfig; /** * Widget entries and widget metadata. */ widgets?: DoubaoAppsWidgetConfig; } export declare type DoubaoAppsPageConfig = DoubaoAppsPageEntryConfig[] | DoubaoAppsLegacyEntryConfig; export declare type DoubaoAppsPageEntryConfig = string | ({ entry: string; } & DoubaoAppsPageMetaConfig); export declare type DoubaoAppsPageMetaConfig = Omit & { /** * Page ID。不配置时默认以入口目录名为 ID,例如 pages/account/demo/index 默认为 demo。 */ id?: string; }; export declare type DoubaoAppsWidgetConfig = DoubaoAppsWidgetEntryConfig[] | DoubaoAppsLegacyEntryConfig; export declare type DoubaoAppsWidgetEntryConfig = string | ({ entry: string; } & DoubaoAppsWidgetMetaConfig); export declare type DoubaoAppsWidgetMetaConfig = Omit & { /** * Widget ID。不配置时默认以入口目录名为 ID,例如 widgets/api/demo/index 默认为 demo。 */ id?: string; }; declare interface PageDefinition extends UIModuleDefinition { /** * The page navbar title */ title?: string; /** * The page path */ path: string; } export declare interface TaroPluginOptions { /** * doubao app name */ name: string; /** * doubao app id */ appId: string; /** * doubao app icons */ icons?: string; /** * widget metadata config */ widgets?: Record; } declare type TaroWidgetOptions = Omit; declare interface UIModuleDefinition extends BaseModuleDefinition { /** * The applet/widget render type, used to choose the render engine */ renderType?: 'lynx'; /** * The view entry */ entry: string; } export { }