Skip to content

Commit

Permalink
Merge pull request #4214 from fekete965/feature/add-mathml-definitions
Browse files Browse the repository at this point in the history
Feature/add mathml definitions
  • Loading branch information
marvinhagemeister authored Dec 8, 2023
2 parents f3d4271 + 6eb5309 commit 901e794
Showing 1 changed file with 371 additions and 0 deletions.
371 changes: 371 additions & 0 deletions src/jsx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2501,6 +2501,340 @@ export namespace JSXInternal {
| SignalLike<number | string | undefined>;
}

export interface MathMLAttributes<Target extends EventTarget = MathMLElement>
extends HTMLAttributes<Target> {
dir?: 'ltr' | 'rtl' | undefined | SignalLike<'ltr' | 'rtl' | undefined>;
displaystyle?: boolean | undefined | SignalLike<boolean | undefined>;
/** @deprecated This feature is non-standard. See https://developer.mozilla.org/en-US/docs/Web/MathML/Global_attributes/href */
href?: string | undefined | SignalLike<string | undefined>;
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Global_attributes/mathbackground */
mathbackground?: string | undefined | SignalLike<string | undefined>;
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Global_attributes/mathcolor */
mathcolor?: string | undefined | SignalLike<string | undefined>;
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Global_attributes/mathsize */
mathsize?: string | undefined | SignalLike<string | undefined>;
nonce?: string | undefined | SignalLike<string | undefined>;
scriptlevel?: string | undefined | SignalLike<string | undefined>;
}

export interface HTMLAnnotationElement extends MathMLElement {
encoding?: string | undefined | SignalLike<string | undefined>;
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/semantics#src */
src?: string | undefined | SignalLike<string | undefined>;
}

export interface HTMLAnnotationXmlElement extends MathMLElement {
encoding?: string | undefined | SignalLike<string | undefined>;
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/semantics#src */
src?: string | undefined | SignalLike<string | undefined>;
}

export interface HTMLMActionElement extends MathMLElement {
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/maction#actiontype */
actiontype?:
| 'statusline'
| 'toggle'
| undefined
| SignalLike<'statusline' | 'toggle' | undefined>;
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/maction#selection */
selection?: string | undefined | SignalLike<string | undefined>;
}

export interface HTMLMathElement extends MathMLElement {
display?:
| 'block'
| 'inline'
| undefined
| SignalLike<'block' | 'inline' | undefined>;
}

export interface HTMLMEncloseElement extends MathMLElement {
notation?: string | undefined | SignalLike<string | undefined>;
}

export interface HTMLMErrorElement extends MathMLElement {}

export interface HTMLMFencedElement extends MathMLElement {
close?: string | undefined | SignalLike<string | undefined>;
open?: string | undefined | SignalLike<string | undefined>;
separators?: string | undefined | SignalLike<string | undefined>;
}

export interface HTMLMFracElement extends MathMLElement {
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mfrac#denomalign */
denomalign?:
| 'center'
| 'left'
| 'right'
| undefined
| SignalLike<'center' | 'left' | 'right' | undefined>;
linethickness?: string | undefined | SignalLike<string | undefined>;
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mfrac#numalign */
numalign?:
| 'center'
| 'left'
| 'right'
| undefined
| SignalLike<'center' | 'left' | 'right' | undefined>;
}

export interface HTMLMiElement extends MathMLElement {
/** The only value allowed in the current specification is normal (case insensitive)
* See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mi#mathvariant */
mathvariant?:
| 'normal'
| 'bold'
| 'italic'
| 'bold-italic'
| 'double-struck'
| 'bold-fraktur'
| 'script'
| 'bold-script'
| 'fraktur'
| 'sans-serif'
| 'bold-sans-serif'
| 'sans-serif-italic'
| 'sans-serif-bold-italic'
| 'monospace'
| 'initial'
| 'tailed'
| 'looped'
| 'stretched'
| undefined
| SignalLike<
| 'normal'
| 'bold'
| 'italic'
| 'bold-italic'
| 'double-struck'
| 'bold-fraktur'
| 'script'
| 'bold-script'
| 'fraktur'
| 'sans-serif'
| 'bold-sans-serif'
| 'sans-serif-italic'
| 'sans-serif-bold-italic'
| 'monospace'
| 'initial'
| 'tailed'
| 'looped'
| 'stretched'
| undefined
>;
}

export interface HTMLMmultiScriptsElement extends MathMLElement {
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mmultiscripts#subscriptshift */
subscriptshift?: string | undefined | SignalLike<string | undefined>;
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mmultiscripts#superscriptshift */
superscriptshift?: string | undefined | SignalLike<string | undefined>;
}

export interface HTMLMNElement extends MathMLElement {}

