@gaozh1024/rn-kit 0.3.4 → 0.4.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/README.md +272 -3
- package/dist/index.d.mts +249 -12
- package/dist/index.d.ts +249 -12
- package/dist/index.js +2419 -798
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2351 -739
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import { ZodError, z, ZodSchema } from 'zod';
|
|
|
4
4
|
export { z } from 'zod';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import * as React$1 from 'react';
|
|
7
|
-
import React__default from 'react';
|
|
7
|
+
import React__default, { ReactNode, ErrorInfo } from 'react';
|
|
8
8
|
export { useMutation, useQuery } from '@tanstack/react-query';
|
|
9
9
|
import { ViewProps, ScrollViewProps, TextProps, PressableProps, StyleProp, TextStyle, ImageSourcePropType, ImageStyle, ListRenderItem, ViewStyle, TextInputProps, TextInput, StatusBarProps, StatusBarStyle } from 'react-native';
|
|
10
10
|
import { LinearGradientProps } from 'expo-linear-gradient';
|
|
@@ -460,6 +460,11 @@ declare function useTheme(): ThemeContextValue;
|
|
|
460
460
|
|
|
461
461
|
interface ThemeColorTokens {
|
|
462
462
|
primary: string;
|
|
463
|
+
success: string;
|
|
464
|
+
warning: string;
|
|
465
|
+
error: string;
|
|
466
|
+
info: string;
|
|
467
|
+
muted: string;
|
|
463
468
|
primarySurface: string;
|
|
464
469
|
background: string;
|
|
465
470
|
card: string;
|
|
@@ -639,6 +644,55 @@ declare function useAsyncState<T = any>(): {
|
|
|
639
644
|
reset: () => void;
|
|
640
645
|
};
|
|
641
646
|
|
|
647
|
+
/**
|
|
648
|
+
* Logger 核心类型
|
|
649
|
+
*/
|
|
650
|
+
type LogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
651
|
+
type LogSource = 'logger' | 'console';
|
|
652
|
+
interface LogEntry {
|
|
653
|
+
id: string;
|
|
654
|
+
level: LogLevel;
|
|
655
|
+
message: string;
|
|
656
|
+
namespace?: string;
|
|
657
|
+
data?: unknown;
|
|
658
|
+
timestamp: number;
|
|
659
|
+
source: LogSource;
|
|
660
|
+
}
|
|
661
|
+
type LoggerTransport = (entry: LogEntry) => void;
|
|
662
|
+
interface LoggerLike {
|
|
663
|
+
log: (level: LogLevel, message: string, data?: unknown, namespace?: string) => void;
|
|
664
|
+
debug: (message: string, data?: unknown, namespace?: string) => void;
|
|
665
|
+
info: (message: string, data?: unknown, namespace?: string) => void;
|
|
666
|
+
warn: (message: string, data?: unknown, namespace?: string) => void;
|
|
667
|
+
error: (message: string, data?: unknown, namespace?: string) => void;
|
|
668
|
+
}
|
|
669
|
+
interface ConsoleTransportOptions {
|
|
670
|
+
useAnsiColors?: boolean;
|
|
671
|
+
consoleRef?: Pick<Console, 'debug' | 'info' | 'log' | 'warn' | 'error'>;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
declare const LOG_LEVEL_WEIGHT: Record<LogLevel, number>;
|
|
675
|
+
declare function shouldLog(currentLevel: LogLevel, nextLevel: LogLevel): boolean;
|
|
676
|
+
declare function createLogEntry(input: {
|
|
677
|
+
level: LogLevel;
|
|
678
|
+
message: string;
|
|
679
|
+
data?: unknown;
|
|
680
|
+
namespace?: string;
|
|
681
|
+
source?: LogEntry['source'];
|
|
682
|
+
}): LogEntry;
|
|
683
|
+
declare function formatLogTime(timestamp: number): string;
|
|
684
|
+
declare function stringifyLogData(data: unknown): string;
|
|
685
|
+
declare function normalizeConsoleArgs(args: unknown[]): {
|
|
686
|
+
message: string;
|
|
687
|
+
data: unknown;
|
|
688
|
+
};
|
|
689
|
+
declare function serializeLogEntries(entries: LogEntry[]): string;
|
|
690
|
+
|
|
691
|
+
declare function createConsoleTransport(options?: ConsoleTransportOptions): LoggerTransport;
|
|
692
|
+
|
|
693
|
+
declare function setGlobalLogger(logger: LoggerLike | null): void;
|
|
694
|
+
declare function getGlobalLogger(): LoggerLike | null;
|
|
695
|
+
|
|
642
696
|
/**
|
|
643
697
|
* @fileoverview API 类型定义模块
|
|
644
698
|
* @module core/api/types
|
|
@@ -662,6 +716,33 @@ interface ApiErrorContext {
|
|
|
662
716
|
}
|
|
663
717
|
type ApiErrorHandler = (error: AppError, context: ApiErrorContext) => void | Promise<void>;
|
|
664
718
|
type ApiBusinessErrorParser = (data: unknown, response: Response) => AppError | null;
|
|
719
|
+
type ApiLogStage = 'request' | 'response' | 'error';
|
|
720
|
+
interface ApiLogEvent {
|
|
721
|
+
stage: ApiLogStage;
|
|
722
|
+
endpointName: string;
|
|
723
|
+
path: string;
|
|
724
|
+
method: ApiMethod;
|
|
725
|
+
url: string;
|
|
726
|
+
input?: unknown;
|
|
727
|
+
response?: Response;
|
|
728
|
+
responseData?: unknown;
|
|
729
|
+
statusCode?: number;
|
|
730
|
+
durationMs?: number;
|
|
731
|
+
error?: AppError;
|
|
732
|
+
}
|
|
733
|
+
type ApiLogTransport = (event: ApiLogEvent) => void | Promise<void>;
|
|
734
|
+
interface ApiObservabilityConfig {
|
|
735
|
+
enabled?: boolean;
|
|
736
|
+
transports?: ApiLogTransport[];
|
|
737
|
+
logger?: LoggerLike | null;
|
|
738
|
+
namespace?: string;
|
|
739
|
+
includeInput?: boolean;
|
|
740
|
+
includeResponseData?: boolean;
|
|
741
|
+
sanitize?: (value: unknown, meta: {
|
|
742
|
+
stage: ApiLogStage;
|
|
743
|
+
field: 'input' | 'responseData' | 'error';
|
|
744
|
+
}) => unknown;
|
|
745
|
+
}
|
|
665
746
|
/**
|
|
666
747
|
* API 端点配置接口
|
|
667
748
|
* @template TInput - 请求输入数据的类型
|
|
@@ -715,6 +796,8 @@ interface ApiConfig<TEndpoints extends Record<string, ApiEndpointConfig<any, any
|
|
|
715
796
|
parseBusinessError?: ApiBusinessErrorParser;
|
|
716
797
|
/** 全局错误监听器(可选) */
|
|
717
798
|
onError?: ApiErrorHandler;
|
|
799
|
+
/** 开发可观测性配置(可选) */
|
|
800
|
+
observability?: ApiObservabilityConfig;
|
|
718
801
|
}
|
|
719
802
|
|
|
720
803
|
/**
|
|
@@ -756,6 +839,8 @@ declare function createAPI<TEndpoints extends Record<string, ApiEndpointConfig<a
|
|
|
756
839
|
[K in keyof TEndpoints]: (input?: any) => Promise<any>;
|
|
757
840
|
};
|
|
758
841
|
|
|
842
|
+
declare function createApiLoggerTransport(config?: Pick<ApiObservabilityConfig, 'logger' | 'namespace' | 'sanitize' | 'includeInput' | 'includeResponseData'>): ApiLogTransport;
|
|
843
|
+
|
|
759
844
|
/**
|
|
760
845
|
* @fileoverview 内存存储实现模块
|
|
761
846
|
* @module core/storage/memory-storage
|
|
@@ -1151,11 +1236,13 @@ interface AppScrollViewProps extends ScrollViewProps {
|
|
|
1151
1236
|
rounded?: string;
|
|
1152
1237
|
/** 自定义类名 */
|
|
1153
1238
|
className?: string;
|
|
1239
|
+
/** 点击非输入区域时是否收起键盘 */
|
|
1240
|
+
dismissKeyboardOnPressOutside?: boolean;
|
|
1154
1241
|
}
|
|
1155
1242
|
/**
|
|
1156
1243
|
* AppScrollView - 带 Tailwind/快捷布局能力的滚动容器
|
|
1157
1244
|
*/
|
|
1158
|
-
declare function AppScrollView({ flex, bg, p, px, py, gap, surface, rounded, className, children, style, ...props }: AppScrollViewProps): react_jsx_runtime.JSX.Element;
|
|
1245
|
+
declare function AppScrollView({ flex, bg, p, px, py, gap, surface, rounded, className, dismissKeyboardOnPressOutside, children, style, ...props }: AppScrollViewProps): react_jsx_runtime.JSX.Element;
|
|
1159
1246
|
|
|
1160
1247
|
/**
|
|
1161
1248
|
* AppText 组件属性接口
|
|
@@ -1247,6 +1334,15 @@ interface AppPressableProps extends PressableProps {
|
|
|
1247
1334
|
*/
|
|
1248
1335
|
declare function AppPressable({ className, pressedClassName, children, ...props }: AppPressableProps): react_jsx_runtime.JSX.Element;
|
|
1249
1336
|
|
|
1337
|
+
interface KeyboardDismissViewProps extends AppViewProps {
|
|
1338
|
+
/** 是否启用点击空白收起键盘 */
|
|
1339
|
+
enabled?: boolean;
|
|
1340
|
+
}
|
|
1341
|
+
/**
|
|
1342
|
+
* KeyboardDismissView - 点击空白区域时自动收起键盘
|
|
1343
|
+
*/
|
|
1344
|
+
declare function KeyboardDismissView({ enabled, children, ...props }: KeyboardDismissViewProps): react_jsx_runtime.JSX.Element;
|
|
1345
|
+
|
|
1250
1346
|
/**
|
|
1251
1347
|
* Row 组件属性接口
|
|
1252
1348
|
*/
|
|
@@ -1419,6 +1515,8 @@ interface SafeScreenProps extends ViewProps {
|
|
|
1419
1515
|
surface?: 'background' | 'card' | 'muted';
|
|
1420
1516
|
/** 是否使用 flex: 1 */
|
|
1421
1517
|
flex?: boolean;
|
|
1518
|
+
/** 点击非输入区域时是否收起键盘 */
|
|
1519
|
+
dismissKeyboardOnPressOutside?: boolean;
|
|
1422
1520
|
/** 自定义样式类 */
|
|
1423
1521
|
className?: string;
|
|
1424
1522
|
/** 子元素 */
|
|
@@ -1434,7 +1532,7 @@ interface SafeScreenProps extends ViewProps {
|
|
|
1434
1532
|
* </SafeScreen>
|
|
1435
1533
|
* ```
|
|
1436
1534
|
*/
|
|
1437
|
-
declare function SafeScreen({ top, bottom, left, right, bg, surface, flex, className, children, style, ...props }: SafeScreenProps): react_jsx_runtime.JSX.Element;
|
|
1535
|
+
declare function SafeScreen({ top, bottom, left, right, bg, surface, flex, dismissKeyboardOnPressOutside, className, children, style, ...props }: SafeScreenProps): react_jsx_runtime.JSX.Element;
|
|
1438
1536
|
/**
|
|
1439
1537
|
* 页面容器组件 - 包含安全区域和基础布局
|
|
1440
1538
|
*
|
|
@@ -1479,6 +1577,8 @@ interface AppButtonProps {
|
|
|
1479
1577
|
disabled?: boolean;
|
|
1480
1578
|
/** 点击回调 */
|
|
1481
1579
|
onPress?: () => void;
|
|
1580
|
+
/** 点击前是否先收起键盘 */
|
|
1581
|
+
dismissKeyboardOnPress?: boolean;
|
|
1482
1582
|
/** 按钮内容 */
|
|
1483
1583
|
children: React.ReactNode;
|
|
1484
1584
|
/** 自定义类名 */
|
|
@@ -1530,7 +1630,7 @@ interface AppButtonProps {
|
|
|
1530
1630
|
* </AppButton>
|
|
1531
1631
|
* ```
|
|
1532
1632
|
*/
|
|
1533
|
-
declare function AppButton({ variant, size, color, loading, disabled, onPress, children, className, }: AppButtonProps): react_jsx_runtime.JSX.Element;
|
|
1633
|
+
declare function AppButton({ variant, size, color, loading, disabled, onPress, dismissKeyboardOnPress, children, className, }: AppButtonProps): react_jsx_runtime.JSX.Element;
|
|
1534
1634
|
|
|
1535
1635
|
/**
|
|
1536
1636
|
* Toast 组件属性接口
|
|
@@ -1542,6 +1642,8 @@ interface ToastProps {
|
|
|
1542
1642
|
type?: 'success' | 'error' | 'warning' | 'info';
|
|
1543
1643
|
/** 是否显示 */
|
|
1544
1644
|
visible?: boolean;
|
|
1645
|
+
/** 测试 ID */
|
|
1646
|
+
testID?: string;
|
|
1545
1647
|
}
|
|
1546
1648
|
/**
|
|
1547
1649
|
* Toast - 轻提示组件
|
|
@@ -1572,7 +1674,7 @@ interface ToastProps {
|
|
|
1572
1674
|
* showToast({ message: '操作成功', type: 'success' });
|
|
1573
1675
|
* ```
|
|
1574
1676
|
*/
|
|
1575
|
-
declare function Toast({ message, type, visible }: ToastProps): react_jsx_runtime.JSX.Element | null;
|
|
1677
|
+
declare function Toast({ message, type, visible, testID }: ToastProps): react_jsx_runtime.JSX.Element | null;
|
|
1576
1678
|
|
|
1577
1679
|
/**
|
|
1578
1680
|
* Alert 按钮配置
|
|
@@ -1616,6 +1718,8 @@ interface LoadingProps {
|
|
|
1616
1718
|
visible?: boolean;
|
|
1617
1719
|
/** 测试 ID */
|
|
1618
1720
|
testID?: string;
|
|
1721
|
+
/** 超时后关闭回调 */
|
|
1722
|
+
onClose?: () => void;
|
|
1619
1723
|
}
|
|
1620
1724
|
/**
|
|
1621
1725
|
* Loading - 加载指示器组件
|
|
@@ -1658,7 +1762,7 @@ interface LoadingProps {
|
|
|
1658
1762
|
* );
|
|
1659
1763
|
* ```
|
|
1660
1764
|
*/
|
|
1661
|
-
declare function Loading({ text, color, overlay, visible, testID }: LoadingProps): react_jsx_runtime.JSX.Element | null;
|
|
1765
|
+
declare function Loading({ text, color, overlay, visible, testID, onClose, }: LoadingProps): react_jsx_runtime.JSX.Element | null;
|
|
1662
1766
|
|
|
1663
1767
|
/**
|
|
1664
1768
|
* Progress 组件属性接口
|
|
@@ -2174,6 +2278,47 @@ interface SelectProps {
|
|
|
2174
2278
|
*/
|
|
2175
2279
|
declare function Select({ value, onChange, options, placeholder, multiple, searchable, onSearch, disabled, clearable, singleSelectTitle, multipleSelectTitle, searchPlaceholder, emptyText, selectedCountText, confirmText, className, }: SelectProps): react_jsx_runtime.JSX.Element;
|
|
2176
2280
|
|
|
2281
|
+
type PickerValue = string | number;
|
|
2282
|
+
interface PickerOption {
|
|
2283
|
+
label: string;
|
|
2284
|
+
value: PickerValue;
|
|
2285
|
+
disabled?: boolean;
|
|
2286
|
+
}
|
|
2287
|
+
interface PickerColumn {
|
|
2288
|
+
key: string;
|
|
2289
|
+
title?: string;
|
|
2290
|
+
options: PickerOption[];
|
|
2291
|
+
}
|
|
2292
|
+
interface PickerRenderFooterContext {
|
|
2293
|
+
close: () => void;
|
|
2294
|
+
setTempValues: (values: PickerValue[]) => void;
|
|
2295
|
+
tempValues: PickerValue[];
|
|
2296
|
+
}
|
|
2297
|
+
interface PickerProps {
|
|
2298
|
+
value?: PickerValue[];
|
|
2299
|
+
onChange?: (values: PickerValue[]) => void;
|
|
2300
|
+
columns: PickerColumn[];
|
|
2301
|
+
placeholder?: string;
|
|
2302
|
+
disabled?: boolean;
|
|
2303
|
+
className?: string;
|
|
2304
|
+
pickerTitle?: string;
|
|
2305
|
+
cancelText?: string;
|
|
2306
|
+
confirmText?: string;
|
|
2307
|
+
triggerIconName?: string;
|
|
2308
|
+
renderDisplayText?: (selectedOptions: Array<PickerOption | undefined>) => string;
|
|
2309
|
+
renderFooter?: (context: PickerRenderFooterContext) => React.ReactNode;
|
|
2310
|
+
tempValue?: PickerValue[];
|
|
2311
|
+
defaultTempValue?: PickerValue[];
|
|
2312
|
+
onTempChange?: (values: PickerValue[]) => void;
|
|
2313
|
+
onOpen?: () => void;
|
|
2314
|
+
rowHeight?: number;
|
|
2315
|
+
visibleRows?: number;
|
|
2316
|
+
}
|
|
2317
|
+
/**
|
|
2318
|
+
* Picker - 通用多列滚轮选择器,适用于日期、省市区等多列选择场景
|
|
2319
|
+
*/
|
|
2320
|
+
declare function Picker({ value, onChange, columns, placeholder, disabled, className, pickerTitle, cancelText, confirmText, triggerIconName, renderDisplayText, renderFooter, tempValue, defaultTempValue, onTempChange, onOpen, rowHeight, visibleRows, }: PickerProps): react_jsx_runtime.JSX.Element;
|
|
2321
|
+
|
|
2177
2322
|
/**
|
|
2178
2323
|
* DatePicker 组件属性接口
|
|
2179
2324
|
*/
|
|
@@ -2200,7 +2345,7 @@ interface DatePickerProps {
|
|
|
2200
2345
|
confirmText?: string;
|
|
2201
2346
|
/** 弹窗标题文案 */
|
|
2202
2347
|
pickerTitle?: string;
|
|
2203
|
-
/**
|
|
2348
|
+
/** 兼容保留:旧版弹窗顶部日期格式 */
|
|
2204
2349
|
pickerDateFormat?: string;
|
|
2205
2350
|
/** 年列标题 */
|
|
2206
2351
|
yearLabel?: string;
|
|
@@ -2216,9 +2361,9 @@ interface DatePickerProps {
|
|
|
2216
2361
|
maxDateText?: string;
|
|
2217
2362
|
}
|
|
2218
2363
|
/**
|
|
2219
|
-
* DatePicker -
|
|
2364
|
+
* DatePicker - 日期滚轮选择器,保留日期封装并复用通用 Picker
|
|
2220
2365
|
*/
|
|
2221
|
-
declare function DatePicker({ value, onChange, placeholder, disabled, format, minDate, maxDate, className, cancelText, confirmText, pickerTitle, pickerDateFormat, yearLabel, monthLabel, dayLabel, todayText, minDateText, maxDateText, }: DatePickerProps): react_jsx_runtime.JSX.Element;
|
|
2366
|
+
declare function DatePicker({ value, onChange, placeholder, disabled, format, minDate, maxDate, className, cancelText, confirmText, pickerTitle, pickerDateFormat: _pickerDateFormat, yearLabel, monthLabel, dayLabel, todayText, minDateText, maxDateText, }: DatePickerProps): react_jsx_runtime.JSX.Element;
|
|
2222
2367
|
|
|
2223
2368
|
interface FormItemProps {
|
|
2224
2369
|
name: string;
|
|
@@ -3291,6 +3436,59 @@ interface AppStatusBarProps extends Omit<StatusBarProps, 'barStyle' | 'backgroun
|
|
|
3291
3436
|
declare function AppStatusBar({ barStyle, backgroundColor, translucent, ...props }: AppStatusBarProps): react_jsx_runtime.JSX.Element;
|
|
3292
3437
|
declare function AppFocusedStatusBar(props: AppStatusBarProps): react_jsx_runtime.JSX.Element | null;
|
|
3293
3438
|
|
|
3439
|
+
interface LoggerExportPayload {
|
|
3440
|
+
entries: LogEntry[];
|
|
3441
|
+
serialized: string;
|
|
3442
|
+
}
|
|
3443
|
+
interface LoggerProviderProps {
|
|
3444
|
+
children: ReactNode;
|
|
3445
|
+
enabled?: boolean;
|
|
3446
|
+
level?: LogLevel;
|
|
3447
|
+
maxEntries?: number;
|
|
3448
|
+
overlayEnabled?: boolean;
|
|
3449
|
+
defaultExpanded?: boolean;
|
|
3450
|
+
consoleEnabled?: boolean;
|
|
3451
|
+
transports?: LoggerTransport[];
|
|
3452
|
+
exportEnabled?: boolean;
|
|
3453
|
+
onExport?: (payload: LoggerExportPayload) => void;
|
|
3454
|
+
}
|
|
3455
|
+
interface LoggerContextType {
|
|
3456
|
+
entries: LogEntry[];
|
|
3457
|
+
enabled: boolean;
|
|
3458
|
+
level: LogLevel;
|
|
3459
|
+
clear: () => void;
|
|
3460
|
+
log: (level: LogLevel, message: string, data?: unknown, namespace?: string) => void;
|
|
3461
|
+
debug: (message: string, data?: unknown, namespace?: string) => void;
|
|
3462
|
+
info: (message: string, data?: unknown, namespace?: string) => void;
|
|
3463
|
+
warn: (message: string, data?: unknown, namespace?: string) => void;
|
|
3464
|
+
error: (message: string, data?: unknown, namespace?: string) => void;
|
|
3465
|
+
}
|
|
3466
|
+
interface ScopedLoggerContextType extends Omit<LoggerContextType, 'log' | 'debug' | 'info' | 'warn' | 'error'> {
|
|
3467
|
+
namespace?: string;
|
|
3468
|
+
log: (level: LogLevel, message: string, data?: unknown) => void;
|
|
3469
|
+
debug: (message: string, data?: unknown) => void;
|
|
3470
|
+
info: (message: string, data?: unknown) => void;
|
|
3471
|
+
warn: (message: string, data?: unknown) => void;
|
|
3472
|
+
error: (message: string, data?: unknown) => void;
|
|
3473
|
+
}
|
|
3474
|
+
|
|
3475
|
+
interface ErrorBoundaryFallbackRenderProps {
|
|
3476
|
+
error: Error;
|
|
3477
|
+
reset: () => void;
|
|
3478
|
+
}
|
|
3479
|
+
interface AppErrorBoundaryProps {
|
|
3480
|
+
children: ReactNode;
|
|
3481
|
+
enabled?: boolean;
|
|
3482
|
+
title?: string;
|
|
3483
|
+
description?: string;
|
|
3484
|
+
showDetails?: boolean;
|
|
3485
|
+
resetText?: string;
|
|
3486
|
+
fallback?: ReactNode | ((props: ErrorBoundaryFallbackRenderProps) => ReactNode);
|
|
3487
|
+
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
3488
|
+
onReset?: () => void;
|
|
3489
|
+
resetKeys?: unknown[];
|
|
3490
|
+
}
|
|
3491
|
+
|
|
3294
3492
|
/**
|
|
3295
3493
|
* AppProvider Props
|
|
3296
3494
|
*/
|
|
@@ -3306,6 +3504,10 @@ interface AppProviderProps extends Omit<NavigationProviderProps, 'children'> {
|
|
|
3306
3504
|
enableOverlay?: boolean;
|
|
3307
3505
|
/** 是否启用主题(默认 true) */
|
|
3308
3506
|
enableTheme?: boolean;
|
|
3507
|
+
/** 是否启用开发日志基础设施(默认开发环境开启) */
|
|
3508
|
+
enableLogger?: boolean;
|
|
3509
|
+
/** 是否启用 React 错误边界(默认开发环境开启) */
|
|
3510
|
+
enableErrorBoundary?: boolean;
|
|
3309
3511
|
/** 是否启用全局状态栏管理(默认 true) */
|
|
3310
3512
|
enableStatusBar?: boolean;
|
|
3311
3513
|
/** 是否启用安全区域(默认 true) */
|
|
@@ -3320,6 +3522,10 @@ interface AppProviderProps extends Omit<NavigationProviderProps, 'children'> {
|
|
|
3320
3522
|
isDark?: boolean;
|
|
3321
3523
|
/** 全局状态栏配置 */
|
|
3322
3524
|
statusBarProps?: AppStatusBarProps;
|
|
3525
|
+
/** Logger Provider 配置 */
|
|
3526
|
+
loggerProps?: Omit<LoggerProviderProps, 'children'>;
|
|
3527
|
+
/** Error Boundary 配置 */
|
|
3528
|
+
errorBoundaryProps?: Omit<AppErrorBoundaryProps, 'children'>;
|
|
3323
3529
|
}
|
|
3324
3530
|
/**
|
|
3325
3531
|
* 统一应用 Provider
|
|
@@ -3418,13 +3624,15 @@ interface AppProviderProps extends Omit<NavigationProviderProps, 'children'> {
|
|
|
3418
3624
|
* }
|
|
3419
3625
|
* ```
|
|
3420
3626
|
*/
|
|
3421
|
-
declare function AppProvider({ children, enableNavigation, enableOverlay, enableTheme, enableStatusBar, enableSafeArea, lightTheme, darkTheme, defaultDark, isDark, statusBarProps, ...navigationProps }: AppProviderProps): react_jsx_runtime.JSX.Element;
|
|
3627
|
+
declare function AppProvider({ children, enableNavigation, enableOverlay, enableTheme, enableLogger, enableErrorBoundary, enableStatusBar, enableSafeArea, lightTheme, darkTheme, defaultDark, isDark, statusBarProps, loggerProps, errorBoundaryProps, ...navigationProps }: AppProviderProps): react_jsx_runtime.JSX.Element;
|
|
3422
3628
|
|
|
3423
3629
|
/**
|
|
3424
3630
|
* Overlay Provider Props
|
|
3425
3631
|
*/
|
|
3426
3632
|
interface OverlayProviderProps {
|
|
3427
3633
|
children: React__default.ReactNode;
|
|
3634
|
+
loggerProps?: Omit<LoggerProviderProps, 'children'>;
|
|
3635
|
+
errorBoundaryProps?: Omit<AppErrorBoundaryProps, 'children'>;
|
|
3428
3636
|
}
|
|
3429
3637
|
/**
|
|
3430
3638
|
* 统一 Overlay Provider
|
|
@@ -3432,7 +3640,7 @@ interface OverlayProviderProps {
|
|
|
3432
3640
|
* 整合:LoadingProvider + ToastProvider + AlertProvider
|
|
3433
3641
|
* 提供全局 Loading、Toast、Alert 功能
|
|
3434
3642
|
*/
|
|
3435
|
-
declare function OverlayProvider({ children }: OverlayProviderProps): react_jsx_runtime.JSX.Element;
|
|
3643
|
+
declare function OverlayProvider({ children, loggerProps, errorBoundaryProps }: OverlayProviderProps): react_jsx_runtime.JSX.Element;
|
|
3436
3644
|
|
|
3437
3645
|
/**
|
|
3438
3646
|
* Loading 子系统类型定义
|
|
@@ -3602,4 +3810,33 @@ interface AlertContextType {
|
|
|
3602
3810
|
*/
|
|
3603
3811
|
declare function useAlert(): AlertContextType;
|
|
3604
3812
|
|
|
3605
|
-
|
|
3813
|
+
declare function LoggerProvider({ children, enabled, level, maxEntries, overlayEnabled, defaultExpanded, consoleEnabled, transports, exportEnabled, onExport, }: LoggerProviderProps): react_jsx_runtime.JSX.Element;
|
|
3814
|
+
|
|
3815
|
+
declare function useLogger(namespace?: string): ScopedLoggerContextType;
|
|
3816
|
+
|
|
3817
|
+
interface LogOverlayProps {
|
|
3818
|
+
entries: LogEntry[];
|
|
3819
|
+
onClear: () => void;
|
|
3820
|
+
defaultExpanded?: boolean;
|
|
3821
|
+
exportEnabled?: boolean;
|
|
3822
|
+
onExport?: (payload: LoggerExportPayload) => void;
|
|
3823
|
+
}
|
|
3824
|
+
declare function LogOverlay({ entries, onClear, defaultExpanded, exportEnabled, onExport, }: LogOverlayProps): react_jsx_runtime.JSX.Element;
|
|
3825
|
+
|
|
3826
|
+
declare const LoggerContext: React$1.Context<LoggerContextType | null>;
|
|
3827
|
+
|
|
3828
|
+
interface AppErrorBoundaryState {
|
|
3829
|
+
error: Error | null;
|
|
3830
|
+
}
|
|
3831
|
+
declare class AppErrorBoundary extends React__default.Component<AppErrorBoundaryProps, AppErrorBoundaryState> {
|
|
3832
|
+
static contextType: React__default.Context<LoggerContextType | null>;
|
|
3833
|
+
context: React__default.ContextType<typeof LoggerContext>;
|
|
3834
|
+
state: AppErrorBoundaryState;
|
|
3835
|
+
static getDerivedStateFromError(error: Error): AppErrorBoundaryState;
|
|
3836
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
3837
|
+
componentDidUpdate(prevProps: AppErrorBoundaryProps): void;
|
|
3838
|
+
handleReset: () => void;
|
|
3839
|
+
render(): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
3840
|
+
}
|
|
3841
|
+
|
|
3842
|
+
export { ActionIcons, Alert, type AlertContextType, type AlertOptions, type AlertProps, type ApiBusinessErrorParser, type ApiConfig, type ApiEndpointConfig, type ApiErrorContext, type ApiErrorHandler, type ApiLogEvent, type ApiLogStage, type ApiLogTransport, type ApiMethod, type ApiObservabilityConfig, AppButton, type AppButtonProps, type AppError, AppErrorBoundary, type AppErrorBoundaryProps, AppFocusedStatusBar, AppHeader, type AppHeaderProps, AppImage, type AppImageProps, AppInput, type AppInputProps, AppList, type AppListProps, type AppNavigation, AppPressable, type AppPressableProps, AppProvider, type AppProviderProps, AppScreen, AppScrollView, type AppScrollViewProps, AppStatusBar, type AppStatusBarProps, AppText, AppTextInput, type AppTextProps, AppView, type AppViewProps, BottomTabBar, Card, type CardProps, Center, type CenterProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Col, type ColProps, type ColorPalette$1 as ColorPalette, type ColorToken, type ConsoleTransportOptions, type CustomBottomTabBarProps, DatePicker, type DatePickerProps, DrawerContent, type DrawerContentProps, type DrawerItem, type DrawerNavigation, DrawerNavigator, type DrawerNavigatorProps, type DrawerOptions, type DrawerParamList, type DrawerRouteConfig, type DrawerScreenOptions, type DrawerScreenProps, type ErrorBoundaryFallbackRenderProps, ErrorCode, FileIcons, type FormErrors, type FormGroupOption, FormItem, type FormItemProps, GradientView, type GradientViewProps, Icon, type IconProps, type IconSize, type InfiniteFetchParams, type InfiniteFetchResult, KeyboardDismissView, type KeyboardDismissViewProps, LOG_LEVEL_WEIGHT, type LinkingConfig, Loading, type LoadingContextType, type LoadingProps, type LoadingState, type LogEntry, type LogLevel, LogOverlay, type LogSource, type LoggerContextType, type LoggerExportPayload, type LoggerLike, LoggerProvider, type LoggerProviderProps, type LoggerTransport, MemoryStorage, NavigationIcons, NavigationProvider, type NavigationProviderProps, type Orientation, OverlayProvider, type OverlayProviderProps, PageDrawer, type PageDrawerProps, type PaginationParams, type PaginationResult, type ParamListBase, type PathConfig, Picker, type PickerColumn, type PickerOption, type PickerProps, type PickerValue, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RgbObject, type RouteConfig, Row, type RowProps, SafeBottom, SafeScreen, type SafeScreenProps, type ScopedLoggerContextType, Select, type SelectOption, type SelectProps, Slider, type SliderProps, type StackNavigation, StackNavigator, type StackNavigatorProps, type StackParamList, type StackRouteConfig, type StackScreenOptions, type StackScreenProps, StatusIcons, Switch, type SwitchProps, type TabBarOptions, type TabNavigation, TabNavigator, type TabNavigatorProps, type TabParamList, type TabRouteConfig, type TabScreenOptions, type TabScreenProps, type Theme, type ColorPalette as ThemeColorPalette, type ThemeConfig, ThemeProvider, Toast, type ToastContextType, type ToastItem, type ToastProps, type ToastType, type UseAsyncState, type UseDimensionsReturn, type UseFormOptions, type UseInfiniteOptions, type UseInfiniteReturn, type UseKeyboardReturn, type UseOrientationReturn, type UsePageDrawerReturn, type UsePaginationOptions, type UsePaginationReturn, type UseRefreshReturn, type UseToggleActions, adjustBrightness, capitalize, clamp, cn, createAPI, createApiLoggerTransport, createConsoleTransport, createDrawerScreens, createLogEntry, createNavigationTheme, createStackScreens, createTabScreens, createTheme, deepMerge, enhanceError, formatCurrency, formatDate, formatLogTime, formatNumber, formatPercent, formatRelativeTime, generateColorPalette, getGlobalLogger, getThemeColors, getValidationErrors, hexToRgb, isDevelopment, isValidEmail, isValidPhone, mapHttpStatus, normalizeConsoleArgs, omit, pick, rgbToHex, serializeLogEntries, setGlobalLogger, shouldLog, slugify, storage, stringifyLogData, truncate, useAlert, useAsyncState, useBackHandler, useDebounce, useDimensions, useDrawerNavigation, useForm, useInfinite, useKeyboard, useLoading, useLogger, useMemoizedFn, useNavigation, useNavigationState, useOrientation, usePageDrawer, usePagination, usePrevious, useRefresh, useRequest, useRoute, useSetState, useStackNavigation, useStorage, useTabNavigation, useTheme, useThemeColors, useThrottle, useToast, useToggle, useUpdateEffect };
|