@doubao-dev/framework 0.0.40 → 0.0.42
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/api.d.ts +1248 -239
- package/dist/components.d.ts +391 -82
- package/dist/config.d.ts +57 -1
- package/dist/index.d.ts +46 -382
- package/package.json +1 -1
package/dist/components.d.ts
CHANGED
|
@@ -49,7 +49,9 @@ import type { UIAppearanceEvent } from '@lynx-js/types';
|
|
|
49
49
|
import type { XOverlayNGProps } from '@byted-lynx/type-lynx';
|
|
50
50
|
|
|
51
51
|
export declare interface AgreePrivacyResult {
|
|
52
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* 用户是否同意隐私协议授权。
|
|
54
|
+
*/
|
|
53
55
|
result: boolean;
|
|
54
56
|
}
|
|
55
57
|
|
|
@@ -126,24 +128,24 @@ declare interface BounceConfig {
|
|
|
126
128
|
* @remarks
|
|
127
129
|
* ## 使用建议
|
|
128
130
|
*
|
|
129
|
-
*
|
|
131
|
+
* 由于组件不开启 CSS 继承,button 的文本样式不会自动应用到 children。
|
|
130
132
|
* 因此提供了以下明确的 API 用法:
|
|
131
133
|
*
|
|
132
|
-
* - `text
|
|
133
|
-
* - `icon` + `text
|
|
134
|
+
* - `text`:传入字符串,按钮会应用默认文本样式
|
|
135
|
+
* - `icon` + `text`:组合使用,显示图标和文字
|
|
134
136
|
* - `children`:完全自定义内容,**不会**应用按钮的默认文本样式
|
|
135
137
|
*
|
|
136
138
|
* ```tsx
|
|
137
|
-
* // 简单文字:用 text
|
|
138
|
-
* <
|
|
139
|
+
* // 简单文字:用 text(推荐)
|
|
140
|
+
* <button text="确定" />
|
|
139
141
|
*
|
|
140
142
|
* // 图标+文字:用 icon + text
|
|
141
|
-
* <
|
|
143
|
+
* <button icon={<Icon />} text="提交" />
|
|
142
144
|
*
|
|
143
145
|
* // 完全自定义:用 children(无默认样式)
|
|
144
|
-
* <
|
|
146
|
+
* <button>
|
|
145
147
|
* <text style={{ color: 'red' }}>自定义</text>
|
|
146
|
-
* </
|
|
148
|
+
* </button>
|
|
147
149
|
* ```
|
|
148
150
|
*/
|
|
149
151
|
export declare interface ButtonProps {
|
|
@@ -233,7 +235,7 @@ export declare interface ButtonProps {
|
|
|
233
235
|
*
|
|
234
236
|
* @example
|
|
235
237
|
* ```tsx
|
|
236
|
-
* <
|
|
238
|
+
* <button
|
|
237
239
|
* openType="openSetting"
|
|
238
240
|
* onOpenSetting={({ detail }) => {
|
|
239
241
|
* if (detail.errMsg === 'openSetting:ok') {
|
|
@@ -971,7 +973,7 @@ export declare interface InputRef {
|
|
|
971
973
|
*/
|
|
972
974
|
setValue: (value: string) => Promise<void>;
|
|
973
975
|
/**
|
|
974
|
-
*
|
|
976
|
+
* 获取输入框的值和选区起止位置,返回 `{ value, selectionStart, selectionEnd }`。
|
|
975
977
|
*/
|
|
976
978
|
getValue: () => Promise<{
|
|
977
979
|
value: string;
|
|
@@ -1427,6 +1429,20 @@ export declare type LongImageState = {
|
|
|
1427
1429
|
declare type Map_2 = ForwardRefExoticComponent<MapProps & RefAttributes<MapRef>>;
|
|
1428
1430
|
export { Map_2 as Map }
|
|
1429
1431
|
|
|
1432
|
+
/**
|
|
1433
|
+
* 地图可视区域,由对角两点的经纬度确定。
|
|
1434
|
+
*/
|
|
1435
|
+
export declare interface MapBounds {
|
|
1436
|
+
/**
|
|
1437
|
+
* 东北角(右上角)经纬度。
|
|
1438
|
+
*/
|
|
1439
|
+
northeast: LatLng;
|
|
1440
|
+
/**
|
|
1441
|
+
* 西南角(左下角)经纬度。
|
|
1442
|
+
*/
|
|
1443
|
+
southwest: LatLng;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1430
1446
|
export declare type MapMarker = ForwardRefExoticComponent<MapMarkerProps & RefAttributes<MapMarkerRef>>;
|
|
1431
1447
|
|
|
1432
1448
|
export declare interface MapMarkerAnimate {
|
|
@@ -1467,6 +1483,9 @@ export declare interface MapMarkerAnimationConfig {
|
|
|
1467
1483
|
* 地图标记点组件,作为 Map 的子组件使用,支持自定义图标和动画。
|
|
1468
1484
|
*/
|
|
1469
1485
|
export declare interface MapMarkerProps {
|
|
1486
|
+
/**
|
|
1487
|
+
* 用于获取组件实例的 ref
|
|
1488
|
+
*/
|
|
1470
1489
|
ref?: Ref<MapMarkerRef>;
|
|
1471
1490
|
/**
|
|
1472
1491
|
* React key 属性
|
|
@@ -1497,7 +1516,7 @@ export declare interface MapMarkerProps {
|
|
|
1497
1516
|
*/
|
|
1498
1517
|
animate?: MapMarkerAnimate;
|
|
1499
1518
|
/**
|
|
1500
|
-
*
|
|
1519
|
+
* 标记点在自定义布局中的容器位置,使用像素坐标 `{ x, y }`。
|
|
1501
1520
|
*/
|
|
1502
1521
|
containerPosition?: {
|
|
1503
1522
|
x: number;
|
|
@@ -1539,6 +1558,9 @@ export declare type MapMarkerRef = {
|
|
|
1539
1558
|
* 地图展示组件,支持标记点、路线、多边形等覆盖物,以及平移、缩放等交互。
|
|
1540
1559
|
*/
|
|
1541
1560
|
export declare interface MapProps {
|
|
1561
|
+
/**
|
|
1562
|
+
* 用于获取组件实例的 ref
|
|
1563
|
+
*/
|
|
1542
1564
|
ref?: Ref<MapRef>;
|
|
1543
1565
|
/**
|
|
1544
1566
|
* 组件的样式。
|
|
@@ -1549,7 +1571,7 @@ export declare interface MapProps {
|
|
|
1549
1571
|
*/
|
|
1550
1572
|
className?: string;
|
|
1551
1573
|
/**
|
|
1552
|
-
* 子元素。一般与 `<
|
|
1574
|
+
* 子元素。一般与 `<map-marker />` 搭配使用。
|
|
1553
1575
|
*/
|
|
1554
1576
|
children?: ReactNode;
|
|
1555
1577
|
/**
|
|
@@ -1637,12 +1659,16 @@ export declare interface MapProps {
|
|
|
1637
1659
|
*/
|
|
1638
1660
|
enableTilt?: boolean;
|
|
1639
1661
|
/**
|
|
1640
|
-
*
|
|
1662
|
+
* 是否允许底层地图处理触摸事件。关闭后,地图不会响应拖动、缩放等手势。
|
|
1641
1663
|
* @defaultValue true
|
|
1642
1664
|
*/
|
|
1643
1665
|
enableNativeInteraction?: boolean;
|
|
1644
1666
|
/**
|
|
1645
|
-
*
|
|
1667
|
+
* 透传给底层地图实现的扩展参数。仅在豆包提供具体参数约定时使用。
|
|
1668
|
+
*/
|
|
1669
|
+
extraParams?: Record<string, unknown>;
|
|
1670
|
+
/**
|
|
1671
|
+
* 点击地图时触发。回调参数的 `point` 为点击位置的经纬度。
|
|
1646
1672
|
*/
|
|
1647
1673
|
onClick?: (event: {
|
|
1648
1674
|
point: LatLng;
|
|
@@ -1652,22 +1678,11 @@ export declare interface MapProps {
|
|
|
1652
1678
|
*/
|
|
1653
1679
|
onMapLoaded?: () => void;
|
|
1654
1680
|
/**
|
|
1655
|
-
*
|
|
1681
|
+
* 视野开始或结束变化时触发。回调参数包含变化阶段 `type`,以及可选的缩放级别、中心点和可视区域等信息。
|
|
1656
1682
|
*/
|
|
1657
|
-
onRegionChange?: (event:
|
|
1658
|
-
type: 'begin' | 'end';
|
|
1659
|
-
rotate?: number;
|
|
1660
|
-
scale?: number;
|
|
1661
|
-
center?: LatLng;
|
|
1662
|
-
region?: {
|
|
1663
|
-
northeast: LatLng;
|
|
1664
|
-
southwest: LatLng;
|
|
1665
|
-
};
|
|
1666
|
-
causedBy?: 'drag' | 'scale';
|
|
1667
|
-
triggeredBy?: 'user' | 'api';
|
|
1668
|
-
}) => void;
|
|
1683
|
+
onRegionChange?: (event: MapRegionChangeEvent) => void;
|
|
1669
1684
|
/**
|
|
1670
|
-
*
|
|
1685
|
+
* 点击路线时触发。回调参数的 `id` 为被点击路线的 ID。
|
|
1671
1686
|
*/
|
|
1672
1687
|
onPolylineClick?: (event: {
|
|
1673
1688
|
id: string;
|
|
@@ -1692,19 +1707,13 @@ export declare interface MapRef {
|
|
|
1692
1707
|
*/
|
|
1693
1708
|
setScale: (scale: number, animationOptions?: MapViewportAnimationOptions) => void;
|
|
1694
1709
|
/**
|
|
1695
|
-
*
|
|
1710
|
+
* 获取当前地图边界,返回西南角 `southwest` 和东北角 `northeast` 的经纬度。
|
|
1696
1711
|
*/
|
|
1697
|
-
getBound: () => Promise<
|
|
1698
|
-
southwest: LatLng;
|
|
1699
|
-
northeast: LatLng;
|
|
1700
|
-
}>;
|
|
1712
|
+
getBound: () => Promise<MapBounds>;
|
|
1701
1713
|
/**
|
|
1702
|
-
*
|
|
1714
|
+
* 设置地图边界。`bounds` 包含西南角 `southwest` 和东北角 `northeast` 的经纬度。
|
|
1703
1715
|
*/
|
|
1704
|
-
setBound: (bounds:
|
|
1705
|
-
northeast: LatLng;
|
|
1706
|
-
southwest: LatLng;
|
|
1707
|
-
}, animationOptions?: MapViewportAnimationOptions) => void;
|
|
1716
|
+
setBound: (bounds: MapBounds, animationOptions?: MapViewportAnimationOptions) => void;
|
|
1708
1717
|
/**
|
|
1709
1718
|
* 使地图视图适合给定的点。
|
|
1710
1719
|
* @param points - 要适配的点数组
|
|
@@ -1713,7 +1722,7 @@ export declare interface MapRef {
|
|
|
1713
1722
|
*/
|
|
1714
1723
|
fitPoints: (points: LatLng[], padding?: number[], animationOptions?: MapViewportAnimationOptions) => void;
|
|
1715
1724
|
/**
|
|
1716
|
-
*
|
|
1725
|
+
* 设置地图锚点(地图坐标对齐的屏幕像素位置),`position` 包含像素坐标 `x` 和 `y`。
|
|
1717
1726
|
* 默认情况下,setCenter() 将坐标对齐到视口中心。
|
|
1718
1727
|
* 调用 setAnchor(x, y) 后,setCenter() 会将坐标对齐到屏幕的 (x, y) 像素位置。
|
|
1719
1728
|
* @param position.x - 屏幕 x 坐标像素(0 = 左边缘)
|
|
@@ -1731,14 +1740,14 @@ export declare interface MapRef {
|
|
|
1731
1740
|
y: number;
|
|
1732
1741
|
}) => void;
|
|
1733
1742
|
/**
|
|
1734
|
-
*
|
|
1743
|
+
* 将地图经纬度转换为屏幕像素坐标,返回 `{ x, y }`。
|
|
1735
1744
|
*/
|
|
1736
1745
|
latLngToPx: (latLng: LatLng) => Promise<{
|
|
1737
1746
|
x: number;
|
|
1738
1747
|
y: number;
|
|
1739
1748
|
}>;
|
|
1740
1749
|
/**
|
|
1741
|
-
*
|
|
1750
|
+
* 将屏幕像素坐标 `{ x, y }` 转换为地图经纬度。
|
|
1742
1751
|
*/
|
|
1743
1752
|
pxToLatLng: (point: {
|
|
1744
1753
|
x: number;
|
|
@@ -1746,6 +1755,42 @@ export declare interface MapRef {
|
|
|
1746
1755
|
}) => Promise<LatLng>;
|
|
1747
1756
|
}
|
|
1748
1757
|
|
|
1758
|
+
/**
|
|
1759
|
+
* 地图视野变化事件的数据。
|
|
1760
|
+
*
|
|
1761
|
+
* 除 `type` 外均为可选:具体带哪些字段由平台和触发方式决定。
|
|
1762
|
+
*/
|
|
1763
|
+
export declare interface MapRegionChangeEvent {
|
|
1764
|
+
/**
|
|
1765
|
+
* 变化阶段,`begin` 为开始变化,`end` 为变化结束。
|
|
1766
|
+
*/
|
|
1767
|
+
type: 'begin' | 'end';
|
|
1768
|
+
/**
|
|
1769
|
+
* 当前地图旋转角度。
|
|
1770
|
+
*/
|
|
1771
|
+
rotate?: number;
|
|
1772
|
+
/**
|
|
1773
|
+
* 当前缩放级别。
|
|
1774
|
+
*/
|
|
1775
|
+
scale?: number;
|
|
1776
|
+
/**
|
|
1777
|
+
* 当前地图中心点经纬度。
|
|
1778
|
+
*/
|
|
1779
|
+
center?: LatLng;
|
|
1780
|
+
/**
|
|
1781
|
+
* 当前可视区域。
|
|
1782
|
+
*/
|
|
1783
|
+
region?: MapBounds;
|
|
1784
|
+
/**
|
|
1785
|
+
* 引起本次变化的手势类型。
|
|
1786
|
+
*/
|
|
1787
|
+
causedBy?: 'drag' | 'scale';
|
|
1788
|
+
/**
|
|
1789
|
+
* 本次变化由用户操作还是 API 调用引起。
|
|
1790
|
+
*/
|
|
1791
|
+
triggeredBy?: 'user' | 'api';
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1749
1794
|
export declare interface MapViewportAnimationOptions {
|
|
1750
1795
|
/**
|
|
1751
1796
|
* 是否开启地图视野变化动画。
|
|
@@ -1760,21 +1805,57 @@ export declare interface MapViewportAnimationOptions {
|
|
|
1760
1805
|
duration?: number;
|
|
1761
1806
|
}
|
|
1762
1807
|
|
|
1808
|
+
/**
|
|
1809
|
+
* 打字机动画每步结束时的事件数据。
|
|
1810
|
+
*/
|
|
1763
1811
|
export declare interface MarkdownAnimationStepEvent {
|
|
1812
|
+
/**
|
|
1813
|
+
* 当前已完成的动画步数。
|
|
1814
|
+
*/
|
|
1764
1815
|
animationStep: number;
|
|
1816
|
+
/**
|
|
1817
|
+
* 全部内容对应的总动画步数。
|
|
1818
|
+
*/
|
|
1765
1819
|
maxAnimationStep: number;
|
|
1766
1820
|
}
|
|
1767
1821
|
|
|
1822
|
+
/**
|
|
1823
|
+
* 暂停打字机动画的结果。
|
|
1824
|
+
*/
|
|
1768
1825
|
export declare interface MarkdownAnimationStepResult {
|
|
1826
|
+
/**
|
|
1827
|
+
* 暂停时已完成的动画步数,可传给 `resumeAnimation` 从该步继续。
|
|
1828
|
+
*/
|
|
1769
1829
|
animationStep: number;
|
|
1770
1830
|
}
|
|
1771
1831
|
|
|
1832
|
+
/**
|
|
1833
|
+
* 相对组件左上角的包围盒。
|
|
1834
|
+
*/
|
|
1772
1835
|
export declare interface MarkdownBoundingRect {
|
|
1836
|
+
/**
|
|
1837
|
+
* 左边界的 x 坐标。
|
|
1838
|
+
*/
|
|
1773
1839
|
left: number;
|
|
1840
|
+
/**
|
|
1841
|
+
* 上边界的 y 坐标。
|
|
1842
|
+
*/
|
|
1774
1843
|
top: number;
|
|
1844
|
+
/**
|
|
1845
|
+
* 右边界的 x 坐标。
|
|
1846
|
+
*/
|
|
1775
1847
|
right: number;
|
|
1848
|
+
/**
|
|
1849
|
+
* 下边界的 y 坐标。
|
|
1850
|
+
*/
|
|
1776
1851
|
bottom: number;
|
|
1852
|
+
/**
|
|
1853
|
+
* 包围盒宽度。
|
|
1854
|
+
*/
|
|
1777
1855
|
width: number;
|
|
1856
|
+
/**
|
|
1857
|
+
* 包围盒高度。
|
|
1858
|
+
*/
|
|
1778
1859
|
height: number;
|
|
1779
1860
|
}
|
|
1780
1861
|
|
|
@@ -1791,72 +1872,207 @@ export declare interface MarkdownContentRangeOptions {
|
|
|
1791
1872
|
end?: number;
|
|
1792
1873
|
}
|
|
1793
1874
|
|
|
1875
|
+
/**
|
|
1876
|
+
* 获取已解析内容的结果。
|
|
1877
|
+
*/
|
|
1794
1878
|
export declare interface MarkdownContentResult {
|
|
1879
|
+
/**
|
|
1880
|
+
* 指定区间内已解析出的文本内容。
|
|
1881
|
+
*/
|
|
1795
1882
|
content: string;
|
|
1796
1883
|
}
|
|
1797
1884
|
|
|
1885
|
+
/**
|
|
1886
|
+
* Markdown 的额外渲染效果配置。
|
|
1887
|
+
*/
|
|
1798
1888
|
export declare type MarkdownEffect = Record<string, unknown>;
|
|
1799
1889
|
|
|
1890
|
+
/**
|
|
1891
|
+
* Markdown 组件事件的通用外壳,`detail` 为各事件自己的数据。
|
|
1892
|
+
*/
|
|
1800
1893
|
export declare type MarkdownEvent<EventType extends string = string, Detail = unknown> = BaseEvent<EventType, Detail>;
|
|
1801
1894
|
|
|
1895
|
+
/**
|
|
1896
|
+
* 获取图片地址的结果。
|
|
1897
|
+
*/
|
|
1802
1898
|
export declare interface MarkdownImagesResult {
|
|
1899
|
+
/**
|
|
1900
|
+
* Markdown 内容中出现的所有图片地址,按出现顺序排列。
|
|
1901
|
+
*/
|
|
1803
1902
|
images: string[];
|
|
1804
1903
|
}
|
|
1805
1904
|
|
|
1905
|
+
/**
|
|
1906
|
+
* 点击图片事件的数据。
|
|
1907
|
+
*/
|
|
1806
1908
|
export declare interface MarkdownImageTapEvent {
|
|
1909
|
+
/**
|
|
1910
|
+
* 被点击图片的地址。
|
|
1911
|
+
*/
|
|
1807
1912
|
url: string;
|
|
1808
1913
|
}
|
|
1809
1914
|
|
|
1915
|
+
/**
|
|
1916
|
+
* 标注边框的线条样式。
|
|
1917
|
+
*/
|
|
1810
1918
|
export declare interface MarkdownLineStyle {
|
|
1919
|
+
/**
|
|
1920
|
+
* 线条类型,实线或虚线。
|
|
1921
|
+
*/
|
|
1811
1922
|
lineType: 'solid' | 'dashed';
|
|
1923
|
+
/**
|
|
1924
|
+
* 线条颜色。
|
|
1925
|
+
*/
|
|
1812
1926
|
color: string;
|
|
1927
|
+
/**
|
|
1928
|
+
* 线条粗细。
|
|
1929
|
+
*/
|
|
1813
1930
|
width: number;
|
|
1931
|
+
/**
|
|
1932
|
+
* 虚线时单段线的长度,实线可不传。
|
|
1933
|
+
*/
|
|
1814
1934
|
elementSize?: number;
|
|
1935
|
+
/**
|
|
1936
|
+
* 虚线时相邻两段线之间空隙的长度,实线可不传。
|
|
1937
|
+
*/
|
|
1815
1938
|
emptySize?: number;
|
|
1816
1939
|
}
|
|
1817
1940
|
|
|
1941
|
+
/**
|
|
1942
|
+
* 点击链接事件的数据。
|
|
1943
|
+
*/
|
|
1818
1944
|
export declare interface MarkdownLinkEvent {
|
|
1945
|
+
/**
|
|
1946
|
+
* 链接地址。
|
|
1947
|
+
*/
|
|
1819
1948
|
url: string;
|
|
1949
|
+
/**
|
|
1950
|
+
* 链接的文本内容。
|
|
1951
|
+
*/
|
|
1820
1952
|
content: string;
|
|
1821
1953
|
}
|
|
1822
1954
|
|
|
1955
|
+
/**
|
|
1956
|
+
* 一段文本标注,用于给指定区间的文本加高亮或边框。
|
|
1957
|
+
*/
|
|
1823
1958
|
export declare interface MarkdownMarkAttachment {
|
|
1959
|
+
/**
|
|
1960
|
+
* 标注区间的起始索引,含该位置。
|
|
1961
|
+
*/
|
|
1824
1962
|
startIndex: number;
|
|
1963
|
+
/**
|
|
1964
|
+
* 标注区间的结束索引,不含该位置。
|
|
1965
|
+
*/
|
|
1825
1966
|
endIndex: number;
|
|
1967
|
+
/**
|
|
1968
|
+
* 索引的计量方式:`char` 按渲染后的字符计,`source` 按 Markdown 源码计。
|
|
1969
|
+
*/
|
|
1826
1970
|
indexType: 'char' | 'source';
|
|
1971
|
+
/**
|
|
1972
|
+
* 标注区域是否可点击。点击后通过 `onTextClick` 回传本条标注的 `id`。
|
|
1973
|
+
*/
|
|
1827
1974
|
clickable?: boolean;
|
|
1975
|
+
/**
|
|
1976
|
+
* 标注标识,会在 `onTextClick` 中回传,用于区分是哪一条标注。
|
|
1977
|
+
*/
|
|
1828
1978
|
id?: string;
|
|
1979
|
+
/**
|
|
1980
|
+
* 标注绘制在文本的下层还是上层。
|
|
1981
|
+
*/
|
|
1829
1982
|
layer?: 'background' | 'foreground';
|
|
1983
|
+
/**
|
|
1984
|
+
* 标注的样式。
|
|
1985
|
+
*/
|
|
1830
1986
|
style: MarkdownMarkStyle;
|
|
1831
1987
|
}
|
|
1832
1988
|
|
|
1989
|
+
/**
|
|
1990
|
+
* 文本标注的样式,用于绘制高亮块和四周边框。
|
|
1991
|
+
*/
|
|
1833
1992
|
export declare interface MarkdownMarkStyle {
|
|
1993
|
+
/**
|
|
1994
|
+
* 标注块的圆角半径。
|
|
1995
|
+
*/
|
|
1834
1996
|
radius?: number;
|
|
1997
|
+
/**
|
|
1998
|
+
* 标注块相对文本左侧的额外内边距。
|
|
1999
|
+
*/
|
|
1835
2000
|
left?: number;
|
|
2001
|
+
/**
|
|
2002
|
+
* 标注块相对文本右侧的额外内边距。
|
|
2003
|
+
*/
|
|
1836
2004
|
right?: number;
|
|
2005
|
+
/**
|
|
2006
|
+
* 标注块相对文本顶部的额外内边距。
|
|
2007
|
+
*/
|
|
1837
2008
|
top?: number;
|
|
2009
|
+
/**
|
|
2010
|
+
* 标注块相对文本底部的额外内边距。
|
|
2011
|
+
*/
|
|
1838
2012
|
bottom?: number;
|
|
2013
|
+
/**
|
|
2014
|
+
* 标注块的填充色。
|
|
2015
|
+
*/
|
|
1839
2016
|
color?: string;
|
|
2017
|
+
/**
|
|
2018
|
+
* 左边框样式。
|
|
2019
|
+
*/
|
|
1840
2020
|
borderLeft?: MarkdownLineStyle;
|
|
2021
|
+
/**
|
|
2022
|
+
* 上边框样式。
|
|
2023
|
+
*/
|
|
1841
2024
|
borderTop?: MarkdownLineStyle;
|
|
2025
|
+
/**
|
|
2026
|
+
* 右边框样式。
|
|
2027
|
+
*/
|
|
1842
2028
|
borderRight?: MarkdownLineStyle;
|
|
2029
|
+
/**
|
|
2030
|
+
* 下边框样式。
|
|
2031
|
+
*/
|
|
1843
2032
|
borderBottom?: MarkdownLineStyle;
|
|
1844
2033
|
}
|
|
1845
2034
|
|
|
2035
|
+
/**
|
|
2036
|
+
* UI 方法调用失败时的结果。
|
|
2037
|
+
*/
|
|
1846
2038
|
export declare interface MarkdownMethodFailResult {
|
|
2039
|
+
/**
|
|
2040
|
+
* 错误码。
|
|
2041
|
+
*/
|
|
1847
2042
|
code: number;
|
|
2043
|
+
/**
|
|
2044
|
+
* 错误信息。
|
|
2045
|
+
*/
|
|
1848
2046
|
data: string;
|
|
1849
2047
|
}
|
|
1850
2048
|
|
|
2049
|
+
/**
|
|
2050
|
+
* 文本溢出事件的数据。
|
|
2051
|
+
*/
|
|
1851
2052
|
export declare interface MarkdownOverflowEvent {
|
|
2053
|
+
/**
|
|
2054
|
+
* 溢出的处理方式:`ellipsis` 显示省略号,`clip` 直接截断。
|
|
2055
|
+
*/
|
|
1852
2056
|
type: 'ellipsis' | 'clip';
|
|
1853
2057
|
}
|
|
1854
2058
|
|
|
2059
|
+
/**
|
|
2060
|
+
* 解析结束事件的数据。
|
|
2061
|
+
*/
|
|
1855
2062
|
export declare interface MarkdownParseEndEvent {
|
|
2063
|
+
/**
|
|
2064
|
+
* 触发解析的内容标识,对应 `contentId`。
|
|
2065
|
+
*/
|
|
1856
2066
|
id: string;
|
|
1857
2067
|
}
|
|
1858
2068
|
|
|
2069
|
+
/**
|
|
2070
|
+
* 获取标签源码区间的结果。
|
|
2071
|
+
*/
|
|
1859
2072
|
export declare interface MarkdownParseResult {
|
|
2073
|
+
/**
|
|
2074
|
+
* 以标签名为 key,值为该标签在源码中出现的所有区间。
|
|
2075
|
+
*/
|
|
1860
2076
|
result: Map<string, MarkdownSourceRange[]>;
|
|
1861
2077
|
}
|
|
1862
2078
|
|
|
@@ -1868,7 +2084,7 @@ export declare interface MarkdownParseResultOptions {
|
|
|
1868
2084
|
}
|
|
1869
2085
|
|
|
1870
2086
|
/**
|
|
1871
|
-
* Markdown
|
|
2087
|
+
* Markdown 渲染组件,用于渲染 Markdown 内容,支持打字机动画、文本选择和文本标注。
|
|
1872
2088
|
*/
|
|
1873
2089
|
export declare interface MarkdownProps {
|
|
1874
2090
|
/**
|
|
@@ -1900,9 +2116,9 @@ export declare interface MarkdownProps {
|
|
|
1900
2116
|
*/
|
|
1901
2117
|
contentId?: string;
|
|
1902
2118
|
/**
|
|
1903
|
-
* Markdown
|
|
1904
|
-
|
|
1905
|
-
|
|
2119
|
+
* Markdown 内部元素样式表。它不是普通的 CSS style:颜色使用不带 `#` 的十六进制字符串
|
|
2120
|
+
*(如 `'151515'`),尺寸使用 number(如 `fontSize: 15`、`lineHeight: 22`),
|
|
2121
|
+
* 不要传 `var(--color)`、`'#151515'` 或 `'15px'`。
|
|
1906
2122
|
* @defaultValue {}
|
|
1907
2123
|
*/
|
|
1908
2124
|
markdownStyle?: MarkdownStyle;
|
|
@@ -2057,27 +2273,69 @@ export declare interface MarkdownResumeAnimationOptions {
|
|
|
2057
2273
|
animationStep?: number;
|
|
2058
2274
|
}
|
|
2059
2275
|
|
|
2276
|
+
/**
|
|
2277
|
+
* 获取选中文本的结果。
|
|
2278
|
+
*/
|
|
2060
2279
|
export declare interface MarkdownSelectedTextResult {
|
|
2280
|
+
/**
|
|
2281
|
+
* 当前选中的文本,没有选区时为空字符串。
|
|
2282
|
+
*/
|
|
2061
2283
|
selectedText: string;
|
|
2062
2284
|
}
|
|
2063
2285
|
|
|
2286
|
+
/**
|
|
2287
|
+
* 文本选区变化事件的数据。
|
|
2288
|
+
*/
|
|
2064
2289
|
export declare interface MarkdownSelectionChangeEvent {
|
|
2290
|
+
/**
|
|
2291
|
+
* 选区起始字符索引。
|
|
2292
|
+
*/
|
|
2065
2293
|
start: number;
|
|
2294
|
+
/**
|
|
2295
|
+
* 选区结束字符索引。
|
|
2296
|
+
*/
|
|
2066
2297
|
end: number;
|
|
2298
|
+
/**
|
|
2299
|
+
* 选区的延展方向。
|
|
2300
|
+
*/
|
|
2067
2301
|
direction: 'forward' | 'backward';
|
|
2068
2302
|
}
|
|
2069
2303
|
|
|
2304
|
+
/**
|
|
2305
|
+
* 选区两端的拖拽手柄位置,可用于自绘选区光标。
|
|
2306
|
+
*/
|
|
2070
2307
|
export declare interface MarkdownSelectionHandle {
|
|
2308
|
+
/**
|
|
2309
|
+
* 手柄圆心的 x 坐标。
|
|
2310
|
+
*/
|
|
2071
2311
|
x: number;
|
|
2312
|
+
/**
|
|
2313
|
+
* 手柄圆心的 y 坐标。
|
|
2314
|
+
*/
|
|
2072
2315
|
y: number;
|
|
2316
|
+
/**
|
|
2317
|
+
* 手柄的半径。
|
|
2318
|
+
*/
|
|
2073
2319
|
radius: number;
|
|
2074
2320
|
}
|
|
2075
2321
|
|
|
2322
|
+
/**
|
|
2323
|
+
* 标签在 Markdown 源码中的位置区间。
|
|
2324
|
+
*/
|
|
2076
2325
|
export declare interface MarkdownSourceRange {
|
|
2326
|
+
/**
|
|
2327
|
+
* 起始索引,含该位置。
|
|
2328
|
+
*/
|
|
2077
2329
|
start: number;
|
|
2330
|
+
/**
|
|
2331
|
+
* 结束索引,不含该位置。
|
|
2332
|
+
*/
|
|
2078
2333
|
end: number;
|
|
2079
2334
|
}
|
|
2080
2335
|
|
|
2336
|
+
/**
|
|
2337
|
+
* Markdown 内部元素的样式表,写法见 `markdownStyle` 属性说明。
|
|
2338
|
+
*/
|
|
2081
2339
|
export declare type MarkdownStyle = Record<string, unknown>;
|
|
2082
2340
|
|
|
2083
2341
|
export declare interface MarkdownTextBoundingRectOptions extends MarkdownContentRangeOptions {
|
|
@@ -2088,12 +2346,27 @@ export declare interface MarkdownTextBoundingRectOptions extends MarkdownContent
|
|
|
2088
2346
|
indexType?: 'source' | 'char';
|
|
2089
2347
|
}
|
|
2090
2348
|
|
|
2349
|
+
/**
|
|
2350
|
+
* 获取文本包围盒的结果。
|
|
2351
|
+
*/
|
|
2091
2352
|
export declare interface MarkdownTextBoundingRectResult {
|
|
2353
|
+
/**
|
|
2354
|
+
* 指定区间整体的包围盒。
|
|
2355
|
+
*/
|
|
2092
2356
|
boundingRect: MarkdownBoundingRect;
|
|
2357
|
+
/**
|
|
2358
|
+
* 指定区间逐行的包围盒,跨行时有多个。
|
|
2359
|
+
*/
|
|
2093
2360
|
boxes: MarkdownBoundingRect[];
|
|
2094
2361
|
}
|
|
2095
2362
|
|
|
2363
|
+
/**
|
|
2364
|
+
* 点击标注文本事件的数据。
|
|
2365
|
+
*/
|
|
2096
2366
|
export declare interface MarkdownTextClickEvent {
|
|
2367
|
+
/**
|
|
2368
|
+
* 被点击标注的标识,对应 `MarkdownMarkAttachment.id`。
|
|
2369
|
+
*/
|
|
2097
2370
|
id: string;
|
|
2098
2371
|
}
|
|
2099
2372
|
|
|
@@ -2116,9 +2389,21 @@ export declare interface MarkdownTextSelectionOptions {
|
|
|
2116
2389
|
endY: number;
|
|
2117
2390
|
}
|
|
2118
2391
|
|
|
2392
|
+
/**
|
|
2393
|
+
* 设置文本选区的结果。
|
|
2394
|
+
*/
|
|
2119
2395
|
export declare interface MarkdownTextSelectionResult {
|
|
2396
|
+
/**
|
|
2397
|
+
* 整个选区的包围盒。
|
|
2398
|
+
*/
|
|
2120
2399
|
boundingRect: MarkdownBoundingRect;
|
|
2400
|
+
/**
|
|
2401
|
+
* 选区逐行的包围盒,跨行选择时有多个。
|
|
2402
|
+
*/
|
|
2121
2403
|
boxes: MarkdownBoundingRect[];
|
|
2404
|
+
/**
|
|
2405
|
+
* 选区起点和终点的手柄位置。
|
|
2406
|
+
*/
|
|
2122
2407
|
handles: {
|
|
2123
2408
|
start: MarkdownSelectionHandle;
|
|
2124
2409
|
end: MarkdownSelectionHandle;
|
|
@@ -2247,7 +2532,7 @@ export declare interface NavigationBarBackEvent {
|
|
|
2247
2532
|
/**
|
|
2248
2533
|
* 页面顶部导航栏组件。
|
|
2249
2534
|
*
|
|
2250
|
-
*
|
|
2535
|
+
* 用于隐藏豆包默认标题栏后的自定义页面导航,自动适配状态栏和平台导航规格。
|
|
2251
2536
|
*/
|
|
2252
2537
|
export declare interface NavigationBarProps {
|
|
2253
2538
|
/** 组件样式。 */
|
|
@@ -2342,7 +2627,7 @@ declare interface OnDragCallback {
|
|
|
2342
2627
|
}
|
|
2343
2628
|
|
|
2344
2629
|
/**
|
|
2345
|
-
*
|
|
2630
|
+
* button 通过 `openType="openSetting"` 打开授权设置页后的回调事件。
|
|
2346
2631
|
*/
|
|
2347
2632
|
export declare interface OpenSettingEvent {
|
|
2348
2633
|
/**
|
|
@@ -2371,6 +2656,9 @@ export declare type OpenSettingEventDetail = {
|
|
|
2371
2656
|
} | {
|
|
2372
2657
|
/**
|
|
2373
2658
|
* 回调状态,失败时格式为 `openSetting:fail ${错误信息}`。
|
|
2659
|
+
*
|
|
2660
|
+
* 错误信息由客户端返回,没有固定枚举,例如 `openSetting:fail Applet bridge unavailable`;
|
|
2661
|
+
* 客户端未返回原因时为 `openSetting:fail unknown error`。
|
|
2374
2662
|
*/
|
|
2375
2663
|
errMsg: `openSetting:fail ${string}`;
|
|
2376
2664
|
};
|
|
@@ -2424,10 +2712,16 @@ export declare interface PickerColumnProps {
|
|
|
2424
2712
|
}
|
|
2425
2713
|
|
|
2426
2714
|
export declare interface PickerColumnRef {
|
|
2715
|
+
/**
|
|
2716
|
+
* 获取当前选中项的值和完整选项数据。
|
|
2717
|
+
*/
|
|
2427
2718
|
getValue: () => {
|
|
2428
2719
|
value: string | number;
|
|
2429
2720
|
option: PickerColumnOption;
|
|
2430
2721
|
};
|
|
2722
|
+
/**
|
|
2723
|
+
* 滚动到指定值对应的选项。
|
|
2724
|
+
*/
|
|
2431
2725
|
setValue: (value: string | number) => void;
|
|
2432
2726
|
}
|
|
2433
2727
|
|
|
@@ -2466,7 +2760,7 @@ export declare interface PickerViewProps {
|
|
|
2466
2760
|
*/
|
|
2467
2761
|
className?: string;
|
|
2468
2762
|
/**
|
|
2469
|
-
*
|
|
2763
|
+
* 组件主题。未传时跟随豆包当前主题;传入后固定使用指定主题。
|
|
2470
2764
|
*/
|
|
2471
2765
|
theme?: Theme;
|
|
2472
2766
|
/**
|
|
@@ -2484,8 +2778,17 @@ export declare interface PickerViewProps {
|
|
|
2484
2778
|
}
|
|
2485
2779
|
|
|
2486
2780
|
export declare interface PickerViewRef {
|
|
2781
|
+
/**
|
|
2782
|
+
* 按列顺序获取各列当前选中项的值。
|
|
2783
|
+
*/
|
|
2487
2784
|
getValues: () => (string | number)[];
|
|
2785
|
+
/**
|
|
2786
|
+
* 按列顺序获取各列当前选中项的完整选项数据。
|
|
2787
|
+
*/
|
|
2488
2788
|
getOptions: () => PickerColumnOption[];
|
|
2789
|
+
/**
|
|
2790
|
+
* 按列顺序把各列滚动到指定值对应的选项。
|
|
2791
|
+
*/
|
|
2489
2792
|
setValues: (values: (string | number)[]) => void;
|
|
2490
2793
|
}
|
|
2491
2794
|
|
|
@@ -3037,44 +3340,44 @@ export declare interface RenderLongImageSegmentsOptions {
|
|
|
3037
3340
|
listItemReuseIdentifierPrefix?: string;
|
|
3038
3341
|
}
|
|
3039
3342
|
|
|
3040
|
-
/**
|
|
3343
|
+
/** 节点树中的 HTML 元素节点,仅支持白名单内的标签。 */
|
|
3041
3344
|
export declare interface RichTextElementNode {
|
|
3042
|
-
/**
|
|
3345
|
+
/** 节点类型标识,用于兼容小程序写法,可省略。 */
|
|
3043
3346
|
type?: 'node';
|
|
3044
|
-
/**
|
|
3347
|
+
/** 要渲染的 HTML 标签名,需在白名单内。 */
|
|
3045
3348
|
name: string;
|
|
3046
|
-
/**
|
|
3349
|
+
/** 元素属性,白名单外的属性会在解析阶段被移除。 */
|
|
3047
3350
|
attrs?: Record<string, string>;
|
|
3048
|
-
/**
|
|
3351
|
+
/** 该元素内嵌套的文本节点和元素节点。 */
|
|
3049
3352
|
children?: RichTextNode[];
|
|
3050
3353
|
}
|
|
3051
3354
|
|
|
3052
|
-
/**
|
|
3355
|
+
/** 富文本节点,可以是文本节点或元素节点。 */
|
|
3053
3356
|
export declare type RichTextNode = RichTextTextNode | RichTextElementNode;
|
|
3054
3357
|
|
|
3055
|
-
/**
|
|
3358
|
+
/** 富文本组件,支持 HTML 字符串或结构化节点,并自动同步内容高度。写法与小程序 rich-text 兼容。 */
|
|
3056
3359
|
export declare interface RichTextProps {
|
|
3057
3360
|
/**
|
|
3058
|
-
*
|
|
3059
|
-
*
|
|
3361
|
+
* 要渲染的内容,可传 HTML 字符串或结构化节点数组。
|
|
3362
|
+
* 白名单外的节点和属性会先被移除,再交给底层渲染。
|
|
3060
3363
|
*/
|
|
3061
3364
|
nodes?: string | RichTextNode[];
|
|
3062
|
-
/**
|
|
3365
|
+
/** 文本节点中的普通空格如何转换。 */
|
|
3063
3366
|
space?: RichTextSpace;
|
|
3064
|
-
/**
|
|
3367
|
+
/** 外层容器的类名。 */
|
|
3065
3368
|
className?: string;
|
|
3066
|
-
/**
|
|
3369
|
+
/** 外层容器的内联样式。 */
|
|
3067
3370
|
style?: CSSProperties | string;
|
|
3068
3371
|
}
|
|
3069
3372
|
|
|
3070
|
-
/**
|
|
3373
|
+
/** 文本中连续空格的转换方式,与小程序 rich-text 一致。 */
|
|
3071
3374
|
export declare type RichTextSpace = '' | 'nbsp' | 'ensp' | 'emsp';
|
|
3072
3375
|
|
|
3073
|
-
/**
|
|
3376
|
+
/** 节点树中的文本节点。 */
|
|
3074
3377
|
export declare interface RichTextTextNode {
|
|
3075
|
-
/**
|
|
3378
|
+
/** 节点类型标识,文本节点固定为 `text`。 */
|
|
3076
3379
|
type: 'text';
|
|
3077
|
-
/**
|
|
3380
|
+
/** 在该位置渲染的纯文本内容。 */
|
|
3078
3381
|
text: string;
|
|
3079
3382
|
}
|
|
3080
3383
|
|
|
@@ -3393,17 +3696,17 @@ declare interface SwiperProps_2<T> {
|
|
|
3393
3696
|
* 子元素,应该是一个函数,返回 SwiperItem
|
|
3394
3697
|
* @example
|
|
3395
3698
|
* ```tsx
|
|
3396
|
-
* <
|
|
3699
|
+
* <swiper
|
|
3397
3700
|
* data={items}
|
|
3398
3701
|
* itemWidth={350}
|
|
3399
3702
|
* >
|
|
3400
3703
|
* {({ index, item }) => (
|
|
3401
|
-
* <
|
|
3704
|
+
* <swiper-item index={index} key={index}>
|
|
3402
3705
|
* <image class="image" src={`${item}`}></image>
|
|
3403
3706
|
* <text class="image-text">Number.{index}</text>
|
|
3404
|
-
* </
|
|
3707
|
+
* </swiper-item>
|
|
3405
3708
|
* )}
|
|
3406
|
-
* </
|
|
3709
|
+
* </swiper>
|
|
3407
3710
|
* ```
|
|
3408
3711
|
*/
|
|
3409
3712
|
children: (prop: RenderFunctionProps<T>) => ReactElement_2;
|
|
@@ -3827,34 +4130,39 @@ export declare interface TextProps {
|
|
|
3827
4130
|
bindtap?: (event: TouchEvent_2) => void;
|
|
3828
4131
|
}
|
|
3829
4132
|
|
|
4133
|
+
/**
|
|
4134
|
+
* 组件主题:`light` 为浅色,`dark` 为深色。
|
|
4135
|
+
*/
|
|
3830
4136
|
export declare type Theme = 'light' | 'dark';
|
|
3831
4137
|
|
|
3832
4138
|
/**
|
|
3833
|
-
*
|
|
4139
|
+
* 主题配置组件,为其包裹的子组件统一指定豆包的浅色 / 深色模式。
|
|
4140
|
+
*
|
|
4141
|
+
* 只影响颜色相关的 CSS 变量,不涉及圆角、间距、字号等其他样式。
|
|
3834
4142
|
*/
|
|
3835
4143
|
export declare interface ThemeProviderProps {
|
|
3836
4144
|
/**
|
|
3837
|
-
*
|
|
4145
|
+
* 子树使用的主题。未传时跟随最近的上层 theme-provider;没有上层 theme-provider 时,跟随豆包当前主题。
|
|
3838
4146
|
*/
|
|
3839
4147
|
theme?: Theme;
|
|
3840
4148
|
/**
|
|
3841
|
-
*
|
|
4149
|
+
* 子元素,会继承本组件设置的豆包主题颜色变量。
|
|
3842
4150
|
*/
|
|
3843
4151
|
children?: ReactNode;
|
|
3844
4152
|
/**
|
|
3845
|
-
*
|
|
4153
|
+
* 容器样式
|
|
3846
4154
|
*/
|
|
3847
4155
|
style?: CSSProperties;
|
|
3848
4156
|
/**
|
|
3849
|
-
*
|
|
4157
|
+
* 容器类名
|
|
3850
4158
|
*/
|
|
3851
4159
|
className?: string;
|
|
3852
4160
|
/**
|
|
3853
|
-
*
|
|
4161
|
+
* 容器 id
|
|
3854
4162
|
*/
|
|
3855
4163
|
id?: string;
|
|
3856
4164
|
/**
|
|
3857
|
-
*
|
|
4165
|
+
* 是否展平容器 view。默认 false,因为该 view 需要作为 CSS 变量的作用域存在。
|
|
3858
4166
|
*
|
|
3859
4167
|
* @defaultValue false
|
|
3860
4168
|
*/
|
|
@@ -4686,10 +4994,11 @@ declare interface WebGLContextAttributes_2 {
|
|
|
4686
4994
|
* H5 页面需要先引入 WebView JSSDK,才能收发消息。可以用 script 标签引入:
|
|
4687
4995
|
*
|
|
4688
4996
|
* ```html
|
|
4689
|
-
* <script src="https://lf3-static.bytednsdoc.com/obj/eden-cn/msvdeh7pfhpquly/doubao-jssdk-0.0.
|
|
4997
|
+
* <script src="https://lf3-static.bytednsdoc.com/obj/eden-cn/msvdeh7pfhpquly/doubao-jssdk-0.0.41.js"></script>
|
|
4690
4998
|
* ```
|
|
4691
4999
|
*
|
|
4692
|
-
*
|
|
5000
|
+
* H5 项目如果用 npm 管理依赖,也可以安装 `@doubao-dev/webview-jssdk` 后导入,
|
|
5001
|
+
* 导入时会同时挂载全局 `window.doubao`:
|
|
4693
5002
|
*
|
|
4694
5003
|
* ```js
|
|
4695
5004
|
* import doubao from '@doubao-dev/webview-jssdk';
|
|
@@ -4699,10 +5008,10 @@ declare interface WebGLContextAttributes_2 {
|
|
|
4699
5008
|
* 应用侧:`src` 指向 H5 地址,`ref` 用于拿到 `postMessage`,`onMessage` 接收 H5 消息。
|
|
4700
5009
|
*
|
|
4701
5010
|
* ```tsx
|
|
4702
|
-
* import {
|
|
5011
|
+
* import { useRef } from '@doubao-dev/framework';
|
|
4703
5012
|
* import type { WebViewRef } from '@doubao-dev/framework/components';
|
|
4704
5013
|
*
|
|
4705
|
-
* function WebViewPage() {
|
|
5014
|
+
* export default function WebViewPage() {
|
|
4706
5015
|
* const webViewRef = useRef<WebViewRef>(null);
|
|
4707
5016
|
*
|
|
4708
5017
|
* return (
|
|
@@ -4722,8 +5031,6 @@ declare interface WebGLContextAttributes_2 {
|
|
|
4722
5031
|
* />
|
|
4723
5032
|
* );
|
|
4724
5033
|
* }
|
|
4725
|
-
*
|
|
4726
|
-
* export default definePage({ render: () => <WebViewPage /> });
|
|
4727
5034
|
* ```
|
|
4728
5035
|
*
|
|
4729
5036
|
* H5 侧:`doubao.onMessage` 接收应用消息并返回注销函数,`doubao.postMessage` 发送消息给应用。
|
|
@@ -4752,6 +5059,8 @@ declare interface WebGLContextAttributes_2 {
|
|
|
4752
5059
|
*
|
|
4753
5060
|
* 除消息通道外,H5 还可以调用 `doubao.setTitle({ title })` 同步应用侧 WebView 头部标题。
|
|
4754
5061
|
*
|
|
5062
|
+
* ## Web 模拟器差异
|
|
5063
|
+
*
|
|
4755
5064
|
* Web 模拟器中的 `<web-view>` 通过本地代理承载 H5 页面,页面脚本读取到的
|
|
4756
5065
|
* `location.origin` / `location.host` 可能是调试器本地域名,而不是真机 WebView 中的业务域名。
|
|
4757
5066
|
* 如果 H5 依赖 `location.origin` 或 `location.host` 判断测试环境、线上环境、白名单或鉴权逻辑,
|