From 5aad27ebdfb98cd9b41ef08fdfc70f0b2af38cac Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Sat, 22 Feb 2025 17:00:30 +0100 Subject: [PATCH 1/2] Remove v3 legacy modules --- src/legacy/ReactDOMRe.res | 19 - src/legacy/ReasonReact.res | 6 - src/v3/ReactDOMStyle_V3.bs.js | 12 - src/v3/ReactDOMStyle_V3.res | 437 ------- src/v3/ReactDOM_V3.bs.js | 17 - src/v3/ReactDOM_V3.res | 2118 --------------------------------- src/v3/ReactEvent_V3.bs.js | 53 - src/v3/ReactEvent_V3.res | 322 ----- src/v3/ReactEvent_V3.resi | 471 -------- src/v3/ReactV3.bs.js | 21 - src/v3/ReactV3.res | 35 - src/v3/React_V3.bs.js | 26 - src/v3/React_V3.res | 409 ------- 13 files changed, 3946 deletions(-) delete mode 100644 src/legacy/ReactDOMRe.res delete mode 100644 src/legacy/ReasonReact.res delete mode 100644 src/v3/ReactDOMStyle_V3.bs.js delete mode 100644 src/v3/ReactDOMStyle_V3.res delete mode 100644 src/v3/ReactDOM_V3.bs.js delete mode 100644 src/v3/ReactDOM_V3.res delete mode 100644 src/v3/ReactEvent_V3.bs.js delete mode 100644 src/v3/ReactEvent_V3.res delete mode 100644 src/v3/ReactEvent_V3.resi delete mode 100644 src/v3/ReactV3.bs.js delete mode 100644 src/v3/ReactV3.res delete mode 100644 src/v3/React_V3.bs.js delete mode 100644 src/v3/React_V3.res diff --git a/src/legacy/ReactDOMRe.res b/src/legacy/ReactDOMRe.res deleted file mode 100644 index c528baa..0000000 --- a/src/legacy/ReactDOMRe.res +++ /dev/null @@ -1,19 +0,0 @@ -/** -This module is kept for ReScript react-jsx v3 compatibility -We removed all functionality that is not needed for JSX usage -**/ -include ReactDOM_V3.Props - -@variadic @module("react") -external createDOMElementVariadic: ( - string, - ~props: ReactDOM_V3.domProps=?, - array, -) => React.element = "createElement" - -@variadic @module("react") -external createElement: ( - string, - ~props: ReactDOM_V3.domProps=?, - array, -) => React.element = "createElement" diff --git a/src/legacy/ReasonReact.res b/src/legacy/ReasonReact.res deleted file mode 100644 index 95ec6eb..0000000 --- a/src/legacy/ReasonReact.res +++ /dev/null @@ -1,6 +0,0 @@ -/** -This module is kept for ReScript react-jsx v3 compatibility -We removed all functionality that is not needed for JSX usage -**/ - -@module("react") external fragment: 'a = "Fragment" diff --git a/src/v3/ReactDOMStyle_V3.bs.js b/src/v3/ReactDOMStyle_V3.bs.js deleted file mode 100644 index 18702c8..0000000 --- a/src/v3/ReactDOMStyle_V3.bs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -'use strict'; - - -function unsafeAddProp(style, key, value) { - var dict = {}; - dict[key] = value; - return Object.assign({}, style, dict); -} - -exports.unsafeAddProp = unsafeAddProp; -/* No side effect */ diff --git a/src/v3/ReactDOMStyle_V3.res b/src/v3/ReactDOMStyle_V3.res deleted file mode 100644 index 93d9711..0000000 --- a/src/v3/ReactDOMStyle_V3.res +++ /dev/null @@ -1,437 +0,0 @@ -type t = ReactDOMStyle.t - -@obj @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external make: ( - ~azimuth: string=?, - ~background: string=?, - ~backgroundAttachment: string=?, - ~backgroundColor: string=?, - ~backgroundImage: string=?, - ~backgroundPosition: string=?, - ~backgroundRepeat: string=?, - ~border: string=?, - ~borderCollapse: string=?, - ~borderColor: string=?, - ~borderSpacing: string=?, - ~borderStyle: string=?, - ~borderTop: string=?, - ~borderRight: string=?, - ~borderBottom: string=?, - ~borderLeft: string=?, - ~borderTopColor: string=?, - ~borderRightColor: string=?, - ~borderBottomColor: string=?, - ~borderLeftColor: string=?, - ~borderTopStyle: string=?, - ~borderRightStyle: string=?, - ~borderBottomStyle: string=?, - ~borderLeftStyle: string=?, - ~borderTopWidth: string=?, - ~borderRightWidth: string=?, - ~borderBottomWidth: string=?, - ~borderLeftWidth: string=?, - ~borderWidth: string=?, - ~bottom: string=?, - ~captionSide: string=?, - ~clear: string=?, - ~clip: string=?, - ~color: string=?, - ~content: string=?, - ~counterIncrement: string=?, - ~counterReset: string=?, - ~cue: string=?, - ~cueAfter: string=?, - ~cueBefore: string=?, - ~cursor: string=?, - ~direction: string=?, - ~display: string=?, - ~elevation: string=?, - ~emptyCells: string=?, - ~float: string=?, - ~font: string=?, - ~fontFamily: string=?, - ~fontSize: string=?, - ~fontSizeAdjust: string=?, - ~fontStretch: string=?, - ~fontStyle: string=?, - ~fontVariant: string=?, - ~fontWeight: string=?, - ~height: string=?, - ~left: string=?, - ~letterSpacing: string=?, - ~lineHeight: string=?, - ~listStyle: string=?, - ~listStyleImage: string=?, - ~listStylePosition: string=?, - ~listStyleType: string=?, - ~margin: string=?, - ~marginTop: string=?, - ~marginRight: string=?, - ~marginBottom: string=?, - ~marginLeft: string=?, - ~markerOffset: string=?, - ~marks: string=?, - ~maxHeight: string=?, - ~maxWidth: string=?, - ~minHeight: string=?, - ~minWidth: string=?, - ~orphans: string=?, - ~outline: string=?, - ~outlineColor: string=?, - ~outlineStyle: string=?, - ~outlineWidth: string=?, - ~overflow: string=?, - ~overflowX: string=?, - ~overflowY: string=?, - ~padding: string=?, - ~paddingTop: string=?, - ~paddingRight: string=?, - ~paddingBottom: string=?, - ~paddingLeft: string=?, - ~page: string=?, - ~pageBreakAfter: string=?, - ~pageBreakBefore: string=?, - ~pageBreakInside: string=?, - ~pause: string=?, - ~pauseAfter: string=?, - ~pauseBefore: string=?, - ~pitch: string=?, - ~pitchRange: string=?, - ~playDuring: string=?, - ~position: string=?, - ~quotes: string=?, - ~richness: string=?, - ~right: string=?, - ~size: string=?, - ~speak: string=?, - ~speakHeader: string=?, - ~speakNumeral: string=?, - ~speakPunctuation: string=?, - ~speechRate: string=?, - ~stress: string=?, - ~tableLayout: string=?, - ~textAlign: string=?, - ~textDecoration: string=?, - ~textIndent: string=?, - ~textShadow: string=?, - ~textTransform: string=?, - ~top: string=?, - ~unicodeBidi: string=?, - ~verticalAlign: string=?, - ~visibility: string=?, - ~voiceFamily: string=?, - ~volume: string=?, - ~whiteSpace: string=?, - ~widows: string=?, - ~width: string=?, - ~wordSpacing: string=?, - ~zIndex: string=?, - ~opacity: /* Below properties based on https://www.w3.org/Style/CSS/all-properties */ - /* Color Level 3 - REC */ - string=?, - ~backgroundOrigin: /* Backgrounds and Borders Level 3 - CR */ - /* backgroundRepeat - already defined by CSS2Properties */ - /* backgroundAttachment - already defined by CSS2Properties */ - string=?, - ~backgroundSize: string=?, - ~backgroundClip: string=?, - ~borderRadius: string=?, - ~borderTopLeftRadius: string=?, - ~borderTopRightRadius: string=?, - ~borderBottomLeftRadius: string=?, - ~borderBottomRightRadius: string=?, - ~borderImage: string=?, - ~borderImageSource: string=?, - ~borderImageSlice: string=?, - ~borderImageWidth: string=?, - ~borderImageOutset: string=?, - ~borderImageRepeat: string=?, - ~boxShadow: string=?, - ~columns: /* Multi-column Layout - CR */ - string=?, - ~columnCount: string=?, - ~columnFill: string=?, - ~columnGap: string=?, - ~columnRule: string=?, - ~columnRuleColor: string=?, - ~columnRuleStyle: string=?, - ~columnRuleWidth: string=?, - ~columnSpan: string=?, - ~columnWidth: string=?, - ~breakAfter: string=?, - ~breakBefore: string=?, - ~breakInside: string=?, - ~rest: /* Speech - CR */ - string=?, - ~restAfter: string=?, - ~restBefore: string=?, - ~speakAs: string=?, - ~voiceBalance: string=?, - ~voiceDuration: string=?, - ~voicePitch: string=?, - ~voiceRange: string=?, - ~voiceRate: string=?, - ~voiceStress: string=?, - ~voiceVolume: string=?, - ~objectFit: /* Image Values and Replaced Content Level 3 - CR */ - string=?, - ~objectPosition: string=?, - ~imageResolution: string=?, - ~imageOrientation: string=?, - ~alignContent: /* Flexible Box Layout - CR */ - string=?, - ~alignItems: string=?, - ~alignSelf: string=?, - ~flex: string=?, - ~flexBasis: string=?, - ~flexDirection: string=?, - ~flexFlow: string=?, - ~flexGrow: string=?, - ~flexShrink: string=?, - ~flexWrap: string=?, - ~justifyContent: string=?, - ~order: string=?, - ~textDecorationColor: /* Text Decoration Level 3 - CR */ - /* textDecoration - already defined by CSS2Properties */ - string=?, - ~textDecorationLine: string=?, - ~textDecorationSkip: string=?, - ~textDecorationStyle: string=?, - ~textEmphasis: string=?, - ~textEmphasisColor: string=?, - ~textEmphasisPosition: string=?, - ~textEmphasisStyle: string=?, - ~textUnderlinePosition: /* textShadow - already defined by CSS2Properties */ - string=?, - ~fontFeatureSettings: /* Fonts Level 3 - CR */ - string=?, - ~fontKerning: string=?, - ~fontLanguageOverride: string=?, - ~fontSynthesis: /* fontSizeAdjust - already defined by CSS2Properties */ - /* fontStretch - already defined by CSS2Properties */ - string=?, - ~forntVariantAlternates: string=?, - ~fontVariantCaps: string=?, - ~fontVariantEastAsian: string=?, - ~fontVariantLigatures: string=?, - ~fontVariantNumeric: string=?, - ~fontVariantPosition: string=?, - ~all: /* Cascading and Inheritance Level 3 - CR */ - string=?, - ~glyphOrientationVertical: /* Writing Modes Level 3 - CR */ - string=?, - ~textCombineUpright: string=?, - ~textOrientation: string=?, - ~writingMode: string=?, - ~shapeImageThreshold: /* Shapes Level 1 - CR */ - string=?, - ~shapeMargin: string=?, - ~shapeOutside: string=?, - ~clipPath: /* Masking Level 1 - CR */ - string=?, - ~clipRule: string=?, - ~mask: string=?, - ~maskBorder: string=?, - ~maskBorderMode: string=?, - ~maskBorderOutset: string=?, - ~maskBorderRepeat: string=?, - ~maskBorderSlice: string=?, - ~maskBorderSource: string=?, - ~maskBorderWidth: string=?, - ~maskClip: string=?, - ~maskComposite: string=?, - ~maskImage: string=?, - ~maskMode: string=?, - ~maskOrigin: string=?, - ~maskPosition: string=?, - ~maskRepeat: string=?, - ~maskSize: string=?, - ~maskType: string=?, - ~backgroundBlendMode: /* Compositing and Blending Level 1 - CR */ - string=?, - ~isolation: string=?, - ~mixBlendMode: string=?, - ~boxDecorationBreak: /* Fragmentation Level 3 - CR */ - string=?, - ~boxSizing: /* breakAfter - already defined by Multi-column Layout */ - /* breakBefore - already defined by Multi-column Layout */ - /* breakInside - already defined by Multi-column Layout */ - /* Basic User Interface Level 3 - CR */ - string=?, - ~caretColor: string=?, - ~navDown: string=?, - ~navLeft: string=?, - ~navRight: string=?, - ~navUp: string=?, - ~outlineOffset: string=?, - ~resize: string=?, - ~textOverflow: string=?, - ~grid: /* Grid Layout Level 1 - CR */ - string=?, - ~gridArea: string=?, - ~gridAutoColumns: string=?, - ~gridAutoFlow: string=?, - ~gridAutoRows: string=?, - ~gridColumn: string=?, - ~gridColumnEnd: string=?, - ~gridColumnGap: string=?, - ~gridColumnStart: string=?, - ~gridGap: string=?, - ~gridRow: string=?, - ~gridRowEnd: string=?, - ~gridRowGap: string=?, - ~gridRowStart: string=?, - ~gridTemplate: string=?, - ~gridTemplateAreas: string=?, - ~gridTemplateColumns: string=?, - ~gridTemplateRows: string=?, - ~willChange: /* Will Change Level 1 - CR */ - string=?, - ~hangingPunctuation: /* Text Level 3 - LC */ - string=?, - ~hyphens: string=?, - ~lineBreak: /* letterSpacing - already defined by CSS2Properties */ - string=?, - ~overflowWrap: string=?, - ~tabSize: string=?, - ~textAlignLast: /* textAlign - already defined by CSS2Properties */ - string=?, - ~textJustify: string=?, - ~wordBreak: string=?, - ~wordWrap: string=?, - ~animation: /* Animations - WD */ - string=?, - ~animationDelay: string=?, - ~animationDirection: string=?, - ~animationDuration: string=?, - ~animationFillMode: string=?, - ~animationIterationCount: string=?, - ~animationName: string=?, - ~animationPlayState: string=?, - ~animationTimingFunction: string=?, - ~transition: /* Transitions - WD */ - string=?, - ~transitionDelay: string=?, - ~transitionDuration: string=?, - ~transitionProperty: string=?, - ~transitionTimingFunction: string=?, - ~backfaceVisibility: /* Transforms Level 1 - WD */ - string=?, - ~perspective: string=?, - ~perspectiveOrigin: string=?, - ~transform: string=?, - ~transformOrigin: string=?, - ~transformStyle: string=?, - ~justifyItems: /* Box Alignment Level 3 - WD */ - /* alignContent - already defined by Flexible Box Layout */ - /* alignItems - already defined by Flexible Box Layout */ - string=?, - ~justifySelf: string=?, - ~placeContent: string=?, - ~placeItems: string=?, - ~placeSelf: string=?, - ~appearance: /* Basic User Interface Level 4 - FPWD */ - string=?, - ~caret: string=?, - ~caretAnimation: string=?, - ~caretShape: string=?, - ~userSelect: string=?, - ~maxLines: /* Overflow Level 3 - WD */ - string=?, - ~marqueeDirection: /* Basix Box Model - WD */ - string=?, - ~marqueeLoop: string=?, - ~marqueeSpeed: string=?, - ~marqueeStyle: string=?, - ~overflowStyle: string=?, - ~rotation: string=?, - ~rotationPoint: string=?, - ~alignmentBaseline: /* SVG 1.1 - REC */ - string=?, - ~baselineShift: string=?, - ~clip: string=?, - ~clipPath: string=?, - ~clipRule: string=?, - ~colorInterpolation: string=?, - ~colorInterpolationFilters: string=?, - ~colorProfile: string=?, - ~colorRendering: string=?, - ~cursor: string=?, - ~dominantBaseline: string=?, - ~fill: string=?, - ~fillOpacity: string=?, - ~fillRule: string=?, - ~filter: string=?, - ~floodColor: string=?, - ~floodOpacity: string=?, - ~glyphOrientationHorizontal: string=?, - ~glyphOrientationVertical: string=?, - ~imageRendering: string=?, - ~kerning: string=?, - ~lightingColor: string=?, - ~markerEnd: string=?, - ~markerMid: string=?, - ~markerStart: string=?, - ~pointerEvents: string=?, - ~shapeRendering: string=?, - ~stopColor: string=?, - ~stopOpacity: string=?, - ~stroke: string=?, - ~strokeDasharray: string=?, - ~strokeDashoffset: string=?, - ~strokeLinecap: string=?, - ~strokeLinejoin: string=?, - ~strokeMiterlimit: string=?, - ~strokeOpacity: string=?, - ~strokeWidth: string=?, - ~textAnchor: string=?, - ~textRendering: string=?, - ~rubyAlign: /* Ruby Layout Level 1 - WD */ - string=?, - ~rubyMerge: string=?, - ~rubyPosition: string=?, - /* Lists and Counters Level 3 - WD */ - /* listStyle - already defined by CSS2Properties */ - /* listStyleImage - already defined by CSS2Properties */ - /* listStylePosition - already defined by CSS2Properties */ - /* listStyleType - already defined by CSS2Properties */ - /* counterIncrement - already defined by CSS2Properties */ - /* counterReset - already defined by CSS2Properties */ - /* Not added yet - * ------------- - * Generated Content for Paged Media - WD - * Generated Content Level 3 - WD - * Line Grid Level 1 - WD - * Regions - WD - * Inline Layout Level 3 - WD - * Round Display Level 1 - WD - * Image Values and Replaced Content Level 4 - WD - * Positioned Layout Level 3 - WD - * Filter Effects Level 1 - -WD - * Exclusions Level 1 - WD - * Text Level 4 - FPWD - * SVG Markers - FPWD - * Motion Path Level 1 - FPWD - * Color Level 4 - FPWD - * SVG Strokes - FPWD - * Table Level 3 - FPWD - */ - unit, -) => t = "" - -/* CSS2Properties: https://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSS2Properties */ -@val @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external combine: (@as(json`{}`) _, t, t) => t = "Object.assign" - -@deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external _dictToStyle: Js.Dict.t => t = "%identity" - -@deprecated("Jsx 3 is deprecated, use jsx 4 instead") -let unsafeAddProp = (style, key, value) => { - let dict = Js.Dict.empty() - Js.Dict.set(dict, key, value) - combine(style, _dictToStyle(dict)) -} - -@val @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external unsafeAddStyle: (@as(json`{}`) _, t, {..}) => t = "Object.assign" diff --git a/src/v3/ReactDOM_V3.bs.js b/src/v3/ReactDOM_V3.bs.js deleted file mode 100644 index e2bdd8a..0000000 --- a/src/v3/ReactDOM_V3.bs.js +++ /dev/null @@ -1,17 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -'use strict'; - - -var Experimental = {}; - -var Ref = {}; - -var Props = {}; - -var Style; - -exports.Experimental = Experimental; -exports.Ref = Ref; -exports.Props = Props; -exports.Style = Style; -/* No side effect */ diff --git a/src/v3/ReactDOM_V3.res b/src/v3/ReactDOM_V3.res deleted file mode 100644 index cfbea88..0000000 --- a/src/v3/ReactDOM_V3.res +++ /dev/null @@ -1,2118 +0,0 @@ -/* First time reading a ReScript file? */ -/* `external` is the foreign function call in OCaml. */ -/* here we're saying `I guarantee that on the JS side, we have a `render` function in the module "react-dom" - that takes in a reactElement, a dom element, and returns unit (nothing) */ -/* It's like `let`, except you're pointing the implementation to the JS side. The compiler will inline these - calls and add the appropriate `require("react-dom")` in the file calling this `render` */ - -// Helper so that ReactDOM itself doesn't bring any runtime -@val @return(nullable) @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external querySelector: string => option = "document.querySelector" - -@module("react-dom") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external render: (React.element, Dom.element) => unit = "render" - -module Experimental = { - type root = ReactDOM.Client.Root.t - - @module("react-dom") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external createRoot: Dom.element => root = "createRoot" - - @module("react-dom") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external createBlockingRoot: Dom.element => root = "createBlockingRoot" - - @send @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external render: (root, React.element) => unit = "render" -} - -@module("react-dom") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external hydrate: (React.element, Dom.element) => unit = "hydrate" - -@module("react-dom") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external createPortal: (React.element, Dom.element) => React.element = "createPortal" - -@module("react-dom") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external unmountComponentAtNode: Dom.element => unit = "unmountComponentAtNode" - -@deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external domElementToObj: Dom.element => {..} = "%identity" - -type style = ReactDOMStyle.t - -type domRef = ReactDOM.domRef - -module Ref = { - type t = domRef - type currentDomRef = React.ref> - type callbackDomRef = Js.nullable => unit - - @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external domRef: currentDomRef => domRef = "%identity" - @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external callbackDomRef: callbackDomRef => domRef = "%identity" -} - -module Props = { - /* This list isn't exhaustive. We'll add more as we go. */ - /* - * Watch out! There are two props types and the only difference is the type of ref. - * Please keep in sync. - */ - @deriving(abstract) - type domProps = { - @optional - key: string, - @optional - ref: domRef, - /* accessibility */ - /* https://www.w3.org/TR/wai-aria-1.1/ */ - /* https://accessibilityresources.org/ is a great resource for these */ - /* [@optional] [@as "aria-current"] ariaCurrent: page|step|location|date|time|true|false, */ - @optional @as("aria-details") - ariaDetails: string, - @optional @as("aria-disabled") - ariaDisabled: bool, - @optional @as("aria-hidden") - ariaHidden: bool, - /* [@optional] [@as "aria-invalid"] ariaInvalid: grammar|false|spelling|true, */ - @optional @as("aria-keyshortcuts") - ariaKeyshortcuts: string, - @optional @as("aria-label") - ariaLabel: string, - @optional @as("aria-roledescription") - ariaRoledescription: string, - /* Widget Attributes */ - /* [@optional] [@as "aria-autocomplete"] ariaAutocomplete: inline|list|both|none, */ - /* [@optional] [@as "aria-checked"] ariaChecked: true|false|mixed, /* https://www.w3.org/TR/wai-aria-1.1/#valuetype_tristate */ */ - @optional @as("aria-expanded") - ariaExpanded: bool, - /* [@optional] [@as "aria-haspopup"] ariaHaspopup: false|true|menu|listbox|tree|grid|dialog, */ - @optional @as("aria-level") - ariaLevel: int, - @optional @as("aria-modal") - ariaModal: bool, - @optional @as("aria-multiline") - ariaMultiline: bool, - @optional @as("aria-multiselectable") - ariaMultiselectable: bool, - /* [@optional] [@as "aria-orientation"] ariaOrientation: horizontal|vertical|undefined, */ - @optional @as("aria-placeholder") - ariaPlaceholder: string, - /* [@optional] [@as "aria-pressed"] ariaPressed: true|false|mixed, /* https://www.w3.org/TR/wai-aria-1.1/#valuetype_tristate */ */ - @optional @as("aria-readonly") - ariaReadonly: bool, - @optional @as("aria-required") - ariaRequired: bool, - @optional @as("aria-selected") - ariaSelected: bool, - @optional @as("aria-sort") - ariaSort: string, - @optional @as("aria-valuemax") - ariaValuemax: float, - @optional @as("aria-valuemin") - ariaValuemin: float, - @optional @as("aria-valuenow") - ariaValuenow: float, - @optional @as("aria-valuetext") - ariaValuetext: string, - /* Live Region Attributes */ - @optional @as("aria-atomic") - ariaAtomic: bool, - @optional @as("aria-busy") - ariaBusy: bool, - /* [@optional] [@as "aria-live"] ariaLive: off|polite|assertive|rude, */ - @optional @as("aria-relevant") - ariaRelevant: string, - /* Drag-and-Drop Attributes */ - /* [@optional] [@as "aria-dropeffect"] ariaDropeffect: copy|move|link|execute|popup|none, */ - @optional @as("aria-grabbed") - ariaGrabbed: bool, - /* Relationship Attributes */ - @optional @as("aria-activedescendant") - ariaActivedescendant: string, - @optional @as("aria-colcount") - ariaColcount: int, - @optional @as("aria-colindex") - ariaColindex: int, - @optional @as("aria-colspan") - ariaColspan: int, - @optional @as("aria-controls") - ariaControls: string, - @optional @as("aria-describedby") - ariaDescribedby: string, - @optional @as("aria-errormessage") - ariaErrormessage: string, - @optional @as("aria-flowto") - ariaFlowto: string, - @optional @as("aria-labelledby") - ariaLabelledby: string, - @optional @as("aria-owns") - ariaOwns: string, - @optional @as("aria-posinset") - ariaPosinset: int, - @optional @as("aria-rowcount") - ariaRowcount: int, - @optional @as("aria-rowindex") - ariaRowindex: int, - @optional @as("aria-rowspan") - ariaRowspan: int, - @optional @as("aria-setsize") - ariaSetsize: int, - /* react textarea/input */ - @optional - defaultChecked: bool, - @optional - defaultValue: string, - /* global html attributes */ - @optional - accessKey: string, - @optional - className: string /* substitute for "class" */, - @optional - contentEditable: bool, - @optional - contextMenu: string, - @optional - dir: string /* "ltr", "rtl" or "auto" */, - @optional - draggable: bool, - @optional - hidden: bool, - @optional - id: string, - @optional - lang: string, - @optional - role: string /* ARIA role */, - @optional - style: style, - @optional - spellCheck: bool, - @optional - tabIndex: int, - @optional - title: string, - /* html5 microdata */ - @optional - itemID: string, - @optional - itemProp: string, - @optional - itemRef: string, - @optional - itemScope: bool, - @optional - itemType: string /* uri */, - /* tag-specific html attributes */ - @optional - accept: string, - @optional - acceptCharset: string, - @optional - action: string /* uri */, - @optional - allowFullScreen: bool, - @optional - alt: string, - @optional - async: bool, - @optional - autoComplete: string /* has a fixed, but large-ish, set of possible values */, - @optional - autoCapitalize: string /* Mobile Safari specific */, - @optional - autoFocus: bool, - @optional - autoPlay: bool, - @optional - challenge: string, - @optional - charSet: string, - @optional - checked: bool, - @optional - cite: string /* uri */, - @optional - crossOrigin: string /* anonymous, use-credentials */, - @optional - cols: int, - @optional - colSpan: int, - @optional - content: string, - @optional - controls: bool, - @optional - coords: string /* set of values specifying the coordinates of a region */, - @optional - data: string /* uri */, - @optional - dateTime: string /* "valid date string with optional time" */, - @optional - default: bool, - @optional - defer: bool, - @optional - disabled: bool, - @optional - download: string /* should really be either a boolean, signifying presence, or a string */, - @optional - encType: string /* "application/x-www-form-urlencoded", "multipart/form-data" or "text/plain" */, - @optional - form: string, - @optional - formAction: string /* uri */, - @optional - formTarget: string /* "_blank", "_self", etc. */, - @optional - formMethod: string /* "post", "get", "put" */, - @optional - headers: string, - @optional - height: string /* in html5 this can only be a number, but in html4 it can ba a percentage as well */, - @optional - high: int, - @optional - href: string /* uri */, - @optional - hrefLang: string, - @optional - htmlFor: string /* substitute for "for" */, - @optional - httpEquiv: string /* has a fixed set of possible values */, - @optional - icon: string /* uri? */, - @optional - inputMode: string /* "verbatim", "latin", "numeric", etc. */, - @optional - integrity: string, - @optional - keyType: string, - @optional - kind: string /* has a fixed set of possible values */, - @optional - label: string, - @optional - list: string, - @optional - loading: [#"lazy" | #eager], - @optional - loop: bool, - @optional - low: int, - @optional - manifest: string /* uri */, - @optional - max: string /* should be int or Js.Date.t */, - @optional - maxLength: int, - @optional - media: string /* a valid media query */, - @optional - mediaGroup: string, - @optional - method: string /* "post" or "get" */, - @optional - min: string, - @optional - minLength: int, - @optional - multiple: bool, - @optional - muted: bool, - @optional - name: string, - @optional - nonce: string, - @optional - noValidate: bool, - @optional @as("open") - open_: bool /* use this one. Previous one is deprecated */, - @optional - optimum: int, - @optional - pattern: string /* valid Js RegExp */, - @optional - placeholder: string, - @optional - playsInline: bool, - @optional - poster: string /* uri */, - @optional - preload: string /* "none", "metadata" or "auto" (and "" as a synonym for "auto") */, - @optional - radioGroup: string, - @optional - readOnly: bool, - @optional - rel: string /* a space- or comma-separated (depending on the element) list of a fixed set of "link types" */, - @optional - required: bool, - @optional - reversed: bool, - @optional - rows: int, - @optional - rowSpan: int, - @optional - sandbox: string /* has a fixed set of possible values */, - @optional - scope: string /* has a fixed set of possible values */, - @optional - scoped: bool, - @optional - scrolling: string /* html4 only, "auto", "yes" or "no" */, - /* seamless - supported by React, but removed from the html5 spec */ - @optional - selected: bool, - @optional - shape: string, - @optional - size: int, - @optional - sizes: string, - @optional - span: int, - @optional - src: string /* uri */, - @optional - srcDoc: string, - @optional - srcLang: string, - @optional - srcSet: string, - @optional - start: int, - @optional - step: float, - @optional - summary: string /* deprecated */, - @optional - target: string, - @optional @as("type") - type_: string /* has a fixed but large-ish set of possible values */ /* use this one. Previous one is deprecated */, - @optional - useMap: string, - @optional - value: string, - @optional - width: string /* in html5 this can only be a number, but in html4 it can ba a percentage as well */, - @optional - wrap: string /* "hard" or "soft" */, - /* Clipboard events */ - @optional - onCopy: ReactEvent.Clipboard.t => unit, - @optional - onCut: ReactEvent.Clipboard.t => unit, - @optional - onPaste: ReactEvent.Clipboard.t => unit, - /* Composition events */ - @optional - onCompositionEnd: ReactEvent.Composition.t => unit, - @optional - onCompositionStart: ReactEvent.Composition.t => unit, - @optional - onCompositionUpdate: ReactEvent.Composition.t => unit, - /* Keyboard events */ - @optional - onKeyDown: ReactEvent.Keyboard.t => unit, - @optional - onKeyPress: ReactEvent.Keyboard.t => unit, - @optional - onKeyUp: ReactEvent.Keyboard.t => unit, - /* Focus events */ - @optional - onFocus: ReactEvent.Focus.t => unit, - @optional - onBlur: ReactEvent.Focus.t => unit, - /* Form events */ - @optional - onChange: ReactEvent.Form.t => unit, - @optional - onInput: ReactEvent.Form.t => unit, - @optional - onSubmit: ReactEvent.Form.t => unit, - @optional - onInvalid: ReactEvent.Form.t => unit, - /* Mouse events */ - @optional - onClick: ReactEvent.Mouse.t => unit, - @optional - onContextMenu: ReactEvent.Mouse.t => unit, - @optional - onDoubleClick: ReactEvent.Mouse.t => unit, - @optional - onDrag: ReactEvent.Mouse.t => unit, - @optional - onDragEnd: ReactEvent.Mouse.t => unit, - @optional - onDragEnter: ReactEvent.Mouse.t => unit, - @optional - onDragExit: ReactEvent.Mouse.t => unit, - @optional - onDragLeave: ReactEvent.Mouse.t => unit, - @optional - onDragOver: ReactEvent.Mouse.t => unit, - @optional - onDragStart: ReactEvent.Mouse.t => unit, - @optional - onDrop: ReactEvent.Mouse.t => unit, - @optional - onMouseDown: ReactEvent.Mouse.t => unit, - @optional - onMouseEnter: ReactEvent.Mouse.t => unit, - @optional - onMouseLeave: ReactEvent.Mouse.t => unit, - @optional - onMouseMove: ReactEvent.Mouse.t => unit, - @optional - onMouseOut: ReactEvent.Mouse.t => unit, - @optional - onMouseOver: ReactEvent.Mouse.t => unit, - @optional - onMouseUp: ReactEvent.Mouse.t => unit, - /* Selection events */ - @optional - onSelect: ReactEvent.Selection.t => unit, - /* Touch events */ - @optional - onTouchCancel: ReactEvent.Touch.t => unit, - @optional - onTouchEnd: ReactEvent.Touch.t => unit, - @optional - onTouchMove: ReactEvent.Touch.t => unit, - @optional - onTouchStart: ReactEvent.Touch.t => unit, - // Pointer events - @optional - onPointerOver: ReactEvent.Pointer.t => unit, - @optional - onPointerEnter: ReactEvent.Pointer.t => unit, - @optional - onPointerDown: ReactEvent.Pointer.t => unit, - @optional - onPointerMove: ReactEvent.Pointer.t => unit, - @optional - onPointerUp: ReactEvent.Pointer.t => unit, - @optional - onPointerCancel: ReactEvent.Pointer.t => unit, - @optional - onPointerOut: ReactEvent.Pointer.t => unit, - @optional - onPointerLeave: ReactEvent.Pointer.t => unit, - @optional - onGotPointerCapture: ReactEvent.Pointer.t => unit, - @optional - onLostPointerCapture: ReactEvent.Pointer.t => unit, - /* UI events */ - @optional - onScroll: ReactEvent.UI.t => unit, - /* Wheel events */ - @optional - onWheel: ReactEvent.Wheel.t => unit, - /* Media events */ - @optional - onAbort: ReactEvent.Media.t => unit, - @optional - onCanPlay: ReactEvent.Media.t => unit, - @optional - onCanPlayThrough: ReactEvent.Media.t => unit, - @optional - onDurationChange: ReactEvent.Media.t => unit, - @optional - onEmptied: ReactEvent.Media.t => unit, - @optional - onEncrypted: ReactEvent.Media.t => unit, - @optional - onEnded: ReactEvent.Media.t => unit, - @optional - onError: ReactEvent.Media.t => unit, - @optional - onLoadedData: ReactEvent.Media.t => unit, - @optional - onLoadedMetadata: ReactEvent.Media.t => unit, - @optional - onLoadStart: ReactEvent.Media.t => unit, - @optional - onPause: ReactEvent.Media.t => unit, - @optional - onPlay: ReactEvent.Media.t => unit, - @optional - onPlaying: ReactEvent.Media.t => unit, - @optional - onProgress: ReactEvent.Media.t => unit, - @optional - onRateChange: ReactEvent.Media.t => unit, - @optional - onSeeked: ReactEvent.Media.t => unit, - @optional - onSeeking: ReactEvent.Media.t => unit, - @optional - onStalled: ReactEvent.Media.t => unit, - @optional - onSuspend: ReactEvent.Media.t => unit, - @optional - onTimeUpdate: ReactEvent.Media.t => unit, - @optional - onVolumeChange: ReactEvent.Media.t => unit, - @optional - onWaiting: ReactEvent.Media.t => unit, - /* Image events */ - @optional - onLoad: ReactEvent.Image.t => unit /* duplicate */ /* ~onError: ReactEvent.Image.t => unit=?, */, - /* Animation events */ - @optional - onAnimationStart: ReactEvent.Animation.t => unit, - @optional - onAnimationEnd: ReactEvent.Animation.t => unit, - @optional - onAnimationIteration: ReactEvent.Animation.t => unit, - /* Transition events */ - @optional - onTransitionEnd: ReactEvent.Transition.t => unit, - /* svg */ - @optional - accentHeight: string, - @optional - accumulate: string, - @optional - additive: string, - @optional - alignmentBaseline: string, - @optional - allowReorder: string, - @optional - alphabetic: string, - @optional - amplitude: string, - @optional - arabicForm: string, - @optional - ascent: string, - @optional - attributeName: string, - @optional - attributeType: string, - @optional - autoReverse: string, - @optional - azimuth: string, - @optional - baseFrequency: string, - @optional - baseProfile: string, - @optional - baselineShift: string, - @optional - bbox: string, - @optional @as("begin") - begin_: string /* use this one. Previous one is deprecated */, - @optional - bias: string, - @optional - by: string, - @optional - calcMode: string, - @optional - capHeight: string, - @optional - clip: string, - @optional - clipPath: string, - @optional - clipPathUnits: string, - @optional - clipRule: string, - @optional - colorInterpolation: string, - @optional - colorInterpolationFilters: string, - @optional - colorProfile: string, - @optional - colorRendering: string, - @optional - contentScriptType: string, - @optional - contentStyleType: string, - @optional - cursor: string, - @optional - cx: string, - @optional - cy: string, - @optional - d: string, - @optional - decelerate: string, - @optional - descent: string, - @optional - diffuseConstant: string, - @optional - direction: string, - @optional - display: string, - @optional - divisor: string, - @optional - dominantBaseline: string, - @optional - dur: string, - @optional - dx: string, - @optional - dy: string, - @optional - edgeMode: string, - @optional - elevation: string, - @optional - enableBackground: string, - @optional @as("end") - end_: string /* use this one. Previous one is deprecated */, - @optional - exponent: string, - @optional - externalResourcesRequired: string, - @optional - fill: string, - @optional - fillOpacity: string, - @optional - fillRule: string, - @optional - filter: string, - @optional - filterRes: string, - @optional - filterUnits: string, - @optional - floodColor: string, - @optional - floodOpacity: string, - @optional - focusable: string, - @optional - fontFamily: string, - @optional - fontSize: string, - @optional - fontSizeAdjust: string, - @optional - fontStretch: string, - @optional - fontStyle: string, - @optional - fontVariant: string, - @optional - fontWeight: string, - @optional - fomat: string, - @optional - from: string, - @optional - fx: string, - @optional - fy: string, - @optional - g1: string, - @optional - g2: string, - @optional - glyphName: string, - @optional - glyphOrientationHorizontal: string, - @optional - glyphOrientationVertical: string, - @optional - glyphRef: string, - @optional - gradientTransform: string, - @optional - gradientUnits: string, - @optional - hanging: string, - @optional - horizAdvX: string, - @optional - horizOriginX: string, - @optional - ideographic: string, - @optional - imageRendering: string, - @optional @as("in") - in_: string /* use this one. Previous one is deprecated */, - @optional - in2: string, - @optional - intercept: string, - @optional - k: string, - @optional - k1: string, - @optional - k2: string, - @optional - k3: string, - @optional - k4: string, - @optional - kernelMatrix: string, - @optional - kernelUnitLength: string, - @optional - kerning: string, - @optional - keyPoints: string, - @optional - keySplines: string, - @optional - keyTimes: string, - @optional - lengthAdjust: string, - @optional - letterSpacing: string, - @optional - lightingColor: string, - @optional - limitingConeAngle: string, - @optional - local: string, - @optional - markerEnd: string, - @optional - markerHeight: string, - @optional - markerMid: string, - @optional - markerStart: string, - @optional - markerUnits: string, - @optional - markerWidth: string, - @optional - mask: string, - @optional - maskContentUnits: string, - @optional - maskUnits: string, - @optional - mathematical: string, - @optional - mode: string, - @optional - numOctaves: string, - @optional - offset: string, - @optional - opacity: string, - @optional - operator: string, - @optional - order: string, - @optional - orient: string, - @optional - orientation: string, - @optional - origin: string, - @optional - overflow: string, - @optional - overflowX: string, - @optional - overflowY: string, - @optional - overlinePosition: string, - @optional - overlineThickness: string, - @optional - paintOrder: string, - @optional - panose1: string, - @optional - pathLength: string, - @optional - patternContentUnits: string, - @optional - patternTransform: string, - @optional - patternUnits: string, - @optional - pointerEvents: string, - @optional - points: string, - @optional - pointsAtX: string, - @optional - pointsAtY: string, - @optional - pointsAtZ: string, - @optional - preserveAlpha: string, - @optional - preserveAspectRatio: string, - @optional - primitiveUnits: string, - @optional - r: string, - @optional - radius: string, - @optional - refX: string, - @optional - refY: string, - @optional - renderingIntent: string, - @optional - repeatCount: string, - @optional - repeatDur: string, - @optional - requiredExtensions: string, - @optional - requiredFeatures: string, - @optional - restart: string, - @optional - result: string, - @optional - rotate: string, - @optional - rx: string, - @optional - ry: string, - @optional - scale: string, - @optional - seed: string, - @optional - shapeRendering: string, - @optional - slope: string, - @optional - spacing: string, - @optional - specularConstant: string, - @optional - specularExponent: string, - @optional - speed: string, - @optional - spreadMethod: string, - @optional - startOffset: string, - @optional - stdDeviation: string, - @optional - stemh: string, - @optional - stemv: string, - @optional - stitchTiles: string, - @optional - stopColor: string, - @optional - stopOpacity: string, - @optional - strikethroughPosition: string, - @optional - strikethroughThickness: string, - @optional - string: string, - @optional - stroke: string, - @optional - strokeDasharray: string, - @optional - strokeDashoffset: string, - @optional - strokeLinecap: string, - @optional - strokeLinejoin: string, - @optional - strokeMiterlimit: string, - @optional - strokeOpacity: string, - @optional - strokeWidth: string, - @optional - surfaceScale: string, - @optional - systemLanguage: string, - @optional - tableValues: string, - @optional - targetX: string, - @optional - targetY: string, - @optional - textAnchor: string, - @optional - textDecoration: string, - @optional - textLength: string, - @optional - textRendering: string, - @optional @as("to") - to_: string /* use this one. Previous one is deprecated */, - @optional - transform: string, - @optional - u1: string, - @optional - u2: string, - @optional - underlinePosition: string, - @optional - underlineThickness: string, - @optional - unicode: string, - @optional - unicodeBidi: string, - @optional - unicodeRange: string, - @optional - unitsPerEm: string, - @optional - vAlphabetic: string, - @optional - vHanging: string, - @optional - vIdeographic: string, - @optional - vMathematical: string, - @optional - values: string, - @optional - vectorEffect: string, - @optional - version: string, - @optional - vertAdvX: string, - @optional - vertAdvY: string, - @optional - vertOriginX: string, - @optional - vertOriginY: string, - @optional - viewBox: string, - @optional - viewTarget: string, - @optional - visibility: string, - /* width::string? => */ - @optional - widths: string, - @optional - wordSpacing: string, - @optional - writingMode: string, - @optional - x: string, - @optional - x1: string, - @optional - x2: string, - @optional - xChannelSelector: string, - @optional - xHeight: string, - @optional - xlinkActuate: string, - @optional - xlinkArcrole: string, - @optional - xlinkHref: string, - @optional - xlinkRole: string, - @optional - xlinkShow: string, - @optional - xlinkTitle: string, - @optional - xlinkType: string, - @optional - xmlns: string, - @optional - xmlnsXlink: string, - @optional - xmlBase: string, - @optional - xmlLang: string, - @optional - xmlSpace: string, - @optional - y: string, - @optional - y1: string, - @optional - y2: string, - @optional - yChannelSelector: string, - @optional - z: string, - @optional - zoomAndPan: string, - /* RDFa */ - @optional - about: string, - @optional - datatype: string, - @optional - inlist: string, - @optional - prefix: string, - @optional - property: string, - @optional - resource: string, - @optional - typeof: string, - @optional - vocab: string, - /* react-specific */ - @optional - dangerouslySetInnerHTML: {"__html": string}, - @optional - suppressContentEditableWarning: bool, - } - - /* This list isn't exhaustive. We'll add more as we go. */ - /* - * Watch out! There are two props types and the only difference is the type of ref. - * Please keep in sync. - */ - @deriving(abstract) - type props = { - @optional - key: string, - @optional - ref: Js.nullable => unit, - /* accessibility */ - /* https://www.w3.org/TR/wai-aria-1.1/ */ - /* https://accessibilityresources.org/ is a great resource for these */ - /* [@optional] [@as "aria-current"] ariaCurrent: page|step|location|date|time|true|false, */ - @optional @as("aria-details") - ariaDetails: string, - @optional @as("aria-disabled") - ariaDisabled: bool, - @optional @as("aria-hidden") - ariaHidden: bool, - /* [@optional] [@as "aria-invalid"] ariaInvalid: grammar|false|spelling|true, */ - @optional @as("aria-keyshortcuts") - ariaKeyshortcuts: string, - @optional @as("aria-label") - ariaLabel: string, - @optional @as("aria-roledescription") - ariaRoledescription: string, - /* Widget Attributes */ - /* [@optional] [@as "aria-autocomplete"] ariaAutocomplete: inline|list|both|none, */ - /* [@optional] [@as "aria-checked"] ariaChecked: true|false|mixed, /* https://www.w3.org/TR/wai-aria-1.1/#valuetype_tristate */ */ - @optional @as("aria-expanded") - ariaExpanded: bool, - /* [@optional] [@as "aria-haspopup"] ariaHaspopup: false|true|menu|listbox|tree|grid|dialog, */ - @optional @as("aria-level") - ariaLevel: int, - @optional @as("aria-modal") - ariaModal: bool, - @optional @as("aria-multiline") - ariaMultiline: bool, - @optional @as("aria-multiselectable") - ariaMultiselectable: bool, - /* [@optional] [@as "aria-orientation"] ariaOrientation: horizontal|vertical|undefined, */ - @optional @as("aria-placeholder") - ariaPlaceholder: string, - /* [@optional] [@as "aria-pressed"] ariaPressed: true|false|mixed, /* https://www.w3.org/TR/wai-aria-1.1/#valuetype_tristate */ */ - @optional @as("aria-readonly") - ariaReadonly: bool, - @optional @as("aria-required") - ariaRequired: bool, - @optional @as("aria-selected") - ariaSelected: bool, - @optional @as("aria-sort") - ariaSort: string, - @optional @as("aria-valuemax") - ariaValuemax: float, - @optional @as("aria-valuemin") - ariaValuemin: float, - @optional @as("aria-valuenow") - ariaValuenow: float, - @optional @as("aria-valuetext") - ariaValuetext: string, - /* Live Region Attributes */ - @optional @as("aria-atomic") - ariaAtomic: bool, - @optional @as("aria-busy") - ariaBusy: bool, - /* [@optional] [@as "aria-live"] ariaLive: off|polite|assertive|rude, */ - @optional @as("aria-relevant") - ariaRelevant: string, - /* Drag-and-Drop Attributes */ - /* [@optional] [@as "aria-dropeffect"] ariaDropeffect: copy|move|link|execute|popup|none, */ - @optional @as("aria-grabbed") - ariaGrabbed: bool, - /* Relationship Attributes */ - @optional @as("aria-activedescendant") - ariaActivedescendant: string, - @optional @as("aria-colcount") - ariaColcount: int, - @optional @as("aria-colindex") - ariaColindex: int, - @optional @as("aria-colspan") - ariaColspan: int, - @optional @as("aria-controls") - ariaControls: string, - @optional @as("aria-describedby") - ariaDescribedby: string, - @optional @as("aria-errormessage") - ariaErrormessage: string, - @optional @as("aria-flowto") - ariaFlowto: string, - @optional @as("aria-labelledby") - ariaLabelledby: string, - @optional @as("aria-owns") - ariaOwns: string, - @optional @as("aria-posinset") - ariaPosinset: int, - @optional @as("aria-rowcount") - ariaRowcount: int, - @optional @as("aria-rowindex") - ariaRowindex: int, - @optional @as("aria-rowspan") - ariaRowspan: int, - @optional @as("aria-setsize") - ariaSetsize: int, - /* react textarea/input */ - @optional - defaultChecked: bool, - @optional - defaultValue: string, - /* global html attributes */ - @optional - accessKey: string, - @optional - className: string /* substitute for "class" */, - @optional - contentEditable: bool, - @optional - contextMenu: string, - @optional - dir: string /* "ltr", "rtl" or "auto" */, - @optional - draggable: bool, - @optional - hidden: bool, - @optional - id: string, - @optional - lang: string, - @optional - role: string /* ARIA role */, - @optional - style: style, - @optional - spellCheck: bool, - @optional - tabIndex: int, - @optional - title: string, - /* html5 microdata */ - @optional - itemID: string, - @optional - itemProp: string, - @optional - itemRef: string, - @optional - itemScope: bool, - @optional - itemType: string /* uri */, - /* tag-specific html attributes */ - @optional - accept: string, - @optional - acceptCharset: string, - @optional - action: string /* uri */, - @optional - allow: string, - @optional - allowFullScreen: bool, - @optional - alt: string, - @optional - async: bool, - @optional - autoComplete: string /* has a fixed, but large-ish, set of possible values */, - @optional - autoCapitalize: string /* Mobile Safari specific */, - @optional - autoFocus: bool, - @optional - autoPlay: bool, - @optional - challenge: string, - @optional - charSet: string, - @optional - checked: bool, - @optional - cite: string /* uri */, - @optional - crossorigin: bool, - @optional - cols: int, - @optional - colSpan: int, - @optional - content: string, - @optional - controls: bool, - @optional - coords: string /* set of values specifying the coordinates of a region */, - @optional - data: string /* uri */, - @optional - dateTime: string /* "valid date string with optional time" */, - @optional - default: bool, - @optional - defer: bool, - @optional - disabled: bool, - @optional - download: string /* should really be either a boolean, signifying presence, or a string */, - @optional - encType: string /* "application/x-www-form-urlencoded", "multipart/form-data" or "text/plain" */, - @optional - form: string, - @optional - formAction: string /* uri */, - @optional - formTarget: string /* "_blank", "_self", etc. */, - @optional - formMethod: string /* "post", "get", "put" */, - @optional - frameBorder: int /* deprecated, prefer to use css border instead */, - @optional - headers: string, - @optional - height: string /* in html5 this can only be a number, but in html4 it can ba a percentage as well */, - @optional - high: int, - @optional - href: string /* uri */, - @optional - hrefLang: string, - @optional - htmlFor: string /* substitute for "for" */, - @optional - httpEquiv: string /* has a fixed set of possible values */, - @optional - icon: string /* uri? */, - @optional - inputMode: string /* "verbatim", "latin", "numeric", etc. */, - @optional - integrity: string, - @optional - keyType: string, - @optional - kind: string /* has a fixed set of possible values */, - @optional - label: string, - @optional - list: string, - @optional - loop: bool, - @optional - low: int, - @optional - manifest: string /* uri */, - @optional - max: string /* should be int or Js.Date.t */, - @optional - maxLength: int, - @optional - media: string /* a valid media query */, - @optional - mediaGroup: string, - @optional - method: string /* "post" or "get" */, - @optional - min: string, - @optional - minLength: int, - @optional - multiple: bool, - @optional - muted: bool, - @optional - name: string, - @optional - nonce: string, - @optional - noValidate: bool, - @optional @as("open") - open_: bool /* use this one. Previous one is deprecated */, - @optional - optimum: int, - @optional - pattern: string /* valid Js RegExp */, - @optional - placeholder: string, - @optional - poster: string /* uri */, - @optional - preload: string /* "none", "metadata" or "auto" (and "" as a synonym for "auto") */, - @optional - radioGroup: string, - @optional - readOnly: bool, - @optional - rel: string /* a space- or comma-separated (depending on the element) list of a fixed set of "link types" */, - @optional - required: bool, - @optional - reversed: bool, - @optional - rows: int, - @optional - rowSpan: int, - @optional - sandbox: string /* has a fixed set of possible values */, - @optional - scope: string /* has a fixed set of possible values */, - @optional - scoped: bool, - @optional - scrolling: string /* html4 only, "auto", "yes" or "no" */, - /* seamless - supported by React, but removed from the html5 spec */ - @optional - selected: bool, - @optional - shape: string, - @optional - size: int, - @optional - sizes: string, - @optional - span: int, - @optional - src: string /* uri */, - @optional - srcDoc: string, - @optional - srcLang: string, - @optional - srcSet: string, - @optional - start: int, - @optional - step: float, - @optional - summary: string /* deprecated */, - @optional - target: string, - @optional @as("type") - type_: string /* has a fixed but large-ish set of possible values */ /* use this one. Previous one is deprecated */, - @optional - useMap: string, - @optional - value: string, - @optional - width: string /* in html5 this can only be a number, but in html4 it can ba a percentage as well */, - @optional - wrap: string /* "hard" or "soft" */, - /* Clipboard events */ - @optional - onCopy: ReactEvent.Clipboard.t => unit, - @optional - onCut: ReactEvent.Clipboard.t => unit, - @optional - onPaste: ReactEvent.Clipboard.t => unit, - /* Composition events */ - @optional - onCompositionEnd: ReactEvent.Composition.t => unit, - @optional - onCompositionStart: ReactEvent.Composition.t => unit, - @optional - onCompositionUpdate: ReactEvent.Composition.t => unit, - /* Keyboard events */ - @optional - onKeyDown: ReactEvent.Keyboard.t => unit, - @optional - onKeyPress: ReactEvent.Keyboard.t => unit, - @optional - onKeyUp: ReactEvent.Keyboard.t => unit, - /* Focus events */ - @optional - onFocus: ReactEvent.Focus.t => unit, - @optional - onBlur: ReactEvent.Focus.t => unit, - /* Form events */ - @optional - onChange: ReactEvent.Form.t => unit, - @optional - onInput: ReactEvent.Form.t => unit, - @optional - onSubmit: ReactEvent.Form.t => unit, - @optional - onInvalid: ReactEvent.Form.t => unit, - /* Mouse events */ - @optional - onClick: ReactEvent.Mouse.t => unit, - @optional - onContextMenu: ReactEvent.Mouse.t => unit, - @optional - onDoubleClick: ReactEvent.Mouse.t => unit, - @optional - onDrag: ReactEvent.Mouse.t => unit, - @optional - onDragEnd: ReactEvent.Mouse.t => unit, - @optional - onDragEnter: ReactEvent.Mouse.t => unit, - @optional - onDragExit: ReactEvent.Mouse.t => unit, - @optional - onDragLeave: ReactEvent.Mouse.t => unit, - @optional - onDragOver: ReactEvent.Mouse.t => unit, - @optional - onDragStart: ReactEvent.Mouse.t => unit, - @optional - onDrop: ReactEvent.Mouse.t => unit, - @optional - onMouseDown: ReactEvent.Mouse.t => unit, - @optional - onMouseEnter: ReactEvent.Mouse.t => unit, - @optional - onMouseLeave: ReactEvent.Mouse.t => unit, - @optional - onMouseMove: ReactEvent.Mouse.t => unit, - @optional - onMouseOut: ReactEvent.Mouse.t => unit, - @optional - onMouseOver: ReactEvent.Mouse.t => unit, - @optional - onMouseUp: ReactEvent.Mouse.t => unit, - /* Selection events */ - @optional - onSelect: ReactEvent.Selection.t => unit, - /* Touch events */ - @optional - onTouchCancel: ReactEvent.Touch.t => unit, - @optional - onTouchEnd: ReactEvent.Touch.t => unit, - @optional - onTouchMove: ReactEvent.Touch.t => unit, - @optional - onTouchStart: ReactEvent.Touch.t => unit, - // Pointer events - @optional - onPointerOver: ReactEvent.Pointer.t => unit, - @optional - onPointerEnter: ReactEvent.Pointer.t => unit, - @optional - onPointerDown: ReactEvent.Pointer.t => unit, - @optional - onPointerMove: ReactEvent.Pointer.t => unit, - @optional - onPointerUp: ReactEvent.Pointer.t => unit, - @optional - onPointerCancel: ReactEvent.Pointer.t => unit, - @optional - onPointerOut: ReactEvent.Pointer.t => unit, - @optional - onPointerLeave: ReactEvent.Pointer.t => unit, - @optional - onGotPointerCapture: ReactEvent.Pointer.t => unit, - @optional - onLostPointerCapture: ReactEvent.Pointer.t => unit, - /* UI events */ - @optional - onScroll: ReactEvent.UI.t => unit, - /* Wheel events */ - @optional - onWheel: ReactEvent.Wheel.t => unit, - /* Media events */ - @optional - onAbort: ReactEvent.Media.t => unit, - @optional - onCanPlay: ReactEvent.Media.t => unit, - @optional - onCanPlayThrough: ReactEvent.Media.t => unit, - @optional - onDurationChange: ReactEvent.Media.t => unit, - @optional - onEmptied: ReactEvent.Media.t => unit, - @optional - onEncrypetd: ReactEvent.Media.t => unit, - @optional - onEnded: ReactEvent.Media.t => unit, - @optional - onError: ReactEvent.Media.t => unit, - @optional - onLoadedData: ReactEvent.Media.t => unit, - @optional - onLoadedMetadata: ReactEvent.Media.t => unit, - @optional - onLoadStart: ReactEvent.Media.t => unit, - @optional - onPause: ReactEvent.Media.t => unit, - @optional - onPlay: ReactEvent.Media.t => unit, - @optional - onPlaying: ReactEvent.Media.t => unit, - @optional - onProgress: ReactEvent.Media.t => unit, - @optional - onRateChange: ReactEvent.Media.t => unit, - @optional - onSeeked: ReactEvent.Media.t => unit, - @optional - onSeeking: ReactEvent.Media.t => unit, - @optional - onStalled: ReactEvent.Media.t => unit, - @optional - onSuspend: ReactEvent.Media.t => unit, - @optional - onTimeUpdate: ReactEvent.Media.t => unit, - @optional - onVolumeChange: ReactEvent.Media.t => unit, - @optional - onWaiting: ReactEvent.Media.t => unit, - /* Image events */ - @optional - onLoad: ReactEvent.Image.t => unit /* duplicate */ /* ~onError: ReactEvent.Image.t => unit=?, */, - /* Animation events */ - @optional - onAnimationStart: ReactEvent.Animation.t => unit, - @optional - onAnimationEnd: ReactEvent.Animation.t => unit, - @optional - onAnimationIteration: ReactEvent.Animation.t => unit, - /* Transition events */ - @optional - onTransitionEnd: ReactEvent.Transition.t => unit, - /* svg */ - @optional - accentHeight: string, - @optional - accumulate: string, - @optional - additive: string, - @optional - alignmentBaseline: string, - @optional - allowReorder: string, - @optional - alphabetic: string, - @optional - amplitude: string, - @optional - arabicForm: string, - @optional - ascent: string, - @optional - attributeName: string, - @optional - attributeType: string, - @optional - autoReverse: string, - @optional - azimuth: string, - @optional - baseFrequency: string, - @optional - baseProfile: string, - @optional - baselineShift: string, - @optional - bbox: string, - @optional @as("begin") - begin_: string /* use this one. Previous one is deprecated */, - @optional - bias: string, - @optional - by: string, - @optional - calcMode: string, - @optional - capHeight: string, - @optional - clip: string, - @optional - clipPath: string, - @optional - clipPathUnits: string, - @optional - clipRule: string, - @optional - colorInterpolation: string, - @optional - colorInterpolationFilters: string, - @optional - colorProfile: string, - @optional - colorRendering: string, - @optional - contentScriptType: string, - @optional - contentStyleType: string, - @optional - cursor: string, - @optional - cx: string, - @optional - cy: string, - @optional - d: string, - @optional - decelerate: string, - @optional - descent: string, - @optional - diffuseConstant: string, - @optional - direction: string, - @optional - display: string, - @optional - divisor: string, - @optional - dominantBaseline: string, - @optional - dur: string, - @optional - dx: string, - @optional - dy: string, - @optional - edgeMode: string, - @optional - elevation: string, - @optional - enableBackground: string, - @optional @as("end") - end_: string /* use this one. Previous one is deprecated */, - @optional - exponent: string, - @optional - externalResourcesRequired: string, - @optional - fill: string, - @optional - fillOpacity: string, - @optional - fillRule: string, - @optional - filter: string, - @optional - filterRes: string, - @optional - filterUnits: string, - @optional - floodColor: string, - @optional - floodOpacity: string, - @optional - focusable: string, - @optional - fontFamily: string, - @optional - fontSize: string, - @optional - fontSizeAdjust: string, - @optional - fontStretch: string, - @optional - fontStyle: string, - @optional - fontVariant: string, - @optional - fontWeight: string, - @optional - fomat: string, - @optional - from: string, - @optional - fx: string, - @optional - fy: string, - @optional - g1: string, - @optional - g2: string, - @optional - glyphName: string, - @optional - glyphOrientationHorizontal: string, - @optional - glyphOrientationVertical: string, - @optional - glyphRef: string, - @optional - gradientTransform: string, - @optional - gradientUnits: string, - @optional - hanging: string, - @optional - horizAdvX: string, - @optional - horizOriginX: string, - @optional - ideographic: string, - @optional - imageRendering: string, - @optional @as("in") - in_: string /* use this one. Previous one is deprecated */, - @optional - in2: string, - @optional - intercept: string, - @optional - k: string, - @optional - k1: string, - @optional - k2: string, - @optional - k3: string, - @optional - k4: string, - @optional - kernelMatrix: string, - @optional - kernelUnitLength: string, - @optional - kerning: string, - @optional - keyPoints: string, - @optional - keySplines: string, - @optional - keyTimes: string, - @optional - lengthAdjust: string, - @optional - letterSpacing: string, - @optional - lightingColor: string, - @optional - limitingConeAngle: string, - @optional - local: string, - @optional - markerEnd: string, - @optional - markerHeight: string, - @optional - markerMid: string, - @optional - markerStart: string, - @optional - markerUnits: string, - @optional - markerWidth: string, - @optional - mask: string, - @optional - maskContentUnits: string, - @optional - maskUnits: string, - @optional - mathematical: string, - @optional - mode: string, - @optional - numOctaves: string, - @optional - offset: string, - @optional - opacity: string, - @optional - operator: string, - @optional - order: string, - @optional - orient: string, - @optional - orientation: string, - @optional - origin: string, - @optional - overflow: string, - @optional - overflowX: string, - @optional - overflowY: string, - @optional - overlinePosition: string, - @optional - overlineThickness: string, - @optional - paintOrder: string, - @optional - panose1: string, - @optional - pathLength: string, - @optional - patternContentUnits: string, - @optional - patternTransform: string, - @optional - patternUnits: string, - @optional - pointerEvents: string, - @optional - points: string, - @optional - pointsAtX: string, - @optional - pointsAtY: string, - @optional - pointsAtZ: string, - @optional - preserveAlpha: string, - @optional - preserveAspectRatio: string, - @optional - primitiveUnits: string, - @optional - r: string, - @optional - radius: string, - @optional - refX: string, - @optional - refY: string, - @optional - renderingIntent: string, - @optional - repeatCount: string, - @optional - repeatDur: string, - @optional - requiredExtensions: string, - @optional - requiredFeatures: string, - @optional - restart: string, - @optional - result: string, - @optional - rotate: string, - @optional - rx: string, - @optional - ry: string, - @optional - scale: string, - @optional - seed: string, - @optional - shapeRendering: string, - @optional - slope: string, - @optional - spacing: string, - @optional - specularConstant: string, - @optional - specularExponent: string, - @optional - speed: string, - @optional - spreadMethod: string, - @optional - startOffset: string, - @optional - stdDeviation: string, - @optional - stemh: string, - @optional - stemv: string, - @optional - stitchTiles: string, - @optional - stopColor: string, - @optional - stopOpacity: string, - @optional - strikethroughPosition: string, - @optional - strikethroughThickness: string, - @optional - string: string, - @optional - stroke: string, - @optional - strokeDasharray: string, - @optional - strokeDashoffset: string, - @optional - strokeLinecap: string, - @optional - strokeLinejoin: string, - @optional - strokeMiterlimit: string, - @optional - strokeOpacity: string, - @optional - strokeWidth: string, - @optional - surfaceScale: string, - @optional - systemLanguage: string, - @optional - tableValues: string, - @optional - targetX: string, - @optional - targetY: string, - @optional - textAnchor: string, - @optional - textDecoration: string, - @optional - textLength: string, - @optional - textRendering: string, - @optional @as("to") - to_: string /* use this one. Previous one is deprecated */, - @optional - transform: string, - @optional - u1: string, - @optional - u2: string, - @optional - underlinePosition: string, - @optional - underlineThickness: string, - @optional - unicode: string, - @optional - unicodeBidi: string, - @optional - unicodeRange: string, - @optional - unitsPerEm: string, - @optional - vAlphabetic: string, - @optional - vHanging: string, - @optional - vIdeographic: string, - @optional - vMathematical: string, - @optional - values: string, - @optional - vectorEffect: string, - @optional - version: string, - @optional - vertAdvX: string, - @optional - vertAdvY: string, - @optional - vertOriginX: string, - @optional - vertOriginY: string, - @optional - viewBox: string, - @optional - viewTarget: string, - @optional - visibility: string, - /* width::string? => */ - @optional - widths: string, - @optional - wordSpacing: string, - @optional - writingMode: string, - @optional - x: string, - @optional - x1: string, - @optional - x2: string, - @optional - xChannelSelector: string, - @optional - xHeight: string, - @optional - xlinkActuate: string, - @optional - xlinkArcrole: string, - @optional - xlinkHref: string, - @optional - xlinkRole: string, - @optional - xlinkShow: string, - @optional - xlinkTitle: string, - @optional - xlinkType: string, - @optional - xmlns: string, - @optional - xmlnsXlink: string, - @optional - xmlBase: string, - @optional - xmlLang: string, - @optional - xmlSpace: string, - @optional - y: string, - @optional - y1: string, - @optional - y2: string, - @optional - yChannelSelector: string, - @optional - z: string, - @optional - zoomAndPan: string, - /* RDFa */ - @optional - about: string, - @optional - datatype: string, - @optional - inlist: string, - @optional - prefix: string, - @optional - property: string, - @optional - resource: string, - @optional - typeof: string, - @optional - vocab: string, - /* react-specific */ - @optional - dangerouslySetInnerHTML: {"__html": string}, - @optional - suppressContentEditableWarning: bool, - } -} - -include Props - -// As we've removed `ReactDOMRe.createElement`, this enables patterns like -// React.createElement(ReactDOM.stringToComponent(multiline ? "textarea" : "input"), ...) -@deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external stringToComponent: string => React.component = "%identity" - -module Style = ReactDOMStyle diff --git a/src/v3/ReactEvent_V3.bs.js b/src/v3/ReactEvent_V3.bs.js deleted file mode 100644 index 179cde2..0000000 --- a/src/v3/ReactEvent_V3.bs.js +++ /dev/null @@ -1,53 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -'use strict'; - - -var Synthetic = {}; - -var Clipboard = {}; - -var Composition = {}; - -var Keyboard = {}; - -var Focus = {}; - -var Form = {}; - -var Mouse = {}; - -var Pointer = {}; - -var $$Selection = {}; - -var $$Touch = {}; - -var UI = {}; - -var Wheel = {}; - -var Media = {}; - -var $$Image = {}; - -var $$Animation = {}; - -var Transition = {}; - -exports.Synthetic = Synthetic; -exports.Clipboard = Clipboard; -exports.Composition = Composition; -exports.Keyboard = Keyboard; -exports.Focus = Focus; -exports.Form = Form; -exports.Mouse = Mouse; -exports.Pointer = Pointer; -exports.$$Selection = $$Selection; -exports.$$Touch = $$Touch; -exports.UI = UI; -exports.Wheel = Wheel; -exports.Media = Media; -exports.$$Image = $$Image; -exports.$$Animation = $$Animation; -exports.Transition = Transition; -/* No side effect */ diff --git a/src/v3/ReactEvent_V3.res b/src/v3/ReactEvent_V3.res deleted file mode 100644 index b142d0b..0000000 --- a/src/v3/ReactEvent_V3.res +++ /dev/null @@ -1,322 +0,0 @@ -type synthetic<'a> = ReactEvent.synthetic<'a> - -module MakeEventWithType = ( - Type: { - type t - }, -) => { - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external bubbles: Type.t => bool = "bubbles" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external cancelable: Type.t => bool = "cancelable" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external currentTarget: Type.t => {..} = "currentTarget" /* Should return Dom.eventTarget */ - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external defaultPrevented: Type.t => bool = "defaultPrevented" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external eventPhase: Type.t => int = "eventPhase" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external isTrusted: Type.t => bool = "isTrusted" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external nativeEvent: Type.t => {..} = "nativeEvent" /* Should return Dom.event */ - @send @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external preventDefault: Type.t => unit = "preventDefault" - @send @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external isDefaultPrevented: Type.t => bool = "isDefaultPrevented" - @send @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external stopPropagation: Type.t => unit = "stopPropagation" - @send @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external isPropagationStopped: Type.t => bool = "isPropagationStopped" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external target: Type.t => {..} = "target" /* Should return Dom.eventTarget */ - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external timeStamp: Type.t => float = "timeStamp" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external type_: Type.t => string = "type" - @send @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external persist: Type.t => unit = "persist" -} - -module Synthetic = { - type tag = ReactEvent.Synthetic.tag - type t = synthetic - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external bubbles: synthetic<'a> => bool = "bubbles" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external cancelable: synthetic<'a> => bool = "cancelable" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external currentTarget: synthetic<'a> => {..} = - "currentTarget" /* Should return Dom.eventTarget */ - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external defaultPrevented: synthetic<'a> => bool = "defaultPrevented" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external eventPhase: synthetic<'a> => int = "eventPhase" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external isTrusted: synthetic<'a> => bool = "isTrusted" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external nativeEvent: synthetic<'a> => {..} = "nativeEvent" /* Should return Dom.event */ - @send @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external preventDefault: synthetic<'a> => unit = "preventDefault" - @send @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external isDefaultPrevented: synthetic<'a> => bool = "isDefaultPrevented" - @send @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external stopPropagation: synthetic<'a> => unit = "stopPropagation" - @send @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external isPropagationStopped: synthetic<'a> => bool = "isPropagationStopped" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external target: synthetic<'a> => {..} = "target" /* Should return Dom.eventTarget */ - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external timeStamp: synthetic<'a> => float = "timeStamp" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external type_: synthetic<'a> => string = "type" - @send @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external persist: synthetic<'a> => unit = "persist" -} - -/* Cast any event type to the general synthetic type. This is safe, since synthetic is more general */ -@deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external toSyntheticEvent: synthetic<'a> => Synthetic.t = "%identity" - -module Clipboard = { - type tag = ReactEvent.Clipboard.tag - type t = synthetic - include MakeEventWithType({ - type t = t - }) - - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external clipboardData: t => {..} = "clipboardData" /* Should return Dom.dataTransfer */ -} - -module Composition = { - type tag = ReactEvent.Composition.tag - type t = synthetic - include MakeEventWithType({ - type t = t - }) - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external data: t => string = "data" -} - -module Keyboard = { - type tag = ReactEvent.Keyboard.tag - type t = synthetic - include MakeEventWithType({ - type t = t - }) - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external altKey: t => bool = "altKey" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external charCode: t => int = "charCode" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external ctrlKey: t => bool = "ctrlKey" - @send @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external getModifierState: (t, string) => bool = "getModifierState" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external key: t => string = "key" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external keyCode: t => int = "keyCode" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external locale: t => string = "locale" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external location: t => int = "location" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external metaKey: t => bool = "metaKey" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external repeat: t => bool = "repeat" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external shiftKey: t => bool = "shiftKey" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external which: t => int = "which" -} - -module Focus = { - type tag = ReactEvent.Focus.tag - type t = synthetic - include MakeEventWithType({ - type t = t - }) - @get @return(nullable) @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external relatedTarget: t => option<{..}> = "relatedTarget" /* Should return Dom.eventTarget */ -} - -module Form = { - type tag = ReactEvent.Form.tag - type t = synthetic - include MakeEventWithType({ - type t = t - }) -} - -module Mouse = { - type tag = ReactEvent.Mouse.tag - type t = synthetic - include MakeEventWithType({ - type t = t - }) - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external altKey: t => bool = "altKey" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external button: t => int = "button" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external buttons: t => int = "buttons" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external clientX: t => int = "clientX" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external clientY: t => int = "clientY" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external ctrlKey: t => bool = "ctrlKey" - @send @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external getModifierState: (t, string) => bool = "getModifierState" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external metaKey: t => bool = "metaKey" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external movementX: t => int = "movementX" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external movementY: t => int = "movementY" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external pageX: t => int = "pageX" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external pageY: t => int = "pageY" - @get @return(nullable) @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external relatedTarget: t => option<{..}> = "relatedTarget" /* Should return Dom.eventTarget */ - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external screenX: t => int = "screenX" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external screenY: t => int = "screenY" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external shiftKey: t => bool = "shiftKey" -} - -module Pointer = { - type tag = ReactEvent.Pointer.tag - type t = synthetic - include MakeEventWithType({ - type t = t - }) - - // UIEvent - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external detail: t => int = "detail" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external view: t => Dom.window = "view" /* Should return DOMAbstractView/WindowProxy */ - - // MouseEvent - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external screenX: t => int = "screenX" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external screenY: t => int = "screenY" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external clientX: t => int = "clientX" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external clientY: t => int = "clientY" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external pageX: t => int = "pageX" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external pageY: t => int = "pageY" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external movementX: t => int = "movementX" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external movementY: t => int = "movementY" - - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external ctrlKey: t => bool = "ctrlKey" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external shiftKey: t => bool = "shiftKey" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external altKey: t => bool = "altKey" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external metaKey: t => bool = "metaKey" - @send @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external getModifierState: (t, string) => bool = "getModifierState" - - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external button: t => int = "button" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external buttons: t => int = "buttons" - - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") @return(nullable) - external relatedTarget: t => option<{..}> = "relatedTarget" /* Should return Dom.eventTarget */ - - // PointerEvent - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external pointerId: t => Dom.eventPointerId = "pointerId" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external width: t => float = "width" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external height: t => float = "height" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external pressure: t => float = "pressure" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external tangentialPressure: t => float = "tangentialPressure" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external tiltX: t => int = "tiltX" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external tiltY: t => int = "tiltY" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external twist: t => int = "twist" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external pointerType: t => string = "pointerType" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external isPrimary: t => bool = "isPrimary" -} - -module Selection = { - type tag = ReactEvent.Selection.tag - type t = synthetic - include MakeEventWithType({ - type t = t - }) -} - -module Touch = { - type tag = ReactEvent.Touch.tag - type t = synthetic - include MakeEventWithType({ - type t = t - }) - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external altKey: t => bool = "altKey" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external changedTouches: t => {..} = "changedTouches" /* Should return Dom.touchList */ - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external ctrlKey: t => bool = "ctrlKey" - @send @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external getModifierState: (t, string) => bool = "getModifierState" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external metaKey: t => bool = "metaKey" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external shiftKey: t => bool = "shiftKey" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external targetTouches: t => {..} = "targetTouches" /* Should return Dom.touchList */ - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external touches: t => {..} = "touches" /* Should return Dom.touchList */ -} - -module UI = { - type tag = ReactEvent.UI.tag - type t = synthetic - include MakeEventWithType({ - type t = t - }) - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external detail: t => int = "detail" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external view: t => Dom.window = "view" /* Should return DOMAbstractView/WindowProxy */ -} - -module Wheel = { - type tag = ReactEvent.Wheel.tag - type t = synthetic - include MakeEventWithType({ - type t = t - }) - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external deltaMode: t => int = "deltaMode" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external deltaX: t => float = "deltaX" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external deltaY: t => float = "deltaY" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") external deltaZ: t => float = "deltaZ" -} - -module Media = { - type tag = ReactEvent.Media.tag - type t = synthetic - include MakeEventWithType({ - type t = t - }) -} - -module Image = { - type tag = ReactEvent.Image.tag - type t = synthetic - include MakeEventWithType({ - type t = t - }) -} - -module Animation = { - type tag = ReactEvent.Animation.tag - type t = synthetic - include MakeEventWithType({ - type t = t - }) - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external animationName: t => string = "animationName" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external pseudoElement: t => string = "pseudoElement" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external elapsedTime: t => float = "elapsedTime" -} - -module Transition = { - type tag = ReactEvent.Transition.tag - type t = synthetic - include MakeEventWithType({ - type t = t - }) - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external propertyName: t => string = "propertyName" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external pseudoElement: t => string = "pseudoElement" - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external elapsedTime: t => float = "elapsedTime" -} diff --git a/src/v3/ReactEvent_V3.resi b/src/v3/ReactEvent_V3.resi deleted file mode 100644 index e4ac845..0000000 --- a/src/v3/ReactEvent_V3.resi +++ /dev/null @@ -1,471 +0,0 @@ -/* This is the whole synthetic event system of ReactJS/ReasonReact. The first module `Synthetic` represents - the generic synthetic event. The rest are the specific ones. - - In each module, the type `t` commonly means "the type of that module" (OCaml convention). In our case, e.g. - `ReactEvent.Mouse.t` represents a ReactJS synthetic mouse event. You'd use it to type your props: - - ``` - type props = { - onClick: ReactEvent.Mouse.t => unit - }; - ``` - - All the methods and properties of a type of event are in the module, as seen below. - - Each module also has a `tag` type. You can ignore it; they're only needed by their `t` type. This way, we - get to allow a base `Synthetic` event module with generic methods. So e.g. even a mouse event (`Mouse.t`) - get to be passed to a generic handler: - - ``` - let handleClick = ({state, props}, event) => { - ReactEvent.Mouse.preventDefault(event); - ... - }; - let handleSubmit = ({state, props}, event) => { - // this handler can be triggered by either a Keyboard or a Mouse event; - // conveniently use the generic preventDefault - ReactEvent.Synthetic.preventDefault(event); - ... - }; - - let render = (_) => ; - ``` - - How to translate idioms from ReactJS: - - 1. myMouseEvent.preventDefault() -> ReactEvent.Mouse.preventDefault(myMouseEvent) - 2. myKeyboardEvent.which -> ReactEvent.Keyboard.which(myKeyboardEvent) - */ -type synthetic<'a> = ReactEvent.synthetic<'a> - -module Synthetic: { - type tag = ReactEvent.Synthetic.tag - type t = synthetic - @get external bubbles: synthetic<'a> => bool = "bubbles" - @get external cancelable: synthetic<'a> => bool = "cancelable" - @get - external currentTarget: synthetic<'a> => {..} = "currentTarget" - @get - external defaultPrevented: synthetic<'a> => bool = "defaultPrevented" - @get external eventPhase: synthetic<'a> => int = "eventPhase" - @get external isTrusted: synthetic<'a> => bool = "isTrusted" - @get - external nativeEvent: synthetic<'a> => {..} = "nativeEvent" - @send - external preventDefault: synthetic<'a> => unit = "preventDefault" - @send - external isDefaultPrevented: synthetic<'a> => bool = "isDefaultPrevented" - @send - external stopPropagation: synthetic<'a> => unit = "stopPropagation" - @send - external isPropagationStopped: synthetic<'a> => bool = "isPropagationStopped" - @get external target: synthetic<'a> => {..} = "target" - @get external timeStamp: synthetic<'a> => float = "timeStamp" - @get external type_: synthetic<'a> => string = "type" - @send external persist: synthetic<'a> => unit = "persist" -} - -/* Cast any event type to the general synthetic type. This is safe, since synthetic is more general */ -external toSyntheticEvent: synthetic<'a> => Synthetic.t = "%identity" - -module Clipboard: { - type tag = ReactEvent.Clipboard.tag - type t = synthetic - @get external bubbles: t => bool = "bubbles" - @get external cancelable: t => bool = "cancelable" - @get external currentTarget: t => {..} = "currentTarget" - @get external defaultPrevented: t => bool = "defaultPrevented" - @get external eventPhase: t => int = "eventPhase" - @get external isTrusted: t => bool = "isTrusted" - @get external nativeEvent: t => {..} = "nativeEvent" - @send external preventDefault: t => unit = "preventDefault" - @send external isDefaultPrevented: t => bool = "isDefaultPrevented" - @send external stopPropagation: t => unit = "stopPropagation" - @send external isPropagationStopped: t => bool = "isPropagationStopped" - @get external target: t => {..} = "target" - @get external timeStamp: t => float = "timeStamp" - @get external type_: t => string = "type" - @send external persist: t => unit = "persist" - @get external clipboardData: t => {..} = "clipboardData" /* Should return Dom.dataTransfer */ -} - -module Composition: { - type tag = ReactEvent.Composition.tag - type t = synthetic - @get external bubbles: t => bool = "bubbles" - @get external cancelable: t => bool = "cancelable" - @get external currentTarget: t => {..} = "currentTarget" - @get external defaultPrevented: t => bool = "defaultPrevented" - @get external eventPhase: t => int = "eventPhase" - @get external isTrusted: t => bool = "isTrusted" - @get external nativeEvent: t => {..} = "nativeEvent" - @send external preventDefault: t => unit = "preventDefault" - @send external isDefaultPrevented: t => bool = "isDefaultPrevented" - @send external stopPropagation: t => unit = "stopPropagation" - @send external isPropagationStopped: t => bool = "isPropagationStopped" - @get external target: t => {..} = "target" - @get external timeStamp: t => float = "timeStamp" - @get external type_: t => string = "type" - @send external persist: t => unit = "persist" - @get external data: t => string = "data" -} - -module Keyboard: { - type tag = ReactEvent.Keyboard.tag - type t = synthetic - @get external bubbles: t => bool = "bubbles" - @get external cancelable: t => bool = "cancelable" - @get external currentTarget: t => {..} = "currentTarget" - @get external defaultPrevented: t => bool = "defaultPrevented" - @get external eventPhase: t => int = "eventPhase" - @get external isTrusted: t => bool = "isTrusted" - @get external nativeEvent: t => {..} = "nativeEvent" - @send external preventDefault: t => unit = "preventDefault" - @send external isDefaultPrevented: t => bool = "isDefaultPrevented" - @send external stopPropagation: t => unit = "stopPropagation" - @send external isPropagationStopped: t => bool = "isPropagationStopped" - @get external target: t => {..} = "target" - @get external timeStamp: t => float = "timeStamp" - @get external type_: t => string = "type" - @send external persist: t => unit = "persist" - @get external altKey: t => bool = "altKey" - @get external charCode: t => int = "charCode" - @get external ctrlKey: t => bool = "ctrlKey" - @send - external getModifierState: (t, string) => bool = "getModifierState" - @get external key: t => string = "key" - @get external keyCode: t => int = "keyCode" - @get external locale: t => string = "locale" - @get external location: t => int = "location" - @get external metaKey: t => bool = "metaKey" - @get external repeat: t => bool = "repeat" - @get external shiftKey: t => bool = "shiftKey" - @get external which: t => int = "which" -} - -module Focus: { - type tag = ReactEvent.Focus.tag - type t = synthetic - @get external bubbles: t => bool = "bubbles" - @get external cancelable: t => bool = "cancelable" - @get external currentTarget: t => {..} = "currentTarget" - @get external defaultPrevented: t => bool = "defaultPrevented" - @get external eventPhase: t => int = "eventPhase" - @get external isTrusted: t => bool = "isTrusted" - @get external nativeEvent: t => {..} = "nativeEvent" - @send external preventDefault: t => unit = "preventDefault" - @send external isDefaultPrevented: t => bool = "isDefaultPrevented" - @send external stopPropagation: t => unit = "stopPropagation" - @send external isPropagationStopped: t => bool = "isPropagationStopped" - @get external target: t => {..} = "target" - @get external timeStamp: t => float = "timeStamp" - @get external type_: t => string = "type" - @send external persist: t => unit = "persist" - @get @return(nullable) - external relatedTarget: t => option<{..}> = "relatedTarget" /* Should return Dom.eventTarget */ -} - -module Form: { - type tag = ReactEvent.Form.tag - type t = synthetic - @get external bubbles: t => bool = "bubbles" - @get external cancelable: t => bool = "cancelable" - @get external currentTarget: t => {..} = "currentTarget" - @get external defaultPrevented: t => bool = "defaultPrevented" - @get external eventPhase: t => int = "eventPhase" - @get external isTrusted: t => bool = "isTrusted" - @get external nativeEvent: t => {..} = "nativeEvent" - @send external preventDefault: t => unit = "preventDefault" - @send external isDefaultPrevented: t => bool = "isDefaultPrevented" - @send external stopPropagation: t => unit = "stopPropagation" - @send external isPropagationStopped: t => bool = "isPropagationStopped" - @get external target: t => {..} = "target" - @get external timeStamp: t => float = "timeStamp" - @get external type_: t => string = "type" - @send external persist: t => unit = "persist" -} - -module Mouse: { - type tag = ReactEvent.Mouse.tag - type t = synthetic - @get external bubbles: t => bool = "bubbles" - @get external cancelable: t => bool = "cancelable" - @get external currentTarget: t => {..} = "currentTarget" - @get external defaultPrevented: t => bool = "defaultPrevented" - @get external eventPhase: t => int = "eventPhase" - @get external isTrusted: t => bool = "isTrusted" - @get external nativeEvent: t => {..} = "nativeEvent" - @send external preventDefault: t => unit = "preventDefault" - @send external isDefaultPrevented: t => bool = "isDefaultPrevented" - @send external stopPropagation: t => unit = "stopPropagation" - @send external isPropagationStopped: t => bool = "isPropagationStopped" - @get external target: t => {..} = "target" - @get external timeStamp: t => float = "timeStamp" - @get external type_: t => string = "type" - @send external persist: t => unit = "persist" - @get external altKey: t => bool = "altKey" - @get external button: t => int = "button" - @get external buttons: t => int = "buttons" - @get external clientX: t => int = "clientX" - @get external clientY: t => int = "clientY" - @get external ctrlKey: t => bool = "ctrlKey" - @send - external getModifierState: (t, string) => bool = "getModifierState" - @get external metaKey: t => bool = "metaKey" - @get external movementX: t => int = "movementX" - @get external movementY: t => int = "movementY" - @get external pageX: t => int = "pageX" - @get external pageY: t => int = "pageY" - @get @return(nullable) - external relatedTarget: t => option<{..}> = "relatedTarget" /* Should return Dom.eventTarget */ - @get external screenX: t => int = "screenX" - @get external screenY: t => int = "screenY" - @get external shiftKey: t => bool = "shiftKey" -} - -module Pointer: { - type tag = ReactEvent.Pointer.tag - type t = synthetic - - // Event - @get external type_: t => string = "type" - @get external target: t => {..} = "target" - @get external currentTarget: t => {..} = "currentTarget" - - @get external eventPhase: t => int = "eventPhase" - - @send external stopPropagation: t => unit = "stopPropagation" // aka cancelBubble - @get external bubbles: t => bool = "bubbles" - @get external cancelable: t => bool = "cancelable" - @send external preventDefault: t => unit = "preventDefault" - @get external defaultPrevented: t => bool = "defaultPrevented" - - @get external isTrusted: t => bool = "isTrusted" - @get external timeStamp: t => float = "timeStamp" - - // SyntheticEvent - @get external nativeEvent: t => {..} = "nativeEvent" - @send external isDefaultPrevented: t => bool = "isDefaultPrevented" - @send external isPropagationStopped: t => bool = "isPropagationStopped" - @send external persist: t => unit = "persist" - - // UIEvent - @get external detail: t => int = "detail" - @get external view: t => Dom.window = "view" /* Should return DOMAbstractView/WindowProxy */ - - // MouseEvent - @get external screenX: t => int = "screenX" - @get external screenY: t => int = "screenY" - @get external clientX: t => int = "clientX" - @get external clientY: t => int = "clientY" - @get external pageX: t => int = "pageX" - @get external pageY: t => int = "pageY" - @get external movementX: t => int = "movementX" - @get external movementY: t => int = "movementY" - - @get external ctrlKey: t => bool = "ctrlKey" - @get external shiftKey: t => bool = "shiftKey" - @get external altKey: t => bool = "altKey" - @get external metaKey: t => bool = "metaKey" - @send - external getModifierState: (t, string) => bool = "getModifierState" - - @get external button: t => int = "button" - @get external buttons: t => int = "buttons" - - @get @return(nullable) - external relatedTarget: t => option<{..}> = "relatedTarget" /* Should return Dom.eventTarget */ - - // PointerEvent - @get external pointerId: t => Dom.eventPointerId = "pointerId" - @get external width: t => float = "width" - @get external height: t => float = "height" - @get external pressure: t => float = "pressure" - @get external tangentialPressure: t => float = "tangentialPressure" - @get external tiltX: t => int = "tiltX" - @get external tiltY: t => int = "tiltY" - @get external twist: t => int = "twist" - @get external pointerType: t => string = "pointerType" - @get external isPrimary: t => bool = "isPrimary" -} - -module Selection: { - type tag = ReactEvent.Selection.tag - type t = synthetic - @get external bubbles: t => bool = "bubbles" - @get external cancelable: t => bool = "cancelable" - @get external currentTarget: t => {..} = "currentTarget" - @get external defaultPrevented: t => bool = "defaultPrevented" - @get external eventPhase: t => int = "eventPhase" - @get external isTrusted: t => bool = "isTrusted" - @get external nativeEvent: t => {..} = "nativeEvent" - @send external preventDefault: t => unit = "preventDefault" - @send external isDefaultPrevented: t => bool = "isDefaultPrevented" - @send external stopPropagation: t => unit = "stopPropagation" - @send external isPropagationStopped: t => bool = "isPropagationStopped" - @get external target: t => {..} = "target" - @get external timeStamp: t => float = "timeStamp" - @get external type_: t => string = "type" - @send external persist: t => unit = "persist" -} - -module Touch: { - type tag = ReactEvent.Touch.tag - type t = synthetic - @get external bubbles: t => bool = "bubbles" - @get external cancelable: t => bool = "cancelable" - @get external currentTarget: t => {..} = "currentTarget" - @get external defaultPrevented: t => bool = "defaultPrevented" - @get external eventPhase: t => int = "eventPhase" - @get external isTrusted: t => bool = "isTrusted" - @get external nativeEvent: t => {..} = "nativeEvent" - @send external preventDefault: t => unit = "preventDefault" - @send external isDefaultPrevented: t => bool = "isDefaultPrevented" - @send external stopPropagation: t => unit = "stopPropagation" - @send external isPropagationStopped: t => bool = "isPropagationStopped" - @get external target: t => {..} = "target" - @get external timeStamp: t => float = "timeStamp" - @get external type_: t => string = "type" - @send external persist: t => unit = "persist" - @get external altKey: t => bool = "altKey" - @get external changedTouches: t => {..} = "changedTouches" /* Should return Dom.touchList */ - @get external ctrlKey: t => bool = "ctrlKey" - @send - external getModifierState: (t, string) => bool = "getModifierState" - @get external metaKey: t => bool = "metaKey" - @get external shiftKey: t => bool = "shiftKey" - @get external targetTouches: t => {..} = "targetTouches" /* Should return Dom.touchList */ - @get external touches: t => {..} = "touches" /* Should return Dom.touchList */ -} - -module UI: { - type tag = ReactEvent.UI.tag - type t = synthetic - @get external bubbles: t => bool = "bubbles" - @get external cancelable: t => bool = "cancelable" - @get external currentTarget: t => {..} = "currentTarget" - @get external defaultPrevented: t => bool = "defaultPrevented" - @get external eventPhase: t => int = "eventPhase" - @get external isTrusted: t => bool = "isTrusted" - @get external nativeEvent: t => {..} = "nativeEvent" - @send external preventDefault: t => unit = "preventDefault" - @send external isDefaultPrevented: t => bool = "isDefaultPrevented" - @send external stopPropagation: t => unit = "stopPropagation" - @send external isPropagationStopped: t => bool = "isPropagationStopped" - @get external target: t => {..} = "target" - @get external timeStamp: t => float = "timeStamp" - @get external type_: t => string = "type" - @send external persist: t => unit = "persist" - @get external detail: t => int = "detail" - @get external view: t => Dom.window = "view" /* Should return DOMAbstractView/WindowProxy */ -} - -module Wheel: { - type tag = ReactEvent.Wheel.tag - type t = synthetic - @get external bubbles: t => bool = "bubbles" - @get external cancelable: t => bool = "cancelable" - @get external currentTarget: t => {..} = "currentTarget" - @get external defaultPrevented: t => bool = "defaultPrevented" - @get external eventPhase: t => int = "eventPhase" - @get external isTrusted: t => bool = "isTrusted" - @get external nativeEvent: t => {..} = "nativeEvent" - @send external preventDefault: t => unit = "preventDefault" - @send external isDefaultPrevented: t => bool = "isDefaultPrevented" - @send external stopPropagation: t => unit = "stopPropagation" - @send external isPropagationStopped: t => bool = "isPropagationStopped" - @get external target: t => {..} = "target" - @get external timeStamp: t => float = "timeStamp" - @get external type_: t => string = "type" - @send external persist: t => unit = "persist" - @get external deltaMode: t => int = "deltaMode" - @get external deltaX: t => float = "deltaX" - @get external deltaY: t => float = "deltaY" - @get external deltaZ: t => float = "deltaZ" -} - -module Media: { - type tag = ReactEvent.Media.tag - type t = synthetic - @get external bubbles: t => bool = "bubbles" - @get external cancelable: t => bool = "cancelable" - @get external currentTarget: t => {..} = "currentTarget" - @get external defaultPrevented: t => bool = "defaultPrevented" - @get external eventPhase: t => int = "eventPhase" - @get external isTrusted: t => bool = "isTrusted" - @get external nativeEvent: t => {..} = "nativeEvent" - @send external preventDefault: t => unit = "preventDefault" - @send external isDefaultPrevented: t => bool = "isDefaultPrevented" - @send external stopPropagation: t => unit = "stopPropagation" - @send external isPropagationStopped: t => bool = "isPropagationStopped" - @get external target: t => {..} = "target" - @get external timeStamp: t => float = "timeStamp" - @get external type_: t => string = "type" - @send external persist: t => unit = "persist" -} - -module Image: { - type tag = ReactEvent.Image.tag - type t = synthetic - @get external bubbles: t => bool = "bubbles" - @get external cancelable: t => bool = "cancelable" - @get external currentTarget: t => {..} = "currentTarget" - @get external defaultPrevented: t => bool = "defaultPrevented" - @get external eventPhase: t => int = "eventPhase" - @get external isTrusted: t => bool = "isTrusted" - @get external nativeEvent: t => {..} = "nativeEvent" - @send external preventDefault: t => unit = "preventDefault" - @send external isDefaultPrevented: t => bool = "isDefaultPrevented" - @send external stopPropagation: t => unit = "stopPropagation" - @send external isPropagationStopped: t => bool = "isPropagationStopped" - @get external target: t => {..} = "target" - @get external timeStamp: t => float = "timeStamp" - @get external type_: t => string = "type" - @send external persist: t => unit = "persist" -} - -module Animation: { - type tag = ReactEvent.Animation.tag - type t = synthetic - @get external bubbles: t => bool = "bubbles" - @get external cancelable: t => bool = "cancelable" - @get external currentTarget: t => {..} = "currentTarget" - @get external defaultPrevented: t => bool = "defaultPrevented" - @get external eventPhase: t => int = "eventPhase" - @get external isTrusted: t => bool = "isTrusted" - @get external nativeEvent: t => {..} = "nativeEvent" - @send external preventDefault: t => unit = "preventDefault" - @send external isDefaultPrevented: t => bool = "isDefaultPrevented" - @send external stopPropagation: t => unit = "stopPropagation" - @send external isPropagationStopped: t => bool = "isPropagationStopped" - @get external target: t => {..} = "target" - @get external timeStamp: t => float = "timeStamp" - @get external type_: t => string = "type" - @send external persist: t => unit = "persist" - @get external animationName: t => string = "animationName" - @get external pseudoElement: t => string = "pseudoElement" - @get external elapsedTime: t => float = "elapsedTime" -} - -module Transition: { - type tag = ReactEvent.Transition.tag - type t = synthetic - @get external bubbles: t => bool = "bubbles" - @get external cancelable: t => bool = "cancelable" - @get external currentTarget: t => {..} = "currentTarget" - @get external defaultPrevented: t => bool = "defaultPrevented" - @get external eventPhase: t => int = "eventPhase" - @get external isTrusted: t => bool = "isTrusted" - @get external nativeEvent: t => {..} = "nativeEvent" - @send external preventDefault: t => unit = "preventDefault" - @send external isDefaultPrevented: t => bool = "isDefaultPrevented" - @send external stopPropagation: t => unit = "stopPropagation" - @send external isPropagationStopped: t => bool = "isPropagationStopped" - @get external target: t => {..} = "target" - @get external timeStamp: t => float = "timeStamp" - @get external type_: t => string = "type" - @send external persist: t => unit = "persist" - @get external propertyName: t => string = "propertyName" - @get external pseudoElement: t => string = "pseudoElement" - @get external elapsedTime: t => float = "elapsedTime" -} diff --git a/src/v3/ReactV3.bs.js b/src/v3/ReactV3.bs.js deleted file mode 100644 index e083669..0000000 --- a/src/v3/ReactV3.bs.js +++ /dev/null @@ -1,21 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -'use strict'; - -var React_V3 = require("./React_V3.bs.js"); -var ReactDOM_V3 = require("./ReactDOM_V3.bs.js"); -var ReactEvent_V3 = require("./ReactEvent_V3.bs.js"); -var ReactDOMStyle_V3 = require("./ReactDOMStyle_V3.bs.js"); - -var React = React_V3; - -var ReactDOM = ReactDOM_V3; - -var ReactDOMStyle = ReactDOMStyle_V3; - -var ReactEvent = ReactEvent_V3; - -exports.React = React; -exports.ReactDOM = ReactDOM; -exports.ReactDOMStyle = ReactDOMStyle; -exports.ReactEvent = ReactEvent; -/* No side effect */ diff --git a/src/v3/ReactV3.res b/src/v3/ReactV3.res deleted file mode 100644 index 9c7dff5..0000000 --- a/src/v3/ReactV3.res +++ /dev/null @@ -1,35 +0,0 @@ -/*** -ReactV3 module is for the backward compatibility. - -`open ReactV3` enables using the rescript-react for V3. - -```rescript -module C = { - @@jsxConfig({version: 3}) - open ReactV3 - - @react.component - let make = ... -} -``` -or in project level, -- open ReactV3 globally -- install the compiler>=10.1 -- install the rescript-react>=0.11.0 -*/ - -module React = { - include React_V3 -} - -module ReactDOM = { - include ReactDOM_V3 -} - -module ReactDOMStyle = { - include ReactDOMStyle_V3 -} - -module ReactEvent = { - include ReactEvent_V3 -} diff --git a/src/v3/React_V3.bs.js b/src/v3/React_V3.bs.js deleted file mode 100644 index a858df8..0000000 --- a/src/v3/React_V3.bs.js +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -'use strict'; - - -var Ref = {}; - -var Children = {}; - -var Context = {}; - -var Fragment = {}; - -var StrictMode = {}; - -var Suspense = {}; - -var Uncurried = {}; - -exports.Ref = Ref; -exports.Children = Children; -exports.Context = Context; -exports.Fragment = Fragment; -exports.StrictMode = StrictMode; -exports.Suspense = Suspense; -exports.Uncurried = Uncurried; -/* No side effect */ diff --git a/src/v3/React_V3.res b/src/v3/React_V3.res deleted file mode 100644 index 4b4de7a..0000000 --- a/src/v3/React_V3.res +++ /dev/null @@ -1,409 +0,0 @@ -/** Binding to React.element enables the compatibility with v3 */ -type element = React.element - -@deprecated("Jsx 3 is deprecated, use jsx 4 instead") @val external null: element = "null" - -@deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external float: float => element = "%identity" -@deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external int: int => element = "%identity" -@deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external string: string => element = "%identity" - -@deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external array: array => element = "%identity" - -type componentLike<'props, 'return> = React.componentLike<'props, 'return> - -type component<'props> = React.component<'props> - -/* this function exists to prepare for making `component` abstract */ -@deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external component: componentLike<'props, element> => component<'props> = "%identity" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external createElement: (component<'props>, 'props) => element = "createElement" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external cloneElement: (element, 'props) => element = "cloneElement" - -@variadic @module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external createElementVariadic: (component<'props>, 'props, array) => element = - "createElement" - -@module("react") @deprecated("Please use JSX syntax directly.") -external jsxKeyed: (component<'props>, 'props, string) => element = "jsx" - -@module("react") @deprecated("Please use JSX syntax directly.") -external jsx: (component<'props>, 'props) => element = "jsx" - -@module("react") @deprecated("Please use JSX syntax directly.") -external jsxs: (component<'props>, 'props) => element = "jsxs" - -@module("react") @deprecated("Please use JSX syntax directly.") -external jsxsKeyed: (component<'props>, 'props, string) => element = "jsxs" - -type ref<'value> = React.ref<'value> = {mutable current: 'value} - -module Ref = { - @deprecated("Please use the type React.ref instead") - type t<'value> = ref<'value> - - @deprecated("Please directly read from ref.current instead") @get - external current: ref<'value> => 'value = "current" - - @deprecated("Please directly assign to ref.current instead") @set - external setCurrent: (ref<'value>, 'value) => unit = "current" -} - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external createRef: unit => ref> = "createRef" - -module Children = { - @module("react") @scope("Children") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external map: (element, element => element) => element = "map" - @module("react") @scope("Children") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external mapWithIndex: (element, @uncurry (element, int) => element) => element = "map" - @module("react") @scope("Children") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external forEach: (element, element => unit) => unit = "forEach" - @module("react") @scope("Children") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external forEachWithIndex: (element, @uncurry (element, int) => unit) => unit = "forEach" - @module("react") @scope("Children") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external count: element => int = "count" - @module("react") @scope("Children") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external only: element => element = "only" - @module("react") @scope("Children") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external toArray: element => array = "toArray" -} - -module Context = { - type t<'props> = React.Context.t<'props> - - @obj - external makeProps: ( - ~value: 'props, - ~children: element, - unit, - ) => {"value": 'props, "children": element} = "" - - @get @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external provider: t<'props> => component<{"value": 'props, "children": element}> = "Provider" -} - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external createContext: 'a => Context.t<'a> = "createContext" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external forwardRef: (@uncurry ('props, Js.Nullable.t>) => element) => component<'props> = - "forwardRef" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external memo: component<'props> => component<'props> = "memo" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external memoCustomCompareProps: ( - component<'props>, - @uncurry ('props, 'props) => bool, -) => component<'props> = "memo" - -module Fragment = { - @obj @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external makeProps: (~children: element, ~key: 'key=?, unit) => {"children": element} = "" - @module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external make: component<{ - "children": element, - }> = "Fragment" -} - -module StrictMode = { - @obj @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external makeProps: (~children: element, ~key: 'key=?, unit) => {"children": element} = "" - @module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external make: component<{ - "children": element, - }> = "StrictMode" -} - -module Suspense = { - @obj @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external makeProps: ( - ~children: element=?, - ~fallback: element=?, - ~key: 'key=?, - unit, - ) => {"children": option, "fallback": option} = "" - @module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external make: component<{ - "children": option, - "fallback": option, - }> = "Suspense" -} - -/* HOOKS */ - -/* - * Yeah, we know this api isn't great. tl;dr: useReducer instead. - * It's because useState can take functions or non-function values and treats - * them differently. Lazy initializer + callback which returns state is the - * only way to safely have any type of state and be able to update it correctly. - */ -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useState: (@uncurry (unit => 'state)) => ('state, ('state => 'state) => unit) = "useState" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useReducer: (@uncurry ('state, 'action) => 'state, 'state) => ('state, 'action => unit) = - "useReducer" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useReducerWithMapState: ( - @uncurry ('state, 'action) => 'state, - 'initialState, - @uncurry ('initialState => 'state), -) => ('state, 'action => unit) = "useReducer" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useEffectOnEveryRender: (@uncurry (unit => option unit>)) => unit = "useEffect" -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useEffect: (@uncurry (unit => option unit>), 'deps) => unit = "useEffect" -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useEffect0: (@uncurry (unit => option unit>), @as(json`[]`) _) => unit = - "useEffect" -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useEffect1: (@uncurry (unit => option unit>), array<'a>) => unit = "useEffect" -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useEffect2: (@uncurry (unit => option unit>), ('a, 'b)) => unit = "useEffect" -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useEffect3: (@uncurry (unit => option unit>), ('a, 'b, 'c)) => unit = "useEffect" -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useEffect4: (@uncurry (unit => option unit>), ('a, 'b, 'c, 'd)) => unit = - "useEffect" -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useEffect5: (@uncurry (unit => option unit>), ('a, 'b, 'c, 'd, 'e)) => unit = - "useEffect" -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useEffect6: (@uncurry (unit => option unit>), ('a, 'b, 'c, 'd, 'e, 'f)) => unit = - "useEffect" -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useEffect7: ( - @uncurry (unit => option unit>), - ('a, 'b, 'c, 'd, 'e, 'f, 'g), -) => unit = "useEffect" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useLayoutEffectOnEveryRender: (@uncurry (unit => option unit>)) => unit = - "useLayoutEffect" -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useLayoutEffect: (@uncurry (unit => option unit>), 'deps) => unit = - "useLayoutEffect" -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useLayoutEffect0: (@uncurry (unit => option unit>), @as(json`[]`) _) => unit = - "useLayoutEffect" -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useLayoutEffect1: (@uncurry (unit => option unit>), array<'a>) => unit = - "useLayoutEffect" -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useLayoutEffect2: (@uncurry (unit => option unit>), ('a, 'b)) => unit = - "useLayoutEffect" -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useLayoutEffect3: (@uncurry (unit => option unit>), ('a, 'b, 'c)) => unit = - "useLayoutEffect" -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useLayoutEffect4: (@uncurry (unit => option unit>), ('a, 'b, 'c, 'd)) => unit = - "useLayoutEffect" -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useLayoutEffect5: (@uncurry (unit => option unit>), ('a, 'b, 'c, 'd, 'e)) => unit = - "useLayoutEffect" -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useLayoutEffect6: ( - @uncurry (unit => option unit>), - ('a, 'b, 'c, 'd, 'e, 'f), -) => unit = "useLayoutEffect" -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useLayoutEffect7: ( - @uncurry (unit => option unit>), - ('a, 'b, 'c, 'd, 'e, 'f, 'g), -) => unit = "useLayoutEffect" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useMemo: (@uncurry (unit => 'any), 'deps) => 'any = "useMemo" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useMemo0: (@uncurry (unit => 'any), @as(json`[]`) _) => 'any = "useMemo" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useMemo1: (@uncurry (unit => 'any), array<'a>) => 'any = "useMemo" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useMemo2: (@uncurry (unit => 'any), ('a, 'b)) => 'any = "useMemo" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useMemo3: (@uncurry (unit => 'any), ('a, 'b, 'c)) => 'any = "useMemo" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useMemo4: (@uncurry (unit => 'any), ('a, 'b, 'c, 'd)) => 'any = "useMemo" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useMemo5: (@uncurry (unit => 'any), ('a, 'b, 'c, 'd, 'e)) => 'any = "useMemo" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useMemo6: (@uncurry (unit => 'any), ('a, 'b, 'c, 'd, 'e, 'f)) => 'any = "useMemo" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useMemo7: (@uncurry (unit => 'any), ('a, 'b, 'c, 'd, 'e, 'f, 'g)) => 'any = "useMemo" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useCallback: ('f, 'deps) => 'f = "useCallback" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useCallback0: ('f, @as(json`[]`) _) => 'f = "useCallback" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useCallback1: ('f, array<'a>) => 'f = "useCallback" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useCallback2: ('f, ('a, 'b)) => 'f = "useCallback" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useCallback3: ('f, ('a, 'b, 'c)) => 'f = "useCallback" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useCallback4: ('f, ('a, 'b, 'c, 'd)) => 'f = "useCallback" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useCallback5: ('f, ('a, 'b, 'c, 'd, 'e)) => 'f = "useCallback" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useCallback6: ('callback, ('a, 'b, 'c, 'd, 'e, 'f)) => 'callback = "useCallback" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useCallback7: ('callback, ('a, 'b, 'c, 'd, 'e, 'f, 'g)) => 'callback = "useCallback" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useContext: Context.t<'any> => 'any = "useContext" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useRef: 'value => ref<'value> = "useRef" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useImperativeHandleOnEveryRender: ( - Js.Nullable.t>, - @uncurry (unit => 'value), -) => unit = "useImperativeHandle" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useImperativeHandle: ( - Js.Nullable.t>, - @uncurry (unit => 'value), - 'deps, -) => unit = "useImperativeHandle" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useImperativeHandle0: ( - Js.Nullable.t>, - @uncurry (unit => 'value), - @as(json`[]`) _, -) => unit = "useImperativeHandle" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useImperativeHandle1: ( - Js.Nullable.t>, - @uncurry (unit => 'value), - array<'a>, -) => unit = "useImperativeHandle" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useImperativeHandle2: ( - Js.Nullable.t>, - @uncurry (unit => 'value), - ('a, 'b), -) => unit = "useImperativeHandle" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useImperativeHandle3: ( - Js.Nullable.t>, - @uncurry (unit => 'value), - ('a, 'b, 'c), -) => unit = "useImperativeHandle" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useImperativeHandle4: ( - Js.Nullable.t>, - @uncurry (unit => 'value), - ('a, 'b, 'c, 'd), -) => unit = "useImperativeHandle" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useImperativeHandle5: ( - Js.Nullable.t>, - @uncurry (unit => 'value), - ('a, 'b, 'c, 'd, 'e), -) => unit = "useImperativeHandle" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useImperativeHandle6: ( - Js.Nullable.t>, - @uncurry (unit => 'value), - ('a, 'b, 'c, 'd, 'e, 'f), -) => unit = "useImperativeHandle" - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useImperativeHandle7: ( - Js.Nullable.t>, - @uncurry (unit => 'value), - ('a, 'b, 'c, 'd, 'e, 'f, 'g), -) => unit = "useImperativeHandle" - -module Uncurried = { - @module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external useState: (@uncurry (unit => 'state)) => ('state, (. 'state => 'state) => unit) = - "useState" - - @module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external useReducer: ( - @uncurry ('state, 'action) => 'state, - 'state, - ) => ('state, (. 'action) => unit) = "useReducer" - - @module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external useReducerWithMapState: ( - @uncurry ('state, 'action) => 'state, - 'initialState, - @uncurry ('initialState => 'state), - ) => ('state, (. 'action) => unit) = "useReducer" - - @module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external useCallback: ('f, 'deps) => 'f = "useCallback" - - @module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external useCallback0: ('f, @as(json`[]`) _) => 'f = "useCallback" - - @module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external useCallback1: ('f, array<'a>) => 'f = "useCallback" - - @module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external useCallback2: ('f, ('a, 'b)) => 'f = "useCallback" - - @module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external useCallback3: ('f, ('a, 'b, 'c)) => 'f = "useCallback" - - @module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external useCallback4: ('f, ('a, 'b, 'c, 'd)) => 'f = "useCallback" - - @module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external useCallback5: ('f, ('a, 'b, 'c, 'd, 'e)) => 'f = "useCallback" - - @module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external useCallback6: ('callback, ('a, 'b, 'c, 'd, 'e, 'f)) => 'callback = "useCallback" - - @module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") - external useCallback7: ('callback, ('a, 'b, 'c, 'd, 'e, 'f, 'g)) => 'callback = "useCallback" -} - -@module("react") @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external useTransition: unit => (bool, (. unit => unit) => unit) = "useTransition" - -@set @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external setDisplayName: (component<'props>, string) => unit = "displayName" - -@get @return(nullable) @deprecated("Jsx 3 is deprecated, use jsx 4 instead") -external displayName: component<'props> => option = "displayName" From 0b20317fa5e66e9146c0aea3c59c1e520a9e0420 Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Sun, 23 Feb 2025 12:32:38 +0100 Subject: [PATCH 2/2] Remove deprecated stuff --- src/React.res | 11 - src/ReactDOM.res | 1054 ----------------------------------------- src/ReactDOMStyle.res | 421 ---------------- 3 files changed, 1486 deletions(-) diff --git a/src/React.res b/src/React.res index 0da49ad..89f4d5b 100644 --- a/src/React.res +++ b/src/React.res @@ -45,17 +45,6 @@ type fragmentProps = {children?: element} type ref<'value> = {mutable current: 'value} -module Ref = { - @deprecated("Please use the type React.ref instead") - type t<'value> = ref<'value> - - @deprecated("Please directly read from ref.current instead") @get - external current: ref<'value> => 'value = "current" - - @deprecated("Please directly assign to ref.current instead") @set - external setCurrent: (ref<'value>, 'value) => unit = "current" -} - @module("react") external createRef: unit => ref> = "createRef" diff --git a/src/ReactDOM.res b/src/ReactDOM.res index 72bce53..04c39c2 100644 --- a/src/ReactDOM.res +++ b/src/ReactDOM.res @@ -9,12 +9,6 @@ @val @return(nullable) external querySelector: string => option = "document.querySelector" -@module("react-dom") -@deprecated( - "ReactDOM.render is no longer supported in React 18. Use ReactDOM.Client.createRoot instead." -) -external render: (React.element, Dom.element) => unit = "render" - module Client = { module Root = { type t @@ -31,21 +25,9 @@ module Client = { external hydrateRoot: (Dom.element, React.element) => Root.t = "hydrateRoot" } -@module("react-dom") -@deprecated( - "ReactDOM.hydrate is no longer supported in React 18. Use ReactDOM.Client.hydrateRoot instead." -) -external hydrate: (React.element, Dom.element) => unit = "hydrate" - @module("react-dom") external createPortal: (React.element, Dom.element) => React.element = "createPortal" -@module("react-dom") -@deprecated( - "ReactDOM.unmountComponentAtNode is no longer supported in React 18. Use ReactDOM.Client.Root.unmount instead." -) -external unmountComponentAtNode: Dom.element => unit = "unmountComponentAtNode" - external domElementToObj: Dom.element => {..} = "%identity" type style = ReactDOMStyle.t @@ -63,1038 +45,6 @@ module Ref = { type domProps = JsxDOM.domProps -@deprecated("Please use type ReactDOM.domProps") -type props = JsxDOM.domProps - -module Props = { - @deprecated("Please use type ReactDOM.domProps") - type domProps = JsxDOM.domProps - - /** DEPRECATED */ - @deriving(abstract) - @deprecated("Please use type ReactDOM.domProps") - type props = { - @optional - key: string, - @optional - ref: Js.nullable => unit, - /* accessibility */ - /* https://www.w3.org/TR/wai-aria-1.1/ */ - /* https://accessibilityresources.org/ is a great resource for these */ - /* [@optional] [@as "aria-current"] ariaCurrent: page|step|location|date|time|true|false, */ - @optional @as("aria-details") - ariaDetails: string, - @optional @as("aria-disabled") - ariaDisabled: bool, - @optional @as("aria-hidden") - ariaHidden: bool, - /* [@optional] [@as "aria-invalid"] ariaInvalid: grammar|false|spelling|true, */ - @optional @as("aria-keyshortcuts") - ariaKeyshortcuts: string, - @optional @as("aria-label") - ariaLabel: string, - @optional @as("aria-roledescription") - ariaRoledescription: string, - /* Widget Attributes */ - /* [@optional] [@as "aria-autocomplete"] ariaAutocomplete: inline|list|both|none, */ - /* [@optional] [@as "aria-checked"] ariaChecked: true|false|mixed, /* https://www.w3.org/TR/wai-aria-1.1/#valuetype_tristate */ */ - @optional @as("aria-expanded") - ariaExpanded: bool, - /* [@optional] [@as "aria-haspopup"] ariaHaspopup: false|true|menu|listbox|tree|grid|dialog, */ - @optional @as("aria-level") - ariaLevel: int, - @optional @as("aria-modal") - ariaModal: bool, - @optional @as("aria-multiline") - ariaMultiline: bool, - @optional @as("aria-multiselectable") - ariaMultiselectable: bool, - /* [@optional] [@as "aria-orientation"] ariaOrientation: horizontal|vertical|undefined, */ - @optional @as("aria-placeholder") - ariaPlaceholder: string, - /* [@optional] [@as "aria-pressed"] ariaPressed: true|false|mixed, /* https://www.w3.org/TR/wai-aria-1.1/#valuetype_tristate */ */ - @optional @as("aria-readonly") - ariaReadonly: bool, - @optional @as("aria-required") - ariaRequired: bool, - @optional @as("aria-selected") - ariaSelected: bool, - @optional @as("aria-sort") - ariaSort: string, - @optional @as("aria-valuemax") - ariaValuemax: float, - @optional @as("aria-valuemin") - ariaValuemin: float, - @optional @as("aria-valuenow") - ariaValuenow: float, - @optional @as("aria-valuetext") - ariaValuetext: string, - /* Live Region Attributes */ - @optional @as("aria-atomic") - ariaAtomic: bool, - @optional @as("aria-busy") - ariaBusy: bool, - /* [@optional] [@as "aria-live"] ariaLive: off|polite|assertive|rude, */ - @optional @as("aria-relevant") - ariaRelevant: string, - /* Drag-and-Drop Attributes */ - /* [@optional] [@as "aria-dropeffect"] ariaDropeffect: copy|move|link|execute|popup|none, */ - @optional @as("aria-grabbed") - ariaGrabbed: bool, - /* Relationship Attributes */ - @optional @as("aria-activedescendant") - ariaActivedescendant: string, - @optional @as("aria-colcount") - ariaColcount: int, - @optional @as("aria-colindex") - ariaColindex: int, - @optional @as("aria-colspan") - ariaColspan: int, - @optional @as("aria-controls") - ariaControls: string, - @optional @as("aria-describedby") - ariaDescribedby: string, - @optional @as("aria-errormessage") - ariaErrormessage: string, - @optional @as("aria-flowto") - ariaFlowto: string, - @optional @as("aria-labelledby") - ariaLabelledby: string, - @optional @as("aria-owns") - ariaOwns: string, - @optional @as("aria-posinset") - ariaPosinset: int, - @optional @as("aria-rowcount") - ariaRowcount: int, - @optional @as("aria-rowindex") - ariaRowindex: int, - @optional @as("aria-rowspan") - ariaRowspan: int, - @optional @as("aria-setsize") - ariaSetsize: int, - /* react textarea/input */ - @optional - defaultChecked: bool, - @optional - defaultValue: string, - /* global html attributes */ - @optional - accessKey: string, - @optional - className: string /* substitute for "class" */, - @optional - contentEditable: bool, - @optional - contextMenu: string, - @optional - dir: string /* "ltr", "rtl" or "auto" */, - @optional - draggable: bool, - @optional - hidden: bool, - @optional - id: string, - @optional - lang: string, - @optional - role: string /* ARIA role */, - @optional - style: style, - @optional - spellCheck: bool, - @optional - tabIndex: int, - @optional - title: string, - /* html5 microdata */ - @optional - itemID: string, - @optional - itemProp: string, - @optional - itemRef: string, - @optional - itemScope: bool, - @optional - itemType: string /* uri */, - /* tag-specific html attributes */ - @optional - accept: string, - @optional - acceptCharset: string, - @optional - action: string /* uri */, - @optional - allow: string, - @optional - allowFullScreen: bool, - @optional - alt: string, - @optional - async: bool, - @optional - autoComplete: string /* has a fixed, but large-ish, set of possible values */, - @optional - autoCapitalize: string /* Mobile Safari specific */, - @optional - autoFocus: bool, - @optional - autoPlay: bool, - @optional - challenge: string, - @optional - charSet: string, - @optional - checked: bool, - @optional - cite: string /* uri */, - @optional - crossorigin: bool, - @optional - cols: int, - @optional - colSpan: int, - @optional - content: string, - @optional - controls: bool, - @optional - coords: string /* set of values specifying the coordinates of a region */, - @optional - data: string /* uri */, - @optional - dateTime: string /* "valid date string with optional time" */, - @optional - default: bool, - @optional - defer: bool, - @optional - disabled: bool, - @optional - download: string /* should really be either a boolean, signifying presence, or a string */, - @optional - encType: string /* "application/x-www-form-urlencoded", "multipart/form-data" or "text/plain" */, - @optional - form: string, - @optional - formAction: string /* uri */, - @optional - formTarget: string /* "_blank", "_self", etc. */, - @optional - formMethod: string /* "post", "get", "put" */, - @optional - frameBorder: int /* deprecated, prefer to use css border instead */, - @optional - headers: string, - @optional - height: string /* in html5 this can only be a number, but in html4 it can ba a percentage as well */, - @optional - high: int, - @optional - href: string /* uri */, - @optional - hrefLang: string, - @optional - htmlFor: string /* substitute for "for" */, - @optional - httpEquiv: string /* has a fixed set of possible values */, - @optional - icon: string /* uri? */, - @optional - inputMode: string /* "verbatim", "latin", "numeric", etc. */, - @optional - integrity: string, - @optional - keyType: string, - @optional - kind: string /* has a fixed set of possible values */, - @optional - label: string, - @optional - list: string, - @optional - loop: bool, - @optional - low: int, - @optional - manifest: string /* uri */, - @optional - max: string /* should be int or Js.Date.t */, - @optional - maxLength: int, - @optional - media: string /* a valid media query */, - @optional - mediaGroup: string, - @optional - method: string /* "post" or "get" */, - @optional - min: string, - @optional - minLength: int, - @optional - multiple: bool, - @optional - muted: bool, - @optional - name: string, - @optional - nonce: string, - @optional - noValidate: bool, - @optional @as("open") - open_: bool /* use this one. Previous one is deprecated */, - @optional - optimum: int, - @optional - pattern: string /* valid Js RegExp */, - @optional - placeholder: string, - @optional - poster: string /* uri */, - @optional - preload: string /* "none", "metadata" or "auto" (and "" as a synonym for "auto") */, - @optional - radioGroup: string, - @optional - readOnly: bool, - @optional - rel: string /* a space- or comma-separated (depending on the element) list of a fixed set of "link types" */, - @optional - required: bool, - @optional - reversed: bool, - @optional - rows: int, - @optional - rowSpan: int, - @optional - sandbox: string /* has a fixed set of possible values */, - @optional - scope: string /* has a fixed set of possible values */, - @optional - scoped: bool, - @optional - scrolling: string /* html4 only, "auto", "yes" or "no" */, - /* seamless - supported by React, but removed from the html5 spec */ - @optional - selected: bool, - @optional - shape: string, - @optional - size: int, - @optional - sizes: string, - @optional - span: int, - @optional - src: string /* uri */, - @optional - srcDoc: string, - @optional - srcLang: string, - @optional - srcSet: string, - @optional - start: int, - @optional - step: float, - @optional - summary: string /* deprecated */, - @optional - target: string, - @optional @as("type") - type_: string /* has a fixed but large-ish set of possible values */ /* use this one. Previous one is deprecated */, - @optional - useMap: string, - @optional - value: string, - @optional - width: string /* in html5 this can only be a number, but in html4 it can ba a percentage as well */, - @optional - wrap: string /* "hard" or "soft" */, - /* Clipboard events */ - @optional - onCopy: ReactEvent.Clipboard.t => unit, - @optional - onCut: ReactEvent.Clipboard.t => unit, - @optional - onPaste: ReactEvent.Clipboard.t => unit, - /* Composition events */ - @optional - onCompositionEnd: ReactEvent.Composition.t => unit, - @optional - onCompositionStart: ReactEvent.Composition.t => unit, - @optional - onCompositionUpdate: ReactEvent.Composition.t => unit, - /* Keyboard events */ - @optional - onKeyDown: ReactEvent.Keyboard.t => unit, - @optional - onKeyPress: ReactEvent.Keyboard.t => unit, - @optional - onKeyUp: ReactEvent.Keyboard.t => unit, - /* Focus events */ - @optional - onFocus: ReactEvent.Focus.t => unit, - @optional - onBlur: ReactEvent.Focus.t => unit, - /* Form events */ - @optional - onChange: ReactEvent.Form.t => unit, - @optional - onInput: ReactEvent.Form.t => unit, - @optional - onSubmit: ReactEvent.Form.t => unit, - @optional - onInvalid: ReactEvent.Form.t => unit, - /* Mouse events */ - @optional - onClick: ReactEvent.Mouse.t => unit, - @optional - onContextMenu: ReactEvent.Mouse.t => unit, - @optional - onDoubleClick: ReactEvent.Mouse.t => unit, - @optional - onDrag: ReactEvent.Mouse.t => unit, - @optional - onDragEnd: ReactEvent.Mouse.t => unit, - @optional - onDragEnter: ReactEvent.Mouse.t => unit, - @optional - onDragExit: ReactEvent.Mouse.t => unit, - @optional - onDragLeave: ReactEvent.Mouse.t => unit, - @optional - onDragOver: ReactEvent.Mouse.t => unit, - @optional - onDragStart: ReactEvent.Mouse.t => unit, - @optional - onDrop: ReactEvent.Mouse.t => unit, - @optional - onMouseDown: ReactEvent.Mouse.t => unit, - @optional - onMouseEnter: ReactEvent.Mouse.t => unit, - @optional - onMouseLeave: ReactEvent.Mouse.t => unit, - @optional - onMouseMove: ReactEvent.Mouse.t => unit, - @optional - onMouseOut: ReactEvent.Mouse.t => unit, - @optional - onMouseOver: ReactEvent.Mouse.t => unit, - @optional - onMouseUp: ReactEvent.Mouse.t => unit, - /* Selection events */ - @optional - onSelect: ReactEvent.Selection.t => unit, - /* Touch events */ - @optional - onTouchCancel: ReactEvent.Touch.t => unit, - @optional - onTouchEnd: ReactEvent.Touch.t => unit, - @optional - onTouchMove: ReactEvent.Touch.t => unit, - @optional - onTouchStart: ReactEvent.Touch.t => unit, - // Pointer events - @optional - onPointerOver: ReactEvent.Pointer.t => unit, - @optional - onPointerEnter: ReactEvent.Pointer.t => unit, - @optional - onPointerDown: ReactEvent.Pointer.t => unit, - @optional - onPointerMove: ReactEvent.Pointer.t => unit, - @optional - onPointerUp: ReactEvent.Pointer.t => unit, - @optional - onPointerCancel: ReactEvent.Pointer.t => unit, - @optional - onPointerOut: ReactEvent.Pointer.t => unit, - @optional - onPointerLeave: ReactEvent.Pointer.t => unit, - @optional - onGotPointerCapture: ReactEvent.Pointer.t => unit, - @optional - onLostPointerCapture: ReactEvent.Pointer.t => unit, - /* UI events */ - @optional - onScroll: ReactEvent.UI.t => unit, - /* Wheel events */ - @optional - onWheel: ReactEvent.Wheel.t => unit, - /* Media events */ - @optional - onAbort: ReactEvent.Media.t => unit, - @optional - onCanPlay: ReactEvent.Media.t => unit, - @optional - onCanPlayThrough: ReactEvent.Media.t => unit, - @optional - onDurationChange: ReactEvent.Media.t => unit, - @optional - onEmptied: ReactEvent.Media.t => unit, - @optional - onEncrypetd: ReactEvent.Media.t => unit, - @optional - onEnded: ReactEvent.Media.t => unit, - @optional - onError: ReactEvent.Media.t => unit, - @optional - onLoadedData: ReactEvent.Media.t => unit, - @optional - onLoadedMetadata: ReactEvent.Media.t => unit, - @optional - onLoadStart: ReactEvent.Media.t => unit, - @optional - onPause: ReactEvent.Media.t => unit, - @optional - onPlay: ReactEvent.Media.t => unit, - @optional - onPlaying: ReactEvent.Media.t => unit, - @optional - onProgress: ReactEvent.Media.t => unit, - @optional - onRateChange: ReactEvent.Media.t => unit, - @optional - onSeeked: ReactEvent.Media.t => unit, - @optional - onSeeking: ReactEvent.Media.t => unit, - @optional - onStalled: ReactEvent.Media.t => unit, - @optional - onSuspend: ReactEvent.Media.t => unit, - @optional - onTimeUpdate: ReactEvent.Media.t => unit, - @optional - onVolumeChange: ReactEvent.Media.t => unit, - @optional - onWaiting: ReactEvent.Media.t => unit, - /* Image events */ - @optional - onLoad: ReactEvent.Image.t => unit /* duplicate */ /* ~onError: ReactEvent.Image.t => unit=?, */, - /* Animation events */ - @optional - onAnimationStart: ReactEvent.Animation.t => unit, - @optional - onAnimationEnd: ReactEvent.Animation.t => unit, - @optional - onAnimationIteration: ReactEvent.Animation.t => unit, - /* Transition events */ - @optional - onTransitionEnd: ReactEvent.Transition.t => unit, - /* svg */ - @optional - accentHeight: string, - @optional - accumulate: string, - @optional - additive: string, - @optional - alignmentBaseline: string, - @optional - allowReorder: string, - @optional - alphabetic: string, - @optional - amplitude: string, - @optional - arabicForm: string, - @optional - ascent: string, - @optional - attributeName: string, - @optional - attributeType: string, - @optional - autoReverse: string, - @optional - azimuth: string, - @optional - baseFrequency: string, - @optional - baseProfile: string, - @optional - baselineShift: string, - @optional - bbox: string, - @optional @as("begin") - begin_: string /* use this one. Previous one is deprecated */, - @optional - bias: string, - @optional - by: string, - @optional - calcMode: string, - @optional - capHeight: string, - @optional - clip: string, - @optional - clipPath: string, - @optional - clipPathUnits: string, - @optional - clipRule: string, - @optional - colorInterpolation: string, - @optional - colorInterpolationFilters: string, - @optional - colorProfile: string, - @optional - colorRendering: string, - @optional - contentScriptType: string, - @optional - contentStyleType: string, - @optional - cursor: string, - @optional - cx: string, - @optional - cy: string, - @optional - d: string, - @optional - decelerate: string, - @optional - descent: string, - @optional - diffuseConstant: string, - @optional - direction: string, - @optional - display: string, - @optional - divisor: string, - @optional - dominantBaseline: string, - @optional - dur: string, - @optional - dx: string, - @optional - dy: string, - @optional - edgeMode: string, - @optional - elevation: string, - @optional - enableBackground: string, - @optional @as("end") - end_: string /* use this one. Previous one is deprecated */, - @optional - exponent: string, - @optional - externalResourcesRequired: string, - @optional - fill: string, - @optional - fillOpacity: string, - @optional - fillRule: string, - @optional - filter: string, - @optional - filterRes: string, - @optional - filterUnits: string, - @optional - floodColor: string, - @optional - floodOpacity: string, - @optional - focusable: string, - @optional - fontFamily: string, - @optional - fontSize: string, - @optional - fontSizeAdjust: string, - @optional - fontStretch: string, - @optional - fontStyle: string, - @optional - fontVariant: string, - @optional - fontWeight: string, - @optional - fomat: string, - @optional - from: string, - @optional - fx: string, - @optional - fy: string, - @optional - g1: string, - @optional - g2: string, - @optional - glyphName: string, - @optional - glyphOrientationHorizontal: string, - @optional - glyphOrientationVertical: string, - @optional - glyphRef: string, - @optional - gradientTransform: string, - @optional - gradientUnits: string, - @optional - hanging: string, - @optional - horizAdvX: string, - @optional - horizOriginX: string, - @optional - ideographic: string, - @optional - imageRendering: string, - @optional @as("in") - in_: string /* use this one. Previous one is deprecated */, - @optional - in2: string, - @optional - intercept: string, - @optional - k: string, - @optional - k1: string, - @optional - k2: string, - @optional - k3: string, - @optional - k4: string, - @optional - kernelMatrix: string, - @optional - kernelUnitLength: string, - @optional - kerning: string, - @optional - keyPoints: string, - @optional - keySplines: string, - @optional - keyTimes: string, - @optional - lengthAdjust: string, - @optional - letterSpacing: string, - @optional - lightingColor: string, - @optional - limitingConeAngle: string, - @optional - local: string, - @optional - markerEnd: string, - @optional - markerHeight: string, - @optional - markerMid: string, - @optional - markerStart: string, - @optional - markerUnits: string, - @optional - markerWidth: string, - @optional - mask: string, - @optional - maskContentUnits: string, - @optional - maskUnits: string, - @optional - mathematical: string, - @optional - mode: string, - @optional - numOctaves: string, - @optional - offset: string, - @optional - opacity: string, - @optional - operator: string, - @optional - order: string, - @optional - orient: string, - @optional - orientation: string, - @optional - origin: string, - @optional - overflow: string, - @optional - overflowX: string, - @optional - overflowY: string, - @optional - overlinePosition: string, - @optional - overlineThickness: string, - @optional - paintOrder: string, - @optional - panose1: string, - @optional - pathLength: string, - @optional - patternContentUnits: string, - @optional - patternTransform: string, - @optional - patternUnits: string, - @optional - pointerEvents: string, - @optional - points: string, - @optional - pointsAtX: string, - @optional - pointsAtY: string, - @optional - pointsAtZ: string, - @optional - preserveAlpha: string, - @optional - preserveAspectRatio: string, - @optional - primitiveUnits: string, - @optional - r: string, - @optional - radius: string, - @optional - refX: string, - @optional - refY: string, - @optional - renderingIntent: string, - @optional - repeatCount: string, - @optional - repeatDur: string, - @optional - requiredExtensions: string, - @optional - requiredFeatures: string, - @optional - restart: string, - @optional - result: string, - @optional - rotate: string, - @optional - rx: string, - @optional - ry: string, - @optional - scale: string, - @optional - seed: string, - @optional - shapeRendering: string, - @optional - slope: string, - @optional - spacing: string, - @optional - specularConstant: string, - @optional - specularExponent: string, - @optional - speed: string, - @optional - spreadMethod: string, - @optional - startOffset: string, - @optional - stdDeviation: string, - @optional - stemh: string, - @optional - stemv: string, - @optional - stitchTiles: string, - @optional - stopColor: string, - @optional - stopOpacity: string, - @optional - strikethroughPosition: string, - @optional - strikethroughThickness: string, - @optional - string: string, - @optional - stroke: string, - @optional - strokeDasharray: string, - @optional - strokeDashoffset: string, - @optional - strokeLinecap: string, - @optional - strokeLinejoin: string, - @optional - strokeMiterlimit: string, - @optional - strokeOpacity: string, - @optional - strokeWidth: string, - @optional - surfaceScale: string, - @optional - systemLanguage: string, - @optional - tableValues: string, - @optional - targetX: string, - @optional - targetY: string, - @optional - textAnchor: string, - @optional - textDecoration: string, - @optional - textLength: string, - @optional - textRendering: string, - @optional @as("to") - to_: string /* use this one. Previous one is deprecated */, - @optional - transform: string, - @optional - u1: string, - @optional - u2: string, - @optional - underlinePosition: string, - @optional - underlineThickness: string, - @optional - unicode: string, - @optional - unicodeBidi: string, - @optional - unicodeRange: string, - @optional - unitsPerEm: string, - @optional - vAlphabetic: string, - @optional - vHanging: string, - @optional - vIdeographic: string, - @optional - vMathematical: string, - @optional - values: string, - @optional - vectorEffect: string, - @optional - version: string, - @optional - vertAdvX: string, - @optional - vertAdvY: string, - @optional - vertOriginX: string, - @optional - vertOriginY: string, - @optional - viewBox: string, - @optional - viewTarget: string, - @optional - visibility: string, - /* width::string? => */ - @optional - widths: string, - @optional - wordSpacing: string, - @optional - writingMode: string, - @optional - x: string, - @optional - x1: string, - @optional - x2: string, - @optional - xChannelSelector: string, - @optional - xHeight: string, - @optional - xlinkActuate: string, - @optional - xlinkArcrole: string, - @optional - xlinkHref: string, - @optional - xlinkRole: string, - @optional - xlinkShow: string, - @optional - xlinkTitle: string, - @optional - xlinkType: string, - @optional - xmlns: string, - @optional - xmlnsXlink: string, - @optional - xmlBase: string, - @optional - xmlLang: string, - @optional - xmlSpace: string, - @optional - y: string, - @optional - y1: string, - @optional - y2: string, - @optional - yChannelSelector: string, - @optional - z: string, - @optional - zoomAndPan: string, - /* RDFa */ - @optional - about: string, - @optional - datatype: string, - @optional - inlist: string, - @optional - prefix: string, - @optional - property: string, - @optional - resource: string, - @optional - typeof: string, - @optional - vocab: string, - /* react-specific */ - @optional - dangerouslySetInnerHTML: {"__html": string}, - @optional - suppressContentEditableWarning: bool, - } -} - @variadic @module("react") external createElement: (string, ~props: domProps=?, array) => React.element = "createElement" @@ -1120,8 +70,4 @@ external jsxs: (string, JsxDOM.domProps) => Jsx.element = "jsxs" @module("react/jsx-runtime") external jsxsKeyed: (string, JsxDOM.domProps, ~key: string=?, @ignore unit) => Jsx.element = "jsxs" -// Currently, not used by JSX ppx -@deprecated("Please use ReactDOM.createElement instead.") -external stringToComponent: string => React.component<'a> = "%identity" - module Style = ReactDOMStyle diff --git a/src/ReactDOMStyle.res b/src/ReactDOMStyle.res index 0f57b7a..ae68d03 100644 --- a/src/ReactDOMStyle.res +++ b/src/ReactDOMStyle.res @@ -1,426 +1,5 @@ type t = JsxDOMStyle.t -@deprecated("Please directly construct the style record instead") @obj -external make: ( - ~azimuth: string=?, - ~backdropFilter: string=?, - ~background: string=?, - ~backgroundAttachment: string=?, - ~backgroundColor: string=?, - ~backgroundImage: string=?, - ~backgroundPosition: string=?, - ~backgroundRepeat: string=?, - ~border: string=?, - ~borderCollapse: string=?, - ~borderColor: string=?, - ~borderSpacing: string=?, - ~borderStyle: string=?, - ~borderTop: string=?, - ~borderRight: string=?, - ~borderBottom: string=?, - ~borderLeft: string=?, - ~borderTopColor: string=?, - ~borderRightColor: string=?, - ~borderBottomColor: string=?, - ~borderLeftColor: string=?, - ~borderTopStyle: string=?, - ~borderRightStyle: string=?, - ~borderBottomStyle: string=?, - ~borderLeftStyle: string=?, - ~borderTopWidth: string=?, - ~borderRightWidth: string=?, - ~borderBottomWidth: string=?, - ~borderLeftWidth: string=?, - ~borderWidth: string=?, - ~bottom: string=?, - ~captionSide: string=?, - ~clear: string=?, - ~clip: string=?, - ~color: string=?, - ~content: string=?, - ~counterIncrement: string=?, - ~counterReset: string=?, - ~cue: string=?, - ~cueAfter: string=?, - ~cueBefore: string=?, - ~cursor: string=?, - ~direction: string=?, - ~display: string=?, - ~elevation: string=?, - ~emptyCells: string=?, - ~float: string=?, - ~font: string=?, - ~fontFamily: string=?, - ~fontSize: string=?, - ~fontSizeAdjust: string=?, - ~fontStretch: string=?, - ~fontStyle: string=?, - ~fontVariant: string=?, - ~fontWeight: string=?, - ~height: string=?, - ~left: string=?, - ~letterSpacing: string=?, - ~lineHeight: string=?, - ~listStyle: string=?, - ~listStyleImage: string=?, - ~listStylePosition: string=?, - ~listStyleType: string=?, - ~margin: string=?, - ~marginTop: string=?, - ~marginRight: string=?, - ~marginBottom: string=?, - ~marginLeft: string=?, - ~markerOffset: string=?, - ~marks: string=?, - ~maxHeight: string=?, - ~maxWidth: string=?, - ~minHeight: string=?, - ~minWidth: string=?, - ~orphans: string=?, - ~outline: string=?, - ~outlineColor: string=?, - ~outlineStyle: string=?, - ~outlineWidth: string=?, - ~overflow: string=?, - ~overflowX: string=?, - ~overflowY: string=?, - ~padding: string=?, - ~paddingTop: string=?, - ~paddingRight: string=?, - ~paddingBottom: string=?, - ~paddingLeft: string=?, - ~page: string=?, - ~pageBreakAfter: string=?, - ~pageBreakBefore: string=?, - ~pageBreakInside: string=?, - ~pause: string=?, - ~pauseAfter: string=?, - ~pauseBefore: string=?, - ~pitch: string=?, - ~pitchRange: string=?, - ~playDuring: string=?, - ~position: string=?, - ~quotes: string=?, - ~richness: string=?, - ~right: string=?, - ~size: string=?, - ~speak: string=?, - ~speakHeader: string=?, - ~speakNumeral: string=?, - ~speakPunctuation: string=?, - ~speechRate: string=?, - ~stress: string=?, - ~tableLayout: string=?, - ~textAlign: string=?, - ~textDecoration: string=?, - ~textIndent: string=?, - ~textShadow: string=?, - ~textTransform: string=?, - ~top: string=?, - ~unicodeBidi: string=?, - ~verticalAlign: string=?, - ~visibility: string=?, - ~voiceFamily: string=?, - ~volume: string=?, - ~whiteSpace: string=?, - ~widows: string=?, - ~width: string=?, - ~wordSpacing: string=?, - ~zIndex: string=?, - ~opacity: /* Below properties based on https://www.w3.org/Style/CSS/all-properties */ - /* Color Level 3 - REC */ - string=?, - ~backgroundOrigin: /* Backgrounds and Borders Level 3 - CR */ - /* backgroundRepeat - already defined by CSS2Properties */ - /* backgroundAttachment - already defined by CSS2Properties */ - string=?, - ~backgroundSize: string=?, - ~backgroundClip: string=?, - ~borderRadius: string=?, - ~borderTopLeftRadius: string=?, - ~borderTopRightRadius: string=?, - ~borderBottomLeftRadius: string=?, - ~borderBottomRightRadius: string=?, - ~borderImage: string=?, - ~borderImageSource: string=?, - ~borderImageSlice: string=?, - ~borderImageWidth: string=?, - ~borderImageOutset: string=?, - ~borderImageRepeat: string=?, - ~boxShadow: string=?, - ~columns: /* Multi-column Layout - CR */ - string=?, - ~columnCount: string=?, - ~columnFill: string=?, - ~columnGap: string=?, - ~columnRule: string=?, - ~columnRuleColor: string=?, - ~columnRuleStyle: string=?, - ~columnRuleWidth: string=?, - ~columnSpan: string=?, - ~columnWidth: string=?, - ~breakAfter: string=?, - ~breakBefore: string=?, - ~breakInside: string=?, - ~rest: /* Speech - CR */ - string=?, - ~restAfter: string=?, - ~restBefore: string=?, - ~speakAs: string=?, - ~voiceBalance: string=?, - ~voiceDuration: string=?, - ~voicePitch: string=?, - ~voiceRange: string=?, - ~voiceRate: string=?, - ~voiceStress: string=?, - ~voiceVolume: string=?, - ~objectFit: /* Image Values and Replaced Content Level 3 - CR */ - string=?, - ~objectPosition: string=?, - ~imageResolution: string=?, - ~imageOrientation: string=?, - ~alignContent: /* Flexible Box Layout - CR */ - string=?, - ~alignItems: string=?, - ~alignSelf: string=?, - ~flex: string=?, - ~flexBasis: string=?, - ~flexDirection: string=?, - ~flexFlow: string=?, - ~flexGrow: string=?, - ~flexShrink: string=?, - ~flexWrap: string=?, - ~justifyContent: string=?, - ~order: string=?, - ~gap: string=?, - ~textDecorationColor: /* Text Decoration Level 3 - CR */ - /* textDecoration - already defined by CSS2Properties */ - string=?, - ~textDecorationLine: string=?, - ~textDecorationSkip: string=?, - ~textDecorationStyle: string=?, - ~textEmphasis: string=?, - ~textEmphasisColor: string=?, - ~textEmphasisPosition: string=?, - ~textEmphasisStyle: string=?, - ~textUnderlinePosition: /* textShadow - already defined by CSS2Properties */ - string=?, - ~fontFeatureSettings: /* Fonts Level 3 - CR */ - string=?, - ~fontKerning: string=?, - ~fontLanguageOverride: string=?, - ~fontSynthesis: /* fontSizeAdjust - already defined by CSS2Properties */ - /* fontStretch - already defined by CSS2Properties */ - string=?, - ~forntVariantAlternates: string=?, - ~fontVariantCaps: string=?, - ~fontVariantEastAsian: string=?, - ~fontVariantLigatures: string=?, - ~fontVariantNumeric: string=?, - ~fontVariantPosition: string=?, - ~all: /* Cascading and Inheritance Level 3 - CR */ - string=?, - ~glyphOrientationVertical: /* Writing Modes Level 3 - CR */ - string=?, - ~textCombineUpright: string=?, - ~textOrientation: string=?, - ~writingMode: string=?, - ~shapeImageThreshold: /* Shapes Level 1 - CR */ - string=?, - ~shapeMargin: string=?, - ~shapeOutside: string=?, - ~clipPath: /* Masking Level 1 - CR */ - string=?, - ~clipRule: string=?, - ~mask: string=?, - ~maskBorder: string=?, - ~maskBorderMode: string=?, - ~maskBorderOutset: string=?, - ~maskBorderRepeat: string=?, - ~maskBorderSlice: string=?, - ~maskBorderSource: string=?, - ~maskBorderWidth: string=?, - ~maskClip: string=?, - ~maskComposite: string=?, - ~maskImage: string=?, - ~maskMode: string=?, - ~maskOrigin: string=?, - ~maskPosition: string=?, - ~maskRepeat: string=?, - ~maskSize: string=?, - ~maskType: string=?, - ~backgroundBlendMode: /* Compositing and Blending Level 1 - CR */ - string=?, - ~isolation: string=?, - ~mixBlendMode: string=?, - ~boxDecorationBreak: /* Fragmentation Level 3 - CR */ - string=?, - ~boxSizing: /* breakAfter - already defined by Multi-column Layout */ - /* breakBefore - already defined by Multi-column Layout */ - /* breakInside - already defined by Multi-column Layout */ - /* Basic User Interface Level 3 - CR */ - string=?, - ~caretColor: string=?, - ~navDown: string=?, - ~navLeft: string=?, - ~navRight: string=?, - ~navUp: string=?, - ~outlineOffset: string=?, - ~resize: string=?, - ~textOverflow: string=?, - ~grid: /* Grid Layout Level 1 - CR */ - string=?, - ~gridArea: string=?, - ~gridAutoColumns: string=?, - ~gridAutoFlow: string=?, - ~gridAutoRows: string=?, - ~gridColumn: string=?, - ~gridColumnEnd: string=?, - ~gridColumnGap: string=?, - ~gridColumnStart: string=?, - ~gridGap: string=?, - ~gridRow: string=?, - ~gridRowEnd: string=?, - ~gridRowGap: string=?, - ~gridRowStart: string=?, - ~gridTemplate: string=?, - ~gridTemplateAreas: string=?, - ~gridTemplateColumns: string=?, - ~gridTemplateRows: string=?, - ~willChange: /* Will Change Level 1 - CR */ - string=?, - ~hangingPunctuation: /* Text Level 3 - LC */ - string=?, - ~hyphens: string=?, - ~lineBreak: /* letterSpacing - already defined by CSS2Properties */ - string=?, - ~overflowWrap: string=?, - ~tabSize: string=?, - ~textAlignLast: /* textAlign - already defined by CSS2Properties */ - string=?, - ~textJustify: string=?, - ~wordBreak: string=?, - ~wordWrap: string=?, - ~animation: /* Animations - WD */ - string=?, - ~animationDelay: string=?, - ~animationDirection: string=?, - ~animationDuration: string=?, - ~animationFillMode: string=?, - ~animationIterationCount: string=?, - ~animationName: string=?, - ~animationPlayState: string=?, - ~animationTimingFunction: string=?, - ~transition: /* Transitions - WD */ - string=?, - ~transitionDelay: string=?, - ~transitionDuration: string=?, - ~transitionProperty: string=?, - ~transitionTimingFunction: string=?, - ~backfaceVisibility: /* Transforms Level 1 - WD */ - string=?, - ~perspective: string=?, - ~perspectiveOrigin: string=?, - ~transform: string=?, - ~transformOrigin: string=?, - ~transformStyle: string=?, - ~justifyItems: /* Box Alignment Level 3 - WD */ - /* alignContent - already defined by Flexible Box Layout */ - /* alignItems - already defined by Flexible Box Layout */ - string=?, - ~justifySelf: string=?, - ~placeContent: string=?, - ~placeItems: string=?, - ~placeSelf: string=?, - ~appearance: /* Basic User Interface Level 4 - FPWD */ - string=?, - ~caret: string=?, - ~caretAnimation: string=?, - ~caretShape: string=?, - ~userSelect: string=?, - ~maxLines: /* Overflow Level 3 - WD */ - string=?, - ~marqueeDirection: /* Basix Box Model - WD */ - string=?, - ~marqueeLoop: string=?, - ~marqueeSpeed: string=?, - ~marqueeStyle: string=?, - ~overflowStyle: string=?, - ~rotation: string=?, - ~rotationPoint: string=?, - ~alignmentBaseline: /* SVG 1.1 - REC */ - string=?, - ~baselineShift: string=?, - ~clip: string=?, - ~clipPath: string=?, - ~clipRule: string=?, - ~colorInterpolation: string=?, - ~colorInterpolationFilters: string=?, - ~colorProfile: string=?, - ~colorRendering: string=?, - ~cursor: string=?, - ~dominantBaseline: string=?, - ~fill: string=?, - ~fillOpacity: string=?, - ~fillRule: string=?, - ~filter: string=?, - ~floodColor: string=?, - ~floodOpacity: string=?, - ~glyphOrientationHorizontal: string=?, - ~glyphOrientationVertical: string=?, - ~imageRendering: string=?, - ~kerning: string=?, - ~lightingColor: string=?, - ~markerEnd: string=?, - ~markerMid: string=?, - ~markerStart: string=?, - ~pointerEvents: string=?, - ~shapeRendering: string=?, - ~stopColor: string=?, - ~stopOpacity: string=?, - ~stroke: string=?, - ~strokeDasharray: string=?, - ~strokeDashoffset: string=?, - ~strokeLinecap: string=?, - ~strokeLinejoin: string=?, - ~strokeMiterlimit: string=?, - ~strokeOpacity: string=?, - ~strokeWidth: string=?, - ~textAnchor: string=?, - ~textRendering: string=?, - ~rubyAlign: /* Ruby Layout Level 1 - WD */ - string=?, - ~rubyMerge: string=?, - ~rubyPosition: string=?, - /* Lists and Counters Level 3 - WD */ - /* listStyle - already defined by CSS2Properties */ - /* listStyleImage - already defined by CSS2Properties */ - /* listStylePosition - already defined by CSS2Properties */ - /* listStyleType - already defined by CSS2Properties */ - /* counterIncrement - already defined by CSS2Properties */ - /* counterReset - already defined by CSS2Properties */ - /* Not added yet - * ------------- - * Generated Content for Paged Media - WD - * Generated Content Level 3 - WD - * Line Grid Level 1 - WD - * Regions - WD - * Inline Layout Level 3 - WD - * Round Display Level 1 - WD - * Image Values and Replaced Content Level 4 - WD - * Positioned Layout Level 3 - WD - * Filter Effects Level 1 - -WD - * Exclusions Level 1 - WD - * Text Level 4 - FPWD - * SVG Markers - FPWD - * Motion Path Level 1 - FPWD - * Color Level 4 - FPWD - * SVG Strokes - FPWD - * Table Level 3 - FPWD - */ - unit, -) => t = "" - /* CSS2Properties: https://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSS2Properties */ @val external combine: (@as(json`{}`) _, t, t) => t = "Object.assign"