// 定义状态
export type State = {
    routerMatchList: {
        path: string,
        menuLevel?: number,
        breadcrumbName: string,
        hidden?: boolean,
        icon?: string,
        children?: State['routerMatchList'][],
    }[],
    userName: string,
    collapsed: boolean,
    selectedKey: string,
    openKeys: string[],
    appThemeMode: string,
};

// 只读状态
export type ReadonlyState = Readonly<State>;

// 修改状态
export type StateAction = {
    setRouterMatchList: (list: State['routerMatchList']) => void,
    setUserName: (userName: string) => void,
    setCollapsed: (status: boolean) => void,
    setSelectedKey: (key: string) => void,
    setOpenKeys: (openKeys: string[]) => void,
    setRoouterName: (name: string) => void,
};

// 仓库类型
export type LayoutStore = {
    state: ReadonlyState,
    onClickLogout: (navigate:any) => Promise<any>,
    onChangeSelectedKey: (item:any) => void,
    onOpenChange: (openKeys: string[]) => void,
    onClickCollapsed: () => void,
    init: (list: State['routerMatchList']) => void,
    reset: () => void,
    handleSelectChange: (selectedKeys: number) => void,
    onSetRouterMatchList: (list: State['routerMatchList']) => void,
    onSetRoouterName:(name:string) => void;
};