UNPKG

@hirebus/academy

Version:

React component library for academy and learning platforms

31 lines (29 loc) 1.36 kB
import { Course } from '../types/course'; export type StoreState = { courses: Course[]; editingCourse: Course | null; }; export type StoreActions = { addCourse: (course: Course) => void; updateCourse: (course: Partial<Course>) => void; deleteCourse: (courseId: string) => void; setInitialCourses: (courses: Course[]) => void; setVideoProgress: (courseId: string, progress: number) => void; setEditingCourse: (course: Course | null) => void; }; export type Store = StoreState & StoreActions; export declare const DEFAULT_STORE_STATE: StoreState; export declare const useStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<Store>, "persist"> & { persist: { setOptions: (options: Partial<import('zustand/middleware').PersistOptions<Store, unknown>>) => void; clearStorage: () => void; rehydrate: () => Promise<void> | void; hasHydrated: () => boolean; onHydrate: (fn: (state: Store) => void) => () => void; onFinishHydration: (fn: (state: Store) => void) => () => void; getOptions: () => Partial<import('zustand/middleware').PersistOptions<Store, unknown>>; }; }>; export declare const useCourses: () => Course[]; export declare const useEditingCourse: () => Course | null; export declare const useCourse: (courseId: string) => Course | undefined;