tauri-kargo-tools 0.2.3 → 0.2.5
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/api.ts +4 -0
- package/src/test/index.ts +8 -0
- package/src/types.ts +7 -0
- package/src/vue-model.ts +16 -0
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -95,6 +95,10 @@ export class TauriKargoClient {
|
|
|
95
95
|
createDirectory(path: string): Promise<T.CreateDirResp> {
|
|
96
96
|
return this.postJson<T.CreateDirResp>("/api/directory/create", { path: path });
|
|
97
97
|
}
|
|
98
|
+
|
|
99
|
+
typescriptTranspile(src: string): Promise<T.TypeScriptTranspileResponse> {
|
|
100
|
+
return this.postJson<T.TypeScriptTranspileResponse>("/api/typescript/transpile", { src: src });
|
|
101
|
+
}
|
|
98
102
|
/**
|
|
99
103
|
* Lire un fichier texte relatif au répertoire courant.
|
|
100
104
|
* (POST sans corps ⇒ READ ; renvoie text/plain ou octet-stream)
|
package/src/test/index.ts
CHANGED
|
@@ -90,6 +90,14 @@ test.test("Test schema simple avec deux type", async () => {
|
|
|
90
90
|
|
|
91
91
|
|
|
92
92
|
|
|
93
|
+
})
|
|
94
|
+
test.test("Test transpile ", async()=> {
|
|
95
|
+
const client = api.createClient();
|
|
96
|
+
const src = ` function m( n:number) { return n+1}`
|
|
97
|
+
const r = await client.typescriptTranspile(src)
|
|
98
|
+
console.log(JSON.stringify(r))
|
|
99
|
+
|
|
100
|
+
|
|
93
101
|
})
|
|
94
102
|
test.test("Test read file", async () => {
|
|
95
103
|
|
package/src/types.ts
CHANGED
|
@@ -104,7 +104,14 @@ export interface StopAllResp {
|
|
|
104
104
|
ok: boolean;
|
|
105
105
|
message: string;
|
|
106
106
|
}
|
|
107
|
+
export type TypeScriptTranspileInput = { src: string };
|
|
107
108
|
|
|
109
|
+
export type TypeScriptTranspileSuccess = { ok: true; src: string };
|
|
110
|
+
|
|
111
|
+
export type TypeScriptTranspileError = { ok: false; message: string };
|
|
112
|
+
|
|
113
|
+
export type TypeScriptTranspileResponse = TypeScriptTranspileSuccess | TypeScriptTranspileError;
|
|
114
|
+
|
|
108
115
|
export interface ExplorerReq {
|
|
109
116
|
path?: string;
|
|
110
117
|
}
|
package/src/vue-model.ts
CHANGED
|
@@ -233,6 +233,22 @@ export class Vue<T extends object> {
|
|
|
233
233
|
return this;
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
+
/* ------------ Label ------------ */
|
|
237
|
+
staticLabel(label: string, opt?: {
|
|
238
|
+
/** Identifiants CSS/DOM */
|
|
239
|
+
id?: string; class?: string | string[];
|
|
240
|
+
width?: number | string; height?: number | string;
|
|
241
|
+
visible?: KeysOfType<T, boolean>; enable?: KeysOfType<T, boolean>;
|
|
242
|
+
useVisibility?: boolean;
|
|
243
|
+
}): this {
|
|
244
|
+
const node: StaticLabelNode<T>= {
|
|
245
|
+
kind: 'staticLabel',
|
|
246
|
+
label,
|
|
247
|
+
...opt
|
|
248
|
+
};
|
|
249
|
+
this.cursor.push(node as unknown as UINode<T>);
|
|
250
|
+
return this;
|
|
251
|
+
}
|
|
236
252
|
|
|
237
253
|
|
|
238
254
|
/* ------------ BootVue (label dynamique) ------------ */
|