-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This shouldn't conflict much with #19, as it generates a single `console.swift` file. Co-authored-by: Jed Fox <[email protected]>
- Loading branch information
1 parent
b56e5fc
commit 7aff5d8
Showing
5 changed files
with
126 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! | ||
|
||
import JavaScriptEventLoop | ||
import JavaScriptKit | ||
|
||
public enum console { | ||
@inlinable public static var jsObject: JSObject { | ||
JSObject.global[Strings.console].object! | ||
} | ||
|
||
@inlinable public static func assert(condition: Bool? = nil, data: JSValue...) { | ||
let this = JSObject.global[Strings.console].object! | ||
_ = this[Strings.assert].function!(this: this, arguments: [condition?.jsValue ?? .undefined] + data.map(\.jsValue)) | ||
} | ||
|
||
@inlinable public static func clear() { | ||
let this = JSObject.global[Strings.console].object! | ||
_ = this[Strings.clear].function!(this: this, arguments: []) | ||
} | ||
|
||
@inlinable public static func debug(data: JSValue...) { | ||
let this = JSObject.global[Strings.console].object! | ||
_ = this[Strings.debug].function!(this: this, arguments: data.map(\.jsValue)) | ||
} | ||
|
||
@inlinable public static func error(data: JSValue...) { | ||
let this = JSObject.global[Strings.console].object! | ||
_ = this[Strings.error].function!(this: this, arguments: data.map(\.jsValue)) | ||
} | ||
|
||
@inlinable public static func info(data: JSValue...) { | ||
let this = JSObject.global[Strings.console].object! | ||
_ = this[Strings.info].function!(this: this, arguments: data.map(\.jsValue)) | ||
} | ||
|
||
@inlinable public static func log(data: JSValue...) { | ||
let this = JSObject.global[Strings.console].object! | ||
_ = this[Strings.log].function!(this: this, arguments: data.map(\.jsValue)) | ||
} | ||
|
||
@inlinable public static func table(tabularData: JSValue? = nil, properties: [String]? = nil) { | ||
let this = JSObject.global[Strings.console].object! | ||
_ = this[Strings.table].function!(this: this, arguments: [tabularData?.jsValue ?? .undefined, properties?.jsValue ?? .undefined]) | ||
} | ||
|
||
@inlinable public static func trace(data: JSValue...) { | ||
let this = JSObject.global[Strings.console].object! | ||
_ = this[Strings.trace].function!(this: this, arguments: data.map(\.jsValue)) | ||
} | ||
|
||
@inlinable public static func warn(data: JSValue...) { | ||
let this = JSObject.global[Strings.console].object! | ||
_ = this[Strings.warn].function!(this: this, arguments: data.map(\.jsValue)) | ||
} | ||
|
||
@inlinable public static func dir(item: JSValue? = nil, options: JSObject? = nil) { | ||
let this = JSObject.global[Strings.console].object! | ||
_ = this[Strings.dir].function!(this: this, arguments: [item?.jsValue ?? .undefined, options?.jsValue ?? .undefined]) | ||
} | ||
|
||
@inlinable public static func dirxml(data: JSValue...) { | ||
let this = JSObject.global[Strings.console].object! | ||
_ = this[Strings.dirxml].function!(this: this, arguments: data.map(\.jsValue)) | ||
} | ||
|
||
@inlinable public static func count(label: String? = nil) { | ||
let this = JSObject.global[Strings.console].object! | ||
_ = this[Strings.count].function!(this: this, arguments: [label?.jsValue ?? .undefined]) | ||
} | ||
|
||
@inlinable public static func countReset(label: String? = nil) { | ||
let this = JSObject.global[Strings.console].object! | ||
_ = this[Strings.countReset].function!(this: this, arguments: [label?.jsValue ?? .undefined]) | ||
} | ||
|
||
@inlinable public static func group(data: JSValue...) { | ||
let this = JSObject.global[Strings.console].object! | ||
_ = this[Strings.group].function!(this: this, arguments: data.map(\.jsValue)) | ||
} | ||
|
||
@inlinable public static func groupCollapsed(data: JSValue...) { | ||
let this = JSObject.global[Strings.console].object! | ||
_ = this[Strings.groupCollapsed].function!(this: this, arguments: data.map(\.jsValue)) | ||
} | ||
|
||
@inlinable public static func groupEnd() { | ||
let this = JSObject.global[Strings.console].object! | ||
_ = this[Strings.groupEnd].function!(this: this, arguments: []) | ||
} | ||
|
||
@inlinable public static func time(label: String? = nil) { | ||
let this = JSObject.global[Strings.console].object! | ||
_ = this[Strings.time].function!(this: this, arguments: [label?.jsValue ?? .undefined]) | ||
} | ||
|
||
@inlinable public static func timeLog(label: String? = nil, data: JSValue...) { | ||
let this = JSObject.global[Strings.console].object! | ||
_ = this[Strings.timeLog].function!(this: this, arguments: [label?.jsValue ?? .undefined] + data.map(\.jsValue)) | ||
} | ||
|
||
@inlinable public static func timeEnd(label: String? = nil) { | ||
let this = JSObject.global[Strings.console].object! | ||
_ = this[Strings.timeEnd].function!(this: this, arguments: [label?.jsValue ?? .undefined]) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import JavaScriptKit | ||
import DOMKit | ||
|
||
let document = global.document | ||
let document = globalThis.document | ||
|
||
let header = HTMLElement(from: document.createElement(localName: "h1"))! | ||
header.innerText = "Hello World!" | ||
_ = document.body.appendChild(node: header) | ||
_ = document.body!.appendChild(node: header) | ||
|
||
console.log(data: "Hello, world!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters