@swipt/api 0.1.0-nightly.89 → 0.1.0-nightly.90
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/maps.d.ts +1 -1
- package/package.json +10 -2
- package/process.d.ts +190 -0
- package/process.mjs +9 -0
- package/swift-ui.d.ts +323 -0
- package/swift-ui.mjs +9 -0
- package/swiplet.d.ts +26 -2
package/maps.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swipt/api",
|
|
3
|
-
"version": "0.1.0-nightly.
|
|
4
|
-
"apiLevel":
|
|
3
|
+
"version": "0.1.0-nightly.90",
|
|
4
|
+
"apiLevel": 3,
|
|
5
5
|
"oldestAPILevel": 2,
|
|
6
6
|
"minimumIOSVersion": 17.4,
|
|
7
7
|
"license": "GPL-3.0-or-later",
|
|
@@ -36,6 +36,10 @@
|
|
|
36
36
|
"types": "./device.d.ts",
|
|
37
37
|
"default": "./device.mjs"
|
|
38
38
|
},
|
|
39
|
+
"./process": {
|
|
40
|
+
"types": "./process.d.ts",
|
|
41
|
+
"default": "./process.mjs"
|
|
42
|
+
},
|
|
39
43
|
"./screen": {
|
|
40
44
|
"types": "./screen.d.ts",
|
|
41
45
|
"default": "./screen.mjs"
|
|
@@ -60,6 +64,10 @@
|
|
|
60
64
|
"types": "./http.d.ts",
|
|
61
65
|
"default": "./http.mjs"
|
|
62
66
|
},
|
|
67
|
+
"./swift-ui": {
|
|
68
|
+
"types": "./swift-ui.d.ts",
|
|
69
|
+
"default": "./swift-ui.mjs"
|
|
70
|
+
},
|
|
63
71
|
"./package.json": "./package.json"
|
|
64
72
|
},
|
|
65
73
|
"files": [
|
package/process.d.ts
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/** @available apiLevel 3 */
|
|
2
|
+
import type { CallOptions } from "./index";
|
|
3
|
+
|
|
4
|
+
export interface Process {
|
|
5
|
+
readonly pid: number;
|
|
6
|
+
readonly executablePath?: string;
|
|
7
|
+
readonly bundleId?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface ProcessAttributes {
|
|
11
|
+
readonly procFlags: number;
|
|
12
|
+
readonly procStatus: number;
|
|
13
|
+
readonly procXstatus: number;
|
|
14
|
+
readonly pid: number;
|
|
15
|
+
readonly ppid: number;
|
|
16
|
+
readonly uid: number;
|
|
17
|
+
readonly gid: number;
|
|
18
|
+
readonly ruid: number;
|
|
19
|
+
readonly rgid: number;
|
|
20
|
+
readonly svuid: number;
|
|
21
|
+
readonly svgid: number;
|
|
22
|
+
readonly comm: string;
|
|
23
|
+
readonly name: string;
|
|
24
|
+
readonly nfiles: number;
|
|
25
|
+
readonly pgid: number;
|
|
26
|
+
readonly pjobc: number;
|
|
27
|
+
readonly tdev: number;
|
|
28
|
+
readonly tpgid: number;
|
|
29
|
+
readonly nice: number;
|
|
30
|
+
readonly memVirtualSize: number;
|
|
31
|
+
readonly memResidentSize: number;
|
|
32
|
+
readonly cpuTotalUser: number;
|
|
33
|
+
readonly cpuTotalSystem: number;
|
|
34
|
+
readonly threadsUser: number;
|
|
35
|
+
readonly threadsSystem: number;
|
|
36
|
+
readonly policy: number;
|
|
37
|
+
readonly faults: number;
|
|
38
|
+
readonly vmPageIns: number;
|
|
39
|
+
readonly cowFaults: number;
|
|
40
|
+
readonly msgSent: number;
|
|
41
|
+
readonly msgRecv: number;
|
|
42
|
+
readonly sysCallsMach: number;
|
|
43
|
+
readonly sysCallsUnix: number;
|
|
44
|
+
readonly ctxSwitch: number;
|
|
45
|
+
readonly threadCount: number;
|
|
46
|
+
readonly numRunning: number;
|
|
47
|
+
readonly priority: number;
|
|
48
|
+
readonly wqNumThreads: number;
|
|
49
|
+
readonly wqRunThreads: number;
|
|
50
|
+
readonly wqBlockedThreads: number;
|
|
51
|
+
readonly wqState: number;
|
|
52
|
+
readonly intWakeups: number;
|
|
53
|
+
readonly platIdleWakeups: number;
|
|
54
|
+
readonly timerWakeBin1: number;
|
|
55
|
+
readonly timerWakeBin2: number;
|
|
56
|
+
readonly machPortCount: number;
|
|
57
|
+
/** Absent without a usable CPU-time baseline. */
|
|
58
|
+
readonly cpuUsage?: number;
|
|
59
|
+
/** Absent without a usable CPU-time baseline. */
|
|
60
|
+
readonly powerScore?: number;
|
|
61
|
+
readonly memRPrvt: number;
|
|
62
|
+
readonly memRShrd: number;
|
|
63
|
+
readonly responsiblePID: number;
|
|
64
|
+
readonly appSleep: boolean;
|
|
65
|
+
readonly latencyQosTier: number;
|
|
66
|
+
readonly throughputQosTier: number;
|
|
67
|
+
readonly memPurgeable: number;
|
|
68
|
+
readonly totalEnergyScore: number;
|
|
69
|
+
readonly procAge: number;
|
|
70
|
+
readonly avgPowerScore: number;
|
|
71
|
+
readonly startAbsTime: number;
|
|
72
|
+
readonly wiredSize: number;
|
|
73
|
+
readonly physFootprint: number;
|
|
74
|
+
readonly memAnon: number;
|
|
75
|
+
readonly memAnonPeak: number;
|
|
76
|
+
readonly uniqueID: number;
|
|
77
|
+
readonly parentUniqueID: number;
|
|
78
|
+
readonly responsibleUniqueID: number;
|
|
79
|
+
readonly diskBytesRead: number;
|
|
80
|
+
readonly diskBytesWritten: number;
|
|
81
|
+
readonly memCompressed: number;
|
|
82
|
+
readonly coalitionID: number;
|
|
83
|
+
readonly __arch: number;
|
|
84
|
+
readonly __restricted: boolean;
|
|
85
|
+
readonly __sandbox: boolean;
|
|
86
|
+
readonly __suddenTerm: boolean;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface SystemAttributes {
|
|
90
|
+
readonly vmFreeCount: number;
|
|
91
|
+
readonly vmActiveCount: number;
|
|
92
|
+
readonly vmInactiveCount: number;
|
|
93
|
+
readonly vmWireCount: number;
|
|
94
|
+
readonly vmZeroFillCount: number;
|
|
95
|
+
readonly vmReactivations: number;
|
|
96
|
+
readonly vmPageIns: number;
|
|
97
|
+
readonly vmPageOuts: number;
|
|
98
|
+
readonly vmFaults: number;
|
|
99
|
+
readonly vmCowFaults: number;
|
|
100
|
+
readonly vmLookups: number;
|
|
101
|
+
readonly vmHits: number;
|
|
102
|
+
readonly vmPurges: number;
|
|
103
|
+
readonly vmPurgeableCount: number;
|
|
104
|
+
readonly vmSpeculativeCount: number;
|
|
105
|
+
readonly vmDecompressions: number;
|
|
106
|
+
readonly vmCompressions: number;
|
|
107
|
+
readonly vmSwapIns: number;
|
|
108
|
+
readonly vmSwapOuts: number;
|
|
109
|
+
readonly vmCompressorPageCount: number;
|
|
110
|
+
readonly vmThrottledCount: number;
|
|
111
|
+
readonly threadCount: number;
|
|
112
|
+
readonly diskReadOps: number;
|
|
113
|
+
readonly diskWriteOps: number;
|
|
114
|
+
readonly diskBytesRead: number;
|
|
115
|
+
readonly diskBytesWritten: number;
|
|
116
|
+
readonly netPacketsIn: number;
|
|
117
|
+
readonly netBytesIn: number;
|
|
118
|
+
readonly netPacketsOut: number;
|
|
119
|
+
readonly netBytesOut: number;
|
|
120
|
+
readonly vmExtPageCount: number;
|
|
121
|
+
readonly vmIntPageCount: number;
|
|
122
|
+
readonly vmTotalUncompPagesInComp: number;
|
|
123
|
+
readonly physMemSize: number;
|
|
124
|
+
readonly vmSize: number;
|
|
125
|
+
readonly vmUsedCount: number;
|
|
126
|
+
readonly __vmSwapUsage: number;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface ResourceUsage<
|
|
130
|
+
ProcessAttribute extends keyof ProcessAttributes = never,
|
|
131
|
+
SystemAttribute extends keyof SystemAttributes = never,
|
|
132
|
+
> {
|
|
133
|
+
readonly time: number;
|
|
134
|
+
readonly pageSize: number;
|
|
135
|
+
/** Empty in the first sample. */
|
|
136
|
+
readonly cpuLoadPerCore: readonly number[];
|
|
137
|
+
readonly system: Pick<SystemAttributes, SystemAttribute>;
|
|
138
|
+
readonly processes: readonly (Process &
|
|
139
|
+
Pick<ProcessAttributes, ProcessAttribute>)[];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export type Signal =
|
|
143
|
+
| "SIGHUP"
|
|
144
|
+
| "SIGINT"
|
|
145
|
+
| "SIGQUIT"
|
|
146
|
+
| "SIGILL"
|
|
147
|
+
| "SIGTRAP"
|
|
148
|
+
| "SIGABRT"
|
|
149
|
+
| "SIGEMT"
|
|
150
|
+
| "SIGFPE"
|
|
151
|
+
| "SIGKILL"
|
|
152
|
+
| "SIGBUS"
|
|
153
|
+
| "SIGSEGV"
|
|
154
|
+
| "SIGSYS"
|
|
155
|
+
| "SIGPIPE"
|
|
156
|
+
| "SIGALRM"
|
|
157
|
+
| "SIGTERM"
|
|
158
|
+
| "SIGURG"
|
|
159
|
+
| "SIGSTOP"
|
|
160
|
+
| "SIGTSTP"
|
|
161
|
+
| "SIGCONT"
|
|
162
|
+
| "SIGCHLD"
|
|
163
|
+
| "SIGTTIN"
|
|
164
|
+
| "SIGTTOU"
|
|
165
|
+
| "SIGIO"
|
|
166
|
+
| "SIGXCPU"
|
|
167
|
+
| "SIGXFSZ"
|
|
168
|
+
| "SIGVTALRM"
|
|
169
|
+
| "SIGPROF"
|
|
170
|
+
| "SIGWINCH"
|
|
171
|
+
| "SIGINFO"
|
|
172
|
+
| "SIGUSR1"
|
|
173
|
+
| "SIGUSR2";
|
|
174
|
+
|
|
175
|
+
export declare function list(options?: CallOptions): Promise<Process[]>;
|
|
176
|
+
export declare function resourceUsage<
|
|
177
|
+
ProcessAttribute extends keyof ProcessAttributes = never,
|
|
178
|
+
SystemAttribute extends keyof SystemAttributes = never,
|
|
179
|
+
>(
|
|
180
|
+
options?: CallOptions & {
|
|
181
|
+
readonly intervalMs?: number;
|
|
182
|
+
readonly processAttributes?: readonly ProcessAttribute[];
|
|
183
|
+
readonly systemAttributes?: readonly SystemAttribute[];
|
|
184
|
+
},
|
|
185
|
+
): AsyncIterable<ResourceUsage<ProcessAttribute, SystemAttribute>>;
|
|
186
|
+
export declare function kill(
|
|
187
|
+
pid: number,
|
|
188
|
+
signal?: Signal | number,
|
|
189
|
+
options?: CallOptions,
|
|
190
|
+
): Promise<void>;
|
package/process.mjs
ADDED
package/swift-ui.d.ts
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
/** @available apiLevel 3 */
|
|
2
|
+
import type { CommonViewModifierProps } from "@expo/ui/swift-ui";
|
|
3
|
+
import type { ModifierConfig } from "@expo/ui/swift-ui/modifiers";
|
|
4
|
+
import type { ReactElement } from "react";
|
|
5
|
+
import type { ColorValue } from "react-native";
|
|
6
|
+
|
|
7
|
+
export type ChartValue = number | string | Date;
|
|
8
|
+
|
|
9
|
+
export type ChartDimension =
|
|
10
|
+
number | { readonly ratio: number } | { readonly inset: number };
|
|
11
|
+
|
|
12
|
+
export type ChartForegroundStyle =
|
|
13
|
+
ColorValue | { readonly gradient: readonly ColorValue[] };
|
|
14
|
+
|
|
15
|
+
export type ChartInterpolation =
|
|
16
|
+
| "linear"
|
|
17
|
+
| "catmullRom"
|
|
18
|
+
| "cardinal"
|
|
19
|
+
| "monotone"
|
|
20
|
+
| "stepStart"
|
|
21
|
+
| "stepCenter"
|
|
22
|
+
| "stepEnd";
|
|
23
|
+
|
|
24
|
+
export type ChartSymbol =
|
|
25
|
+
| "circle"
|
|
26
|
+
| "square"
|
|
27
|
+
| "triangle"
|
|
28
|
+
| "diamond"
|
|
29
|
+
| "pentagon"
|
|
30
|
+
| "plus"
|
|
31
|
+
| "cross"
|
|
32
|
+
| "asterisk";
|
|
33
|
+
|
|
34
|
+
export type ChartStacking = "standard" | "normalized" | "center" | "unstacked";
|
|
35
|
+
|
|
36
|
+
export interface ChartLineStyle {
|
|
37
|
+
readonly width?: number;
|
|
38
|
+
readonly dash?: readonly number[];
|
|
39
|
+
readonly cap?: "butt" | "round" | "square";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ChartDatum {
|
|
43
|
+
readonly series?: string;
|
|
44
|
+
readonly group?: string;
|
|
45
|
+
readonly color?: ColorValue;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface ChartPoint extends ChartDatum {
|
|
49
|
+
readonly x: ChartValue;
|
|
50
|
+
readonly y: ChartValue;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface ChartVerticalSpan extends ChartDatum {
|
|
54
|
+
readonly x: ChartValue;
|
|
55
|
+
readonly yStart: ChartValue;
|
|
56
|
+
readonly yEnd: ChartValue;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface ChartHorizontalSpan extends ChartDatum {
|
|
60
|
+
readonly xStart: ChartValue;
|
|
61
|
+
readonly xEnd: ChartValue;
|
|
62
|
+
readonly y: ChartValue;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface ChartArea extends ChartDatum {
|
|
66
|
+
readonly xStart: ChartValue;
|
|
67
|
+
readonly xEnd: ChartValue;
|
|
68
|
+
readonly yStart: ChartValue;
|
|
69
|
+
readonly yEnd: ChartValue;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface ChartSector extends ChartDatum {
|
|
73
|
+
readonly value: number;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface ChartMarkStyle {
|
|
77
|
+
readonly foregroundStyle?: ChartForegroundStyle;
|
|
78
|
+
readonly opacity?: number;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface LineMark extends ChartMarkStyle {
|
|
82
|
+
readonly type: "line";
|
|
83
|
+
readonly data: readonly ChartPoint[];
|
|
84
|
+
readonly interpolation?: ChartInterpolation;
|
|
85
|
+
readonly lineStyle?: ChartLineStyle;
|
|
86
|
+
readonly symbol?: ChartSymbol;
|
|
87
|
+
readonly symbolSize?: number;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface AreaMark extends ChartMarkStyle {
|
|
91
|
+
readonly type: "area";
|
|
92
|
+
readonly data: readonly (
|
|
93
|
+
ChartPoint | ChartVerticalSpan | ChartHorizontalSpan
|
|
94
|
+
)[];
|
|
95
|
+
readonly interpolation?: ChartInterpolation;
|
|
96
|
+
readonly stacking?: ChartStacking;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface BarMark extends ChartMarkStyle {
|
|
100
|
+
readonly type: "bar";
|
|
101
|
+
readonly data: readonly (
|
|
102
|
+
ChartPoint | ChartVerticalSpan | ChartHorizontalSpan
|
|
103
|
+
)[];
|
|
104
|
+
readonly stacking?: ChartStacking;
|
|
105
|
+
readonly width?: ChartDimension;
|
|
106
|
+
readonly height?: ChartDimension;
|
|
107
|
+
readonly cornerRadius?: number;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface PointMark extends ChartMarkStyle {
|
|
111
|
+
readonly type: "point";
|
|
112
|
+
readonly data: readonly ChartPoint[];
|
|
113
|
+
readonly symbol?: ChartSymbol;
|
|
114
|
+
readonly symbolSize?: number;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface RuleMark extends ChartMarkStyle {
|
|
118
|
+
readonly type: "rule";
|
|
119
|
+
readonly data: readonly (
|
|
120
|
+
| (ChartDatum & { readonly x: ChartValue })
|
|
121
|
+
| (ChartDatum & { readonly y: ChartValue })
|
|
122
|
+
| ChartVerticalSpan
|
|
123
|
+
| ChartHorizontalSpan
|
|
124
|
+
)[];
|
|
125
|
+
readonly lineStyle?: ChartLineStyle;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface RectangleMark extends ChartMarkStyle {
|
|
129
|
+
readonly type: "rectangle";
|
|
130
|
+
readonly data: readonly (
|
|
131
|
+
ChartPoint | ChartVerticalSpan | ChartHorizontalSpan | ChartArea
|
|
132
|
+
)[];
|
|
133
|
+
readonly width?: ChartDimension;
|
|
134
|
+
readonly height?: ChartDimension;
|
|
135
|
+
readonly cornerRadius?: number;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface SectorMark extends ChartMarkStyle {
|
|
139
|
+
readonly type: "sector";
|
|
140
|
+
readonly data: readonly ChartSector[];
|
|
141
|
+
readonly innerRadius?: ChartDimension;
|
|
142
|
+
readonly outerRadius?: ChartDimension;
|
|
143
|
+
readonly angularInset?: number;
|
|
144
|
+
readonly cornerRadius?: number;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export type ChartMark =
|
|
148
|
+
| LineMark
|
|
149
|
+
| AreaMark
|
|
150
|
+
| BarMark
|
|
151
|
+
| PointMark
|
|
152
|
+
| RuleMark
|
|
153
|
+
| RectangleMark
|
|
154
|
+
| SectorMark;
|
|
155
|
+
|
|
156
|
+
export type ChartFormat =
|
|
157
|
+
| {
|
|
158
|
+
readonly style: "number";
|
|
159
|
+
readonly fractionDigits?: number;
|
|
160
|
+
readonly notation?: "compact";
|
|
161
|
+
readonly scale?: number;
|
|
162
|
+
}
|
|
163
|
+
| {
|
|
164
|
+
readonly style: "percent";
|
|
165
|
+
readonly fractionDigits?: number;
|
|
166
|
+
readonly scale?: number;
|
|
167
|
+
}
|
|
168
|
+
| {
|
|
169
|
+
readonly style: "bytes";
|
|
170
|
+
readonly units?: "memory" | "file" | "binary" | "decimal";
|
|
171
|
+
}
|
|
172
|
+
| {
|
|
173
|
+
readonly style: "date";
|
|
174
|
+
readonly date?:
|
|
175
|
+
"omitted" | "numeric" | "abbreviated" | "long" | "complete";
|
|
176
|
+
readonly time?: "omitted" | "shortened" | "standard" | "complete";
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
export interface ChartAxis {
|
|
180
|
+
readonly preset?: "automatic" | "extended" | "aligned" | "inset";
|
|
181
|
+
readonly position?: "automatic" | "leading" | "trailing" | "top" | "bottom";
|
|
182
|
+
readonly count?: number;
|
|
183
|
+
readonly values?: readonly (
|
|
184
|
+
ChartValue | { readonly value: ChartValue; readonly label: string }
|
|
185
|
+
)[];
|
|
186
|
+
readonly gridLines?: boolean;
|
|
187
|
+
readonly ticks?: boolean;
|
|
188
|
+
readonly labels?: boolean | ChartFormat;
|
|
189
|
+
readonly title?: string;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export type ChartScaleType =
|
|
193
|
+
"linear" | "log" | "squareRoot" | "symmetricLog" | "date" | "category";
|
|
194
|
+
|
|
195
|
+
export type ChartScale =
|
|
196
|
+
| {
|
|
197
|
+
readonly domain:
|
|
198
|
+
readonly [number, number] | readonly [Date, Date] | readonly string[];
|
|
199
|
+
readonly type?: ChartScaleType;
|
|
200
|
+
}
|
|
201
|
+
| {
|
|
202
|
+
readonly domain?: undefined;
|
|
203
|
+
readonly includesZero?: boolean;
|
|
204
|
+
readonly reversed?: boolean;
|
|
205
|
+
readonly type?: ChartScaleType;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
export interface ChartLegend {
|
|
209
|
+
readonly position?:
|
|
210
|
+
| "automatic"
|
|
211
|
+
| "overlay"
|
|
212
|
+
| "top"
|
|
213
|
+
| "bottom"
|
|
214
|
+
| "leading"
|
|
215
|
+
| "trailing"
|
|
216
|
+
| "topLeading"
|
|
217
|
+
| "topTrailing"
|
|
218
|
+
| "bottomLeading"
|
|
219
|
+
| "bottomTrailing";
|
|
220
|
+
readonly spacing?: number;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export interface ChartProps extends CommonViewModifierProps {
|
|
224
|
+
readonly marks: readonly ChartMark[];
|
|
225
|
+
readonly xAxis?: "automatic" | "hidden" | ChartAxis;
|
|
226
|
+
readonly yAxis?: "automatic" | "hidden" | ChartAxis;
|
|
227
|
+
readonly xScale?: ChartScale;
|
|
228
|
+
readonly yScale?: ChartScale;
|
|
229
|
+
readonly seriesColors?: Readonly<Record<string, ColorValue>>;
|
|
230
|
+
readonly legend?: "automatic" | "hidden" | ChartLegend;
|
|
231
|
+
readonly scrollableAxes?: "horizontal" | "vertical" | "both";
|
|
232
|
+
readonly xVisibleDomain?: number;
|
|
233
|
+
readonly yVisibleDomain?: number;
|
|
234
|
+
readonly initialScrollX?: ChartValue;
|
|
235
|
+
readonly initialScrollY?: ChartValue;
|
|
236
|
+
readonly onXSelectionChange?: (value: ChartValue | undefined) => void;
|
|
237
|
+
readonly onYSelectionChange?: (value: ChartValue | undefined) => void;
|
|
238
|
+
readonly animated?: boolean;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export declare function Chart(props: ChartProps): ReactElement;
|
|
242
|
+
|
|
243
|
+
export type DataGridCellImage =
|
|
244
|
+
| { readonly systemName: string; readonly color?: ColorValue }
|
|
245
|
+
| { readonly uri: string };
|
|
246
|
+
|
|
247
|
+
export interface DataGridCell {
|
|
248
|
+
readonly text: string;
|
|
249
|
+
readonly image?: DataGridCellImage;
|
|
250
|
+
readonly color?: ColorValue;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export interface DataGridFont {
|
|
254
|
+
readonly textStyle?:
|
|
255
|
+
| "largeTitle"
|
|
256
|
+
| "title"
|
|
257
|
+
| "title2"
|
|
258
|
+
| "title3"
|
|
259
|
+
| "headline"
|
|
260
|
+
| "subheadline"
|
|
261
|
+
| "body"
|
|
262
|
+
| "callout"
|
|
263
|
+
| "footnote"
|
|
264
|
+
| "caption"
|
|
265
|
+
| "caption2";
|
|
266
|
+
readonly size?: number;
|
|
267
|
+
readonly weight?:
|
|
268
|
+
| "ultraLight"
|
|
269
|
+
| "thin"
|
|
270
|
+
| "light"
|
|
271
|
+
| "regular"
|
|
272
|
+
| "medium"
|
|
273
|
+
| "semibold"
|
|
274
|
+
| "bold"
|
|
275
|
+
| "heavy"
|
|
276
|
+
| "black";
|
|
277
|
+
readonly design?: "default" | "rounded" | "monospaced" | "serif";
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export interface DataGridColumn<Item> {
|
|
281
|
+
readonly header: string;
|
|
282
|
+
readonly cell: (item: Item) => string | number | DataGridCell;
|
|
283
|
+
/** Only the cells that have been displayed widen a column; this widens it ahead of them. */
|
|
284
|
+
readonly prototype?: string | number | DataGridCell;
|
|
285
|
+
readonly minWidth?: number;
|
|
286
|
+
readonly maxWidth?: number;
|
|
287
|
+
/** The square space every cell keeps for its image; without it the cells show no image. */
|
|
288
|
+
readonly imageSize?: number;
|
|
289
|
+
readonly alignment?: "leading" | "center" | "trailing";
|
|
290
|
+
readonly font?: DataGridFont;
|
|
291
|
+
readonly monospacedDigit?: boolean;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export interface DataGridSortIndicator {
|
|
295
|
+
readonly column: number;
|
|
296
|
+
readonly order?: "ascending" | "descending";
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export interface DataGridProps<Item> extends CommonViewModifierProps {
|
|
300
|
+
readonly data: readonly Item[];
|
|
301
|
+
readonly columns: readonly DataGridColumn<Item>[];
|
|
302
|
+
readonly keyExtractor: (item: Item) => string;
|
|
303
|
+
/** The rows beyond the visible ones that `cell` is also called for. */
|
|
304
|
+
readonly overscanCount?: number;
|
|
305
|
+
readonly frozenColumns?: number;
|
|
306
|
+
readonly rowHeight?: number;
|
|
307
|
+
readonly headerHeight?: number;
|
|
308
|
+
readonly headerFont?: DataGridFont;
|
|
309
|
+
readonly headerColor?: ColorValue;
|
|
310
|
+
readonly rowColors?: readonly ColorValue[];
|
|
311
|
+
readonly sortIndicator?: DataGridSortIndicator;
|
|
312
|
+
readonly onCellPress?: (key: string, column: number) => void;
|
|
313
|
+
readonly onHeaderPress?: (column: number) => void;
|
|
314
|
+
readonly onHeaderLongPress?: (column: number) => void;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export declare function DataGrid<Item>(
|
|
318
|
+
props: DataGridProps<Item>,
|
|
319
|
+
): ReactElement;
|
|
320
|
+
|
|
321
|
+
export declare function horizontalSizeClass(
|
|
322
|
+
sizeClass: "compact" | "regular",
|
|
323
|
+
): ModifierConfig;
|
package/swift-ui.mjs
ADDED
package/swiplet.d.ts
CHANGED
|
@@ -58,6 +58,21 @@ export declare function defineAction<
|
|
|
58
58
|
context: ActionContext,
|
|
59
59
|
): Returned<O, R> | Promise<Returned<O, R>>;
|
|
60
60
|
}): Action<Sent<I>, Jsonify<Awaited<Delivered<O, R>>>>;
|
|
61
|
+
export declare function defineAction<
|
|
62
|
+
I extends Schema | undefined = undefined,
|
|
63
|
+
O extends Schema | undefined = undefined,
|
|
64
|
+
T = void,
|
|
65
|
+
>(definition: {
|
|
66
|
+
readonly title: string;
|
|
67
|
+
readonly description?: string;
|
|
68
|
+
readonly input?: I;
|
|
69
|
+
readonly output?: O;
|
|
70
|
+
/** @available apiLevel 3 */
|
|
71
|
+
stream(
|
|
72
|
+
input: Received<I>,
|
|
73
|
+
context: ActionContext,
|
|
74
|
+
): AsyncIterable<Returned<O, T>>;
|
|
75
|
+
}): Action<Sent<I>, AsyncIterable<Jsonify<Delivered<O, T>>>>;
|
|
61
76
|
|
|
62
77
|
export declare function defineExtension<
|
|
63
78
|
Actions extends Record<string, Action<any, any>> = {},
|
|
@@ -71,14 +86,23 @@ export declare function defineExtension<
|
|
|
71
86
|
|
|
72
87
|
export type ServiceStatus = "starting" | "running" | "stopped" | "failed";
|
|
73
88
|
|
|
89
|
+
type ActionReturn<Output> = [Output] extends [never]
|
|
90
|
+
? Promise<Output>
|
|
91
|
+
: Output extends AsyncIterable<unknown>
|
|
92
|
+
? Output
|
|
93
|
+
: Promise<Output>;
|
|
94
|
+
|
|
74
95
|
type ActionCall<A> =
|
|
75
96
|
A extends Action<infer Input, infer Output>
|
|
76
97
|
? [Input] extends [void]
|
|
77
98
|
? (
|
|
78
99
|
input?: undefined,
|
|
79
100
|
options?: { signal?: AbortSignal },
|
|
80
|
-
) =>
|
|
81
|
-
: (
|
|
101
|
+
) => ActionReturn<Output>
|
|
102
|
+
: (
|
|
103
|
+
input: Input,
|
|
104
|
+
options?: { signal?: AbortSignal },
|
|
105
|
+
) => ActionReturn<Output>
|
|
82
106
|
: never;
|
|
83
107
|
|
|
84
108
|
export type ActionCalls<E extends Extension<any, any>> = {
|