UNPKG

logsdx

Version:

<div align="center"><img alt="logsdx" width="300" src="https://github.com/user-attachments/assets/cc2a3b55-5bfd-44e8-a330-bfa146b50059" /></div>

248 lines (247 loc) 9.33 kB
import { z } from "zod"; import type { ThemePreset } from "../types"; export declare const colorPaletteSchema: z.ZodObject<{ name: z.ZodString; description: z.ZodString; colors: z.ZodObject<{ primary: z.ZodString; secondary: z.ZodString; success: z.ZodString; warning: z.ZodString; error: z.ZodString; info: z.ZodString; muted: z.ZodString; background: z.ZodString; text: z.ZodString; accent: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { text: string; background: string; primary: string; secondary: string; error: string; warning: string; info: string; success: string; muted: string; accent?: string | undefined; }, { text: string; background: string; primary: string; secondary: string; error: string; warning: string; info: string; success: string; muted: string; accent?: string | undefined; }>; accessibility: z.ZodObject<{ contrastRatio: z.ZodNumber; colorBlindSafe: z.ZodBoolean; darkMode: z.ZodBoolean; }, "strip", z.ZodTypeAny, { contrastRatio: number; colorBlindSafe: boolean; darkMode: boolean; }, { contrastRatio: number; colorBlindSafe: boolean; darkMode: boolean; }>; }, "strip", z.ZodTypeAny, { name: string; description: string; colors: { text: string; background: string; primary: string; secondary: string; error: string; warning: string; info: string; success: string; muted: string; accent?: string | undefined; }; accessibility: { contrastRatio: number; colorBlindSafe: boolean; darkMode: boolean; }; }, { name: string; description: string; colors: { text: string; background: string; primary: string; secondary: string; error: string; warning: string; info: string; success: string; muted: string; accent?: string | undefined; }; accessibility: { contrastRatio: number; colorBlindSafe: boolean; darkMode: boolean; }; }>; export type ColorPalette = z.infer<typeof colorPaletteSchema>; export declare const patternPresetSchema: z.ZodObject<{ name: z.ZodString; description: z.ZodString; category: z.ZodEnum<["api", "system", "application", "security", "database", "generic"]>; patterns: z.ZodArray<z.ZodObject<{ name: z.ZodString; pattern: z.ZodString; description: z.ZodString; colorRole: z.ZodEnum<["primary", "secondary", "success", "warning", "error", "info", "muted", "accent"]>; styleCodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { name: string; description: string; pattern: string; colorRole: "primary" | "secondary" | "error" | "warning" | "info" | "success" | "muted" | "accent"; styleCodes?: string[] | undefined; }, { name: string; description: string; pattern: string; colorRole: "primary" | "secondary" | "error" | "warning" | "info" | "success" | "muted" | "accent"; styleCodes?: string[] | undefined; }>, "many">; matchWords: z.ZodRecord<z.ZodString, z.ZodObject<{ colorRole: z.ZodEnum<["primary", "secondary", "success", "warning", "error", "info", "muted", "accent"]>; styleCodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { colorRole: "primary" | "secondary" | "error" | "warning" | "info" | "success" | "muted" | "accent"; styleCodes?: string[] | undefined; }, { colorRole: "primary" | "secondary" | "error" | "warning" | "info" | "success" | "muted" | "accent"; styleCodes?: string[] | undefined; }>>; }, "strip", z.ZodTypeAny, { name: string; description: string; matchWords: Record<string, { colorRole: "primary" | "secondary" | "error" | "warning" | "info" | "success" | "muted" | "accent"; styleCodes?: string[] | undefined; }>; category: "system" | "api" | "application" | "security" | "database" | "generic"; patterns: { name: string; description: string; pattern: string; colorRole: "primary" | "secondary" | "error" | "warning" | "info" | "success" | "muted" | "accent"; styleCodes?: string[] | undefined; }[]; }, { name: string; description: string; matchWords: Record<string, { colorRole: "primary" | "secondary" | "error" | "warning" | "info" | "success" | "muted" | "accent"; styleCodes?: string[] | undefined; }>; category: "system" | "api" | "application" | "security" | "database" | "generic"; patterns: { name: string; description: string; pattern: string; colorRole: "primary" | "secondary" | "error" | "warning" | "info" | "success" | "muted" | "accent"; styleCodes?: string[] | undefined; }[]; }>; export type PatternPreset = z.infer<typeof patternPresetSchema>; export declare const themeGeneratorConfigSchema: z.ZodObject<{ name: z.ZodString; description: z.ZodOptional<z.ZodString>; colorPalette: z.ZodString; patternPresets: z.ZodArray<z.ZodString, "many">; customPatterns: z.ZodOptional<z.ZodArray<z.ZodObject<{ name: z.ZodString; pattern: z.ZodString; colorRole: z.ZodEnum<["primary", "secondary", "success", "warning", "error", "info", "muted", "accent"]>; styleCodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { name: string; pattern: string; colorRole: "primary" | "secondary" | "error" | "warning" | "info" | "success" | "muted" | "accent"; styleCodes?: string[] | undefined; }, { name: string; pattern: string; colorRole: "primary" | "secondary" | "error" | "warning" | "info" | "success" | "muted" | "accent"; styleCodes?: string[] | undefined; }>, "many">>; customWords: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{ colorRole: z.ZodEnum<["primary", "secondary", "success", "warning", "error", "info", "muted", "accent"]>; styleCodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { colorRole: "primary" | "secondary" | "error" | "warning" | "info" | "success" | "muted" | "accent"; styleCodes?: string[] | undefined; }, { colorRole: "primary" | "secondary" | "error" | "warning" | "info" | "success" | "muted" | "accent"; styleCodes?: string[] | undefined; }>>>; options: z.ZodOptional<z.ZodObject<{ whiteSpace: z.ZodOptional<z.ZodEnum<["preserve", "trim"]>>; newLine: z.ZodOptional<z.ZodEnum<["preserve", "trim"]>>; }, "strip", z.ZodTypeAny, { whiteSpace?: "preserve" | "trim" | undefined; newLine?: "preserve" | "trim" | undefined; }, { whiteSpace?: "preserve" | "trim" | undefined; newLine?: "preserve" | "trim" | undefined; }>>; }, "strip", z.ZodTypeAny, { name: string; colorPalette: string; patternPresets: string[]; options?: { whiteSpace?: "preserve" | "trim" | undefined; newLine?: "preserve" | "trim" | undefined; } | undefined; description?: string | undefined; customWords?: Record<string, { colorRole: "primary" | "secondary" | "error" | "warning" | "info" | "success" | "muted" | "accent"; styleCodes?: string[] | undefined; }> | undefined; customPatterns?: { name: string; pattern: string; colorRole: "primary" | "secondary" | "error" | "warning" | "info" | "success" | "muted" | "accent"; styleCodes?: string[] | undefined; }[] | undefined; }, { name: string; colorPalette: string; patternPresets: string[]; options?: { whiteSpace?: "preserve" | "trim" | undefined; newLine?: "preserve" | "trim" | undefined; } | undefined; description?: string | undefined; customWords?: Record<string, { colorRole: "primary" | "secondary" | "error" | "warning" | "info" | "success" | "muted" | "accent"; styleCodes?: string[] | undefined; }> | undefined; customPatterns?: { name: string; pattern: string; colorRole: "primary" | "secondary" | "error" | "warning" | "info" | "success" | "muted" | "accent"; styleCodes?: string[] | undefined; }[] | undefined; }>; export type ThemeGeneratorConfig = z.infer<typeof themeGeneratorConfigSchema>; export declare const COLOR_PALETTES: ColorPalette[]; export declare const PATTERN_PRESETS: PatternPreset[]; export declare function getColorPalette(name: string): ColorPalette | undefined; export declare function getPatternPreset(name: string): PatternPreset | undefined; export declare function listColorPalettes(): ColorPalette[]; export declare function listPatternPresets(category?: PatternPreset["category"]): PatternPreset[]; export declare function generateTemplate(config: ThemeGeneratorConfig): ThemePreset;