nitropage
Version:
A free and open source, extensible visual page builder based on SolidStart.
23 lines (21 loc) • 668 B
text/typescript
import type { EditorUiState } from "#../types";
import { createContext } from "solid-js";
import { SetStoreFunction, Store } from "solid-js/store";
import type { Settings } from "../server/settings";
export const EditorUiContext =
createContext<
[
get: Store<EditorUiState>,
set: (fn: (draft: EditorUiState) => any) => void,
]
>();
export const ElementFocusContext = createContext<(id: string) => void>();
export const SettingsContext = createContext<
[
get: Store<{ pages: Partial<Settings>; projects: Partial<Settings> }>,
set: SetStoreFunction<{
pages: Partial<Settings>;
projects: Partial<Settings>;
}>,
]
>();