@playcanvas/splat-transform 1.1.0 → 1.2.0

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.
@@ -30,5 +30,5 @@ export { writeHtml } from './writers/write-html';
30
30
  export { writeLod } from './writers/write-lod';
31
31
  export type { Options, Param } from './types';
32
32
  export { logger } from './utils/logger';
33
- export type { Logger } from './utils/logger';
33
+ export type { Logger, ProgressNode } from './utils/logger';
34
34
  export { WebPCodec } from './utils/webp-codec';
@@ -30,5 +30,5 @@ export { writeHtml } from './writers/write-html';
30
30
  export { writeLod } from './writers/write-lod';
31
31
  export type { Options, Param } from './types';
32
32
  export { logger } from './utils/logger';
33
- export type { Logger } from './utils/logger';
33
+ export type { Logger, ProgressNode } from './utils/logger';
34
34
  export { WebPCodec } from './utils/webp-codec';
@@ -1,3 +1,19 @@
1
+ /**
2
+ * Progress node representing a step in a nested progress tree.
3
+ * Walk up via `parent` to access enclosing steps.
4
+ */
5
+ interface ProgressNode {
6
+ /** Current step number at this level. */
7
+ step: number;
8
+ /** Total number of steps at this level. */
9
+ totalSteps: number;
10
+ /** Name of the current step (undefined for anonymous steps). */
11
+ stepName?: string;
12
+ /** Parent node (undefined for root level). */
13
+ parent?: ProgressNode;
14
+ /** Nesting depth (0 for root level). */
15
+ depth: number;
16
+ }
1
17
  /**
2
18
  * Logger interface for injectable logging implementation.
3
19
  */
@@ -10,10 +26,29 @@ interface Logger {
10
26
  error(...args: any[]): void;
11
27
  /** Log debug/verbose messages. */
12
28
  debug(...args: any[]): void;
13
- /** Output text without newline (for progress indicators). */
14
- progress(text: string): void;
15
29
  /** Output data to stdout (for piping). */
16
30
  output(text: string): void;
31
+ /** Called on progress step updates with the current node. */
32
+ onProgress(node: ProgressNode): void;
33
+ }
34
+ /**
35
+ * Progress tracking with nested step support.
36
+ * Access via logger.progress.begin(), logger.progress.step()
37
+ */
38
+ declare class Progress {
39
+ private currentNode;
40
+ /**
41
+ * Start a multi-step progress operation. Creates a new node with current as parent.
42
+ * Calls onProgress with step: 0 to notify consumers of the new progress block.
43
+ * @param totalSteps - Total number of steps in the operation.
44
+ */
45
+ begin(totalSteps: number): void;
46
+ /**
47
+ * Advance to the next step. Auto-increments the step counter.
48
+ * Auto-ends when all steps are complete.
49
+ * @param name - Optional name of the step.
50
+ */
51
+ step(name?: string): void;
17
52
  }
18
53
  /**
19
54
  * Global logger instance with injectable implementation.
@@ -21,6 +56,11 @@ interface Logger {
21
56
  * Use setQuiet() to suppress log/warn/progress output.
22
57
  */
23
58
  declare const logger: {
59
+ /**
60
+ * Progress tracking with nested step support.
61
+ * Call begin(n) to start, then step() n times. Auto-ends when complete.
62
+ */
63
+ progress: Progress;
24
64
  /**
25
65
  * Set a custom logger implementation.
26
66
  * @param l - The logger implementation to use.
@@ -51,11 +91,6 @@ declare const logger: {
51
91
  * @param args - The arguments to log.
52
92
  */
53
93
  debug(...args: any[]): void;
54
- /**
55
- * Output text without newline (for progress indicators). Suppressed in quiet mode.
56
- * @param text - The text to output.
57
- */
58
- progress(text: string): void;
59
94
  /**
60
95
  * Output data to stdout (for piping). Always shown, even in quiet mode.
61
96
  * @param text - The text to output.
@@ -63,4 +98,4 @@ declare const logger: {
63
98
  output(text: string): void;
64
99
  };
65
100
  export { logger };
66
- export type { Logger };
101
+ export type { Logger, ProgressNode };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playcanvas/splat-transform",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "author": "PlayCanvas<support@playcanvas.com>",
5
5
  "homepage": "https://playcanvas.com",
6
6
  "description": "Library and CLI tool for 3D Gaussian splat format conversion and transformation",