tauri-kargo-tools 0.3.2 → 0.3.4
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/package.json +1 -1
- package/src/test.ts +1 -1
- package/src/types.ts +37 -32
package/package.json
CHANGED
package/src/test.ts
CHANGED
|
@@ -355,7 +355,7 @@ export async function assertEqualsSnapshot(actual: unknown, name: string, msg?:
|
|
|
355
355
|
try {
|
|
356
356
|
const response = await fetch(`/test/snapshot/${name}.json`)
|
|
357
357
|
if (response.status === 404) {
|
|
358
|
-
const updateSnapshot: UpdateSnapshot = { type: "snapshot", value: actual }
|
|
358
|
+
const updateSnapshot: UpdateSnapshot = { type: "snapshot", value: actual ,name:name}
|
|
359
359
|
if (self) {
|
|
360
360
|
self.postMessage(updateSnapshot)
|
|
361
361
|
return
|
package/src/types.ts
CHANGED
|
@@ -111,7 +111,7 @@ export type TypeScriptTranspileSuccess = { ok: true; src: string };
|
|
|
111
111
|
export type TypeScriptTranspileError = { ok: false; message: string };
|
|
112
112
|
|
|
113
113
|
export type TypeScriptTranspileResponse = TypeScriptTranspileSuccess | TypeScriptTranspileError;
|
|
114
|
-
|
|
114
|
+
|
|
115
115
|
export interface ExplorerReq {
|
|
116
116
|
path?: string;
|
|
117
117
|
}
|
|
@@ -153,7 +153,7 @@ export type ExplorerFileResponse = {
|
|
|
153
153
|
};
|
|
154
154
|
|
|
155
155
|
export type ExplorerArrayFileItem = {
|
|
156
|
-
type:'file'
|
|
156
|
+
type: 'file'
|
|
157
157
|
name: string;
|
|
158
158
|
/** chemin absolu du fichier */
|
|
159
159
|
path: string;
|
|
@@ -161,33 +161,33 @@ export type ExplorerArrayFileItem = {
|
|
|
161
161
|
|
|
162
162
|
export type ExplorerTreeItem =
|
|
163
163
|
| {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
164
|
+
type: "file";
|
|
165
|
+
name: string;
|
|
166
|
+
path: string; // absolu
|
|
167
|
+
}
|
|
168
168
|
| {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
169
|
+
type: "directory";
|
|
170
|
+
name: string;
|
|
171
|
+
path: string; // absolu
|
|
172
|
+
/** peut être absent si maxDeep empêche d'expand */
|
|
173
|
+
content?: ExplorerTreeItem[];
|
|
174
|
+
};
|
|
175
175
|
|
|
176
176
|
export type ExplorerDirectoryResponse =
|
|
177
177
|
| {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
178
|
+
type: "directory";
|
|
179
|
+
path: string; // absolu
|
|
180
|
+
parent: string | null;
|
|
181
|
+
/** si request.type === "array" */
|
|
182
|
+
content: ExplorerArrayFileItem[];
|
|
183
|
+
}
|
|
184
184
|
| {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
185
|
+
type: "directory";
|
|
186
|
+
path: string; // absolu
|
|
187
|
+
parent: string | null;
|
|
188
|
+
/** si request.type === "tree" (ou mode absent côté compat) */
|
|
189
|
+
content: ExplorerTreeItem[];
|
|
190
|
+
};
|
|
191
191
|
|
|
192
192
|
export type ExplorerResponse =
|
|
193
193
|
| ExplorerErrorResponse
|
|
@@ -264,15 +264,20 @@ export interface ApiTypescriptAstRequest {
|
|
|
264
264
|
path: string;
|
|
265
265
|
}
|
|
266
266
|
export interface Assert {
|
|
267
|
-
type:'assert'
|
|
268
|
-
value:boolean
|
|
269
|
-
message:string
|
|
270
|
-
|
|
267
|
+
type: 'assert'
|
|
268
|
+
value: boolean
|
|
269
|
+
message: string
|
|
270
|
+
}
|
|
271
271
|
export interface Log {
|
|
272
|
-
type:'log'
|
|
273
|
-
message:(string|number)[]|string|number
|
|
272
|
+
type: 'log'
|
|
273
|
+
message: (string | number)[] | string | number
|
|
274
274
|
}
|
|
275
275
|
export interface Terminate {
|
|
276
|
-
type:'terminate'
|
|
276
|
+
type: 'terminate'
|
|
277
277
|
}
|
|
278
|
-
export type TestEvent = Assert|Log|Terminate
|
|
278
|
+
export type TestEvent = Assert | Log | Terminate
|
|
279
|
+
export type UpdateSnapshot = {
|
|
280
|
+
type: "snapshot",
|
|
281
|
+
name:string,
|
|
282
|
+
value: any
|
|
283
|
+
}
|