forked from swiftwasm/JavaScriptKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOptionals.d.ts
More file actions
86 lines (85 loc) · 3.85 KB
/
Copy pathOptionals.d.ts
File metadata and controls
86 lines (85 loc) · 3.85 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
74
75
76
77
78
79
80
81
82
83
84
85
86
// 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`.
/// 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 Greeter extends SwiftHeapObject {
greet(): string;
changeName(name: string | null): void;
name: string | null;
}
export interface OptionalPropertyHolder extends SwiftHeapObject {
optionalName: string | null;
optionalAge: number | null;
optionalGreeter: Greeter | null;
}
export interface WithOptionalJSClass {
roundTripStringOrNull(value: string | null): string | null;
roundTripStringOrUndefined(value: string | undefined): string | undefined;
roundTripDoubleOrNull(value: number | null): number | null;
roundTripDoubleOrUndefined(value: number | undefined): number | undefined;
roundTripBoolOrNull(value: boolean | null): boolean | null;
roundTripBoolOrUndefined(value: boolean | undefined): boolean | undefined;
roundTripIntOrNull(value: number | null): number | null;
roundTripIntOrUndefined(value: number | undefined): number | undefined;
roundTripChildOrNull(value: WithOptionalJSClass | null): WithOptionalJSClass | null;
stringOrNull: string | null;
stringOrUndefined: string | undefined;
doubleOrNull: number | null;
doubleOrUndefined: number | undefined;
boolOrNull: boolean | null;
boolOrUndefined: boolean | undefined;
intOrNull: number | null;
intOrUndefined: number | undefined;
childOrNull: WithOptionalJSClass | null;
}
export type Exports = {
Greeter: {
new(name: string | null): Greeter;
}
OptionalPropertyHolder: {
new(): OptionalPropertyHolder;
}
roundTripOptionalClass(value: Greeter | null): Greeter | null;
testOptionalPropertyRoundtrip(holder: OptionalPropertyHolder | null): OptionalPropertyHolder | null;
roundTripExportedOptionalJSObject(value: any | null): any | null;
roundTripExportedOptionalJSClass(value: WithOptionalJSClass | null): WithOptionalJSClass | null;
roundTripString(name: string | null): string | null;
roundTripInt(value: number | null): number | null;
roundTripInt8(value: number | null): number | null;
roundTripUInt8(value: number | null): number | null;
roundTripInt16(value: number | null): number | null;
roundTripUInt16(value: number | null): number | null;
roundTripInt32(value: number | null): number | null;
roundTripUInt32(value: number | null): number | null;
roundTripBool(flag: boolean | null): boolean | null;
roundTripFloat(number: number | null): number | null;
roundTripDouble(precision: number | null): number | null;
roundTripSyntax(name: string | null): string | null;
roundTripMixSyntax(name: string | null): string | null;
roundTripSwiftSyntax(name: string | null): string | null;
roundTripMixedSwiftSyntax(name: string | null): string | null;
roundTripWithSpaces(value: number | null): number | null;
roundTripAlias(age: number | null): number | null;
roundTripOptionalAlias(name: string | null): string | null;
testMixedOptionals(firstName: string | null, lastName: string | null, age: number | null, active: boolean): string | null;
}
export type Imports = {
WithOptionalJSClass: {
new(valueOrNull: string | null, valueOrUndefined: string | undefined): WithOptionalJSClass;
}
}
export function createInstantiator(options: {
imports: Imports;
}, swift: any): Promise<{
addImports: (importObject: WebAssembly.Imports) => void;
setInstance: (instance: WebAssembly.Instance) => void;
createExports: (instance: WebAssembly.Instance) => Exports;
}>;