slint-ui 1.8.0-nightly.2024090616 → 1.8.0-nightly.2024091000

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/Cargo.toml CHANGED
@@ -40,10 +40,10 @@ accessibility = ["slint-interpreter/accessibility"]
40
40
  [dependencies]
41
41
  napi = { version = "2.14.0", default-features = false, features = ["napi8"] }
42
42
  napi-derive = "2.14.0"
43
- i-slint-compiler = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "f85cb45e88ce6610c9d7723802628e6039761351", version = "=1.8.0", default-features = false }
44
- i-slint-core = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "f85cb45e88ce6610c9d7723802628e6039761351", version = "=1.8.0", default-features = false }
45
- i-slint-backend-selector = { git = "https://github.com/slint-ui/slint", rev = "f85cb45e88ce6610c9d7723802628e6039761351", version = "=1.8.0", default-features = false }
46
- slint-interpreter = { default-features = false , features = ["display-diagnostics", "internal", "compat-1-2"] , git = "https://github.com/slint-ui/slint", rev = "f85cb45e88ce6610c9d7723802628e6039761351", version = "=1.8.0"}
43
+ i-slint-compiler = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "84fe3216001d51015e6e98e7bd4d3cc5e53c530e", version = "=1.8.0", default-features = false }
44
+ i-slint-core = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "84fe3216001d51015e6e98e7bd4d3cc5e53c530e", version = "=1.8.0", default-features = false }
45
+ i-slint-backend-selector = { git = "https://github.com/slint-ui/slint", rev = "84fe3216001d51015e6e98e7bd4d3cc5e53c530e", version = "=1.8.0", default-features = false }
46
+ slint-interpreter = { default-features = false , features = ["display-diagnostics", "internal", "compat-1-2"] , git = "https://github.com/slint-ui/slint", rev = "84fe3216001d51015e6e98e7bd4d3cc5e53c530e", version = "=1.8.0"}
47
47
  spin_on = { version = "0.1" }
48
48
  css-color-parser2 = { version = "1.0.1" }
49
49
  itertools = { version = "0.13" }
package/biome.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
3
+ "extends": ["../../editors/vscode/biome.json"],
4
+ "formatter": {
5
+ "ignore": ["*/rust-module.d.ts"]
6
+ },
7
+ "linter": {
8
+ "ignore": ["rust-module.d.ts"]
9
+ }
10
+ }
@@ -7,15 +7,16 @@
7
7
  import { Worker } from "node:worker_threads";
8
8
  import { spawn } from "child_process";
9
9
 
10
- const worker = new Worker("./rust-module.cjs")
10
+ const worker = new Worker("./rust-module.cjs");
11
11
  // Define dummy error handler to prevent node from aborting on errors
12
- worker.on('error', (error) => { console.log(`Error loading rust-module.cjs: {error}`) })
13
- worker.on('exit', (code) => {
14
- if (code != 0) {
15
- console.log("slint-ui: loading rust-module.cjs failed, building now")
12
+ worker.on("error", (error) => {
13
+ console.log(`Error loading rust-module.cjs: {error}`);
14
+ });
15
+ worker.on("exit", (code) => {
16
+ if (code !== 0) {
17
+ console.log("slint-ui: loading rust-module.cjs failed, building now");
16
18
  spawn("npm", ["run", "build"], {
17
- stdio: 'inherit'
18
- })
19
+ stdio: "inherit",
20
+ });
19
21
  }
20
- })
21
-
22
+ });
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as napi from "./rust-module.cjs";
2
- export { Diagnostic, DiagnosticLevel, RgbaColor, Brush } from "./rust-module";
2
+ export { Diagnostic, DiagnosticLevel, RgbaColor, Brush, } from "./rust-module";
3
3
  /**
4
4
  * Represents a two-dimensional point.
5
5
  */
