dom: remove X* = ref XObj [backport] (#20910)
dom: remove X* = ref XObj
This commit is contained in:
parent
9c5061eab7
commit
ce971400c0
1 changed files with 37 additions and 76 deletions
113
lib/js/dom.nim
113
lib/js/dom.nim
|
|
@ -48,8 +48,7 @@ const
|
||||||
DomApiVersion* = 3 ## the version of DOM API we try to follow. No guarantees though.
|
DomApiVersion* = 3 ## the version of DOM API we try to follow. No guarantees though.
|
||||||
|
|
||||||
type
|
type
|
||||||
EventTarget* = ref EventTargetObj
|
EventTarget* {.importc.} = ref object of RootObj
|
||||||
EventTargetObj {.importc.} = object of RootObj
|
|
||||||
onabort*: proc (event: Event) {.closure.}
|
onabort*: proc (event: Event) {.closure.}
|
||||||
onblur*: proc (event: Event) {.closure.}
|
onblur*: proc (event: Event) {.closure.}
|
||||||
onchange*: proc (event: Event) {.closure.}
|
onchange*: proc (event: Event) {.closure.}
|
||||||
|
|
@ -160,8 +159,7 @@ type
|
||||||
|
|
||||||
Storage* {.importc.} = ref object
|
Storage* {.importc.} = ref object
|
||||||
|
|
||||||
Window* = ref WindowObj
|
Window* {.importc.} = ref object of EventTarget
|
||||||
WindowObj {.importc.} = object of EventTargetObj
|
|
||||||
document*: Document
|
document*: Document
|
||||||
event*: Event
|
event*: Event
|
||||||
history*: History
|
history*: History
|
||||||
|
|
@ -190,11 +188,9 @@ type
|
||||||
sessionStorage*: Storage
|
sessionStorage*: Storage
|
||||||
parent*: Window
|
parent*: Window
|
||||||
|
|
||||||
Frame* = ref FrameObj
|
Frame* {.importc.} = ref object of Window
|
||||||
FrameObj {.importc.} = object of WindowObj
|
|
||||||
|
|
||||||
ClassList* = ref ClassListObj
|
ClassList* {.importc.} = ref object of RootObj
|
||||||
ClassListObj {.importc.} = object of RootObj
|
|
||||||
|
|
||||||
NodeType* = enum
|
NodeType* = enum
|
||||||
ElementNode = 1,
|
ElementNode = 1,
|
||||||
|
|
@ -210,8 +206,7 @@ type
|
||||||
DocumentFragmentNode,
|
DocumentFragmentNode,
|
||||||
NotationNode
|
NotationNode
|
||||||
|
|
||||||
Node* = ref NodeObj
|
Node* {.importc.} = ref object of EventTarget
|
||||||
NodeObj {.importc.} = object of EventTargetObj
|
|
||||||
attributes*: seq[Node]
|
attributes*: seq[Node]
|
||||||
childNodes*: seq[Node]
|
childNodes*: seq[Node]
|
||||||
children*: seq[Node]
|
children*: seq[Node]
|
||||||
|
|
@ -235,8 +230,7 @@ type
|
||||||
parentElement*: Element
|
parentElement*: Element
|
||||||
isConnected*: bool
|
isConnected*: bool
|
||||||
|
|
||||||
Document* = ref DocumentObj
|
Document* {.importc.} = ref object of Node
|
||||||
DocumentObj {.importc.} = object of NodeObj
|
|
||||||
activeElement*: Element
|
activeElement*: Element
|
||||||
documentElement*: Element
|
documentElement*: Element
|
||||||
alinkColor*: cstring
|
alinkColor*: cstring
|
||||||
|
|
@ -263,8 +257,7 @@ type
|
||||||
links*: seq[LinkElement]
|
links*: seq[LinkElement]
|
||||||
fonts*: FontFaceSet
|
fonts*: FontFaceSet
|
||||||
|
|
||||||
Element* = ref ElementObj
|
Element* {.importc.} = ref object of Node
|
||||||
ElementObj {.importc.} = object of NodeObj
|
|
||||||
className*: cstring
|
className*: cstring
|
||||||
classList*: ClassList
|
classList*: ClassList
|
||||||
checked*: bool
|
checked*: bool
|
||||||
|
|
@ -285,8 +278,7 @@ type
|
||||||
offsetLeft*: int
|
offsetLeft*: int
|
||||||
offsetTop*: int
|
offsetTop*: int
|
||||||
|
|
||||||
ValidityState* = ref ValidityStateObj ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/ValidityState>`_
|
ValidityState* {.importc.} = ref object ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/ValidityState>`_
|
||||||
ValidityStateObj {.importc.} = object
|
|
||||||
badInput*: bool
|
badInput*: bool
|
||||||
customError*: bool
|
customError*: bool
|
||||||
patternMismatch*: bool
|
patternMismatch*: bool
|
||||||
|
|
@ -299,25 +291,21 @@ type
|
||||||
valid*: bool
|
valid*: bool
|
||||||
valueMissing*: bool
|
valueMissing*: bool
|
||||||
|
|
||||||
Blob* = ref BlobObj ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/Blob>`_
|
Blob* {.importc.} = ref object of RootObj ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/Blob>`_
|
||||||
BlobObj {.importc.} = object of RootObj
|
|
||||||
size*: int
|
size*: int
|
||||||
`type`*: cstring
|
`type`*: cstring
|
||||||
|
|
||||||
File* = ref FileObj ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/File>`_
|
File* {.importc.} = ref object of Blob ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/File>`_
|
||||||
FileObj {.importc.} = object of Blob
|
|
||||||
lastModified*: int
|
lastModified*: int
|
||||||
name*: cstring
|
name*: cstring
|
||||||
|
|
||||||
TextAreaElement* = ref TextAreaElementObj ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement>`_
|
TextAreaElement* {.importc.} = ref object of Element ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement>`_
|
||||||
TextAreaElementObj {.importc.} = object of Element
|
|
||||||
value*: cstring
|
value*: cstring
|
||||||
selectionStart*, selectionEnd*: int
|
selectionStart*, selectionEnd*: int
|
||||||
selectionDirection*: cstring
|
selectionDirection*: cstring
|
||||||
rows*, cols*: int
|
rows*, cols*: int
|
||||||
|
|
||||||
InputElement* = ref InputElementObj ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement>`_
|
InputElement* {.importc.} = ref object of Element ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement>`_
|
||||||
InputElementObj {.importc.} = object of Element
|
|
||||||
# Properties related to the parent form
|
# Properties related to the parent form
|
||||||
formAction*: cstring
|
formAction*: cstring
|
||||||
formEncType*: cstring
|
formEncType*: cstring
|
||||||
|
|
@ -369,15 +357,13 @@ type
|
||||||
valueAsDate*: cstring
|
valueAsDate*: cstring
|
||||||
valueAsNumber*: float
|
valueAsNumber*: float
|
||||||
|
|
||||||
LinkElement* = ref LinkObj
|
LinkElement* {.importc.} = ref object of Element
|
||||||
LinkObj {.importc.} = object of ElementObj
|
|
||||||
target*: cstring
|
target*: cstring
|
||||||
text*: cstring
|
text*: cstring
|
||||||
x*: int
|
x*: int
|
||||||
y*: int
|
y*: int
|
||||||
|
|
||||||
EmbedElement* = ref EmbedObj
|
EmbedElement* {.importc.} = ref object of Element
|
||||||
EmbedObj {.importc.} = object of ElementObj
|
|
||||||
height*: int
|
height*: int
|
||||||
hspace*: int
|
hspace*: int
|
||||||
src*: cstring
|
src*: cstring
|
||||||
|
|
@ -385,21 +371,18 @@ type
|
||||||
`type`*: cstring
|
`type`*: cstring
|
||||||
vspace*: int
|
vspace*: int
|
||||||
|
|
||||||
AnchorElement* = ref AnchorObj
|
AnchorElement* {.importc.} = ref object of Element
|
||||||
AnchorObj {.importc.} = object of ElementObj
|
|
||||||
text*: cstring
|
text*: cstring
|
||||||
x*, y*: int
|
x*, y*: int
|
||||||
|
|
||||||
OptionElement* = ref OptionObj
|
OptionElement* {.importc.} = ref object of Element
|
||||||
OptionObj {.importc.} = object of ElementObj
|
|
||||||
defaultSelected*: bool
|
defaultSelected*: bool
|
||||||
selected*: bool
|
selected*: bool
|
||||||
selectedIndex*: int
|
selectedIndex*: int
|
||||||
text*: cstring
|
text*: cstring
|
||||||
value*: cstring
|
value*: cstring
|
||||||
|
|
||||||
FormElement* = ref FormObj ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement>`_
|
FormElement* {.importc.} = ref object of Element ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement>`_
|
||||||
FormObj {.importc.} = object of ElementObj
|
|
||||||
acceptCharset*: cstring
|
acceptCharset*: cstring
|
||||||
action*: cstring
|
action*: cstring
|
||||||
autocomplete*: cstring
|
autocomplete*: cstring
|
||||||
|
|
@ -411,8 +394,7 @@ type
|
||||||
noValidate*: bool
|
noValidate*: bool
|
||||||
target*: cstring
|
target*: cstring
|
||||||
|
|
||||||
ImageElement* = ref ImageObj
|
ImageElement* {.importc.} = ref object of Element
|
||||||
ImageObj {.importc.} = object of ElementObj
|
|
||||||
border*: int
|
border*: int
|
||||||
complete*: bool
|
complete*: bool
|
||||||
height*: int
|
height*: int
|
||||||
|
|
@ -422,8 +404,7 @@ type
|
||||||
vspace*: int
|
vspace*: int
|
||||||
width*: int
|
width*: int
|
||||||
|
|
||||||
Style* = ref StyleObj
|
Style* {.importc.} = ref object of RootObj
|
||||||
StyleObj {.importc.} = object of RootObj
|
|
||||||
alignContent*: cstring
|
alignContent*: cstring
|
||||||
alignItems*: cstring
|
alignItems*: cstring
|
||||||
alignSelf*: cstring
|
alignSelf*: cstring
|
||||||
|
|
@ -799,8 +780,7 @@ type
|
||||||
AtTarget,
|
AtTarget,
|
||||||
BubblingPhase
|
BubblingPhase
|
||||||
|
|
||||||
Event* = ref EventObj ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/Event>`_
|
Event* {.importc.} = ref object of RootObj ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/Event>`_
|
||||||
EventObj {.importc.} = object of RootObj
|
|
||||||
bubbles*: bool
|
bubbles*: bool
|
||||||
cancelBubble*: bool
|
cancelBubble*: bool
|
||||||
cancelable*: bool
|
cancelable*: bool
|
||||||
|
|
@ -812,13 +792,11 @@ type
|
||||||
`type`*: cstring
|
`type`*: cstring
|
||||||
isTrusted*: bool
|
isTrusted*: bool
|
||||||
|
|
||||||
UIEvent* = ref UIEventObj ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/UIEvent>`_
|
UIEvent* {.importc.} = ref object of Event ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/UIEvent>`_
|
||||||
UIEventObj {.importc.} = object of Event
|
|
||||||
detail*: int64
|
detail*: int64
|
||||||
view*: Window
|
view*: Window
|
||||||
|
|
||||||
KeyboardEvent* = ref KeyboardEventObj ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent>`_
|
KeyboardEvent* {.importc.} = ref object of UIEvent ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent>`_
|
||||||
KeyboardEventObj {.importc.} = object of UIEvent
|
|
||||||
altKey*, ctrlKey*, metaKey*, shiftKey*: bool
|
altKey*, ctrlKey*, metaKey*, shiftKey*: bool
|
||||||
code*: cstring
|
code*: cstring
|
||||||
isComposing*: bool
|
isComposing*: bool
|
||||||
|
|
@ -1180,8 +1158,7 @@ type
|
||||||
FourthButton = 8,
|
FourthButton = 8,
|
||||||
FifthButton = 16
|
FifthButton = 16
|
||||||
|
|
||||||
MouseEvent* = ref MouseEventObj ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent>`_
|
MouseEvent* {.importc.} = ref object of UIEvent ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent>`_
|
||||||
MouseEventObj {.importc.} = object of UIEvent
|
|
||||||
altKey*, ctrlKey*, metaKey*, shiftKey*: bool
|
altKey*, ctrlKey*, metaKey*, shiftKey*: bool
|
||||||
button*: int
|
button*: int
|
||||||
buttons*: int
|
buttons*: int
|
||||||
|
|
@ -1198,13 +1175,11 @@ type
|
||||||
File = "file",
|
File = "file",
|
||||||
String = "string"
|
String = "string"
|
||||||
|
|
||||||
DataTransferItem* = ref DataTransferItemObj ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem>`_
|
DataTransferItem* {.importc.} = ref object of RootObj ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem>`_
|
||||||
DataTransferItemObj {.importc.} = object of RootObj
|
|
||||||
kind*: cstring
|
kind*: cstring
|
||||||
`type`*: cstring
|
`type`*: cstring
|
||||||
|
|
||||||
DataTransfer* = ref DataTransferObj ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer>`_
|
DataTransfer* {.importc.} = ref object of RootObj ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer>`_
|
||||||
DataTransferObj {.importc.} = object of RootObj
|
|
||||||
dropEffect*: cstring
|
dropEffect*: cstring
|
||||||
effectAllowed*: cstring
|
effectAllowed*: cstring
|
||||||
files*: seq[Element]
|
files*: seq[Element]
|
||||||
|
|
@ -1246,8 +1221,7 @@ type
|
||||||
## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent>`_
|
## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent>`_
|
||||||
clipboardData*: DataTransfer
|
clipboardData*: DataTransfer
|
||||||
|
|
||||||
StorageEvent* = ref StorageEventObj ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/StorageEvent>`_
|
StorageEvent* {.importc.} = ref object of Event ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/StorageEvent>`_
|
||||||
StorageEventObj {.importc.} = object of Event
|
|
||||||
key*: cstring
|
key*: cstring
|
||||||
newValue*, oldValue*: cstring
|
newValue*, oldValue*: cstring
|
||||||
storageArea*: Storage
|
storageArea*: Storage
|
||||||
|
|
@ -1256,8 +1230,7 @@ type
|
||||||
TouchList* {.importc.} = ref object of RootObj
|
TouchList* {.importc.} = ref object of RootObj
|
||||||
length*: int
|
length*: int
|
||||||
|
|
||||||
Touch* = ref TouchObj
|
Touch* {.importc.} = ref object of RootObj
|
||||||
TouchObj {.importc.} = object of RootObj
|
|
||||||
identifier*: int
|
identifier*: int
|
||||||
screenX*, screenY*, clientX*, clientY*, pageX*, pageY*: int
|
screenX*, screenY*, clientX*, clientY*, pageX*, pageY*: int
|
||||||
target*: Element
|
target*: Element
|
||||||
|
|
@ -1265,12 +1238,10 @@ type
|
||||||
rotationAngle*: int
|
rotationAngle*: int
|
||||||
force*: float
|
force*: float
|
||||||
|
|
||||||
TouchEvent* = ref TouchEventObj
|
TouchEvent* {.importc.} = ref object of UIEvent
|
||||||
TouchEventObj {.importc.} = object of UIEvent
|
|
||||||
changedTouches*, targetTouches*, touches*: seq[Touch]
|
changedTouches*, targetTouches*, touches*: seq[Touch]
|
||||||
|
|
||||||
Location* = ref LocationObj
|
Location* {.importc.} = ref object of RootObj
|
||||||
LocationObj {.importc.} = object of RootObj
|
|
||||||
hash*: cstring
|
hash*: cstring
|
||||||
host*: cstring
|
host*: cstring
|
||||||
hostname*: cstring
|
hostname*: cstring
|
||||||
|
|
@ -1281,12 +1252,10 @@ type
|
||||||
search*: cstring
|
search*: cstring
|
||||||
origin*: cstring
|
origin*: cstring
|
||||||
|
|
||||||
History* = ref HistoryObj
|
History* {.importc.} = ref object of RootObj
|
||||||
HistoryObj {.importc.} = object of RootObj
|
|
||||||
length*: int
|
length*: int
|
||||||
|
|
||||||
Navigator* = ref NavigatorObj
|
Navigator* {.importc.} = ref object of RootObj
|
||||||
NavigatorObj {.importc.} = object of RootObj
|
|
||||||
appCodeName*: cstring
|
appCodeName*: cstring
|
||||||
appName*: cstring
|
appName*: cstring
|
||||||
appVersion*: cstring
|
appVersion*: cstring
|
||||||
|
|
@ -1324,8 +1293,7 @@ type
|
||||||
ToolBar* = LocationBar
|
ToolBar* = LocationBar
|
||||||
StatusBar* = LocationBar
|
StatusBar* = LocationBar
|
||||||
|
|
||||||
Screen = ref ScreenObj
|
Screen* {.importc.} = ref object of RootObj
|
||||||
ScreenObj {.importc.} = object of RootObj
|
|
||||||
availHeight*: int
|
availHeight*: int
|
||||||
availWidth*: int
|
availWidth*: int
|
||||||
colorDepth*: int
|
colorDepth*: int
|
||||||
|
|
@ -1355,8 +1323,7 @@ type
|
||||||
`block`*: cstring
|
`block`*: cstring
|
||||||
inline*: cstring
|
inline*: cstring
|
||||||
|
|
||||||
MediaQueryList* = ref MediaQueryListObj
|
MediaQueryList* {.importc.} = ref object of EventTarget
|
||||||
MediaQueryListObj {.importc.} = object of EventTargetObj
|
|
||||||
matches*: bool
|
matches*: bool
|
||||||
media*: cstring
|
media*: cstring
|
||||||
|
|
||||||
|
|
@ -1371,31 +1338,26 @@ since (1, 3):
|
||||||
## discard prsr.parseFromString("<html><marquee>Hello World</marquee></html>".cstring, "text/html".cstring)
|
## discard prsr.parseFromString("<html><marquee>Hello World</marquee></html>".cstring, "text/html".cstring)
|
||||||
## ```
|
## ```
|
||||||
|
|
||||||
DomException* = ref DOMExceptionObj
|
DomException* {.importc.} = ref object
|
||||||
## The DOMException interface represents an abnormal event (called an exception)
|
## The DOMException interface represents an abnormal event (called an exception)
|
||||||
## which occurs as a result of calling a method or accessing a property of a web API.
|
## which occurs as a result of calling a method or accessing a property of a web API.
|
||||||
## Each exception has a name, which is a short "CamelCase" style string identifying
|
## Each exception has a name, which is a short "CamelCase" style string identifying
|
||||||
## the error or abnormal condition.
|
## the error or abnormal condition.
|
||||||
## https://developer.mozilla.org/en-US/docs/Web/API/DOMException
|
## https://developer.mozilla.org/en-US/docs/Web/API/DOMException
|
||||||
|
|
||||||
DOMExceptionObj {.importc.} = object
|
FileReader* {.importc.} = ref object of EventTarget
|
||||||
|
|
||||||
FileReader* = ref FileReaderObj
|
|
||||||
## The FileReader object lets web applications asynchronously read the contents of files
|
## The FileReader object lets web applications asynchronously read the contents of files
|
||||||
## (or raw data buffers) stored on the user's computer, using File or Blob objects to specify
|
## (or raw data buffers) stored on the user's computer, using File or Blob objects to specify
|
||||||
## the file or data to read.
|
## the file or data to read.
|
||||||
## https://developer.mozilla.org/en-US/docs/Web/API/FileReader
|
## https://developer.mozilla.org/en-US/docs/Web/API/FileReader
|
||||||
|
|
||||||
FileReaderObj {.importc.} = object of EventTargetObj
|
|
||||||
|
|
||||||
FileReaderState* = distinct range[0'u16..2'u16]
|
FileReaderState* = distinct range[0'u16..2'u16]
|
||||||
RootNodeOptions* = object of RootObj
|
RootNodeOptions* = object of RootObj
|
||||||
composed*: bool
|
composed*: bool
|
||||||
DocumentOrShadowRoot* {.importc.} = object of RootObj
|
DocumentOrShadowRoot* {.importc.} = object of RootObj
|
||||||
activeElement*: Element
|
activeElement*: Element
|
||||||
# styleSheets*: StyleSheetList
|
# styleSheets*: StyleSheetList
|
||||||
ShadowRoot* = ref ShadowRootObj
|
ShadowRoot* {.importc.} = ref object of DocumentOrShadowRoot
|
||||||
ShadowRootObj {.importc.} = object of DocumentOrShadowRoot
|
|
||||||
delegatesFocus*: bool
|
delegatesFocus*: bool
|
||||||
host*: Element
|
host*: Element
|
||||||
innerHTML*: cstring
|
innerHTML*: cstring
|
||||||
|
|
@ -1404,8 +1366,7 @@ since (1, 3):
|
||||||
mode*: cstring
|
mode*: cstring
|
||||||
delegatesFocus*: bool
|
delegatesFocus*: bool
|
||||||
|
|
||||||
HTMLSlotElement* = ref HTMLSlotElementObj
|
HTMLSlotElement* {.importc.} = ref object of RootObj
|
||||||
HTMLSlotElementObj {.importc.} = object of RootObj
|
|
||||||
name*: cstring
|
name*: cstring
|
||||||
SlotOptions* = object of RootObj
|
SlotOptions* = object of RootObj
|
||||||
flatten*: bool
|
flatten*: bool
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue