mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 18:33:33 +00:00
Lint all files
This commit is contained in:
parent
22af76b4d6
commit
30e52ebb54
334 changed files with 76519 additions and 75932 deletions
|
|
@ -5,104 +5,104 @@ import { immer } from 'zustand/middleware/immer';
|
|||
import { Platform } from '/@/renderer/types';
|
||||
|
||||
type SidebarProps = {
|
||||
collapsed: boolean;
|
||||
expanded: string[];
|
||||
image: boolean;
|
||||
leftWidth: string;
|
||||
rightExpanded: boolean;
|
||||
rightWidth: string;
|
||||
collapsed: boolean;
|
||||
expanded: string[];
|
||||
image: boolean;
|
||||
leftWidth: string;
|
||||
rightExpanded: boolean;
|
||||
rightWidth: string;
|
||||
};
|
||||
|
||||
type TitlebarProps = {
|
||||
backgroundColor: string;
|
||||
outOfView: boolean;
|
||||
backgroundColor: string;
|
||||
outOfView: boolean;
|
||||
};
|
||||
|
||||
type CommandPaletteProps = {
|
||||
close: () => void;
|
||||
open: () => void;
|
||||
opened: boolean;
|
||||
toggle: () => void;
|
||||
close: () => void;
|
||||
open: () => void;
|
||||
opened: boolean;
|
||||
toggle: () => void;
|
||||
};
|
||||
|
||||
export interface AppState {
|
||||
commandPalette: CommandPaletteProps;
|
||||
isReorderingQueue: boolean;
|
||||
platform: Platform;
|
||||
sidebar: SidebarProps;
|
||||
titlebar: TitlebarProps;
|
||||
commandPalette: CommandPaletteProps;
|
||||
isReorderingQueue: boolean;
|
||||
platform: Platform;
|
||||
sidebar: SidebarProps;
|
||||
titlebar: TitlebarProps;
|
||||
}
|
||||
|
||||
export interface AppSlice extends AppState {
|
||||
actions: {
|
||||
setAppStore: (data: Partial<AppSlice>) => void;
|
||||
setSideBar: (options: Partial<SidebarProps>) => void;
|
||||
setTitleBar: (options: Partial<TitlebarProps>) => void;
|
||||
};
|
||||
actions: {
|
||||
setAppStore: (data: Partial<AppSlice>) => void;
|
||||
setSideBar: (options: Partial<SidebarProps>) => void;
|
||||
setTitleBar: (options: Partial<TitlebarProps>) => void;
|
||||
};
|
||||
}
|
||||
|
||||
export const useAppStore = create<AppSlice>()(
|
||||
persist(
|
||||
devtools(
|
||||
immer((set, get) => ({
|
||||
actions: {
|
||||
setAppStore: (data) => {
|
||||
set({ ...get(), ...data });
|
||||
},
|
||||
setSideBar: (options) => {
|
||||
set((state) => {
|
||||
state.sidebar = { ...state.sidebar, ...options };
|
||||
});
|
||||
},
|
||||
setTitleBar: (options) => {
|
||||
set((state) => {
|
||||
state.titlebar = { ...state.titlebar, ...options };
|
||||
});
|
||||
},
|
||||
persist(
|
||||
devtools(
|
||||
immer((set, get) => ({
|
||||
actions: {
|
||||
setAppStore: (data) => {
|
||||
set({ ...get(), ...data });
|
||||
},
|
||||
setSideBar: (options) => {
|
||||
set((state) => {
|
||||
state.sidebar = { ...state.sidebar, ...options };
|
||||
});
|
||||
},
|
||||
setTitleBar: (options) => {
|
||||
set((state) => {
|
||||
state.titlebar = { ...state.titlebar, ...options };
|
||||
});
|
||||
},
|
||||
},
|
||||
commandPalette: {
|
||||
close: () => {
|
||||
set((state) => {
|
||||
state.commandPalette.opened = false;
|
||||
});
|
||||
},
|
||||
open: () => {
|
||||
set((state) => {
|
||||
state.commandPalette.opened = true;
|
||||
});
|
||||
},
|
||||
opened: false,
|
||||
toggle: () => {
|
||||
set((state) => {
|
||||
state.commandPalette.opened = !state.commandPalette.opened;
|
||||
});
|
||||
},
|
||||
},
|
||||
isReorderingQueue: false,
|
||||
platform: Platform.WINDOWS,
|
||||
sidebar: {
|
||||
collapsed: false,
|
||||
expanded: [],
|
||||
image: false,
|
||||
leftWidth: '400px',
|
||||
rightExpanded: false,
|
||||
rightWidth: '400px',
|
||||
},
|
||||
titlebar: {
|
||||
backgroundColor: '#000000',
|
||||
outOfView: false,
|
||||
},
|
||||
})),
|
||||
{ name: 'store_app' },
|
||||
),
|
||||
{
|
||||
merge: (persistedState, currentState) => {
|
||||
return merge(currentState, persistedState);
|
||||
},
|
||||
name: 'store_app',
|
||||
version: 2,
|
||||
},
|
||||
commandPalette: {
|
||||
close: () => {
|
||||
set((state) => {
|
||||
state.commandPalette.opened = false;
|
||||
});
|
||||
},
|
||||
open: () => {
|
||||
set((state) => {
|
||||
state.commandPalette.opened = true;
|
||||
});
|
||||
},
|
||||
opened: false,
|
||||
toggle: () => {
|
||||
set((state) => {
|
||||
state.commandPalette.opened = !state.commandPalette.opened;
|
||||
});
|
||||
},
|
||||
},
|
||||
isReorderingQueue: false,
|
||||
platform: Platform.WINDOWS,
|
||||
sidebar: {
|
||||
collapsed: false,
|
||||
expanded: [],
|
||||
image: false,
|
||||
leftWidth: '400px',
|
||||
rightExpanded: false,
|
||||
rightWidth: '400px',
|
||||
},
|
||||
titlebar: {
|
||||
backgroundColor: '#000000',
|
||||
outOfView: false,
|
||||
},
|
||||
})),
|
||||
{ name: 'store_app' },
|
||||
),
|
||||
{
|
||||
merge: (persistedState, currentState) => {
|
||||
return merge(currentState, persistedState);
|
||||
},
|
||||
name: 'store_app',
|
||||
version: 2,
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
export const useAppStoreActions = () => useAppStore((state) => state.actions);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue