@nativescript/types-swiftui 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/libNodeAPI.dylib +0 -0
- package/dist/libSwiftBridge.node +0 -0
- package/index.js +21 -0
- package/package.json +15 -0
- package/types/IREnums.generated.d.ts +513 -0
- package/types/IRModifiers.generated.d.ts +348 -0
- package/types/IRNodes.generated.d.ts +562 -0
- package/types/IRScenes.generated.d.ts +69 -0
- package/types/IRSwiftUI.d.ts +48 -0
- package/types/SwiftUI.d.ts +58 -0
- package/types/index.d.ts +6 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// SwiftUI TypeScript declarations
|
|
2
|
+
// Re-exports IR types and adds SwiftUI base classes
|
|
3
|
+
|
|
4
|
+
import { Animation } from "./IREnums.generated";
|
|
5
|
+
import type { IRNodeChild } from "./IRSwiftUI";
|
|
6
|
+
|
|
7
|
+
/** Base class for SwiftUI View implemented in JavaScript */
|
|
8
|
+
export declare class SwiftUIView {
|
|
9
|
+
/** Override this to return your view's IR representation */
|
|
10
|
+
get body(): IRNodeChild;
|
|
11
|
+
|
|
12
|
+
/** Call to trigger a re-render of the view */
|
|
13
|
+
invalidate(): void;
|
|
14
|
+
|
|
15
|
+
// Binding to a state variable
|
|
16
|
+
$<T = any>(name: string): Binding<T>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Base class for SwiftUI App implemented in JavaScript */
|
|
20
|
+
export declare class SwiftUIApp {
|
|
21
|
+
/** Override this to return your app's root view */
|
|
22
|
+
get body(): IRNodeChild;
|
|
23
|
+
|
|
24
|
+
/** Start the application */
|
|
25
|
+
static main(): void;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { SwiftUIView as View, SwiftUIApp as App };
|
|
29
|
+
|
|
30
|
+
export declare class SwiftUIBinding<T> {
|
|
31
|
+
constructor({ get, set }: { get: () => T; set: (newValue: T) => void });
|
|
32
|
+
|
|
33
|
+
get: () => T;
|
|
34
|
+
set: (newValue: T) => void;
|
|
35
|
+
|
|
36
|
+
animated(animation?: Animation): this;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { SwiftUIBinding as Binding };
|
|
40
|
+
|
|
41
|
+
export function withAnimation<T>(callback: () => T): T;
|
|
42
|
+
export function withAnimation<T>(animation: Animation, callback: () => T): T;
|
|
43
|
+
|
|
44
|
+
declare global {
|
|
45
|
+
class App extends SwiftUIApp {}
|
|
46
|
+
class View extends SwiftUIView {}
|
|
47
|
+
const withAnimation: typeof import("./SwiftUI.d.ts").withAnimation;
|
|
48
|
+
class Binding<T> extends SwiftUIBinding<T> {}
|
|
49
|
+
|
|
50
|
+
class Console {
|
|
51
|
+
log(...args: any[]): void;
|
|
52
|
+
error(...args: any[]): void;
|
|
53
|
+
warn(...args: any[]): void;
|
|
54
|
+
info(...args: any[]): void;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const console: Console;
|
|
58
|
+
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="./IRSwiftUI.d.ts" />
|
|
2
|
+
/// <reference types="./SwiftUI.d.ts" />
|
|
3
|
+
/// <reference types="./IRNodes.generated.d.ts" />
|
|
4
|
+
/// <reference types="./IRModifiers.generated.d.ts" />
|
|
5
|
+
/// <reference types="./IREnums.generated.d.ts" />
|
|
6
|
+
/// <reference types="./IRScenes.generated.d.ts" />
|