templates store
Signed-off-by: FTCHD <144691102+FTCHD@users.noreply.github.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import { create } from 'zustand'
|
||||
import { type StateStorage, createJSONStorage, persist } from 'zustand/middleware'
|
||||
import type { ConfigFile } from '../types/config'
|
||||
import type { ScheduledTask } from '../types/task'
|
||||
import type { Template } from '../types/template'
|
||||
|
||||
// const { LazyStore } = window.__TAURI__.store
|
||||
const store = new LazyStore('store.json')
|
||||
@@ -110,6 +111,8 @@ interface PersistedState {
|
||||
removeScheduledTask: (id: string) => void
|
||||
updateScheduledTask: (id: string, task: Partial<ScheduledTask>) => void
|
||||
|
||||
templates: Template[]
|
||||
|
||||
configFiles: ConfigFile[]
|
||||
addConfigFile: (configFile: ConfigFile) => void
|
||||
removeConfigFile: (id: string) => void
|
||||
@@ -249,6 +252,8 @@ export const usePersistedStore = create<PersistedState>()(
|
||||
),
|
||||
})),
|
||||
|
||||
templates: [],
|
||||
|
||||
configFiles: [],
|
||||
addConfigFile: (configFile: ConfigFile) =>
|
||||
set((state) => ({
|
||||
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
export interface Template {
|
||||
id: string
|
||||
name: string
|
||||
operation: 'copy' | 'sync' | 'move' | 'delete' | 'purge'
|
||||
options: Record<string, any>
|
||||
}
|
||||
Reference in New Issue
Block a user