From 0d35abb2f7ac78895c938275ce69f625b81a31df Mon Sep 17 00:00:00 2001
From: eleliauk <2831336720@qq.com>
Date: Fri, 5 Jul 2024 08:58:17 +0800
Subject: [PATCH 01/13] =?UTF-8?q?feat:=E5=AE=8C=E6=88=90JSX=20=E7=B1=BB?=
=?UTF-8?q?=E5=9E=8B=E8=A1=A5=E5=85=A8=E9=83=A8=E5=88=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/inula/src/types.ts | 1160 ++++++++++++++++++++++++++++++++++-
1 file changed, 1157 insertions(+), 3 deletions(-)
diff --git a/packages/inula/src/types.ts b/packages/inula/src/types.ts
index 67db6d32..cc881204 100644
--- a/packages/inula/src/types.ts
+++ b/packages/inula/src/types.ts
@@ -17,6 +17,7 @@ import { Component } from './renderer/components/BaseClassComponent';
import { MutableRef, RefCallBack, RefObject } from './renderer/hooks/HookType';
import * as Event from './EventTypes';
+import Element = JSX.Element;
//
// --------------------------------- Inula Base Types ----------------------------------
@@ -244,6 +245,1152 @@ export type JSXElementConstructor
=
| ((props: P) => InulaElement | null)
| (new (props: P) => Component);
+
+interface ClassAttributes extends Attributes {
+ ref : Ref;
+ key : Key | undefined;
+ jsx : boolean | undefined;
+}
+//让其他代码在值发生变化时得到通知
+interface SignalLike {
+ value: T;
+ peek(): T;
+ subscribe(fn: (value: T) => void): () => void;
+}
+export type Signalish = T | SignalLike;
+export interface DOMAttributes{
+
+ // Image Events
+ onLoad?: GenericEventHandler | undefined;
+ onLoadCapture?: GenericEventHandler | undefined;
+ onError?: GenericEventHandler | undefined;
+ onErrorCapture?: GenericEventHandler | undefined;
+
+ // Clipboard Events
+ onCopy?: ClipboardEventHandler | undefined;
+ onCopyCapture?: ClipboardEventHandler | undefined;
+ onCut?: ClipboardEventHandler | undefined;
+ onCutCapture?: ClipboardEventHandler | undefined;
+ onPaste?: ClipboardEventHandler | undefined;
+ onPasteCapture?: ClipboardEventHandler | undefined;
+ // Composition Events
+ onCompositionEnd?: CompositionEventHandler | undefined;
+ onCompositionEndCapture?: CompositionEventHandler | undefined;
+ onCompositionStart?: CompositionEventHandler | undefined;
+ onCompositionStartCapture?: CompositionEventHandler | undefined;
+ onCompositionUpdate?: CompositionEventHandler | undefined;
+ onCompositionUpdateCapture?: CompositionEventHandler | undefined;
+
+ // Details Events
+ onToggle?: GenericEventHandler | undefined;
+
+ // Dialog Events
+ onClose?: GenericEventHandler | undefined;
+ onCancel?: GenericEventHandler | undefined;
+
+ // Focus Events
+ onFocus?: FocusEventHandler | undefined;
+ onFocusCapture?: FocusEventHandler | undefined;
+ onFocusIn?: FocusEventHandler | undefined;
+ onFocusInCapture?: FocusEventHandler | undefined;
+ onFocusOut?: FocusEventHandler | undefined;
+ onFocusOutCapture?: FocusEventHandler | undefined;
+ onBlur?: FocusEventHandler | undefined;
+ onBlurCapture?: FocusEventHandler | undefined;
+
+ // Form Events
+ onChange?: GenericEventHandler | undefined;
+ onChangeCapture?: GenericEventHandler | undefined;
+ onInput?: FormEventHandler | undefined;
+ onInputCapture?: FormEventHandler | undefined;
+ onBeforeInput?: FormEventHandler | undefined;
+ onBeforeInputCapture?: FormEventHandler | undefined;
+ onSearch?: GenericEventHandler | undefined;
+ onSearchCapture?: GenericEventHandler | undefined;
+ onSubmit?: FormEventHandler | undefined;
+ onSubmitCapture?: FormEventHandler | undefined;
+ onInvalid?: GenericEventHandler | undefined;
+ onInvalidCapture?: GenericEventHandler | undefined;
+ onReset?: GenericEventHandler | undefined;
+ onResetCapture?: GenericEventHandler | undefined;
+ onFormData?: GenericEventHandler | undefined;
+ onFormDataCapture?: GenericEventHandler | undefined;
+
+ // Keyboard Events
+ onKeyDown?: KeyboardEventHandler | undefined;
+ onKeyDownCapture?: KeyboardEventHandler | undefined;
+ onKeyPress?: KeyboardEventHandler | undefined;
+ onKeyPressCapture?: KeyboardEventHandler | undefined;
+ onKeyUp?: KeyboardEventHandler | undefined;
+ onKeyUpCapture?: KeyboardEventHandler | undefined;
+
+ // Media Events
+ onAbort?: GenericEventHandler | undefined;
+ onAbortCapture?: GenericEventHandler | undefined;
+ onCanPlay?: GenericEventHandler | undefined;
+ onCanPlayCapture?: GenericEventHandler | undefined;
+ onCanPlayThrough?: GenericEventHandler | undefined;
+ onCanPlayThroughCapture?: GenericEventHandler | undefined;
+ onDurationChange?: GenericEventHandler | undefined;
+ onDurationChangeCapture?: GenericEventHandler | undefined;
+ onEmptied?: GenericEventHandler | undefined;
+ onEmptiedCapture?: GenericEventHandler | undefined;
+ onEncrypted?: GenericEventHandler | undefined;
+ onEncryptedCapture?: GenericEventHandler | undefined;
+ onEnded?: GenericEventHandler | undefined;
+ onEndedCapture?: GenericEventHandler | undefined;
+ onLoadedData?: GenericEventHandler | undefined;
+ onLoadedDataCapture?: GenericEventHandler | undefined;
+ onLoadedMetadata?: GenericEventHandler | undefined;
+ onLoadedMetadataCapture?: GenericEventHandler | undefined;
+ onLoadStart?: GenericEventHandler | undefined;
+ onLoadStartCapture?: GenericEventHandler | undefined;
+ onPause?: GenericEventHandler | undefined;
+ onPauseCapture?: GenericEventHandler | undefined;
+ onPlay?: GenericEventHandler | undefined;
+ onPlayCapture?: GenericEventHandler | undefined;
+ onPlaying?: GenericEventHandler | undefined;
+ onPlayingCapture?: GenericEventHandler | undefined;
+ onProgress?: GenericEventHandler | undefined;
+ onProgressCapture?: GenericEventHandler | undefined;
+ onRateChange?: GenericEventHandler | undefined;
+ onRateChangeCapture?: GenericEventHandler | undefined;
+ onSeeked?: GenericEventHandler | undefined;
+ onSeekedCapture?: GenericEventHandler | undefined;
+ onSeeking?: GenericEventHandler | undefined;
+ onSeekingCapture?: GenericEventHandler | undefined;
+ onStalled?: GenericEventHandler | undefined;
+ onStalledCapture?: GenericEventHandler | undefined;
+ onSuspend?: GenericEventHandler | undefined;
+ onSuspendCapture?: GenericEventHandler | undefined;
+ onTimeUpdate?: GenericEventHandler | undefined;
+ onTimeUpdateCapture?: GenericEventHandler | undefined;
+ onVolumeChange?: GenericEventHandler | undefined;
+ onVolumeChangeCapture?: GenericEventHandler | undefined;
+ onWaiting?: GenericEventHandler | undefined;
+ onWaitingCapture?: GenericEventHandler | undefined;
+
+ // MouseEvents
+ onClick?: MouseEventHandler | undefined;
+ onClickCapture?: MouseEventHandler | undefined;
+ onContextMenu?: MouseEventHandler | undefined;
+ onContextMenuCapture?: MouseEventHandler | undefined;
+ onDblClick?: MouseEventHandler | undefined;
+ onDblClickCapture?: MouseEventHandler | undefined;
+ onDrag?: DragEventHandler | undefined;
+ onDragCapture?: DragEventHandler | undefined;
+ onDragEnd?: DragEventHandler | undefined;
+ onDragEndCapture?: DragEventHandler | undefined;
+ onDragEnter?: DragEventHandler | undefined;
+ onDragEnterCapture?: DragEventHandler | undefined;
+ onDragExit?: DragEventHandler | undefined;
+ onDragExitCapture?: DragEventHandler | undefined;
+ onDragLeave?: DragEventHandler | undefined;
+ onDragLeaveCapture?: DragEventHandler | undefined;
+ onDragOver?: DragEventHandler | undefined;
+ onDragOverCapture?: DragEventHandler | undefined;
+ onDragStart?: DragEventHandler | undefined;
+ onDragStartCapture?: DragEventHandler | undefined;
+ onDrop?: DragEventHandler | undefined;
+ onDropCapture?: DragEventHandler | undefined;
+ onMouseDown?: MouseEventHandler | undefined;
+ onMouseDownCapture?: MouseEventHandler | undefined;
+ onMouseEnter?: MouseEventHandler | undefined;
+ onMouseEnterCapture?: MouseEventHandler | undefined;
+ onMouseLeave?: MouseEventHandler | undefined;
+ onMouseLeaveCapture?: MouseEventHandler | undefined;
+ onMouseMove?: MouseEventHandler | undefined;
+ onMouseMoveCapture?: MouseEventHandler | undefined;
+ onMouseOut?: MouseEventHandler | undefined;
+ onMouseOutCapture?: MouseEventHandler | undefined;
+ onMouseOver?: MouseEventHandler | undefined;
+ onMouseOverCapture?: MouseEventHandler | undefined;
+ onMouseUp?: MouseEventHandler | undefined;
+ onMouseUpCapture?: MouseEventHandler | undefined;
+
+ // Selection Events
+ onSelect?: GenericEventHandler | undefined;
+ onSelectCapture?: GenericEventHandler | undefined;
+
+ // Touch Events
+ onTouchCancel?: TouchEventHandler | undefined;
+ onTouchCancelCapture?: TouchEventHandler | undefined;
+ onTouchEnd?: TouchEventHandler | undefined;
+ onTouchEndCapture?: TouchEventHandler | undefined;
+ onTouchMove?: TouchEventHandler | undefined;
+ onTouchMoveCapture?: TouchEventHandler | undefined;
+ onTouchStart?: TouchEventHandler | undefined;
+ onTouchStartCapture?: TouchEventHandler | undefined;
+
+ // Pointer Events
+ onPointerOver?: PointerEventHandler | undefined;
+ onPointerOverCapture?: PointerEventHandler | undefined;
+ onPointerEnter?: PointerEventHandler | undefined;
+ onPointerEnterCapture?: PointerEventHandler | undefined;
+ onPointerDown?: PointerEventHandler | undefined;
+ onPointerDownCapture?: PointerEventHandler | undefined;
+ onPointerMove?: PointerEventHandler | undefined;
+ onPointerMoveCapture?: PointerEventHandler | undefined;
+ onPointerUp?: PointerEventHandler | undefined;
+ onPointerUpCapture?: PointerEventHandler | undefined;
+ onPointerCancel?: PointerEventHandler | undefined;
+ onPointerCancelCapture?: PointerEventHandler | undefined;
+ onPointerOut?: PointerEventHandler | undefined;
+ onPointerOutCapture?: PointerEventHandler | undefined;
+ onPointerLeave?: PointerEventHandler | undefined;
+ onPointerLeaveCapture?: PointerEventHandler | undefined;
+ onGotPointerCapture?: PointerEventHandler | undefined;
+ onGotPointerCaptureCapture?: PointerEventHandler | undefined;
+ onLostPointerCapture?: PointerEventHandler | undefined;
+ onLostPointerCaptureCapture?: PointerEventHandler | undefined;
+
+ // UI Events
+ onScroll?: UIEventHandler | undefined;
+ onScrollEnd?: UIEventHandler | undefined;
+ onScrollCapture?: UIEventHandler | undefined;
+
+ // Wheel Events
+ onWheel?: WheelEventHandler | undefined;
+ onWheelCapture?: WheelEventHandler | undefined;
+
+ // Animation Events
+ onAnimationStart?: AnimationEventHandler | undefined;
+ onAnimationStartCapture?: AnimationEventHandler | undefined;
+ onAnimationEnd?: AnimationEventHandler | undefined;
+ onAnimationEndCapture?: AnimationEventHandler | undefined;
+ onAnimationIteration?: AnimationEventHandler | undefined;
+ onAnimationIterationCapture?: AnimationEventHandler | undefined;
+
+ // Transition Events
+ onTransitionCancel?: TransitionEventHandler;
+ onTransitionCancelCapture?: TransitionEventHandler;
+ onTransitionEnd?: TransitionEventHandler;
+ onTransitionEndCapture?: TransitionEventHandler;
+ onTransitionRun?: TransitionEventHandler;
+ onTransitionRunCapture?: TransitionEventHandler;
+ onTransitionStart?: TransitionEventHandler;
+ onTransitionStartCapture?: TransitionEventHandler;
+
+ // PictureInPicture Events
+ onEnterPictureInPicture?: ChangeEventHandler;
+ onEnterPictureInPictureCapture?: ChangeEventHandler;
+ onLeavePictureInPicture?: ChangeEventHandler;
+ onLeavePictureInPictureCapture?: ChangeEventHandler;
+ onResize?: ChangeEventHandler;
+ onResizeCapture?: ChangeEventHandler;
+}
+
+export interface AriaAttributes {
+ /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */
+ 'aria-activedescendant'?: Signalish;
+ /** Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute. */
+ 'aria-atomic'?: Signalish;
+ /**
+ * Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be
+ * presented if they are made.
+ */
+ 'aria-autocomplete'?: Signalish<
+ 'none' | 'inline' | 'list' | 'both' | undefined
+ >;
+ /**
+ * Defines a string value that labels the current element, which is intended to be converted into Braille.
+ * @see aria-label.
+ */
+ 'aria-braillelabel'?: Signalish;
+ /**
+ * Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.
+ * @see aria-roledescription.
+ */
+ 'aria-brailleroledescription'?: Signalish;
+ /** Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user. */
+ 'aria-busy'?: Signalish;
+ /**
+ * Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
+ * @see aria-pressed
+ * @see aria-selected.
+ */
+ 'aria-checked'?: Signalish;
+ /**
+ * Defines the total number of columns in a table, grid, or treegrid.
+ * @see aria-colindex.
+ */
+ 'aria-colcount'?: Signalish;
+ /**
+ * Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.
+ * @see aria-colcount
+ * @see aria-colspan.
+ */
+ 'aria-colindex'?: Signalish;
+ /**
+ * Defines a human readable text alternative of aria-colindex.
+ * @see aria-rowindextext.
+ */
+ 'aria-colindextext'?: Signalish;
+ /**
+ * Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
+ * @see aria-colindex
+ * @see aria-rowspan.
+ */
+ 'aria-colspan'?: Signalish;
+ /**
+ * Identifies the element (or elements) whose contents or presence are controlled by the current element.
+ * @see aria-owns.
+ */
+ 'aria-controls'?: Signalish;
+ /** Indicates the element that represents the current item within a container or set of related elements. */
+ 'aria-current'?: Signalish<
+ Booleanish | 'page' | 'step' | 'location' | 'date' | 'time' | undefined
+ >;
+ /**
+ * Identifies the element (or elements) that describes the object.
+ * @see aria-labelledby
+ */
+ 'aria-describedby'?: Signalish;
+ /**
+ * Defines a string value that describes or annotates the current element.
+ * @see related aria-describedby.
+ */
+ 'aria-description'?: Signalish;
+ /**
+ * Identifies the element that provides a detailed, extended description for the object.
+ * @see aria-describedby.
+ */
+ 'aria-details'?: Signalish;
+ /**
+ * Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
+ * @see aria-hidden
+ * @see aria-readonly.
+ */
+ 'aria-disabled'?: Signalish;
+ /**
+ * Indicates what functions can be performed when a dragged object is released on the drop target.
+ * @deprecated in ARIA 1.1
+ */
+ 'aria-dropeffect'?: Signalish<
+ 'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup' | undefined
+ >;
+ /**
+ * Identifies the element that provides an error message for the object.
+ * @see aria-invalid
+ * @see aria-describedby.
+ */
+ 'aria-errormessage'?: Signalish;
+ /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
+ 'aria-expanded'?: Signalish;
+ /**
+ * Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,
+ * allows assistive technology to override the general default of reading in document source order.
+ */
+ 'aria-flowto'?: Signalish;
+ /**
+ * Indicates an element's "grabbed" state in a drag-and-drop operation.
+ * @deprecated in ARIA 1.1
+ */
+ 'aria-grabbed'?: Signalish;
+ /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
+ 'aria-haspopup'?: Signalish<
+ Booleanish | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | undefined
+ >;
+ /**
+ * Indicates whether the element is exposed to an accessibility API.
+ * @see aria-disabled.
+ */
+ 'aria-hidden'?: Signalish;
+ /**
+ * Indicates the entered value does not conform to the format expected by the application.
+ * @see aria-errormessage.
+ */
+ 'aria-invalid'?: Signalish;
+ /** Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. */
+ 'aria-keyshortcuts'?: Signalish;
+ /**
+ * Defines a string value that labels the current element.
+ * @see aria-labelledby.
+ */
+ 'aria-label'?: Signalish;
+ /**
+ * Identifies the element (or elements) that labels the current element.
+ * @see aria-describedby.
+ */
+ 'aria-labelledby'?: Signalish;
+ /** Defines the hierarchical level of an element within a structure. */
+ 'aria-level'?: Signalish;
+ /** Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region. */
+ 'aria-live'?: Signalish<'off' | 'assertive' | 'polite' | undefined>;
+ /** Indicates whether an element is modal when displayed. */
+ 'aria-modal'?: Signalish;
+ /** Indicates whether a text box accepts multiple lines of input or only a single line. */
+ 'aria-multiline'?: Signalish;
+ /** Indicates that the user may select more than one item from the current selectable descendants. */
+ 'aria-multiselectable'?: Signalish;
+ /** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */
+ 'aria-orientation'?: Signalish<'horizontal' | 'vertical' | undefined>;
+ /**
+ * Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship
+ * between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
+ * @see aria-controls.
+ */
+ 'aria-owns'?: Signalish;
+ /**
+ * Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.
+ * A hint could be a sample value or a brief description of the expected format.
+ */
+ 'aria-placeholder'?: Signalish;
+ /**
+ * Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
+ * @see aria-setsize.
+ */
+ 'aria-posinset'?: Signalish;
+ /**
+ * Indicates the current "pressed" state of toggle buttons.
+ * @see aria-checked
+ * @see aria-selected.
+ */
+ 'aria-pressed'?: Signalish;
+ /**
+ * Indicates that the element is not editable, but is otherwise operable.
+ * @see aria-disabled.
+ */
+ 'aria-readonly'?: Signalish;
+ /**
+ * Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
+ * @see aria-atomic.
+ */
+ 'aria-relevant'?: Signalish<
+ | 'additions'
+ | 'additions removals'
+ | 'additions text'
+ | 'all'
+ | 'removals'
+ | 'removals additions'
+ | 'removals text'
+ | 'text'
+ | 'text additions'
+ | 'text removals'
+ | undefined
+ >;
+ /** Indicates that user input is required on the element before a form may be submitted. */
+ 'aria-required'?: Signalish;
+ /** Defines a human-readable, author-localized description for the role of an element. */
+ 'aria-roledescription'?: Signalish;
+ /**
+ * Defines the total number of rows in a table, grid, or treegrid.
+ * @see aria-rowindex.
+ */
+ 'aria-rowcount'?: Signalish;
+ /**
+ * Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.
+ * @see aria-rowcount
+ * @see aria-rowspan.
+ */
+ 'aria-rowindex'?: Signalish;
+ /**
+ * Defines a human readable text alternative of aria-rowindex.
+ * @see aria-colindextext.
+ */
+ 'aria-rowindextext'?: Signalish;
+ /**
+ * Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
+ * @see aria-rowindex
+ * @see aria-colspan.
+ */
+ 'aria-rowspan'?: Signalish;
+ /**
+ * Indicates the current "selected" state of various widgets.
+ * @see aria-checked
+ * @see aria-pressed.
+ */
+ 'aria-selected'?: Signalish;
+ /**
+ * Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
+ * @see aria-posinset.
+ */
+ 'aria-setsize'?: Signalish;
+ /** Indicates if items in a table or grid are sorted in ascending or descending order. */
+ 'aria-sort'?: Signalish<
+ 'none' | 'ascending' | 'descending' | 'other' | undefined
+ >;
+ /** Defines the maximum allowed value for a range widget. */
+ 'aria-valuemax'?: Signalish;
+ /** Defines the minimum allowed value for a range widget. */
+ 'aria-valuemin'?: Signalish;
+ /**
+ * Defines the current value for a range widget.
+ * @see aria-valuetext.
+ */
+ 'aria-valuenow'?: Signalish;
+ /** Defines the human readable text alternative of aria-valuenow for a range widget. */
+ 'aria-valuetext'?: Signalish;
+}
+// All the WAI-ARIA 1.2 role attribute values from https://www.w3.org/TR/wai-aria-1.2/#role_definitions
+type WAIAriaRole =
+ | 'alert'
+ | 'alertdialog'
+ | 'application'
+ | 'article'
+ | 'banner'
+ | 'blockquote'
+ | 'button'
+ | 'caption'
+ | 'cell'
+ | 'checkbox'
+ | 'code'
+ | 'columnheader'
+ | 'combobox'
+ | 'command'
+ | 'complementary'
+ | 'composite'
+ | 'contentinfo'
+ | 'definition'
+ | 'deletion'
+ | 'dialog'
+ | 'directory'
+ | 'document'
+ | 'emphasis'
+ | 'feed'
+ | 'figure'
+ | 'form'
+ | 'generic'
+ | 'grid'
+ | 'gridcell'
+ | 'group'
+ | 'heading'
+ | 'img'
+ | 'input'
+ | 'insertion'
+ | 'landmark'
+ | 'link'
+ | 'list'
+ | 'listbox'
+ | 'listitem'
+ | 'log'
+ | 'main'
+ | 'marquee'
+ | 'math'
+ | 'meter'
+ | 'menu'
+ | 'menubar'
+ | 'menuitem'
+ | 'menuitemcheckbox'
+ | 'menuitemradio'
+ | 'navigation'
+ | 'none'
+ | 'note'
+ | 'option'
+ | 'paragraph'
+ | 'presentation'
+ | 'progressbar'
+ | 'radio'
+ | 'radiogroup'
+ | 'range'
+ | 'region'
+ | 'roletype'
+ | 'row'
+ | 'rowgroup'
+ | 'rowheader'
+ | 'scrollbar'
+ | 'search'
+ | 'searchbox'
+ | 'section'
+ | 'sectionhead'
+ | 'select'
+ | 'separator'
+ | 'slider'
+ | 'spinbutton'
+ | 'status'
+ | 'strong'
+ | 'structure'
+ | 'subscript'
+ | 'superscript'
+ | 'switch'
+ | 'tab'
+ | 'table'
+ | 'tablist'
+ | 'tabpanel'
+ | 'term'
+ | 'textbox'
+ | 'time'
+ | 'timer'
+ | 'toolbar'
+ | 'tooltip'
+ | 'tree'
+ | 'treegrid'
+ | 'treeitem'
+ | 'widget'
+ | 'window'
+ | 'none presentation';
+
+// All the Digital Publishing WAI-ARIA 1.0 role attribute values from https://www.w3.org/TR/dpub-aria-1.0/#role_definitions
+type DPubAriaRole =
+ | 'doc-abstract'
+ | 'doc-acknowledgments'
+ | 'doc-afterword'
+ | 'doc-appendix'
+ | 'doc-backlink'
+ | 'doc-biblioentry'
+ | 'doc-bibliography'
+ | 'doc-biblioref'
+ | 'doc-chapter'
+ | 'doc-colophon'
+ | 'doc-conclusion'
+ | 'doc-cover'
+ | 'doc-credit'
+ | 'doc-credits'
+ | 'doc-dedication'
+ | 'doc-endnote'
+ | 'doc-endnotes'
+ | 'doc-epigraph'
+ | 'doc-epilogue'
+ | 'doc-errata'
+ | 'doc-example'
+ | 'doc-footnote'
+ | 'doc-foreword'
+ | 'doc-glossary'
+ | 'doc-glossref'
+ | 'doc-index'
+ | 'doc-introduction'
+ | 'doc-noteref'
+ | 'doc-notice'
+ | 'doc-pagebreak'
+ | 'doc-pagelist'
+ | 'doc-part'
+ | 'doc-preface'
+ | 'doc-prologue'
+ | 'doc-pullquote'
+ | 'doc-qna'
+ | 'doc-subtitle'
+ | 'doc-tip'
+ | 'doc-toc';
+//用于处理HTML 属性或其他需要接受布尔值或布尔字符串的地方特别有用
+type Booleanish = boolean | 'true' | 'false';
+type AriaRole = WAIAriaRole | DPubAriaRole;
+export interface HTMLAttributes
+ extends ClassAttributes,
+ DOMAttributes,
+ AriaAttributes {
+ // Standard HTML Attributes
+ accept?: string | undefined | SignalLike;
+ acceptCharset?: string | undefined | SignalLike;
+ 'accept-charset'?: HTMLAttributes['acceptCharset'];
+ accessKey?: string | undefined | SignalLike;
+ accesskey?: HTMLAttributes['accessKey'];
+ action?: string | undefined | SignalLike;
+ allow?: string | undefined | SignalLike;
+ allowFullScreen?: boolean | undefined | SignalLike;
+ allowTransparency?: boolean | undefined | SignalLike;
+ alt?: string | undefined | SignalLike;
+ as?: string | undefined | SignalLike;
+ async?: boolean | undefined | SignalLike;
+ autocomplete?: string | undefined | SignalLike;
+ autoComplete?: string | undefined | SignalLike;
+ autocorrect?: string | undefined | SignalLike