import type { ComponentType, ReactNode } from 'react';
import type { EnvironmentOptions } from './environment';
import type { FeatureConfig } from './feature';
import type { NativeLogLevel } from './logs';
import type { DebugNavigationRef } from './navigation';
import type { DebugSource, StateAdapter } from './source';
export interface DebugAccount {
id: string;
title: string;
subtitle?: string;
note?: string;
}
export interface AccountsSnapshot {
items: readonly A[];
currentId?: string | null;
scopeKey?: string;
contextLabel?: string;
isAuthenticated?: boolean;
currentDetails?: readonly {
title: string;
value: string;
}[];
}
export type AccountsData = (Partial> & {
source?: never;
}) | ({
source: DebugSource>;
} & {
[K in keyof AccountsSnapshot]?: never;
});
export type AccountsOptions = AccountsData & {
onSwitch?(account: A, context: {
signal: AbortSignal;
}): void | Promise;
onRollback?(account: A, context: {
reason: 'error' | 'superseded';
error?: unknown;
}): void | Promise;
onSuccess?(account: A): void | Promise;
onError?(error: unknown, account: A): void | Promise;
closeOnSuccess?: boolean;
};
export type DebugTab = {
id: string;
} & FeatureConfig<{
title: string;
onActivate?(): void;
onDeactivate?(): void;
onClear?(): void;
} & ({
source?: never;
component: ComponentType<{}>;
badge?(): {
label: string;
color: string;
} | null;
} | {
source: DebugSource;
component: ComponentType<{
snapshot: S;
}>;
badge?(snapshot: S): {
label: string;
color: string;
} | null;
})>;
export interface DebugQuickAction {
id: string;
title: string;
icon?: ReactNode;
onPress: () => void | Promise;
disabled?: boolean;
closeOnPress?: boolean;
}
export interface DebugQuickActionsConfig {
enabled?: boolean;
items: readonly DebugQuickAction[];
}
export interface DebugToolkitConfig {
enabled?: boolean;
locale?: 'en' | 'zh-CN';
network?: FeatureConfig<{
maxLogs?: number;
excludeUrls?: readonly (string | RegExp)[];
}>;
console?: FeatureConfig<{
maxLogs?: number;
}>;
native?: FeatureConfig<{
maxLogs?: number;
minLevel?: NativeLogLevel;
includeTags?: readonly string[];
excludeTags?: readonly string[];
pollIntervalMs?: number;
}>;
state?: FeatureConfig<{
maxLogs?: number;
adapters?: readonly StateAdapter[];
}>;
navigation?: FeatureConfig<{
maxLogs?: number;
ref?: {
current: DebugNavigationRef | null;
};
}>;
track?: FeatureConfig<{
maxLogs?: number;
}>;
connect?: FeatureConfig<{
appId?: string;
endpoint?: string;
}>;
clipboard?: FeatureConfig<{}>;
history?: FeatureConfig<{
maxSessions?: number;
}>;
environment?: EnvironmentOptions;
accounts?: FeatureConfig>;
tabs?: FeatureConfig<{
items?: {
readonly [K in keyof S]: DebugTab;
};
}>;
quickActions?: DebugQuickActionsConfig;
}
//# sourceMappingURL=config.d.ts.map