starchild-widget
Version:
Starchild Widget
85 lines • 1.92 kB
TypeScript
import { CommonState } from './common';
import { AuthState } from './auth';
import { ChatcacheState, ChatState } from './chat';
import { SearchState } from './search';
import { PositioncacheState } from './position';
import { TradeState } from './trade';
/**
* Root state interface - contains state of all sub-modules
*/
export interface RootState {
common: CommonState;
auth: AuthState;
chat: ChatState;
search: SearchState;
positioncache: PositioncacheState;
trade: TradeState;
chatcache: ChatcacheState;
}
/**
* Root action type enumeration
*/
export declare enum RootActionType {
COMMON = "COMMON",
AUTH = "AUTH",
CHAT = "CHAT",
SEARCH = "SEARCH",
POSITION_CACHE = "POSITION_CACHE",
TRADE = "TRADE",
RESET_ALL = "RESET_ALL",
CHAT_CACHE = "CHAT_CACHE"
}
/**
* Root action type union - 简化版本,去掉多余的 type 层但保留 actionType 识别
*/
export type RootAction = {
type: RootActionType.COMMON;
payload: {
actionType: string;
data: any;
};
} | {
type: RootActionType.AUTH;
payload: {
actionType: string;
data: any;
};
} | {
type: RootActionType.CHAT;
payload: {
actionType: string;
data: any;
};
} | {
type: RootActionType.SEARCH;
payload: {
actionType: string;
data: any;
};
} | {
type: RootActionType.POSITION_CACHE;
payload: {
actionType: string;
data: any;
};
} | {
type: RootActionType.TRADE;
payload: {
actionType: string;
data: any;
};
} | {
type: RootActionType.CHAT_CACHE;
payload: {
actionType: string;
data: any;
};
} | {
type: RootActionType.RESET_ALL;
};
export interface WidgetContextType {
state: RootState;
dispatch: React.Dispatch<RootAction>;
isHydrated: boolean;
}
//# sourceMappingURL=root.d.ts.map