@devflow-cc/react
Version:
一个功能强大的React库,用于构建数据驱动的应用程序,支持实时通信、身份验证和数据库操作
96 lines • 2.5 kB
TypeScript
import { DevFlowConfig } from '../types';
/**
* 标准表字段(所有表都必须包含)
*/
export declare const STANDARD_FIELDS: readonly ["id", "created_by", "created_at", "updated_by", "updated_at", "deleted_by", "deleted_at"];
/**
* 默认配置
*/
export declare const DEFAULT_CONFIG: DevFlowConfig;
/**
* 国际化消息
*/
export declare const I18N_MESSAGES: {
zh: {
'error.network': string;
'error.timeout': string;
'error.unauthorized': string;
'error.forbidden': string;
'error.not_found': string;
'error.validation': string;
'error.server': string;
'error.unknown': string;
'warning.standard_field': string;
'success.operation': string;
'info.loading': string;
'info.no_data': string;
'info.pagination': string;
};
en: {
'error.network': string;
'error.timeout': string;
'error.unauthorized': string;
'error.forbidden': string;
'error.not_found': string;
'error.validation': string;
'error.server': string;
'error.unknown': string;
'warning.standard_field': string;
'success.operation': string;
'info.loading': string;
'info.no_data': string;
'info.pagination': string;
};
};
/**
* 配置管理器
*/
export declare class ConfigManager {
private config;
private messages;
constructor(config: DevFlowConfig);
/**
* 获取配置
*/
getConfig(): DevFlowConfig;
/**
* 更新配置
*/
updateConfig(newConfig: Partial<DevFlowConfig>): void;
/**
* 获取当前语言
*/
getCurrentLanguage(): string;
/**
* 设置语言
*/
setLanguage(language: string): void;
/**
* 获取国际化消息
*/
getMessage(key: string, params?: Record<string, any>): string;
/**
* 扩展国际化消息
*/
extendMessages(language: string, messages: Record<string, string>): void;
/**
* 获取支持的语言列表
*/
getSupportedLanguages(): string[];
/**
* 设置错误处理器
*/
setErrorHandler(onError: (error: any) => void, retry?: number): void;
/**
* 获取错误处理器配置
*/
getErrorHandler(): {
onError?: (error: any) => void;
retry: number;
} | undefined;
/**
* 清除错误处理器
*/
clearErrorHandler(): void;
}
//# sourceMappingURL=config.d.ts.map