forked from swiftwasm/JavaScriptKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProtocol.Export.d.ts
More file actions
44 lines (42 loc) · 1.45 KB
/
Protocol.Export.d.ts
File metadata and controls
44 lines (42 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
// DO NOT EDIT.
//
// To update this file, just rebuild your project or run
// `swift package bridge-js`.
export interface MyViewControllerDelegate {
onSomethingHappened(): void;
onValueChanged(value: string): void;
onCountUpdated(count: number): boolean;
onLabelUpdated(prefix: string, suffix: string): void;
isCountEven(): boolean;
}
/// Represents a Swift heap object like a class instance or an actor instance.
export interface SwiftHeapObject {
/// Release the heap object.
///
/// Note: Calling this method will release the heap object and it will no longer be accessible.
release(): void;
}
export interface MyViewController extends SwiftHeapObject {
triggerEvent(): void;
updateValue(value: string): void;
updateCount(count: number): boolean;
updateLabel(prefix: string, suffix: string): void;
checkEvenCount(): boolean;
delegate: MyViewControllerDelegate;
secondDelegate: MyViewControllerDelegate | null;
}
export type Exports = {
MyViewController: {
new(delegate: MyViewControllerDelegate): MyViewController;
}
}
export type Imports = {
}
export function createInstantiator(options: {
imports: Imports;
}, swift: any): Promise<{
addImports: (importObject: WebAssembly.Imports) => void;
setInstance: (instance: WebAssembly.Instance) => void;
createExports: (instance: WebAssembly.Instance) => Exports;
}>;