Files
tweakcn/types/editor.ts
T
Sahaj Jain f82f2e55fc Feature/hsl (#62)
* working hsl adjuster

* refactor

* format to hex
2025-05-08 23:44:32 +05:30

41 lines
973 B
TypeScript

import { ThemeStyles } from "./theme";
// Base interface for any editor's state
export interface BaseEditorState {
styles: ThemeStyles;
}
// Interface for editor-specific controls
export interface EditorControls {
// Controls can be added per editor type as needed
}
// Interface for editor-specific preview props
export interface EditorPreviewProps {
styles: ThemeStyles;
}
export interface ThemeEditorState extends BaseEditorState {
preset?: string;
styles: ThemeStyles;
currentMode: "light" | "dark";
hslAdjustments?: {
hueShift: number;
saturationScale: number;
lightnessScale: number;
};
}
// Type for available editors
export type EditorType = "button" | "input" | "card" | "dialog" | "theme";
// Interface for editor configuration
export interface EditorConfig {
type: EditorType;
name: string;
description: string;
defaultState: BaseEditorState;
controls: React.ComponentType<any>;
preview: React.ComponentType<any>;
}