@doubao-dev/framework 0.9.1 → 0.10.0

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/dist/config.d.ts CHANGED
@@ -177,6 +177,9 @@ export declare const defineConfig: <Config extends DoubaoAppsConfig>(config: Con
177
177
  export declare type DoubaoAppsAppConfig = DoubaoAppsMetaConfig;
178
178
 
179
179
  export declare interface DoubaoAppsBuildConfig {
180
+ experimental?: {
181
+ taro?: TaroPluginOptions;
182
+ };
180
183
  resolve?: {
181
184
  alias?: DoubaoAppsObject;
182
185
  [key: string]: unknown;
@@ -330,7 +333,16 @@ declare interface PageDefinition extends UIModuleDefinition {
330
333
  chat?: AppletPageChatConfig;
331
334
  }
332
335
 
333
- export declare interface TaroPluginOptions {
336
+ export declare type TaroComponentOptions = {
337
+ /** Name of an existing export from taro-runtime/components. */
338
+ $duplicateFromComponent: string;
339
+ } & Record<string, TaroComponentPropValue>;
340
+
341
+ export declare type TaroComponentPropValue = string | number | boolean | null | TaroComponentPropValue[] | {
342
+ [key: string]: TaroComponentPropValue;
343
+ };
344
+
345
+ export declare interface TaroPluginOptions extends TaroRuntimeExtensions {
334
346
  /**
335
347
  * Doubao app name.
336
348
  */
@@ -347,6 +359,17 @@ export declare interface TaroPluginOptions {
347
359
  * Widget metadata config.
348
360
  */
349
361
  widgets?: Record<string, TaroWidgetOptions>;
362
+ /** Component aliases and JSON-compatible default props. Props are not checked against host capabilities. */
363
+ components?: Record<string, TaroComponentOptions>;
364
+ /** Map component export names to native tag names verbatim. */
365
+ componentsMap?: Record<string, string>;
366
+ }
367
+
368
+ export declare interface TaroRuntimeExtensions {
369
+ /** Map API export names to project-relative files with a default export. */
370
+ extraAPI?: Record<string, string>;
371
+ /** Map component export names to project-relative files with a default export. */
372
+ extraComponent?: Record<string, string>;
350
373
  }
351
374
 
352
375
  export declare type TaroWidgetOptions = Omit<DoubaoAppsWidgetMetaConfig, 'id' | 'web'>;
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import { Attributes } from 'react';
2
2
  import { CElement } from 'react';
3
3
  import { CFactory } from 'react';
4
4
  import { ChildContextProvider } from 'react';
5
+ import { Children } from 'react';
5
6
  import { ClassAttributes } from 'react';
6
7
  import { ClassicComponent } from 'react';
7
8
  import { ClassicComponentClass } from 'react';
@@ -27,6 +28,7 @@ import { Context } from 'react';
27
28
  import { ContextType } from 'react';
28
29
  import { createContext } from 'react';
29
30
  import { createElement } from 'react';
31
+ import { createPortal } from '@lynx-js/react';
30
32
  import { createRef } from 'react';
31
33
  import type { CSSProperties } from '@lynx-js/types';
32
34
  import { CustomComponentPropsWithRef } from 'react';
@@ -258,7 +260,7 @@ declare type AppAIMeta = Omit<AIAppMetadata, 'appId'> & {
258
260
 
259
261
  /** @public */
260
262
  declare interface AppBaseInfoHost {
261
- /** 当前豆包客户端的 appId */
263
+ /** 豆包客户端应用标识(AID) */
262
264
  appId: string;
263
265
  }
264
266
 
@@ -311,6 +313,8 @@ declare type ChatStyle = {
311
313
 
312
314
  export { ChildContextProvider }
313
315
 
316
+ export { Children }
317
+
314
318
  export { ClassAttributes }
315
319
 
316
320
  export { ClassicComponent }
@@ -361,6 +365,8 @@ export { createContext }
361
365
 
362
366
  export { createElement }
363
367
 
368
+ export { createPortal }
369
+
364
370
  export { createRef }
365
371
 
366
372
  /** 当前页面栈中的页面信息。 */
@@ -639,18 +645,28 @@ export { getApp_2 as getApp }
639
645
  declare interface GetAppBaseInfoResult {
640
646
  /** 客户端基础库版本 */
641
647
  SDKVersion?: string;
642
- /** 是否已打开调试 */
648
+ /** 豆包客户端是否为调试构建 */
643
649
  enableDebug?: boolean;
644
650
  /** 当前豆包客户端信息 */
645
651
  host?: AppBaseInfoHost;
646
- /** 当前语言 */
652
+ /** 豆包客户端当前使用的语言 */
647
653
  language: string;
648
654
  /** 豆包客户端版本号 */
649
655
  version?: string;
650
- /** 当前主题 */
656
+ /** 当前应用插件使用的主题 */
651
657
  theme?: 'light' | 'dark';
652
658
  }
653
659
 
660
+ /**
661
+ * 返回调用所在页面的路由和查询参数。
662
+ *
663
+ * 从宿主下发的页面地址解析,格式与 `getCurrentPages()` 的各项一致。宿主未下发页面地址时
664
+ * (例如在 Widget 中)返回 `null`。页面地址未变化时返回同一个对象。
665
+ *
666
+ * @public
667
+ */
668
+ export declare function getCurrentPage(): CurrentPage | null;
669
+
654
670
  export declare function getCurrentPages(): {
655
671
  route: string;
656
672
  query: Record<string, string>;
@@ -678,7 +694,14 @@ declare interface GetDeviceInfoResult {
678
694
  model: string;
679
695
  /** 操作系统及版本。 */
680
696
  system: string;
681
- /** 客户端平台。 */
697
+ /**
698
+ * 应用插件运行平台标识,返回小写字符串。
699
+ * android:Android 客户端;ios:iOS 客户端(含 iPad)。
700
+ * windows:Windows 桌面客户端;mac:macOS 客户端;linux:Linux 平台。
701
+ * web:豆包网页版,或桌面客户端无法识别平台时的回退值。
702
+ * devtools_web:Web 模拟器,切换模拟的 iOS 或 Android 机型不会改变此值。
703
+ * 豆包网页版中始终返回 web,与设备的操作系统无关;操作系统及版本请读取 system。
704
+ */
682
705
  platform: string;
683
706
  /** 设备 CPU 型号,仅 Android 支持。 */
684
707
  cpuType?: string;
@@ -715,7 +738,7 @@ declare interface GetSystemInfoResult {
715
738
  windowHeight: number;
716
739
  /** 状态栏高度,单位为逻辑像素 */
717
740
  statusBarHeight: number;
718
- /** 系统语言,格式为 language_region,如 zh_CN、en_US */
741
+ /** 豆包客户端当前使用的语言 */
719
742
  language: string;
720
743
  /** 豆包客户端版本号 */
721
744
  version?: string;
@@ -725,13 +748,13 @@ declare interface GetSystemInfoResult {
725
748
  platform: string;
726
749
  /** 客户端基础库版本 */
727
750
  SDKVersion?: string;
728
- /** 系统当前主题 */
751
+ /** 当前应用插件使用的主题 */
729
752
  theme?: 'light' | 'dark';
730
753
  /** 设备性能等级,-1 表示未知 */
731
754
  benchmarkLevel?: number;
732
755
  /** 在竖屏正方向下的安全区域,单位为逻辑像素 */
733
756
  safeArea?: SystemInfoSafeArea;
734
- /** 是否已打开调试 */
757
+ /** 豆包客户端是否为调试构建 */
735
758
  enableDebug?: boolean;
736
759
  /** 设备方向 */
737
760
  deviceOrientation?: 'portrait' | 'landscape';
@@ -1033,6 +1056,15 @@ export { useContext }
1033
1056
 
1034
1057
  export declare function useCreated(callback: LifecycleCallback): void;
1035
1058
 
1059
+ /**
1060
+ * 读取调用所在页面的路由和查询参数,在宿主更新页面地址时自动触发组件渲染。
1061
+ *
1062
+ * 返回值与 `getCurrentPage()` 相同;页面地址未变化时返回同一个对象。
1063
+ *
1064
+ * @public
1065
+ */
1066
+ export declare function useCurrentPage(): CurrentPage | null;
1067
+
1036
1068
  export { useDebugValue }
1037
1069
 
1038
1070
  export declare function useDestroy(callback: LifecycleCallback): void;
@@ -1225,4 +1257,7 @@ declare interface WindowSafeArea {
1225
1257
  height: number;
1226
1258
  }
1227
1259
 
1260
+
1261
+ export * from "@lynx-js/react/compat";
1262
+
1228
1263
  export { }
package/jsx-runtime.d.ts CHANGED
@@ -18,6 +18,8 @@ export namespace JSX {
18
18
  button: import('./components.d.ts').ButtonProps;
19
19
  camera: import('./components.d.ts').CameraProps;
20
20
  canvas: import('./components.d.ts').CanvasProps;
21
+ checkbox: import('./components.d.ts').CheckboxProps;
22
+ 'checkbox-group': import('./components.d.ts').CheckboxGroupProps;
21
23
  map: import('./components.d.ts').MapProps;
22
24
  'map-marker': import('./components.d.ts').MapMarkerProps;
23
25
  markdown: import('./components.d.ts').MarkdownProps;
@@ -45,6 +47,8 @@ export namespace JSX {
45
47
  input: import('./components.d.ts').InputProps;
46
48
  list: import('./components.d.ts').ListProps;
47
49
  'list-item': import('@lynx-js/types').ListItemProps;
50
+ refresh: import('./components.d.ts').RefreshProps;
51
+ 'refresh-header': import('./components.d.ts').RefreshHeaderProps;
48
52
  'scroll-view': import('./components.d.ts').ScrollViewProps;
49
53
  svg: import('./components.d.ts').SvgProps;
50
54
  text: import('./components.d.ts').TextProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doubao-dev/framework",
3
- "version": "0.9.1",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {