Skip to content

Commit 94762ae

Browse files
Documentation: Fix docc formatting issues
1 parent 1fda970 commit 94762ae

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

Sources/JavaScriptKit/BasicObjects/JSArray.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class JSArray: JSBridgedClass {
1919
/// Construct a `JSArray` from Array `JSObject`.
2020
/// Return `nil` if the object is not an Array.
2121
///
22-
/// - Parameter object: A `JSObject` expected to be a JavaScript Array
22+
/// - Parameter jsObject: A `JSObject` expected to be a JavaScript Array
2323
public convenience init?(_ jsObject: JSObject) {
2424
guard Self.isArray(jsObject) else { return nil }
2525
self.init(unsafelyWrapping: jsObject)

Sources/JavaScriptKit/Documentation.docc/Articles/BridgeJS/Exporting-Swift/Exporting-Swift-Closure.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@ import JavaScriptKit
1515

1616
@JS class TextProcessor {
1717
private var transform: (String) -> String
18-
18+
1919
@JS init(transform: @escaping (String) -> String) {
2020
self.transform = transform
2121
}
22-
22+
2323
@JS func processWithPerson(_ person: Person, formatter: (Person) -> String) -> String {
2424
return formatter(person)
2525
}
26-
26+
2727
@JS func makePersonCreator(defaultName: String) -> (String) -> Person {
2828
return { name in
2929
let fullName = name.isEmpty ? defaultName : name
3030
return Person(name: fullName)
3131
}
3232
}
33-
33+
3434
@JS func getTransform() -> (String) -> String {
3535
return transform
3636
}
@@ -83,8 +83,8 @@ export interface TextProcessor extends SwiftHeapObject {
8383
}
8484

8585
export type Exports = {
86-
TextProcessor: {
87-
new(transform: (arg0: string) => string): TextProcessor
86+
TextProcessor: {
87+
new(transform: (arg0: string) => string): TextProcessor
8888
};
8989
}
9090
```
@@ -111,4 +111,4 @@ Both directions use automatic memory management - no manual cleanup required.
111111
112112
## See Also
113113
114-
- <doc:Supported-Types> - Complete list of supported types across BridgeJS
114+
- <doc:Supported-Types>

Sources/JavaScriptKit/FundamentalObjects/JSClosure.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ public class JSOneshotClosure: JSObject, JSClosureProtocol {
4949
/// - Parameters:
5050
/// - priority: The priority of the new unstructured Task created under the hood.
5151
/// - body: The Swift function to call asynchronously.
52+
/// - file: The file identifier where the function is defined.
53+
/// - line: The line number where the function is defined.
5254
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
5355
public static func async(
5456
priority: TaskPriority? = nil,
@@ -65,6 +67,8 @@ public class JSOneshotClosure: JSObject, JSClosureProtocol {
6567
/// - taskExecutor: The executor preference of the new unstructured Task created under the hood.
6668
/// - priority: The priority of the new unstructured Task created under the hood.
6769
/// - body: The Swift function to call asynchronously.
70+
/// - file: The file identifier where the function is defined.
71+
/// - line: The line number where the function is defined.
6872
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
6973
public static func async(
7074
executorPreference taskExecutor: (any TaskExecutor)? = nil,
@@ -171,6 +175,8 @@ public class JSClosure: JSObject, JSClosureProtocol {
171175
/// - Parameters:
172176
/// - priority: The priority of the new unstructured Task created under the hood.
173177
/// - body: The Swift function to call asynchronously.
178+
/// - file: The file identifier where the function is defined.
179+
/// - line: The line number where the function is defined.
174180
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
175181
public static func async(
176182
priority: TaskPriority? = nil,
@@ -187,6 +193,8 @@ public class JSClosure: JSObject, JSClosureProtocol {
187193
/// - taskExecutor: The executor preference of the new unstructured Task created under the hood.
188194
/// - priority: The priority of the new unstructured Task created under the hood.
189195
/// - body: The Swift function to call asynchronously.
196+
/// - file: The file identifier where the function is defined.
197+
/// - line: The line number where the function is defined.
190198
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
191199
public static func async(
192200
executorPreference taskExecutor: (any TaskExecutor)? = nil,

Sources/JavaScriptKit/FundamentalObjects/JSObject.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public class JSObject: Equatable, ExpressibleByDictionaryLiteral {
174174
}
175175

176176
/// Access the `symbol` member dynamically through JavaScript and Swift runtime bridge library.
177-
/// - Parameter symbol: The name of this object's member to access.
177+
/// - Parameter name: The name of this object's member to access.
178178
/// - Returns: The value of the `name` member of this object.
179179
public subscript(_ name: JSSymbol) -> JSValue {
180180
get {

Sources/JavaScriptKit/JSValueDecoder.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ public class JSValueDecoder {
243243
///
244244
/// - Parameter T: The type of the value to decode.
245245
/// - Parameter value: The `JSValue` to decode from.
246+
/// - Parameter userInfo: Additional information to pass to the decoder.
246247
public func decode<T>(
247248
_: T.Type = T.self,
248249
from value: JSValue,

0 commit comments

Comments
 (0)