forked from swiftwasm/JavaScriptKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStaticFunctions.Export.d.ts
More file actions
73 lines (65 loc) · 1.94 KB
/
StaticFunctions.Export.d.ts
File metadata and controls
73 lines (65 loc) · 1.94 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// 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 const CalculatorValues: {
readonly Scientific: 0;
readonly Basic: 1;
};
export type CalculatorTag = typeof CalculatorValues[keyof typeof CalculatorValues];
export const APIResultValues: {
readonly Tag: {
readonly Success: 0;
readonly Failure: 1;
};
};
export type APIResultTag =
{ tag: typeof APIResultValues.Tag.Success; param0: string } | { tag: typeof APIResultValues.Tag.Failure; param0: number }
export type CalculatorObject = typeof CalculatorValues & {
square(value: number): number;
};
export type APIResultObject = typeof APIResultValues & {
roundtrip(value: APIResultTag): APIResultTag;
};
export {};
declare global {
namespace Utils {
namespace String {
uppercase(text: string): string;
}
}
}
/// 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 MathUtils extends SwiftHeapObject {
multiply(x: number, y: number): number;
}
export type Exports = {
MathUtils: {
new(): MathUtils;
subtract(a: number, b: number): number;
add(a: number, b: number): number;
}
Calculator: CalculatorObject
APIResult: APIResultObject
Utils: {
String: {
uppercase(text: string): string;
},
},
}
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;
}>;