@retion-miniapp/react-native 0.19.0 → 0.20.1
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/index.d.mts +114 -6
- package/dist/index.d.ts +114 -6
- package/dist/index.js +11 -11
- package/dist/index.mjs +11 -11
- package/docs/MINIAPP_README.md +33 -0
- package/package.json +9 -1
package/dist/index.d.mts
CHANGED
|
@@ -751,13 +751,112 @@ interface MiniAppUpdatesProps {
|
|
|
751
751
|
renderUpdate?: (props: MiniAppUpdatePromptProps) => ReactNode;
|
|
752
752
|
/** UI riêng cho "Có gì mới" (logic vẫn do SDK). */
|
|
753
753
|
renderChangelog?: (props: MiniAppChangelogPromptProps) => ReactNode;
|
|
754
|
+
/** Màu / bo góc cho UI mặc định và các khối nội dung SDK (nhóm changelog, lịch sử). */
|
|
755
|
+
theme?: MiniAppUpdatesTheme;
|
|
756
|
+
/** Header riêng cho màn "Xem tất cả" (vd ScreenHeader của app). Không truyền → header nổi mặc định. */
|
|
757
|
+
renderHistoryHeader?: (props: MiniAppHistoryHeaderProps) => ReactNode;
|
|
758
|
+
/** Đổi chữ (đa ngôn ngữ / giọng văn riêng). */
|
|
759
|
+
labels?: Partial<MiniAppUpdatesLabels>;
|
|
760
|
+
/** Nút riêng cho popup "Có gì mới" (thay "Đã hiểu" + "Xem tất cả"). */
|
|
761
|
+
renderChangelogActions?: (props: MiniAppChangelogActionsProps) => ReactNode;
|
|
762
|
+
/** Nút riêng cho popup cập nhật (thay "Cập nhật ngay" / "Thử lại"; lúc đang tải SDK vẫn hiện %). */
|
|
763
|
+
renderUpdateAction?: (props: MiniAppUpdateActionProps) => ReactNode;
|
|
754
764
|
}
|
|
765
|
+
interface MiniAppUpdatesLabels {
|
|
766
|
+
changelog_title: string;
|
|
767
|
+
changelog_ok: string;
|
|
768
|
+
changelog_view_all: string;
|
|
769
|
+
/** Mẫu "+{count} thay đổi khác". */
|
|
770
|
+
changelog_more: string;
|
|
771
|
+
history_title: string;
|
|
772
|
+
history_empty: string;
|
|
773
|
+
history_error: string;
|
|
774
|
+
retry: string;
|
|
775
|
+
update_title: string;
|
|
776
|
+
updating_title: string;
|
|
777
|
+
/** Mẫu, có {next} và {current}. */
|
|
778
|
+
update_message: string;
|
|
779
|
+
update_failed: string;
|
|
780
|
+
update_now: string;
|
|
781
|
+
updating_hint: string;
|
|
782
|
+
}
|
|
783
|
+
interface MiniAppChangelogActionsProps {
|
|
784
|
+
onClose: () => void;
|
|
785
|
+
onViewAll: () => void;
|
|
786
|
+
labels: MiniAppUpdatesLabels;
|
|
787
|
+
}
|
|
788
|
+
interface MiniAppUpdateActionProps {
|
|
789
|
+
onUpdate: () => void;
|
|
790
|
+
has_failed: boolean;
|
|
791
|
+
/** "Cập nhật ngay" hoặc "Thử lại" theo labels. */
|
|
792
|
+
label: string;
|
|
793
|
+
}
|
|
794
|
+
declare const DEFAULT_MINIAPP_UPDATES_LABELS: MiniAppUpdatesLabels;
|
|
795
|
+
interface MiniAppHistoryHeaderProps {
|
|
796
|
+
title: string;
|
|
797
|
+
/** Tên mini app. */
|
|
798
|
+
subtitle: string;
|
|
799
|
+
onBack: () => void;
|
|
800
|
+
}
|
|
801
|
+
interface MiniAppChangelogKindStyle {
|
|
802
|
+
label?: string;
|
|
803
|
+
color?: string;
|
|
804
|
+
bg?: string;
|
|
805
|
+
}
|
|
806
|
+
/** Tuỳ biến UI — chỉ truyền phần cần đổi, còn lại theo mặc định (sáng hoặc tối nếu `dark`). */
|
|
807
|
+
interface MiniAppUpdatesTheme {
|
|
808
|
+
dark?: boolean;
|
|
809
|
+
/** Nút chính, link, version mới. */
|
|
810
|
+
primary?: string;
|
|
811
|
+
/** Chữ trên nút chính. */
|
|
812
|
+
on_primary?: string;
|
|
813
|
+
/** Nền màn lịch sử, nền viên version, nền `code`. Dạng #RRGGBB (header fade nối thêm alpha). */
|
|
814
|
+
background?: string;
|
|
815
|
+
/** Nền popup / card. */
|
|
816
|
+
surface?: string;
|
|
817
|
+
text?: string;
|
|
818
|
+
text_secondary?: string;
|
|
819
|
+
/** Chữ mờ: số lượng mục, mũi tên version. */
|
|
820
|
+
hint?: string;
|
|
821
|
+
/** Lớp phủ sau popup. */
|
|
822
|
+
overlay?: string;
|
|
823
|
+
divider?: string;
|
|
824
|
+
/** Bo góc popup (card lịch sử = radius - 12). */
|
|
825
|
+
radius?: number;
|
|
826
|
+
/** Bo góc nút chính. */
|
|
827
|
+
button_radius?: number;
|
|
828
|
+
/** Chiều cao nút chính. */
|
|
829
|
+
button_height?: number;
|
|
830
|
+
/** Màu chữ nút phụ "Xem tất cả" (mặc định primary). */
|
|
831
|
+
secondary?: string;
|
|
832
|
+
/** Màu / nhãn từng nhóm. */
|
|
833
|
+
kinds?: Partial<Record<keyof MiniAppChangelog, MiniAppChangelogKindStyle>>;
|
|
834
|
+
}
|
|
835
|
+
type ResolvedTheme = Required<Omit<MiniAppUpdatesTheme, 'kinds' | 'secondary'>> & {
|
|
836
|
+
secondary?: string;
|
|
837
|
+
labels: MiniAppUpdatesLabels;
|
|
838
|
+
kinds: {
|
|
839
|
+
key: keyof MiniAppChangelog;
|
|
840
|
+
label: string;
|
|
841
|
+
color: string;
|
|
842
|
+
bg: string;
|
|
843
|
+
}[];
|
|
844
|
+
};
|
|
845
|
+
/** Khai báo trước resolveMiniAppUpdatesTheme — DEFAULT_THEME tính ngay lúc nạp module. */
|
|
755
846
|
declare const MINIAPP_CHANGELOG_KINDS: {
|
|
756
847
|
key: keyof MiniAppChangelog;
|
|
757
848
|
label: string;
|
|
758
849
|
color: string;
|
|
759
850
|
bg: string;
|
|
760
851
|
}[];
|
|
852
|
+
declare const resolveMiniAppUpdatesTheme: (theme?: MiniAppUpdatesTheme, labels?: Partial<MiniAppUpdatesLabels>) => ResolvedTheme;
|
|
853
|
+
/** Bọc UI riêng để MiniAppChangelogGroups / MiniAppChangelogHistory ăn theme của app. */
|
|
854
|
+
declare const MiniAppUpdatesThemeProvider: ({ theme, labels, children }: {
|
|
855
|
+
theme?: MiniAppUpdatesTheme;
|
|
856
|
+
labels?: Partial<MiniAppUpdatesLabels>;
|
|
857
|
+
children: ReactNode;
|
|
858
|
+
}) => React.JSX.Element;
|
|
859
|
+
declare const useMiniAppUpdatesTheme: () => ResolvedTheme;
|
|
761
860
|
declare const mergeMiniAppChangelog: (versions: MiniAppChangelogVersion[]) => MiniAppChangelog;
|
|
762
861
|
/** 1 mục changelog: **đậm**, `code`, [chữ](https://link) — Text lồng nhau, link mở trình duyệt. */
|
|
763
862
|
declare const MiniAppChangelogText: ({ text, style }: {
|
|
@@ -765,22 +864,31 @@ declare const MiniAppChangelogText: ({ text, style }: {
|
|
|
765
864
|
style?: TextProps["style"];
|
|
766
865
|
}) => React.JSX.Element;
|
|
767
866
|
/** 3 nhóm Mới / Sửa lỗi / Cải thiện (bỏ nhóm trống) — dùng lại được trong UI riêng. */
|
|
768
|
-
declare const MiniAppChangelogGroups: ({ changelog }: {
|
|
867
|
+
declare const MiniAppChangelogGroups: ({ changelog, max_items, onMore }: {
|
|
769
868
|
changelog: MiniAppChangelog;
|
|
869
|
+
/** Mỗi nhóm chỉ hiện tối đa N mục, còn lại gom thành "+N thay đổi khác" (popup). */
|
|
870
|
+
max_items?: number;
|
|
871
|
+
onMore?: () => void;
|
|
770
872
|
}) => React.JSX.Element;
|
|
771
873
|
/** Toàn bộ lịch sử changelog của 1 mini app (màn "Xem tất cả"), mới nhất trước. Header nổi kiểu Chat SDK. */
|
|
772
|
-
declare const MiniAppChangelogHistory: ({ app_id, name, onBack }: {
|
|
874
|
+
declare const MiniAppChangelogHistory: ({ app_id, name, onBack, renderHeader }: {
|
|
773
875
|
app_id: string;
|
|
774
876
|
name: string;
|
|
775
877
|
onBack: () => void;
|
|
878
|
+
/** Header riêng (nằm trong luồng, SDK đệm sẵn status bar). Không truyền → header nổi mặc định. */
|
|
879
|
+
renderHeader?: (props: MiniAppHistoryHeaderProps) => ReactNode;
|
|
776
880
|
}) => React.JSX.Element;
|
|
777
881
|
/** UI mặc định "Có gì mới". */
|
|
778
|
-
declare const DefaultMiniAppChangelogPrompt: ({ request, changelog, onClose }: MiniAppChangelogPromptProps
|
|
882
|
+
declare const DefaultMiniAppChangelogPrompt: ({ request, changelog, onClose, renderHistoryHeader, renderActions }: MiniAppChangelogPromptProps & {
|
|
883
|
+
renderHistoryHeader?: MiniAppUpdatesProps["renderHistoryHeader"];
|
|
884
|
+
renderActions?: MiniAppUpdatesProps["renderChangelogActions"];
|
|
885
|
+
}) => React.JSX.Element;
|
|
779
886
|
/** UI mặc định popup cập nhật bắt buộc (không đóng được). */
|
|
780
|
-
declare const DefaultMiniAppUpdatePrompt: ({ update, is_updating, progress, has_failed, onUpdate, logo }: MiniAppUpdatePromptProps & {
|
|
887
|
+
declare const DefaultMiniAppUpdatePrompt: ({ update, is_updating, progress, has_failed, onUpdate, logo, renderAction }: MiniAppUpdatePromptProps & {
|
|
781
888
|
logo?: ImageSourcePropType;
|
|
889
|
+
renderAction?: MiniAppUpdatesProps["renderUpdateAction"];
|
|
782
890
|
}) => React.JSX.Element;
|
|
783
|
-
declare const _default: React.MemoExoticComponent<({ app_ids, shouldShowUpdate, logo, renderUpdate, renderChangelog }: MiniAppUpdatesProps) => React.JSX.Element | null>;
|
|
891
|
+
declare const _default: React.MemoExoticComponent<({ app_ids, shouldShowUpdate, logo, renderUpdate, renderChangelog, theme, renderHistoryHeader, labels, renderChangelogActions, renderUpdateAction }: MiniAppUpdatesProps) => React.JSX.Element | null>;
|
|
784
892
|
|
|
785
893
|
/**
|
|
786
894
|
* Markdown inline tối giản cho changelog (1 dòng / mục): **đậm**, `code`, [chữ](https://link).
|
|
@@ -976,4 +1084,4 @@ interface UploadCapabilities {
|
|
|
976
1084
|
/** XHR (không phải fetch) để có tiến trình upload; RN đọc file từ uri (cả content://), không nạp vào JS. */
|
|
977
1085
|
declare const uploadToUrl: MiniAppUploader;
|
|
978
1086
|
|
|
979
|
-
export { CodeType, DefaultMiniAppChangelogPrompt, DefaultMiniAppSplash, DefaultMiniAppUpdatePrompt, type InlineToken, type LocationOptions, type LocationResult, MINIAPP_CHANGELOG_KINDS, MINIAPP_PLATFORM_URL, type MiniAppBiometricAvailability, type MiniAppBiometricRequest, type MiniAppBiometricResult, type MiniAppBiometrics, type MiniAppBiometryType, type MiniAppBridgeOptions, type MiniAppCatalogEntry, type MiniAppCatalogItem, type MiniAppChangelog, MiniAppChangelogGroups, MiniAppChangelogHistory, type MiniAppChangelogPromptProps, type MiniAppChangelogRequest, type MiniAppChangelogState, MiniAppChangelogText, type MiniAppChangelogVersion, type MiniAppChannel, type MiniAppConfig, type MiniAppContainerProps, type MiniAppContext, type MiniAppDownloadState, type MiniAppDownloadStatus, type MiniAppDownloadTask, type MiniAppEvent, type MiniAppFileSystem, type MiniAppHandlerContext, type MiniAppHapticType, _default$1 as MiniAppHost, type MiniAppHostData, BridgeError as MiniAppHostError, type MiniAppHostProps, type MiniAppKeepAlive, type MiniAppLaunch, type MiniAppLocalBundle, type MiniAppManifest, type MiniAppNativeHandlers, type MiniAppPaymentRequest, type MiniAppPaymentResult, type MiniAppPendingChangelog, type MiniAppPermission, type MiniAppPickedFile, type MiniAppSpeechProvider, type MiniAppSpeechStartContext, type MiniAppSplashProps, type MiniAppStorage, type MiniAppSyncResult, type MiniAppUpdate, type MiniAppUpdatePromptProps, _default as MiniAppUpdates, type MiniAppUpdatesProps, type MiniAppUploadCaller, type MiniAppUploadOptions, type MiniAppUploadProcessOptions, type MiniAppUploadProcessor, type MiniAppUploadRequest, type MiniAppUploadSource, type MiniAppUploadSourceRequest, type MiniAppUploadTarget, type MiniAppUploader, type MiniAppUrlUploadTarget, type OpenMiniAppArgs, type ReactNativeBiometricsLike, ScannerEndReason, ScannerEvent, ScannerLayout, ScannerMethod, type ScannerOptions, type ScannerResult, type SpeechOptions, ToastType, type UploadCapabilities, type UploadFileType, type UploadFilesResult, type UploadedFile, closeMiniApp, configureMiniApp, createMmkvStorage, createReactNativeBiometrics, createRnfsFileSystem, dismissMiniAppChangelog, ensureMiniApp, fetchMiniAppChangelog, getLocalMiniApp, getMiniAppCatalog, getMiniAppCatalogEntry, getMiniAppChangelogSeen, getMiniAppStatuses, getMiniAppUpdate, getPendingChangelog, installBundledMiniApp, markMiniAppChangelogSeen, mergeMiniAppChangelog, onMiniAppEvent, openMiniApp, parseInlineMarkdown, pauseMiniApp, pauseMiniAppDownloads, preloadMiniApp, releaseSpeechFor, restoreMiniApp, resumeMiniApp, resumeMiniAppDownloads, sendEventToWeb, showMiniAppChangelog, stripInlineMarkdown, syncMiniAppCatalog, uninstallMiniApp, updateMiniApp, uploadToUrl, useMiniAppChangelog, useMiniAppChangelogRequest, useMiniAppDownload, useMiniAppDownloadsPaused };
|
|
1087
|
+
export { CodeType, DEFAULT_MINIAPP_UPDATES_LABELS, DefaultMiniAppChangelogPrompt, DefaultMiniAppSplash, DefaultMiniAppUpdatePrompt, type InlineToken, type LocationOptions, type LocationResult, MINIAPP_CHANGELOG_KINDS, MINIAPP_PLATFORM_URL, type MiniAppBiometricAvailability, type MiniAppBiometricRequest, type MiniAppBiometricResult, type MiniAppBiometrics, type MiniAppBiometryType, type MiniAppBridgeOptions, type MiniAppCatalogEntry, type MiniAppCatalogItem, type MiniAppChangelog, type MiniAppChangelogActionsProps, MiniAppChangelogGroups, MiniAppChangelogHistory, type MiniAppChangelogKindStyle, type MiniAppChangelogPromptProps, type MiniAppChangelogRequest, type MiniAppChangelogState, MiniAppChangelogText, type MiniAppChangelogVersion, type MiniAppChannel, type MiniAppConfig, type MiniAppContainerProps, type MiniAppContext, type MiniAppDownloadState, type MiniAppDownloadStatus, type MiniAppDownloadTask, type MiniAppEvent, type MiniAppFileSystem, type MiniAppHandlerContext, type MiniAppHapticType, type MiniAppHistoryHeaderProps, _default$1 as MiniAppHost, type MiniAppHostData, BridgeError as MiniAppHostError, type MiniAppHostProps, type MiniAppKeepAlive, type MiniAppLaunch, type MiniAppLocalBundle, type MiniAppManifest, type MiniAppNativeHandlers, type MiniAppPaymentRequest, type MiniAppPaymentResult, type MiniAppPendingChangelog, type MiniAppPermission, type MiniAppPickedFile, type MiniAppSpeechProvider, type MiniAppSpeechStartContext, type MiniAppSplashProps, type MiniAppStorage, type MiniAppSyncResult, type MiniAppUpdate, type MiniAppUpdateActionProps, type MiniAppUpdatePromptProps, _default as MiniAppUpdates, type MiniAppUpdatesLabels, type MiniAppUpdatesProps, type MiniAppUpdatesTheme, MiniAppUpdatesThemeProvider, type MiniAppUploadCaller, type MiniAppUploadOptions, type MiniAppUploadProcessOptions, type MiniAppUploadProcessor, type MiniAppUploadRequest, type MiniAppUploadSource, type MiniAppUploadSourceRequest, type MiniAppUploadTarget, type MiniAppUploader, type MiniAppUrlUploadTarget, type OpenMiniAppArgs, type ReactNativeBiometricsLike, ScannerEndReason, ScannerEvent, ScannerLayout, ScannerMethod, type ScannerOptions, type ScannerResult, type SpeechOptions, ToastType, type UploadCapabilities, type UploadFileType, type UploadFilesResult, type UploadedFile, closeMiniApp, configureMiniApp, createMmkvStorage, createReactNativeBiometrics, createRnfsFileSystem, dismissMiniAppChangelog, ensureMiniApp, fetchMiniAppChangelog, getLocalMiniApp, getMiniAppCatalog, getMiniAppCatalogEntry, getMiniAppChangelogSeen, getMiniAppStatuses, getMiniAppUpdate, getPendingChangelog, installBundledMiniApp, markMiniAppChangelogSeen, mergeMiniAppChangelog, onMiniAppEvent, openMiniApp, parseInlineMarkdown, pauseMiniApp, pauseMiniAppDownloads, preloadMiniApp, releaseSpeechFor, resolveMiniAppUpdatesTheme, restoreMiniApp, resumeMiniApp, resumeMiniAppDownloads, sendEventToWeb, showMiniAppChangelog, stripInlineMarkdown, syncMiniAppCatalog, uninstallMiniApp, updateMiniApp, uploadToUrl, useMiniAppChangelog, useMiniAppChangelogRequest, useMiniAppDownload, useMiniAppDownloadsPaused, useMiniAppUpdatesTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -751,13 +751,112 @@ interface MiniAppUpdatesProps {
|
|
|
751
751
|
renderUpdate?: (props: MiniAppUpdatePromptProps) => ReactNode;
|
|
752
752
|
/** UI riêng cho "Có gì mới" (logic vẫn do SDK). */
|
|
753
753
|
renderChangelog?: (props: MiniAppChangelogPromptProps) => ReactNode;
|
|
754
|
+
/** Màu / bo góc cho UI mặc định và các khối nội dung SDK (nhóm changelog, lịch sử). */
|
|
755
|
+
theme?: MiniAppUpdatesTheme;
|
|
756
|
+
/** Header riêng cho màn "Xem tất cả" (vd ScreenHeader của app). Không truyền → header nổi mặc định. */
|
|
757
|
+
renderHistoryHeader?: (props: MiniAppHistoryHeaderProps) => ReactNode;
|
|
758
|
+
/** Đổi chữ (đa ngôn ngữ / giọng văn riêng). */
|
|
759
|
+
labels?: Partial<MiniAppUpdatesLabels>;
|
|
760
|
+
/** Nút riêng cho popup "Có gì mới" (thay "Đã hiểu" + "Xem tất cả"). */
|
|
761
|
+
renderChangelogActions?: (props: MiniAppChangelogActionsProps) => ReactNode;
|
|
762
|
+
/** Nút riêng cho popup cập nhật (thay "Cập nhật ngay" / "Thử lại"; lúc đang tải SDK vẫn hiện %). */
|
|
763
|
+
renderUpdateAction?: (props: MiniAppUpdateActionProps) => ReactNode;
|
|
754
764
|
}
|
|
765
|
+
interface MiniAppUpdatesLabels {
|
|
766
|
+
changelog_title: string;
|
|
767
|
+
changelog_ok: string;
|
|
768
|
+
changelog_view_all: string;
|
|
769
|
+
/** Mẫu "+{count} thay đổi khác". */
|
|
770
|
+
changelog_more: string;
|
|
771
|
+
history_title: string;
|
|
772
|
+
history_empty: string;
|
|
773
|
+
history_error: string;
|
|
774
|
+
retry: string;
|
|
775
|
+
update_title: string;
|
|
776
|
+
updating_title: string;
|
|
777
|
+
/** Mẫu, có {next} và {current}. */
|
|
778
|
+
update_message: string;
|
|
779
|
+
update_failed: string;
|
|
780
|
+
update_now: string;
|
|
781
|
+
updating_hint: string;
|
|
782
|
+
}
|
|
783
|
+
interface MiniAppChangelogActionsProps {
|
|
784
|
+
onClose: () => void;
|
|
785
|
+
onViewAll: () => void;
|
|
786
|
+
labels: MiniAppUpdatesLabels;
|
|
787
|
+
}
|
|
788
|
+
interface MiniAppUpdateActionProps {
|
|
789
|
+
onUpdate: () => void;
|
|
790
|
+
has_failed: boolean;
|
|
791
|
+
/** "Cập nhật ngay" hoặc "Thử lại" theo labels. */
|
|
792
|
+
label: string;
|
|
793
|
+
}
|
|
794
|
+
declare const DEFAULT_MINIAPP_UPDATES_LABELS: MiniAppUpdatesLabels;
|
|
795
|
+
interface MiniAppHistoryHeaderProps {
|
|
796
|
+
title: string;
|
|
797
|
+
/** Tên mini app. */
|
|
798
|
+
subtitle: string;
|
|
799
|
+
onBack: () => void;
|
|
800
|
+
}
|
|
801
|
+
interface MiniAppChangelogKindStyle {
|
|
802
|
+
label?: string;
|
|
803
|
+
color?: string;
|
|
804
|
+
bg?: string;
|
|
805
|
+
}
|
|
806
|
+
/** Tuỳ biến UI — chỉ truyền phần cần đổi, còn lại theo mặc định (sáng hoặc tối nếu `dark`). */
|
|
807
|
+
interface MiniAppUpdatesTheme {
|
|
808
|
+
dark?: boolean;
|
|
809
|
+
/** Nút chính, link, version mới. */
|
|
810
|
+
primary?: string;
|
|
811
|
+
/** Chữ trên nút chính. */
|
|
812
|
+
on_primary?: string;
|
|
813
|
+
/** Nền màn lịch sử, nền viên version, nền `code`. Dạng #RRGGBB (header fade nối thêm alpha). */
|
|
814
|
+
background?: string;
|
|
815
|
+
/** Nền popup / card. */
|
|
816
|
+
surface?: string;
|
|
817
|
+
text?: string;
|
|
818
|
+
text_secondary?: string;
|
|
819
|
+
/** Chữ mờ: số lượng mục, mũi tên version. */
|
|
820
|
+
hint?: string;
|
|
821
|
+
/** Lớp phủ sau popup. */
|
|
822
|
+
overlay?: string;
|
|
823
|
+
divider?: string;
|
|
824
|
+
/** Bo góc popup (card lịch sử = radius - 12). */
|
|
825
|
+
radius?: number;
|
|
826
|
+
/** Bo góc nút chính. */
|
|
827
|
+
button_radius?: number;
|
|
828
|
+
/** Chiều cao nút chính. */
|
|
829
|
+
button_height?: number;
|
|
830
|
+
/** Màu chữ nút phụ "Xem tất cả" (mặc định primary). */
|
|
831
|
+
secondary?: string;
|
|
832
|
+
/** Màu / nhãn từng nhóm. */
|
|
833
|
+
kinds?: Partial<Record<keyof MiniAppChangelog, MiniAppChangelogKindStyle>>;
|
|
834
|
+
}
|
|
835
|
+
type ResolvedTheme = Required<Omit<MiniAppUpdatesTheme, 'kinds' | 'secondary'>> & {
|
|
836
|
+
secondary?: string;
|
|
837
|
+
labels: MiniAppUpdatesLabels;
|
|
838
|
+
kinds: {
|
|
839
|
+
key: keyof MiniAppChangelog;
|
|
840
|
+
label: string;
|
|
841
|
+
color: string;
|
|
842
|
+
bg: string;
|
|
843
|
+
}[];
|
|
844
|
+
};
|
|
845
|
+
/** Khai báo trước resolveMiniAppUpdatesTheme — DEFAULT_THEME tính ngay lúc nạp module. */
|
|
755
846
|
declare const MINIAPP_CHANGELOG_KINDS: {
|
|
756
847
|
key: keyof MiniAppChangelog;
|
|
757
848
|
label: string;
|
|
758
849
|
color: string;
|
|
759
850
|
bg: string;
|
|
760
851
|
}[];
|
|
852
|
+
declare const resolveMiniAppUpdatesTheme: (theme?: MiniAppUpdatesTheme, labels?: Partial<MiniAppUpdatesLabels>) => ResolvedTheme;
|
|
853
|
+
/** Bọc UI riêng để MiniAppChangelogGroups / MiniAppChangelogHistory ăn theme của app. */
|
|
854
|
+
declare const MiniAppUpdatesThemeProvider: ({ theme, labels, children }: {
|
|
855
|
+
theme?: MiniAppUpdatesTheme;
|
|
856
|
+
labels?: Partial<MiniAppUpdatesLabels>;
|
|
857
|
+
children: ReactNode;
|
|
858
|
+
}) => React.JSX.Element;
|
|
859
|
+
declare const useMiniAppUpdatesTheme: () => ResolvedTheme;
|
|
761
860
|
declare const mergeMiniAppChangelog: (versions: MiniAppChangelogVersion[]) => MiniAppChangelog;
|
|
762
861
|
/** 1 mục changelog: **đậm**, `code`, [chữ](https://link) — Text lồng nhau, link mở trình duyệt. */
|
|
763
862
|
declare const MiniAppChangelogText: ({ text, style }: {
|
|
@@ -765,22 +864,31 @@ declare const MiniAppChangelogText: ({ text, style }: {
|
|
|
765
864
|
style?: TextProps["style"];
|
|
766
865
|
}) => React.JSX.Element;
|
|
767
866
|
/** 3 nhóm Mới / Sửa lỗi / Cải thiện (bỏ nhóm trống) — dùng lại được trong UI riêng. */
|
|
768
|
-
declare const MiniAppChangelogGroups: ({ changelog }: {
|
|
867
|
+
declare const MiniAppChangelogGroups: ({ changelog, max_items, onMore }: {
|
|
769
868
|
changelog: MiniAppChangelog;
|
|
869
|
+
/** Mỗi nhóm chỉ hiện tối đa N mục, còn lại gom thành "+N thay đổi khác" (popup). */
|
|
870
|
+
max_items?: number;
|
|
871
|
+
onMore?: () => void;
|
|
770
872
|
}) => React.JSX.Element;
|
|
771
873
|
/** Toàn bộ lịch sử changelog của 1 mini app (màn "Xem tất cả"), mới nhất trước. Header nổi kiểu Chat SDK. */
|
|
772
|
-
declare const MiniAppChangelogHistory: ({ app_id, name, onBack }: {
|
|
874
|
+
declare const MiniAppChangelogHistory: ({ app_id, name, onBack, renderHeader }: {
|
|
773
875
|
app_id: string;
|
|
774
876
|
name: string;
|
|
775
877
|
onBack: () => void;
|
|
878
|
+
/** Header riêng (nằm trong luồng, SDK đệm sẵn status bar). Không truyền → header nổi mặc định. */
|
|
879
|
+
renderHeader?: (props: MiniAppHistoryHeaderProps) => ReactNode;
|
|
776
880
|
}) => React.JSX.Element;
|
|
777
881
|
/** UI mặc định "Có gì mới". */
|
|
778
|
-
declare const DefaultMiniAppChangelogPrompt: ({ request, changelog, onClose }: MiniAppChangelogPromptProps
|
|
882
|
+
declare const DefaultMiniAppChangelogPrompt: ({ request, changelog, onClose, renderHistoryHeader, renderActions }: MiniAppChangelogPromptProps & {
|
|
883
|
+
renderHistoryHeader?: MiniAppUpdatesProps["renderHistoryHeader"];
|
|
884
|
+
renderActions?: MiniAppUpdatesProps["renderChangelogActions"];
|
|
885
|
+
}) => React.JSX.Element;
|
|
779
886
|
/** UI mặc định popup cập nhật bắt buộc (không đóng được). */
|
|
780
|
-
declare const DefaultMiniAppUpdatePrompt: ({ update, is_updating, progress, has_failed, onUpdate, logo }: MiniAppUpdatePromptProps & {
|
|
887
|
+
declare const DefaultMiniAppUpdatePrompt: ({ update, is_updating, progress, has_failed, onUpdate, logo, renderAction }: MiniAppUpdatePromptProps & {
|
|
781
888
|
logo?: ImageSourcePropType;
|
|
889
|
+
renderAction?: MiniAppUpdatesProps["renderUpdateAction"];
|
|
782
890
|
}) => React.JSX.Element;
|
|
783
|
-
declare const _default: React.MemoExoticComponent<({ app_ids, shouldShowUpdate, logo, renderUpdate, renderChangelog }: MiniAppUpdatesProps) => React.JSX.Element | null>;
|
|
891
|
+
declare const _default: React.MemoExoticComponent<({ app_ids, shouldShowUpdate, logo, renderUpdate, renderChangelog, theme, renderHistoryHeader, labels, renderChangelogActions, renderUpdateAction }: MiniAppUpdatesProps) => React.JSX.Element | null>;
|
|
784
892
|
|
|
785
893
|
/**
|
|
786
894
|
* Markdown inline tối giản cho changelog (1 dòng / mục): **đậm**, `code`, [chữ](https://link).
|
|
@@ -976,4 +1084,4 @@ interface UploadCapabilities {
|
|
|
976
1084
|
/** XHR (không phải fetch) để có tiến trình upload; RN đọc file từ uri (cả content://), không nạp vào JS. */
|
|
977
1085
|
declare const uploadToUrl: MiniAppUploader;
|
|
978
1086
|
|
|
979
|
-
export { CodeType, DefaultMiniAppChangelogPrompt, DefaultMiniAppSplash, DefaultMiniAppUpdatePrompt, type InlineToken, type LocationOptions, type LocationResult, MINIAPP_CHANGELOG_KINDS, MINIAPP_PLATFORM_URL, type MiniAppBiometricAvailability, type MiniAppBiometricRequest, type MiniAppBiometricResult, type MiniAppBiometrics, type MiniAppBiometryType, type MiniAppBridgeOptions, type MiniAppCatalogEntry, type MiniAppCatalogItem, type MiniAppChangelog, MiniAppChangelogGroups, MiniAppChangelogHistory, type MiniAppChangelogPromptProps, type MiniAppChangelogRequest, type MiniAppChangelogState, MiniAppChangelogText, type MiniAppChangelogVersion, type MiniAppChannel, type MiniAppConfig, type MiniAppContainerProps, type MiniAppContext, type MiniAppDownloadState, type MiniAppDownloadStatus, type MiniAppDownloadTask, type MiniAppEvent, type MiniAppFileSystem, type MiniAppHandlerContext, type MiniAppHapticType, _default$1 as MiniAppHost, type MiniAppHostData, BridgeError as MiniAppHostError, type MiniAppHostProps, type MiniAppKeepAlive, type MiniAppLaunch, type MiniAppLocalBundle, type MiniAppManifest, type MiniAppNativeHandlers, type MiniAppPaymentRequest, type MiniAppPaymentResult, type MiniAppPendingChangelog, type MiniAppPermission, type MiniAppPickedFile, type MiniAppSpeechProvider, type MiniAppSpeechStartContext, type MiniAppSplashProps, type MiniAppStorage, type MiniAppSyncResult, type MiniAppUpdate, type MiniAppUpdatePromptProps, _default as MiniAppUpdates, type MiniAppUpdatesProps, type MiniAppUploadCaller, type MiniAppUploadOptions, type MiniAppUploadProcessOptions, type MiniAppUploadProcessor, type MiniAppUploadRequest, type MiniAppUploadSource, type MiniAppUploadSourceRequest, type MiniAppUploadTarget, type MiniAppUploader, type MiniAppUrlUploadTarget, type OpenMiniAppArgs, type ReactNativeBiometricsLike, ScannerEndReason, ScannerEvent, ScannerLayout, ScannerMethod, type ScannerOptions, type ScannerResult, type SpeechOptions, ToastType, type UploadCapabilities, type UploadFileType, type UploadFilesResult, type UploadedFile, closeMiniApp, configureMiniApp, createMmkvStorage, createReactNativeBiometrics, createRnfsFileSystem, dismissMiniAppChangelog, ensureMiniApp, fetchMiniAppChangelog, getLocalMiniApp, getMiniAppCatalog, getMiniAppCatalogEntry, getMiniAppChangelogSeen, getMiniAppStatuses, getMiniAppUpdate, getPendingChangelog, installBundledMiniApp, markMiniAppChangelogSeen, mergeMiniAppChangelog, onMiniAppEvent, openMiniApp, parseInlineMarkdown, pauseMiniApp, pauseMiniAppDownloads, preloadMiniApp, releaseSpeechFor, restoreMiniApp, resumeMiniApp, resumeMiniAppDownloads, sendEventToWeb, showMiniAppChangelog, stripInlineMarkdown, syncMiniAppCatalog, uninstallMiniApp, updateMiniApp, uploadToUrl, useMiniAppChangelog, useMiniAppChangelogRequest, useMiniAppDownload, useMiniAppDownloadsPaused };
|
|
1087
|
+
export { CodeType, DEFAULT_MINIAPP_UPDATES_LABELS, DefaultMiniAppChangelogPrompt, DefaultMiniAppSplash, DefaultMiniAppUpdatePrompt, type InlineToken, type LocationOptions, type LocationResult, MINIAPP_CHANGELOG_KINDS, MINIAPP_PLATFORM_URL, type MiniAppBiometricAvailability, type MiniAppBiometricRequest, type MiniAppBiometricResult, type MiniAppBiometrics, type MiniAppBiometryType, type MiniAppBridgeOptions, type MiniAppCatalogEntry, type MiniAppCatalogItem, type MiniAppChangelog, type MiniAppChangelogActionsProps, MiniAppChangelogGroups, MiniAppChangelogHistory, type MiniAppChangelogKindStyle, type MiniAppChangelogPromptProps, type MiniAppChangelogRequest, type MiniAppChangelogState, MiniAppChangelogText, type MiniAppChangelogVersion, type MiniAppChannel, type MiniAppConfig, type MiniAppContainerProps, type MiniAppContext, type MiniAppDownloadState, type MiniAppDownloadStatus, type MiniAppDownloadTask, type MiniAppEvent, type MiniAppFileSystem, type MiniAppHandlerContext, type MiniAppHapticType, type MiniAppHistoryHeaderProps, _default$1 as MiniAppHost, type MiniAppHostData, BridgeError as MiniAppHostError, type MiniAppHostProps, type MiniAppKeepAlive, type MiniAppLaunch, type MiniAppLocalBundle, type MiniAppManifest, type MiniAppNativeHandlers, type MiniAppPaymentRequest, type MiniAppPaymentResult, type MiniAppPendingChangelog, type MiniAppPermission, type MiniAppPickedFile, type MiniAppSpeechProvider, type MiniAppSpeechStartContext, type MiniAppSplashProps, type MiniAppStorage, type MiniAppSyncResult, type MiniAppUpdate, type MiniAppUpdateActionProps, type MiniAppUpdatePromptProps, _default as MiniAppUpdates, type MiniAppUpdatesLabels, type MiniAppUpdatesProps, type MiniAppUpdatesTheme, MiniAppUpdatesThemeProvider, type MiniAppUploadCaller, type MiniAppUploadOptions, type MiniAppUploadProcessOptions, type MiniAppUploadProcessor, type MiniAppUploadRequest, type MiniAppUploadSource, type MiniAppUploadSourceRequest, type MiniAppUploadTarget, type MiniAppUploader, type MiniAppUrlUploadTarget, type OpenMiniAppArgs, type ReactNativeBiometricsLike, ScannerEndReason, ScannerEvent, ScannerLayout, ScannerMethod, type ScannerOptions, type ScannerResult, type SpeechOptions, ToastType, type UploadCapabilities, type UploadFileType, type UploadFilesResult, type UploadedFile, closeMiniApp, configureMiniApp, createMmkvStorage, createReactNativeBiometrics, createRnfsFileSystem, dismissMiniAppChangelog, ensureMiniApp, fetchMiniAppChangelog, getLocalMiniApp, getMiniAppCatalog, getMiniAppCatalogEntry, getMiniAppChangelogSeen, getMiniAppStatuses, getMiniAppUpdate, getPendingChangelog, installBundledMiniApp, markMiniAppChangelogSeen, mergeMiniAppChangelog, onMiniAppEvent, openMiniApp, parseInlineMarkdown, pauseMiniApp, pauseMiniAppDownloads, preloadMiniApp, releaseSpeechFor, resolveMiniAppUpdatesTheme, restoreMiniApp, resumeMiniApp, resumeMiniAppDownloads, sendEventToWeb, showMiniAppChangelog, stripInlineMarkdown, syncMiniAppCatalog, uninstallMiniApp, updateMiniApp, uploadToUrl, useMiniAppChangelog, useMiniAppChangelogRequest, useMiniAppDownload, useMiniAppDownloadsPaused, useMiniAppUpdatesTheme };
|