@@ -264,111 +264,111 @@ export declare namespace private_api {
264
264
  *
265
265
  * ```ts
266
266
  * import { Model, ArrayModel, MapModel } from "./index";
267
- *
268
- * interface Name {
269
- * first: string;
270
- * last: string;
271
- * }
272
- *
273
- * const model = new ArrayModel<Name>([
274
- * {
275
- * first: "Hans",
276
- * last: "Emil",
277
- * },
278
- * {
279
- * first: "Max",
280
- * last: "Mustermann",
281
- * },
282
- * {
283
- * first: "Roman",
284
- * last: "Tisch",
285
- * },
286
- * ]);
287
- *
288
- * const mappedModel = new MapModel(
289
- * model,
290
- * (data) => {
291
- * return data.last + ", " + data.first;
292
- * }
293
- * );
294
- *
295
- * // prints "Emil, Hans"
296
- * console.log(mappedModel.rowData(0));
297
- *
298
- * // prints "Mustermann, Max"
299
- * console.log(mappedModel.rowData(1));
300
- *
301
- * // prints "Tisch, Roman"
302
- * console.log(mappedModel.rowData(2));
303
- *
304
- * // Alternatively you can use the shortcut {@link MapModel.map}.
305
- *
306
- * const model = new ArrayModel<Name>([
307
- * {
308
- * first: "Hans",
309
- * last: "Emil",
310
- * },
311
- * {
312
- * first: "Max",
313
- * last: "Mustermann",
314
- * },
315
- * {
316
- * first: "Roman",
317
- * last: "Tisch",
318
- * },
319
- * ]);
320
- *
321
- * const mappedModel = model.map(
322
- * (data) => {
323
- * return data.last + ", " + data.first;
324
- * }
325
- * );
326
- *
327
- *
328
- * // prints "Emil, Hans"
329
- * console.log(mappedModel.rowData(0));
330
- *
331
- * // prints "Mustermann, Max"
332
- * console.log(mappedModel.rowData(1));
333
- *
334
- * // prints "Tisch, Roman"
335
- * console.log(mappedModel.rowData(2));
336
- *
337
- * // You can modifying the underlying {@link ArrayModel}:
338
- *
339
- * const model = new ArrayModel<Name>([
340
- * {
341
- * first: "Hans",
342
- * last: "Emil",
343
- * },
344
- * {
345
- * first: "Max",
346
- * last: "Mustermann",
347
- * },
348
- * {
349
- * first: "Roman",
350
- * last: "Tisch",
351
- * },
352
- * ]);
353
- *
354
- * const mappedModel = model.map(
355
- * (data) => {
356
- * return data.last + ", " + data.first;
357
- * }
358
- * );
359
- *
360
- * model.setRowData(1, { first: "Minnie", last: "Musterfrau" } );
361
- *
362
- * // prints "Emil, Hans"
363
- * console.log(mappedModel.rowData(0));
364
- *
365
- * // prints "Musterfrau, Minnie"
366
- * console.log(mappedModel.rowData(1));
367
- *
368
- * // prints "Tisch, Roman"
369
- * console.log(mappedModel.rowData(2));
370
- * ```
371
- */
267
+ *
268
+ * interface Name {
269
+ * first: string;
270
+ * last: string;
271
+ * }
272
+ *
273
+ * const model = new ArrayModel<Name>([
274
+ * {
275
+ * first: "Hans",
276
+ * last: "Emil",
277
+ * },
278
+ * {
279
+ * first: "Max",
280
+ * last: "Mustermann",
281
+ * },
282
+ * {
283
+ * first: "Roman",
284
+ * last: "Tisch",
285
+ * },
286
+ * ]);
287
+ *
288
+ * const mappedModel = new MapModel(
289
+ * model,
290
+ * (data) => {
291
+ * return data.last + ", " + data.first;
292
+ * }
293
+ * );
294
+ *
295
+ * // prints "Emil, Hans"
296
+ * console.log(mappedModel.rowData(0));
297
+ *
298
+ * // prints "Mustermann, Max"
299
+ * console.log(mappedModel.rowData(1));
300
+ *
301
+ * // prints "Tisch, Roman"
302
+ * console.log(mappedModel.rowData(2));
303
+ *
304
+ * // Alternatively you can use the shortcut {@link MapModel.map}.
305
+ *
306
+ * const model = new ArrayModel<Name>([
307
+ * {
308
+ * first: "Hans",
309
+ * last: "Emil",
310
+ * },
311
+ * {
312
+ * first: "Max",
313
+ * last: "Mustermann",
314
+ * },
315
+ * {
316
+ * first: "Roman",
317
+ * last: "Tisch",
318
+ * },
319
+ * ]);
320
+ *
321
+ * const mappedModel = model.map(
322
+ * (data) => {
323
+ * return data.last + ", " + data.first;
324
+ * }
325
+ * );
326
+ *
327
+ *
328
+ * // prints "Emil, Hans"
329
+ * console.log(mappedModel.rowData(0));
330
+ *
331
+ * // prints "Mustermann, Max"
332
+ * console.log(mappedModel.rowData(1));
333
+ *
334
+ * // prints "Tisch, Roman"
335
+ * console.log(mappedModel.rowData(2));
336
+ *
337
+ * // You can modifying the underlying {@link ArrayModel}:
338
+ *
339
+ * const model = new ArrayModel<Name>([
340
+ * {
341
+ * first: "Hans",
342
+ * last: "Emil",
343
+ * },
344
+ * {
345
+ * first: "Max",
346
+ * last: "Mustermann",
347
+ * },
348
+ * {
349
+ * first: "Roman",
350
+ * last: "Tisch",
351
+ * },
352
+ * ]);
353
+ *
354
+ * const mappedModel = model.map(
355
+ * (data) => {
356
+ * return data.last + ", " + data.first;
357
+ * }
358
+ * );
359
+ *
360
+ * model.setRowData(1, { first: "Minnie", last: "Musterfrau" } );
361
+ *
362
+ * // prints "Emil, Hans"
363
+ * console.log(mappedModel.rowData(0));
364
+ *
365
+ * // prints "Musterfrau, Minnie"
366
+ * console.log(mappedModel.rowData(1));
367
+ *
368
+ * // prints "Tisch, Roman"
369
+ * console.log(mappedModel.rowData(2));
370
+ * ```
371
+ */
372
372
  class MapModel<T, U> extends Model<U> {
373
373
  #private;
374
374
  readonly sourceModel: Model<T>;
@@ -431,8 +431,8 @@ declare class Component implements ComponentHandle {
431
431
  constructor(instance: napi.ComponentInstance);
432
432
  get window(): Window;
433
433
  /**
434
- * @hidden
435
- */
434
+ * @hidden
435
+ */
436
436
  get component_instance(): napi.ComponentInstance;
437
437
  run(): Promise<void>;
438
438
  show(): void;