@@ -229,54 +229,65 @@ export declare namespace document {
229
229
* @param tagName The name of an element.
230
230
*/
231
231
@external ( "env" , "document.createElement" )
232
+ @external . js ( "return document.createElement(tagName);" )
232
233
export function createElement ( tagName : string /* , options?: ElementCreationOptions */ ) : externref ;
233
234
/**
234
235
* Returns a reference to the first HTMLElement object with the specified value of the ID attribute.
235
236
* @param id String that specifies the ID value.
236
237
*/
237
238
@external ( "env" , "document.getElementById" )
239
+ @external . js ( "return document.getElementById(id);" )
238
240
export function getElementById ( id : string ) : externref ;
239
241
/**
240
242
* Returns a HTMLCollection of the elements in the object on which the method was invoked that have all the classes
241
243
* given by classNames. The classNames argument is interpreted as a space-separated list of classes.
242
244
* @param classNames Gets a collection of objects based on the value of the CLASS attribute.
243
245
*/
244
246
@external ( "env" , "document.getElementsByClassName" )
247
+ @external . js ( "return document.getElementsByClassName(classNames);" )
245
248
export function getElementsByClassName ( classNames : string ) : externref ;
246
249
/**
247
250
* Gets a collection of HTMLElement objects based on the value of the NAME or ID attribute.
248
251
* @param elementName Gets a collection of objects based on the value of the NAME or ID attribute.
249
252
*/
250
253
@external ( "env" , "document.getElementsByName" )
254
+ @external . js ( "return document.getElementsByName(elementName);" )
251
255
export function getElementsByName ( elementName : string ) : externref ;
252
256
/** Gets a value indicating whether the object currently has focus. */
253
257
@external ( "env" , "document.hasFocus" )
258
+ @external . js ( "return document.hasFocus();" )
254
259
export function hasFocus ( ) : bool ;
255
260
/** Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. */
256
261
@external ( "env" , "document.append" )
262
+ @external . js ( "return document.append(node);" )
257
263
export function append ( node : externref ) : void ;
258
264
/** Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. */
259
265
@external ( "env" , "document.prepend" )
266
+ @external . js ( "return document.prepend(node);" )
260
267
export function prepend ( node : externref ) : void ;
261
268
/** Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. */
262
269
@external ( "env" , "document.replaceChildren" )
270
+ @external . js ( "return document.replaceChildren(node);" )
263
271
export function replaceChildren ( node : externref ) : void ;
264
272
/**
265
273
* Writes one or more HTML expressions to a document in the specified window.
266
274
* @param content Specifies the text and HTML tags to write.
267
275
*/
268
276
@external ( "env" , "document.write" )
277
+ @external . js ( "return document.write(content);" )
269
278
export function write ( content : string ) : void ;
270
279
/**
271
280
* Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.
272
281
* @param content Specifies the text and HTML tags to write.
273
282
*/
274
283
@external ( "env" , "document.writeln" )
284
+ @external . js ( "return document.writeln(content);" )
275
285
export function writeln ( content : string ) : void ;
276
286
}
277
287
278
288
export declare namespace performance {
279
289
@external ( "env" , "performance.now" )
290
+ @external . js ( "return performance.now();" )
280
291
export function now ( ) : f64 ;
281
292
}
282
293
0 commit comments