Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3143,17 +3143,19 @@ extension BridgeJSLink {

let sortedMethods = klass.methods.sorted { $0.name < $1.name }
for method in sortedMethods {
let staticKeyword = method.effects.isStatic ? "static " : ""
let methodSignature =
"\(method.name)\(renderTSSignatureCallback(method.parameters, method.returnType, method.effects));"
"\(staticKeyword)\(method.name)\(renderTSSignatureCallback(method.parameters, method.returnType, method.effects));"
printer.write(methodSignature)
}

let sortedProperties = klass.properties.filter { !$0.isStatic }.sorted {
$0.name < $1.name
}
let sortedProperties = klass.properties.sorted { $0.name < $1.name }
for property in sortedProperties {
let staticKeyword = property.isStatic ? "static " : ""
let readonly = property.isReadonly ? "readonly " : ""
printer.write("\(readonly)\(property.name): \(property.type.tsType);")
printer.write(
"\(staticKeyword)\(readonly)\(property.name): \(property.type.tsType);"
)
}

printer.write("release(): void;")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ declare global {
class Greeter {
constructor(name: string);
greet(): string;
makeDefault(): Greeter;
static makeDefault(): Greeter;
static readonly defaultGreeting: string;
release(): void;
}
class UUID {
Expand Down
Loading