lib/js - Dropped 'T' from types
This commit is contained in:
parent
ea03fc6886
commit
6e8e3fdd23
1 changed files with 74 additions and 68 deletions
142
lib/js/dom.nim
142
lib/js/dom.nim
|
|
@ -14,56 +14,56 @@ when not defined(js) and not defined(Nimdoc):
|
||||||
{.error: "This module only works on the JavaScript platform".}
|
{.error: "This module only works on the JavaScript platform".}
|
||||||
|
|
||||||
type
|
type
|
||||||
TEventHandlers* {.importc.} = object of RootObj
|
EventHandlers* {.importc.} = object of RootObj
|
||||||
onabort*: proc (event: ref TEvent) {.nimcall.}
|
onabort*: proc (event: ref Event) {.nimcall.}
|
||||||
onblur*: proc (event: ref TEvent) {.nimcall.}
|
onblur*: proc (event: ref Event) {.nimcall.}
|
||||||
onchange*: proc (event: ref TEvent) {.nimcall.}
|
onchange*: proc (event: ref Event) {.nimcall.}
|
||||||
onclick*: proc (event: ref TEvent) {.nimcall.}
|
onclick*: proc (event: ref Event) {.nimcall.}
|
||||||
ondblclick*: proc (event: ref TEvent) {.nimcall.}
|
ondblclick*: proc (event: ref Event) {.nimcall.}
|
||||||
onerror*: proc (event: ref TEvent) {.nimcall.}
|
onerror*: proc (event: ref Event) {.nimcall.}
|
||||||
onfocus*: proc (event: ref TEvent) {.nimcall.}
|
onfocus*: proc (event: ref Event) {.nimcall.}
|
||||||
onkeydown*: proc (event: ref TEvent) {.nimcall.}
|
onkeydown*: proc (event: ref Event) {.nimcall.}
|
||||||
onkeypress*: proc (event: ref TEvent) {.nimcall.}
|
onkeypress*: proc (event: ref Event) {.nimcall.}
|
||||||
onkeyup*: proc (event: ref TEvent) {.nimcall.}
|
onkeyup*: proc (event: ref Event) {.nimcall.}
|
||||||
onload*: proc (event: ref TEvent) {.nimcall.}
|
onload*: proc (event: ref Event) {.nimcall.}
|
||||||
onmousedown*: proc (event: ref TEvent) {.nimcall.}
|
onmousedown*: proc (event: ref Event) {.nimcall.}
|
||||||
onmousemove*: proc (event: ref TEvent) {.nimcall.}
|
onmousemove*: proc (event: ref Event) {.nimcall.}
|
||||||
onmouseout*: proc (event: ref TEvent) {.nimcall.}
|
onmouseout*: proc (event: ref Event) {.nimcall.}
|
||||||
onmouseover*: proc (event: ref TEvent) {.nimcall.}
|
onmouseover*: proc (event: ref Event) {.nimcall.}
|
||||||
onmouseup*: proc (event: ref TEvent) {.nimcall.}
|
onmouseup*: proc (event: ref Event) {.nimcall.}
|
||||||
onreset*: proc (event: ref TEvent) {.nimcall.}
|
onreset*: proc (event: ref Event) {.nimcall.}
|
||||||
onselect*: proc (event: ref TEvent) {.nimcall.}
|
onselect*: proc (event: ref Event) {.nimcall.}
|
||||||
onsubmit*: proc (event: ref TEvent) {.nimcall.}
|
onsubmit*: proc (event: ref Event) {.nimcall.}
|
||||||
onunload*: proc (event: ref TEvent) {.nimcall.}
|
onunload*: proc (event: ref Event) {.nimcall.}
|
||||||
|
|
||||||
addEventListener*: proc(ev: cstring, cb: proc(ev: ref TEvent), useCapture: bool = false) {.nimcall.}
|
addEventListener*: proc(ev: cstring, cb: proc(ev: ref Event), useCapture: bool = false) {.nimcall.}
|
||||||
|
|
||||||
Window* = ref WindowObj
|
Window* = ref WindowObj
|
||||||
WindowObj {.importc.} = object of TEventHandlers
|
WindowObj {.importc.} = object of EventHandlers
|
||||||
document*: Document
|
document*: Document
|
||||||
event*: ref TEvent
|
event*: ref Event
|
||||||
history*: ref THistory
|
history*: ref History
|
||||||
location*: ref TLocation
|
location*: ref Location
|
||||||
closed*: bool
|
closed*: bool
|
||||||
defaultStatus*: cstring
|
defaultStatus*: cstring
|
||||||
innerHeight*, innerWidth*: int
|
innerHeight*, innerWidth*: int
|
||||||
locationbar*: ref TLocationBar
|
locationbar*: ref LocationBar
|
||||||
menubar*: ref TMenuBar
|
menubar*: ref MenuBar
|
||||||
name*: cstring
|
name*: cstring
|
||||||
outerHeight*, outerWidth*: int
|
outerHeight*, outerWidth*: int
|
||||||
pageXOffset*, pageYOffset*: int
|
pageXOffset*, pageYOffset*: int
|
||||||
personalbar*: ref TPersonalBar
|
personalbar*: ref PersonalBar
|
||||||
scrollbars*: ref TScrollBars
|
scrollbars*: ref ScrollBars
|
||||||
statusbar*: ref TStatusBar
|
statusbar*: ref StatusBar
|
||||||
status*: cstring
|
status*: cstring
|
||||||
toolbar*: ref TToolBar
|
toolbar*: ref ToolBar
|
||||||
|
|
||||||
alert*: proc (msg: cstring) {.nimcall.}
|
alert*: proc (msg: cstring) {.nimcall.}
|
||||||
back*: proc () {.nimcall.}
|
back*: proc () {.nimcall.}
|
||||||
blur*: proc () {.nimcall.}
|
blur*: proc () {.nimcall.}
|
||||||
captureEvents*: proc (eventMask: int) {.nimcall.}
|
captureEvents*: proc (eventMask: int) {.nimcall.}
|
||||||
clearInterval*: proc (interval: ref TInterval) {.nimcall.}
|
clearInterval*: proc (interval: ref Interval) {.nimcall.}
|
||||||
clearTimeout*: proc (timeout: ref TTimeOut) {.nimcall.}
|
clearTimeout*: proc (timeout: ref TimeOut) {.nimcall.}
|
||||||
close*: proc () {.nimcall.}
|
close*: proc () {.nimcall.}
|
||||||
confirm*: proc (msg: cstring): bool {.nimcall.}
|
confirm*: proc (msg: cstring): bool {.nimcall.}
|
||||||
disableExternalCapture*: proc () {.nimcall.}
|
disableExternalCapture*: proc () {.nimcall.}
|
||||||
|
|
@ -72,7 +72,7 @@ type
|
||||||
backwards = false) {.nimcall.}
|
backwards = false) {.nimcall.}
|
||||||
focus*: proc () {.nimcall.}
|
focus*: proc () {.nimcall.}
|
||||||
forward*: proc () {.nimcall.}
|
forward*: proc () {.nimcall.}
|
||||||
handleEvent*: proc (e: ref TEvent) {.nimcall.}
|
handleEvent*: proc (e: ref Event) {.nimcall.}
|
||||||
home*: proc () {.nimcall.}
|
home*: proc () {.nimcall.}
|
||||||
moveBy*: proc (x, y: int) {.nimcall.}
|
moveBy*: proc (x, y: int) {.nimcall.}
|
||||||
moveTo*: proc (x, y: int) {.nimcall.}
|
moveTo*: proc (x, y: int) {.nimcall.}
|
||||||
|
|
@ -83,13 +83,13 @@ type
|
||||||
releaseEvents*: proc (eventMask: int) {.nimcall.}
|
releaseEvents*: proc (eventMask: int) {.nimcall.}
|
||||||
resizeBy*: proc (x, y: int) {.nimcall.}
|
resizeBy*: proc (x, y: int) {.nimcall.}
|
||||||
resizeTo*: proc (x, y: int) {.nimcall.}
|
resizeTo*: proc (x, y: int) {.nimcall.}
|
||||||
routeEvent*: proc (event: ref TEvent) {.nimcall.}
|
routeEvent*: proc (event: ref Event) {.nimcall.}
|
||||||
scrollBy*: proc (x, y: int) {.nimcall.}
|
scrollBy*: proc (x, y: int) {.nimcall.}
|
||||||
scrollTo*: proc (x, y: int) {.nimcall.}
|
scrollTo*: proc (x, y: int) {.nimcall.}
|
||||||
setInterval*: proc (code: cstring, pause: int): ref TInterval {.nimcall.}
|
setInterval*: proc (code: cstring, pause: int): ref Interval {.nimcall.}
|
||||||
setTimeout*: proc (code: cstring, pause: int): ref TTimeOut {.nimcall.}
|
setTimeout*: proc (code: cstring, pause: int): ref TimeOut {.nimcall.}
|
||||||
stop*: proc () {.nimcall.}
|
stop*: proc () {.nimcall.}
|
||||||
frames*: seq[TFrame]
|
frames*: seq[FrameObj]
|
||||||
|
|
||||||
Frame* = ref FrameObj
|
Frame* = ref FrameObj
|
||||||
FrameObj {.importc.} = object of WindowObj
|
FrameObj {.importc.} = object of WindowObj
|
||||||
|
|
@ -100,7 +100,7 @@ type
|
||||||
contains*: proc (class: cstring):bool {.nimcall.}
|
contains*: proc (class: cstring):bool {.nimcall.}
|
||||||
toggle*: proc (class: cstring) {.nimcall.}
|
toggle*: proc (class: cstring) {.nimcall.}
|
||||||
|
|
||||||
TNodeType* = enum
|
NodeType* = enum
|
||||||
ElementNode = 1,
|
ElementNode = 1,
|
||||||
AttributeNode,
|
AttributeNode,
|
||||||
TextNode,
|
TextNode,
|
||||||
|
|
@ -115,7 +115,7 @@ type
|
||||||
NotationNode
|
NotationNode
|
||||||
|
|
||||||
Node* = ref NodeObj
|
Node* = ref NodeObj
|
||||||
NodeObj {.importc.} = object of TEventHandlers
|
NodeObj {.importc.} = object of EventHandlers
|
||||||
attributes*: seq[Node]
|
attributes*: seq[Node]
|
||||||
childNodes*: seq[Node]
|
childNodes*: seq[Node]
|
||||||
children*: seq[Node]
|
children*: seq[Node]
|
||||||
|
|
@ -124,7 +124,7 @@ type
|
||||||
lastChild*: Node
|
lastChild*: Node
|
||||||
nextSibling*: Node
|
nextSibling*: Node
|
||||||
nodeName*: cstring
|
nodeName*: cstring
|
||||||
nodeType*: TNodeType
|
nodeType*: NodeType
|
||||||
nodeValue*: cstring
|
nodeValue*: cstring
|
||||||
parentNode*: Node
|
parentNode*: Node
|
||||||
previousSibling*: Node
|
previousSibling*: Node
|
||||||
|
|
@ -146,7 +146,7 @@ type
|
||||||
scrollIntoView*: proc () {.nimcall.}
|
scrollIntoView*: proc () {.nimcall.}
|
||||||
setAttribute*: proc (name, value: cstring) {.nimcall.}
|
setAttribute*: proc (name, value: cstring) {.nimcall.}
|
||||||
setAttributeNode*: proc (attr: Node) {.nimcall.}
|
setAttributeNode*: proc (attr: Node) {.nimcall.}
|
||||||
style*: ref TStyle
|
style*: ref Style
|
||||||
|
|
||||||
Document* = ref DocumentObj
|
Document* = ref DocumentObj
|
||||||
DocumentObj {.importc.} = object of NodeObj
|
DocumentObj {.importc.} = object of NodeObj
|
||||||
|
|
@ -173,16 +173,16 @@ type
|
||||||
getElementsByTagName*: proc (name: cstring): seq[Element] {.nimcall.}
|
getElementsByTagName*: proc (name: cstring): seq[Element] {.nimcall.}
|
||||||
getElementsByClassName*: proc (name: cstring): seq[Element] {.nimcall.}
|
getElementsByClassName*: proc (name: cstring): seq[Element] {.nimcall.}
|
||||||
getSelection*: proc (): cstring {.nimcall.}
|
getSelection*: proc (): cstring {.nimcall.}
|
||||||
handleEvent*: proc (event: ref TEvent) {.nimcall.}
|
handleEvent*: proc (event: ref Event) {.nimcall.}
|
||||||
open*: proc () {.nimcall.}
|
open*: proc () {.nimcall.}
|
||||||
releaseEvents*: proc (eventMask: int) {.nimcall.}
|
releaseEvents*: proc (eventMask: int) {.nimcall.}
|
||||||
routeEvent*: proc (event: ref TEvent) {.nimcall.}
|
routeEvent*: proc (event: ref Event) {.nimcall.}
|
||||||
write*: proc (text: cstring) {.nimcall.}
|
write*: proc (text: cstring) {.nimcall.}
|
||||||
writeln*: proc (text: cstring) {.nimcall.}
|
writeln*: proc (text: cstring) {.nimcall.}
|
||||||
anchors*: seq[AnchorElement]
|
anchors*: seq[AnchorElement]
|
||||||
forms*: seq[FormElement]
|
forms*: seq[FormElement]
|
||||||
images*: seq[ImageElement]
|
images*: seq[ImageElement]
|
||||||
applets*: seq[ref TApplet]
|
applets*: seq[ref Applet]
|
||||||
embeds*: seq[EmbedElement]
|
embeds*: seq[EmbedElement]
|
||||||
links*: seq[LinkElement]
|
links*: seq[LinkElement]
|
||||||
|
|
||||||
|
|
@ -199,7 +199,7 @@ type
|
||||||
blur*: proc () {.nimcall.}
|
blur*: proc () {.nimcall.}
|
||||||
click*: proc () {.nimcall.}
|
click*: proc () {.nimcall.}
|
||||||
focus*: proc () {.nimcall.}
|
focus*: proc () {.nimcall.}
|
||||||
handleEvent*: proc (event: ref TEvent) {.nimcall.}
|
handleEvent*: proc (event: ref Event) {.nimcall.}
|
||||||
select*: proc () {.nimcall.}
|
select*: proc () {.nimcall.}
|
||||||
options*: seq[OptionElement]
|
options*: seq[OptionElement]
|
||||||
getElementsByTagName*: proc (name: cstring): seq[Element] {.nimcall.}
|
getElementsByTagName*: proc (name: cstring): seq[Element] {.nimcall.}
|
||||||
|
|
@ -228,7 +228,7 @@ type
|
||||||
text*: cstring
|
text*: cstring
|
||||||
x*, y*: int
|
x*, y*: int
|
||||||
|
|
||||||
TApplet* {.importc.} = object of RootObj
|
Applet* {.importc.} = object of RootObj
|
||||||
|
|
||||||
OptionElement* = ref OptionObj
|
OptionElement* = ref OptionObj
|
||||||
OptionObj {.importc.} = object of ElementObj
|
OptionObj {.importc.} = object of ElementObj
|
||||||
|
|
@ -260,7 +260,7 @@ type
|
||||||
width*: int
|
width*: int
|
||||||
|
|
||||||
|
|
||||||
TStyle* {.importc.} = object of RootObj
|
Style* {.importc.} = object of RootObj
|
||||||
background*: cstring
|
background*: cstring
|
||||||
backgroundAttachment*: cstring
|
backgroundAttachment*: cstring
|
||||||
backgroundColor*: cstring
|
backgroundColor*: cstring
|
||||||
|
|
@ -354,7 +354,7 @@ type
|
||||||
removeAttribute*: proc (attr: cstring, caseSensitive=false) {.nimcall.}
|
removeAttribute*: proc (attr: cstring, caseSensitive=false) {.nimcall.}
|
||||||
setAttribute*: proc (attr, value: cstring, caseSensitive=false) {.nimcall.}
|
setAttribute*: proc (attr, value: cstring, caseSensitive=false) {.nimcall.}
|
||||||
|
|
||||||
TEvent* {.importc.} = object of RootObj
|
Event* {.importc.} = object of RootObj
|
||||||
target*: Node
|
target*: Node
|
||||||
altKey*, ctrlKey*, shiftKey*: bool
|
altKey*, ctrlKey*, shiftKey*: bool
|
||||||
button*: int
|
button*: int
|
||||||
|
|
@ -393,7 +393,7 @@ type
|
||||||
SUBMIT*: int
|
SUBMIT*: int
|
||||||
UNLOAD*: int
|
UNLOAD*: int
|
||||||
|
|
||||||
TLocation* {.importc.} = object of RootObj
|
Location* {.importc.} = object of RootObj
|
||||||
hash*: cstring
|
hash*: cstring
|
||||||
host*: cstring
|
host*: cstring
|
||||||
hostname*: cstring
|
hostname*: cstring
|
||||||
|
|
@ -405,13 +405,13 @@ type
|
||||||
reload*: proc () {.nimcall.}
|
reload*: proc () {.nimcall.}
|
||||||
replace*: proc (s: cstring) {.nimcall.}
|
replace*: proc (s: cstring) {.nimcall.}
|
||||||
|
|
||||||
THistory* {.importc.} = object of RootObj
|
History* {.importc.} = object of RootObj
|
||||||
length*: int
|
length*: int
|
||||||
back*: proc () {.nimcall.}
|
back*: proc () {.nimcall.}
|
||||||
forward*: proc () {.nimcall.}
|
forward*: proc () {.nimcall.}
|
||||||
go*: proc (pagesToJump: int) {.nimcall.}
|
go*: proc (pagesToJump: int) {.nimcall.}
|
||||||
|
|
||||||
TNavigator* {.importc.} = object of RootObj
|
Navigator* {.importc.} = object of RootObj
|
||||||
appCodeName*: cstring
|
appCodeName*: cstring
|
||||||
appName*: cstring
|
appName*: cstring
|
||||||
appVersion*: cstring
|
appVersion*: cstring
|
||||||
|
|
@ -420,28 +420,28 @@ type
|
||||||
platform*: cstring
|
platform*: cstring
|
||||||
userAgent*: cstring
|
userAgent*: cstring
|
||||||
javaEnabled*: proc (): bool {.nimcall.}
|
javaEnabled*: proc (): bool {.nimcall.}
|
||||||
mimeTypes*: seq[ref TMimeType]
|
mimeTypes*: seq[ref MimeType]
|
||||||
|
|
||||||
TPlugin* {.importc.} = object of RootObj
|
Plugin* {.importc.} = object of RootObj
|
||||||
description*: cstring
|
description*: cstring
|
||||||
filename*: cstring
|
filename*: cstring
|
||||||
name*: cstring
|
name*: cstring
|
||||||
|
|
||||||
TMimeType* {.importc.} = object of RootObj
|
MimeType* {.importc.} = object of RootObj
|
||||||
description*: cstring
|
description*: cstring
|
||||||
enabledPlugin*: ref TPlugin
|
enabledPlugin*: ref Plugin
|
||||||
suffixes*: seq[cstring]
|
suffixes*: seq[cstring]
|
||||||
`type`*: cstring
|
`type`*: cstring
|
||||||
|
|
||||||
TLocationBar* {.importc.} = object of RootObj
|
LocationBar* {.importc.} = object of RootObj
|
||||||
visible*: bool
|
visible*: bool
|
||||||
TMenuBar* = TLocationBar
|
MenuBar* = LocationBar
|
||||||
TPersonalBar* = TLocationBar
|
PersonalBar* = LocationBar
|
||||||
TScrollBars* = TLocationBar
|
ScrollBars* = LocationBar
|
||||||
TToolBar* = TLocationBar
|
ToolBar* = LocationBar
|
||||||
TStatusBar* = TLocationBar
|
StatusBar* = LocationBar
|
||||||
|
|
||||||
TScreen* {.importc.} = object of RootObj
|
Screen* {.importc.} = object of RootObj
|
||||||
availHeight*: int
|
availHeight*: int
|
||||||
availWidth*: int
|
availWidth*: int
|
||||||
colorDepth*: int
|
colorDepth*: int
|
||||||
|
|
@ -449,14 +449,20 @@ type
|
||||||
pixelDepth*: int
|
pixelDepth*: int
|
||||||
width*: int
|
width*: int
|
||||||
|
|
||||||
TTimeOut* {.importc.} = object of RootObj
|
TimeOut* {.importc.} = object of RootObj
|
||||||
TInterval* {.importc.} = object of RootObj
|
Interval* {.importc.} = object of RootObj
|
||||||
|
{.deprecated: [TEventHandlers: EventHandlers, TEvent: Event, TNodeType: NodeType,
|
||||||
|
TInterval: Interval, TTimeOut: TimeOut, TStatusBar: StatusBar,
|
||||||
|
TMenuBar: MenuBar, TApplet: Applet, TLocation: Location,
|
||||||
|
THistory: History, TNavigator: Navigator, TPlugin: Plugin,
|
||||||
|
TMimeType: MimeType, TLocationBar: LocationBar, TPersonalBar: PersonalBar,
|
||||||
|
TScrollBars: ScrollBars, TToolBar: ToolBar, TScreen: Screen].}
|
||||||
|
|
||||||
var
|
var
|
||||||
window* {.importc, nodecl.}: Window
|
window* {.importc, nodecl.}: Window
|
||||||
document* {.importc, nodecl.}: Document
|
document* {.importc, nodecl.}: Document
|
||||||
navigator* {.importc, nodecl.}: ref TNavigator
|
navigator* {.importc, nodecl.}: ref Navigator
|
||||||
screen* {.importc, nodecl.}: ref TScreen
|
screen* {.importc, nodecl.}: ref Screen
|
||||||
|
|
||||||
proc decodeURI*(uri: cstring): cstring {.importc, nodecl.}
|
proc decodeURI*(uri: cstring): cstring {.importc, nodecl.}
|
||||||
proc encodeURI*(uri: cstring): cstring {.importc, nodecl.}
|
proc encodeURI*(uri: cstring): cstring {.importc, nodecl.}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue