{"version":3,"file":"types.mjs","sources":["../../src/core/types.ts"],"sourcesContent":["import type { KatexOptions } from \"katex\";\n\ntype CSSProperties = Record<string, string | number | undefined>;\n\n/**\n * Basic options for rendering math equations with mathsnap\n */\nexport interface MathOptions {\n    /** The LaTeX equation to render */\n    equation: string;\n\n    /** Whether to render in display mode (centered, block) or inline mode */\n    displayMode?: boolean;\n\n    /** Custom class name to add to the math container */\n    className?: string;\n\n    /** Custom inline styles for the container */\n    style?: CSSProperties;\n\n    /** Error callback when rendering fails */\n    onError?: (error: Error) => void;\n\n    /** Additional KaTeX options */\n    katexOptions?: Omit<KatexOptions, 'displayMode' | 'throwOnError' | 'output'>;\n}\n\n/**\n * Predefined equations that can be used with mathsnap\n */\nexport const equations = {\n    /** Quadratic formula */\n    quadratic: 'x = \\\\frac{-b \\\\pm \\\\sqrt{b^2 - 4ac}}{2a}',\n    \n    /** Einstein's mass-energy equivalence */\n    einstein: 'E = mc^2',\n    \n    /** Pythagorean theorem */\n    pythagorean: 'a^2 + b^2 = c^2',\n    \n    /** Euler's identity */\n    euler: 'e^{i\\\\pi} + 1 = 0',\n    \n    /** Area of a circle */\n    circleArea: 'A = \\\\pi r^2',\n    \n    /** Normal distribution */\n    normalDistribution: 'f(x) = \\\\frac{1}{\\\\sigma\\\\sqrt{2\\\\pi}} e^{-\\\\frac{1}{2}\\\\left(\\\\frac{x-\\\\mu}{\\\\sigma}\\\\right)^2}',\n    \n    /** Derivative definition */\n    derivative: '\\\\frac{df}{dx} = \\\\lim_{h \\\\to 0} \\\\frac{f(x+h) - f(x)}{h}',\n    \n    /** Integral definition */\n    integral: '\\\\int_{a}^{b} f(x) \\\\, dx = F(b) - F(a)',\n    \n    /** Maxwell's equations (divergence of E) */\n    maxwellDivergenceE: '\\\\nabla \\\\cdot \\\\vec{E} = \\\\frac{\\\\rho}{\\\\varepsilon_0}', \n    \n    /** Schrödinger equation */\n    schrodinger: 'i\\\\hbar\\\\frac{\\\\partial}{\\\\partial t}\\\\Psi(\\\\vec{r},t) = \\\\hat{H}\\\\Psi(\\\\vec{r},t)',\n}\n\n/** Error state for math rendering */\nexport interface MathError {\n    hasError: boolean;\n    message: string;\n}"],"names":["equations","quadratic","einstein","pythagorean","euler","circleArea","normalDistribution","derivative","integral","maxwellDivergenceE","schrodinger"],"mappings":"AA8BO,MAAMA,IAAY;AAAA;AAAA,EAErBC,WAAW;AAAA;AAAA,EAGXC,UAAU;AAAA;AAAA,EAGVC,aAAa;AAAA;AAAA,EAGbC,OAAO;AAAA;AAAA,EAGPC,YAAY;AAAA;AAAA,EAGZC,oBAAoB;AAAA;AAAA,EAGpBC,YAAY;AAAA;AAAA,EAGZC,UAAU;AAAA;AAAA,EAGVC,oBAAoB;AAAA;AAAA,EAGpBC,aAAa;AACjB;"}