export interface HTMLMOElement extends MathMLElement {
/** Non-standard attribute See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mo#accent */
accent?: boolean | undefined | SignalLike<boolean | undefined>;
fence?: boolean | undefined | SignalLike<boolean | undefined>;
largeop?: boolean | undefined | SignalLike<boolean | undefined>;
lspace?: string | undefined | SignalLike<string | undefined>;
maxsize?: string | undefined | SignalLike<string | undefined>;
minsize?: string | undefined | SignalLike<string | undefined>;
movablelimits?: boolean | undefined | SignalLike<boolean | undefined>;
rspace?: string | undefined | SignalLike<string | undefined>;
separator?: boolean | undefined | SignalLike<boolean | undefined>;
stretchy?: boolean | undefined | SignalLike<boolean | undefined>;
symmetric?: boolean | undefined | SignalLike<boolean | undefined>;
}

export interface HTMLMOverElement extends MathMLElement {
accent?: boolean | undefined | SignalLike<boolean | undefined>;
}

export interface HTMLMPaddedElement extends MathMLElement {
depth?: string | undefined | SignalLike<string | undefined>;
height?: string | undefined | SignalLike<string | undefined>;
lspace?: string | undefined | SignalLike<string | undefined>;
voffset?: string | undefined | SignalLike<string | undefined>;
width?: string | undefined | SignalLike<string | undefined>;
}

export interface HTMLMPhantomElement extends MathMLElement {}

export interface HTMLMPrescriptsElement extends MathMLElement {}

export interface HTMLMRootElement extends MathMLElement {}

export interface HTMLMRowElement extends MathMLElement {}

export interface HTMLMSElement extends MathMLElement {
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/ms#browser_compatibility */
lquote?: string | undefined | SignalLike<string | undefined>;
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/ms#browser_compatibility */
rquote?: string | undefined | SignalLike<string | undefined>;
}

export interface HTMLMSpaceElement extends MathMLElement {
depth?: string | undefined | SignalLike<string | undefined>;
height?: string | undefined | SignalLike<string | undefined>;
width?: string | undefined | SignalLike<string | undefined>;
}

export interface HTMLMSqrtElement extends MathMLElement {}

export interface HTMLMStyleElement extends MathMLElement {
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mstyle#background */
background?: string | undefined | SignalLike<string | undefined>;
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mstyle#color */
color?: string | undefined | SignalLike<string | undefined>;
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mstyle#fontsize */
fontsize?: string | undefined | SignalLike<string | undefined>;
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mstyle#fontstyle */
fontstyle?: string | undefined | SignalLike<string | undefined>;
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mstyle#fontweight */
fontweight?: string | undefined | SignalLike<string | undefined>;
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mstyle#scriptminsize */
scriptminsize?: string | undefined | SignalLike<string | undefined>;
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mstyle#scriptsizemultiplier */
scriptsizemultiplier?: string | undefined | SignalLike<string | undefined>;
}

export interface HTMLMSubElement extends MathMLElement {
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msub#subscriptshift */
subscriptshift?: string | undefined | SignalLike<string | undefined>;
}

export interface HTMLMSubsupElement extends MathMLElement {
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msubsup#subscriptshift */
subscriptshift?: string | undefined | SignalLike<string | undefined>;
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msubsup#superscriptshift */
superscriptshift?: string | undefined | SignalLike<string | undefined>;
}

export interface HTMLMSupElement extends MathMLElement {
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msup#superscriptshift */
superscriptshift?: string | undefined | SignalLike<string | undefined>;
}

export interface HTMLMTableElement extends MathMLElement {
/** Non-standard attribute See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtable#align */
align?:
| 'axis'
| 'baseline'
| 'bottom'
| 'center'
| 'top'
| undefined
| SignalLike<
'axis' | 'baseline' | 'bottom' | 'center' | 'top' | undefined
>;
/** Non-standard attribute See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtable#columnalign */
columnalign?:
| 'center'
| 'left'
| 'right'
| undefined
| SignalLike<'center' | 'left' | 'right' | undefined>;
/** Non-standard attribute See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtable#columnlines */
columnlines?:
| 'dashed'
| 'none'
| 'solid'
| undefined
| SignalLike<'dashed' | 'none' | 'solid' | undefined>;
/** Non-standard attribute See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtable#columnspacing */
columnspacing?: string | undefined | SignalLike<string | undefined>;
/** Non-standard attribute See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtable#frame */
frame?:
| 'dashed'
| 'none'
| 'solid'
| undefined
| SignalLike<'dashed' | 'none' | 'solid' | undefined>;
/** Non-standard attribute See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtable#framespacing */
framespacing?: string | undefined | SignalLike<string | undefined>;
/** Non-standard attribute See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtable#rowalign */
rowalign?:
| 'axis'
| 'baseline'
| 'bottom'
| 'center'
| 'top'
| undefined
| SignalLike<
'axis' | 'baseline' | 'bottom' | 'center' | 'top' | undefined
>;
/** Non-standard attribute See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtable#rowlines */
rowlines?:
| 'dashed'
| 'none'
| 'solid'
| undefined
| SignalLike<'dashed' | 'none' | 'solid' | undefined>;
/** Non-standard attribute See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtable#rowspacing */
rowspacing?: string | undefined | SignalLike<string | undefined>;
/** Non-standard attribute See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtable#width */
width?: string | undefined | SignalLike<string | undefined>;
}

