@playcanvas/inspector 0.4.0 → 0.6.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.
- package/README.md +176 -3
- package/package.json +8 -6
- package/src/asset-view.js +66 -3
- package/src/camera-view.js +1 -1
- package/src/copy-json.js +48 -9
- package/src/describe.js +1 -1
- package/src/frame-graph-view.js +4 -4
- package/src/image-capture.js +387 -0
- package/src/inspector.js +700 -57
- package/src/layer-view.js +235 -0
- package/src/list-view.js +2 -0
- package/src/log-capture.js +225 -0
- package/src/material-view.js +1 -1
- package/src/mcp-tools.js +1149 -0
- package/src/memory-view.js +60 -4
- package/src/mesh-view.js +51 -2
- package/src/perf-copy.js +1 -1
- package/src/physics-view.js +2 -2
- package/src/ref-registry.js +136 -0
- package/src/render-target-view.js +86 -9
- package/src/shader-view.js +33 -2
- package/src/snapshot-view.js +268 -0
- package/src/styles.js +283 -0
- package/src/texture-view.js +2 -2
- package/src/treemap-view.js +837 -0
- package/types/asset-view.d.ts +10 -0
- package/types/image-capture.d.ts +136 -0
- package/types/inspector.d.ts +291 -11
- package/types/layer-view.d.ts +80 -0
- package/types/log-capture.d.ts +104 -0
- package/types/mcp-tools.d.ts +855 -0
- package/types/memory-view.d.ts +11 -0
- package/types/mesh-view.d.ts +13 -0
- package/types/perf-copy.d.ts +22 -0
- package/types/ref-registry.d.ts +75 -0
- package/types/render-target-view.d.ts +17 -4
- package/types/shader-view.d.ts +12 -0
- package/types/snapshot-view.d.ts +166 -0
- package/types/texture-view.d.ts +12 -1
- package/types/treemap-view.d.ts +379 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A message logged by the page.
|
|
3
|
+
*/
|
|
4
|
+
export type LogEntry = object;
|
|
5
|
+
/**
|
|
6
|
+
* A message logged by the page.
|
|
7
|
+
*
|
|
8
|
+
* @typedef {object} LogEntry
|
|
9
|
+
* @ignore
|
|
10
|
+
* @property {number} seq - Its number: later messages have higher numbers.
|
|
11
|
+
* @property {number} time - When it was logged, in milliseconds since the capture started; for a
|
|
12
|
+
* repeated message, when it was last logged.
|
|
13
|
+
* @property {number} frame - The app frame it was logged in, or last logged in.
|
|
14
|
+
* @property {string} level - 'error', 'warn', 'info', 'log' or 'debug'.
|
|
15
|
+
* @property {string} text - The message.
|
|
16
|
+
* @property {number} count - How many times in a row it was logged.
|
|
17
|
+
* @property {string} [stack] - Where an uncaught error was thrown.
|
|
18
|
+
*/
|
|
19
|
+
export const LEVELS: string[];
|
|
20
|
+
/**
|
|
21
|
+
* Keeps the messages the page logs to the console, and the errors nothing caught, while started:
|
|
22
|
+
* the engine's warnings and errors in a debug build, shader compile errors, and the app's own
|
|
23
|
+
* messages. The console methods are wrapped while it runs, and still log as before; the console
|
|
24
|
+
* then names the wrapper as where a message came from, which is why it only runs while asked.
|
|
25
|
+
*
|
|
26
|
+
* @ignore
|
|
27
|
+
*/
|
|
28
|
+
export class LogCapture {
|
|
29
|
+
/**
|
|
30
|
+
* @param {() => number} frame - The app frame now.
|
|
31
|
+
*/
|
|
32
|
+
constructor(frame: () => number);
|
|
33
|
+
/**
|
|
34
|
+
* The messages kept, oldest first.
|
|
35
|
+
*
|
|
36
|
+
* @type {LogEntry[]}
|
|
37
|
+
*/
|
|
38
|
+
entries: LogEntry[];
|
|
39
|
+
/**
|
|
40
|
+
* The number of the last message.
|
|
41
|
+
*
|
|
42
|
+
* @type {number}
|
|
43
|
+
*/
|
|
44
|
+
seq: number;
|
|
45
|
+
/**
|
|
46
|
+
* @type {() => number}
|
|
47
|
+
* @private
|
|
48
|
+
*/
|
|
49
|
+
private _frame;
|
|
50
|
+
/**
|
|
51
|
+
* The console methods replaced, by level, while started.
|
|
52
|
+
*
|
|
53
|
+
* @type {Map<string, Function>|null}
|
|
54
|
+
* @private
|
|
55
|
+
*/
|
|
56
|
+
private _originals;
|
|
57
|
+
/**
|
|
58
|
+
* @type {Map<string, Function>}
|
|
59
|
+
* @private
|
|
60
|
+
*/
|
|
61
|
+
private _wrappers;
|
|
62
|
+
/**
|
|
63
|
+
* @type {number}
|
|
64
|
+
* @private
|
|
65
|
+
*/
|
|
66
|
+
private _start;
|
|
67
|
+
/**
|
|
68
|
+
* Whether messages are being kept.
|
|
69
|
+
*
|
|
70
|
+
* @type {boolean}
|
|
71
|
+
*/
|
|
72
|
+
get capturing(): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Starts keeping messages.
|
|
75
|
+
*/
|
|
76
|
+
start(): void;
|
|
77
|
+
/**
|
|
78
|
+
* Stops keeping messages, and puts the console back. A console method something else replaced
|
|
79
|
+
* after the capture started is left as it is.
|
|
80
|
+
*/
|
|
81
|
+
stop(): void;
|
|
82
|
+
/**
|
|
83
|
+
* Keeps a message. A message logged again right after itself counts up rather than repeating.
|
|
84
|
+
*
|
|
85
|
+
* @param {string} level - Its level.
|
|
86
|
+
* @param {string} text - The message.
|
|
87
|
+
* @param {string} [stack] - Where it was thrown.
|
|
88
|
+
*/
|
|
89
|
+
add(level: string, text: string, stack?: string): void;
|
|
90
|
+
/**
|
|
91
|
+
* Forgets every message kept.
|
|
92
|
+
*/
|
|
93
|
+
clear(): void;
|
|
94
|
+
/**
|
|
95
|
+
* @param {ErrorEvent} e - An error nothing caught.
|
|
96
|
+
* @private
|
|
97
|
+
*/
|
|
98
|
+
private _onError;
|
|
99
|
+
/**
|
|
100
|
+
* @param {PromiseRejectionEvent} e - A rejection nothing handled.
|
|
101
|
+
* @private
|
|
102
|
+
*/
|
|
103
|
+
private _onRejection;
|
|
104
|
+
}
|