export interface HTMLMTdElement extends MathMLElement {
columnspan?: number | undefined | SignalLike<number | undefined>;
rowspan?: number | undefined | SignalLike<number | undefined>;
/** Non-standard attribute See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtd#columnalign */
columnalign?:
| 'center'
| 'left'
| 'right'
| undefined
| SignalLike<'center' | 'left' | 'right' | undefined>;
/** Non-standard attribute See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtd#rowalign */
rowalign?:
| 'axis'
| 'baseline'
| 'bottom'
| 'center'
| 'top'
| undefined
| SignalLike<
'axis' | 'baseline' | 'bottom' | 'center' | 'top' | undefined
>;
}

export interface HTMLMTextElement extends MathMLElement {}

export interface HTMLMTrElement extends MathMLElement {
/** Non-standard attribute See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtr#columnalign */
columnalign?:
| 'center'
| 'left'
| 'right'
| undefined
| SignalLike<'center' | 'left' | 'right' | undefined>;
/** Non-standard attribute See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtr#rowalign */
rowalign?:
| 'axis'
| 'baseline'
| 'bottom'
| 'center'
| 'top'
| undefined
| SignalLike<
'axis' | 'baseline' | 'bottom' | 'center' | 'top' | undefined
>;
}

export interface HTMLMUnderElement extends MathMLElement {
accentunder?: boolean | undefined | SignalLike<boolean | undefined>;
}

export interface HTMLMUnderoverElement extends MathMLElement {
accent?: boolean | undefined | SignalLike<boolean | undefined>;
accentunder?: boolean | undefined | SignalLike<boolean | undefined>;
}

export interface HTMLSemanticsElement extends MathMLElement {}

export interface IntrinsicElements {
// HTML
a: HTMLAttributes<HTMLAnchorElement>;
Expand Down Expand Up @@ -2680,5 +3014,42 @@ export namespace JSXInternal {
tspan: SVGAttributes<SVGTSpanElement>;
use: SVGAttributes<SVGUseElement>;
view: SVGAttributes<SVGViewElement>;

// MathML See https://developer.mozilla.org/en-US/docs/Web/MathML
'annotation-xml': MathMLAttributes<HTMLAnnotationXmlElement>;
annotation: MathMLAttributes<HTMLAnnotationElement>;
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/maction */
maction: MathMLAttributes<HTMLMActionElement>;
math: MathMLAttributes<HTMLMathElement>;
/** This feature is non-standard. See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/menclose */
menclose: MathMLAttributes<HTMLMEncloseElement>;
merror: MathMLAttributes<HTMLMErrorElement>;
/** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mfenced */
mfenced: HTMLAttributes<HTMLMFencedElement>;
mfrac: MathMLAttributes<HTMLMFracElement>;
mi: MathMLAttributes<HTMLMiElement>;
mmultiscripts: MathMLAttributes<HTMLMmultiScriptsElement>;
mn: MathMLAttributes<HTMLMNElement>;
mo: MathMLAttributes<HTMLMOElement>;
mover: MathMLAttributes<HTMLMOverElement>;
mpadded: MathMLAttributes<HTMLMPaddedElement>;
mphantom: MathMLAttributes<HTMLMPhantomElement>;
mprescripts: MathMLAttributes<HTMLMPrescriptsElement>;
mroot: MathMLAttributes<HTMLMRootElement>;
mrow: MathMLAttributes<HTMLMRowElement>;
ms: MathMLAttributes<HTMLMSElement>;
mspace: MathMLAttributes<HTMLMSpaceElement>;
msqrt: MathMLAttributes<HTMLMSqrtElement>;
mstyle: MathMLAttributes<HTMLMStyleElement>;
msub: MathMLAttributes<HTMLMSubElement>;
msubsup: MathMLAttributes<HTMLMSubsupElement>;
msup: MathMLAttributes<HTMLMSupElement>;
mtable: MathMLAttributes<HTMLMTableElement>;
mtd: MathMLAttributes<HTMLMTdElement>;
mtext: MathMLAttributes<HTMLMTextElement>;
mtr: MathMLAttributes<HTMLMTrElement>;
munder: MathMLAttributes<HTMLMUnderElement>;
munderover: MathMLAttributes<HTMLMUnderoverElement>;
semantics: MathMLAttributes<HTMLSemanticsElement>;
}
}

0 comments on commit 901e794

Please sign in to comment.