@playcanvas/inspector 0.1.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.
Files changed (77) hide show
  1. package/LICENSE +19 -0
  2. package/README.md +110 -0
  3. package/package.json +62 -0
  4. package/src/asset-usage.js +108 -0
  5. package/src/asset-view.js +370 -0
  6. package/src/camera-view.js +128 -0
  7. package/src/debug.js +31 -0
  8. package/src/describe.js +302 -0
  9. package/src/entity-inspector-script.js +130 -0
  10. package/src/frame-graph-view.js +767 -0
  11. package/src/hierarchy-view.js +475 -0
  12. package/src/index.js +4 -0
  13. package/src/input/fly-controller.js +116 -0
  14. package/src/input/input.js +299 -0
  15. package/src/input/math.js +8 -0
  16. package/src/input/orbit-controller.js +158 -0
  17. package/src/input/pose.js +207 -0
  18. package/src/inspector.js +3293 -0
  19. package/src/instance-survey.js +50 -0
  20. package/src/list-view.js +410 -0
  21. package/src/material-view.js +197 -0
  22. package/src/memory-view.js +344 -0
  23. package/src/mesh-view.js +235 -0
  24. package/src/model.js +170 -0
  25. package/src/node-model.js +404 -0
  26. package/src/physics-debug.js +527 -0
  27. package/src/physics-view.js +314 -0
  28. package/src/picker/picker.js +545 -0
  29. package/src/picker/render-pass-picker.js +206 -0
  30. package/src/property-view.js +628 -0
  31. package/src/render-target-view.js +288 -0
  32. package/src/renderers/texture-renderer-shaders.js +139 -0
  33. package/src/renderers/texture-renderer.js +430 -0
  34. package/src/renderers/wire-renderer.js +954 -0
  35. package/src/script-view.js +288 -0
  36. package/src/shader-view.js +287 -0
  37. package/src/styles.js +918 -0
  38. package/src/texture-view.js +186 -0
  39. package/src/tooltip.js +72 -0
  40. package/src/viewport-tools.js +695 -0
  41. package/types/asset-usage.d.ts +23 -0
  42. package/types/asset-view.d.ts +94 -0
  43. package/types/camera-view.d.ts +45 -0
  44. package/types/debug.d.ts +14 -0
  45. package/types/describe.d.ts +43 -0
  46. package/types/entity-inspector-script.d.ts +87 -0
  47. package/types/frame-graph-view.d.ts +155 -0
  48. package/types/hierarchy-view.d.ts +172 -0
  49. package/types/index.d.ts +3 -0
  50. package/types/input/fly-controller.d.ts +42 -0
  51. package/types/input/input.d.ts +192 -0
  52. package/types/input/math.d.ts +1 -0
  53. package/types/input/orbit-controller.d.ts +63 -0
  54. package/types/input/pose.d.ts +126 -0
  55. package/types/inspector.d.ts +1304 -0
  56. package/types/instance-survey.d.ts +35 -0
  57. package/types/list-view.d.ts +151 -0
  58. package/types/material-view.d.ts +63 -0
  59. package/types/memory-view.d.ts +95 -0
  60. package/types/mesh-view.d.ts +89 -0
  61. package/types/model.d.ts +104 -0
  62. package/types/node-model.d.ts +54 -0
  63. package/types/physics-debug.d.ts +254 -0
  64. package/types/physics-view.d.ts +81 -0
  65. package/types/picker/picker.d.ts +255 -0
  66. package/types/picker/render-pass-picker.d.ts +47 -0
  67. package/types/property-view.d.ts +189 -0
  68. package/types/render-target-view.d.ts +98 -0
  69. package/types/renderers/texture-renderer-shaders.d.ts +9 -0
  70. package/types/renderers/texture-renderer.d.ts +231 -0
  71. package/types/renderers/wire-renderer.d.ts +347 -0
  72. package/types/script-view.d.ts +56 -0
  73. package/types/shader-view.d.ts +46 -0
  74. package/types/styles.d.ts +22 -0
  75. package/types/texture-view.d.ts +30 -0
  76. package/types/tooltip.d.ts +17 -0
  77. package/types/viewport-tools.d.ts +237 -0
@@ -0,0 +1,35 @@
1
+ /**
2
+ * A mesh instance found, and where it was found.
3
+ */
4
+ export type FoundInstance = {
5
+ /**
6
+ * - The mesh instance.
7
+ */
8
+ instance: MeshInstance;
9
+ /**
10
+ * - Where it was found, such as 'render component' or 'drawn on "World"'.
11
+ */
12
+ role: string;
13
+ };
14
+ /** @import { AppBase } from 'playcanvas' */
15
+ /**
16
+ * A mesh instance found, and where it was found.
17
+ *
18
+ * @typedef {object} FoundInstance
19
+ * @property {MeshInstance} instance - The mesh instance.
20
+ * @property {string} role - Where it was found, such as 'render component' or 'drawn on "World"'.
21
+ * @ignore
22
+ */
23
+ /**
24
+ * Finds the mesh instances of the app. Nothing keeps a list of them, so they are gathered from
25
+ * what holds them: the render and model components of the hierarchy, including those of disabled
26
+ * entities, which the layers drop, then every layer of the composition, which adds sprites, text,
27
+ * particles, batches and the sky. An instance is held by its component and listed by every layer
28
+ * it renders in, so it is reported once, under the first place it is found. The batches of debug
29
+ * lines are not included: they are pushed straight into the visible lists each frame, so callers
30
+ * find them through the immediate renderer.
31
+ *
32
+ * @param {AppBase} app - The app.
33
+ * @returns {FoundInstance[]} The mesh instances, in the order found.
34
+ */
35
+ export function collectMeshInstances(app: MeshInstance): FoundInstance[];
@@ -0,0 +1,151 @@
1
+ export type ListCell = object;
2
+ export type ListRow = object;
3
+ /**
4
+ * The brackets a row shows in the gutter on its left. A bracket spans a run of rows in one lane,
5
+ * each lane a nesting level, and marks the row it belongs to with a tick pointing at the row.
6
+ */
7
+ export type ListGuides = object;
8
+ export type ListEntry = object;
9
+ /**
10
+ * A flat, selectable list of rows with cells. Rows are keyed and reconciled in place, so a list
11
+ * rebuilt from scratch a couple of times a second keeps its selection and scroll position and only
12
+ * touches the text that changed.
13
+ *
14
+ * @ignore
15
+ */
16
+ export class ListView {
17
+ /**
18
+ * @param {HTMLElement} container - The element to render into.
19
+ * @param {(item: *, key: string|null) => void} onSelect - The selection callback.
20
+ * @param {(target: *) => void} [onLink] - The link callback.
21
+ */
22
+ constructor(container: HTMLElement, onSelect: (item: any, key: string | null) => void, onLink?: (target: any) => void);
23
+ /**
24
+ * The element the list is rendered into.
25
+ *
26
+ * @type {HTMLElement}
27
+ */
28
+ container: HTMLElement;
29
+ /**
30
+ * Called with the selected item and its row key, or null when the selection is cleared.
31
+ *
32
+ * @type {(item: *, key: string|null) => void}
33
+ */
34
+ onSelect: (item: any, key: string | null) => void;
35
+ /**
36
+ * Called with the target of a link cell when it is clicked.
37
+ *
38
+ * @type {((target: *) => void)|undefined}
39
+ */
40
+ onLink: ((target: any) => void) | undefined;
41
+ /**
42
+ * Called when the pointer enters a link, with the link element and a function reading the
43
+ * link's current target, and with nulls when it leaves. The target is read through the
44
+ * function because a refresh can point the same element at a new target while it is hovered.
45
+ *
46
+ * @type {((el: HTMLElement|null, target: (() => *)|null) => void)|undefined}
47
+ */
48
+ onHover: ((el: HTMLElement | null, target: (() => any) | null) => void) | undefined;
49
+ /**
50
+ * Called with a row's item and the new state when one of its checkbox cells changes.
51
+ *
52
+ * @type {((item: *, checked: boolean) => void)|undefined}
53
+ */
54
+ onToggle: ((item: any, checked: boolean) => void) | undefined;
55
+ /**
56
+ * Case-insensitive filter on the rows' names.
57
+ *
58
+ * @type {string}
59
+ */
60
+ filter: string;
61
+ /**
62
+ * The key of the selected row, or null.
63
+ *
64
+ * @type {string|null}
65
+ */
66
+ selectedKey: string | null;
67
+ /**
68
+ * The number of rows shown after filtering, as of the last render.
69
+ *
70
+ * @type {number}
71
+ */
72
+ visibleCount: number;
73
+ /**
74
+ * @type {ListRow[]}
75
+ * @private
76
+ */
77
+ private _rows;
78
+ /**
79
+ * @type {Map<string, ListEntry>}
80
+ * @private
81
+ */
82
+ private _entries;
83
+ /**
84
+ * The number of rows before filtering.
85
+ *
86
+ * @type {number}
87
+ */
88
+ get rowCount(): number;
89
+ /**
90
+ * The item of the selected row, or null when nothing is selected or the row is gone.
91
+ *
92
+ * @type {*}
93
+ */
94
+ get selected(): any;
95
+ /**
96
+ * Replaces the rows and re-renders.
97
+ *
98
+ * @param {ListRow[]} rows - The rows, in display order.
99
+ */
100
+ setRows(rows: ListRow[]): void;
101
+ /**
102
+ * Selects a row by key.
103
+ *
104
+ * @param {string|null} key - The row key, or null to clear the selection.
105
+ */
106
+ select(key: string | null): void;
107
+ /**
108
+ * Selects the first row whose item is the given object.
109
+ *
110
+ * @param {*} item - The item.
111
+ * @returns {boolean} Whether a row was found.
112
+ */
113
+ selectItem(item: any): boolean;
114
+ /**
115
+ * Synchronizes the DOM with the rows.
116
+ */
117
+ render(): void;
118
+ /**
119
+ * @param {ListEntry} entry - The row entry.
120
+ * @param {ListCell[]} cells - The cells to show.
121
+ * @private
122
+ */
123
+ private _syncCells;
124
+ /**
125
+ * @param {ListEntry} entry - The row entry.
126
+ * @param {number} index - The cell index.
127
+ * @returns {HTMLElement} A text cell, clicking a link cell calls {@link onLink}.
128
+ * @private
129
+ */
130
+ private _createTextCell;
131
+ /**
132
+ * @param {ListEntry} entry - The row entry.
133
+ * @param {number} index - The cell index.
134
+ * @returns {HTMLInputElement} A checkbox cell that reports through {@link onToggle}.
135
+ * @private
136
+ */
137
+ private _createToggleCell;
138
+ /**
139
+ * @param {ListRow} row - The row.
140
+ * @returns {ListEntry} The new entry.
141
+ * @private
142
+ */
143
+ private _createEntry;
144
+ /**
145
+ * Reports the row the pointer is over, when it previews something, or that nothing is hovered.
146
+ *
147
+ * @param {ListEntry} entry - The row entry.
148
+ * @private
149
+ */
150
+ private _hoverRow;
151
+ }
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Where a material was found besides its mesh instances, which the material lists itself.
3
+ */
4
+ export type MaterialSources = {
5
+ /**
6
+ * - The material assets holding it.
7
+ */
8
+ assets: Material[];
9
+ /**
10
+ * - The layers whose debug lines draw with it.
11
+ */
12
+ lines: string[];
13
+ };
14
+ /**
15
+ * Everything the property view shows for a material: its textures, its compiled variants and its
16
+ * properties, and what uses it, with each mesh instance opening in place.
17
+ *
18
+ * @param {Material} material - The material.
19
+ * @param {{ app: AppBase }} ctx - The app, to find the assets and debug lines using the material.
20
+ * @returns {PropertySection[]} The sections.
21
+ */
22
+ export function buildMaterialModel(material: Material, ctx: {
23
+ app: Material;
24
+ }): PropertySection[];
25
+ /**
26
+ * One row per material found, the most used first, dimmed when no mesh instance uses it.
27
+ *
28
+ * @param {Map<Material, MaterialSources>} survey - The materials found.
29
+ * @returns {ListRow[]} The rows.
30
+ */
31
+ export function materialListRows(survey: Map<Material, MaterialSources>): ListRow[];
32
+ /**
33
+ * @param {AppBase} app - The app.
34
+ * @param {Shader} shader - A shader.
35
+ * @returns {Material[]} The materials found that compiled it as one of their variants.
36
+ */
37
+ export function materialsUsingShader(app: Material, shader: Material): Material[];
38
+ /**
39
+ * @param {AppBase} app - The app.
40
+ * @param {Texture} texture - A texture.
41
+ * @returns {Material[]} The materials found that sample it.
42
+ */
43
+ export function materialsUsingTexture(app: Material, texture: Material): Material[];
44
+ /**
45
+ * Finds the materials of the app. Nothing keeps a list of them, so they are found through what
46
+ * uses them: the mesh instances of the components and layers, see {@link collectMeshInstances},
47
+ * which add the sky, sprite, text and particle materials and the default material; the batches of
48
+ * debug lines, one per material; and the loaded material assets of the registry, which include
49
+ * those a glb container creates and hold materials nothing may be drawing with. A material only the
50
+ * app's own code holds, never given to a mesh instance, cannot be found.
51
+ *
52
+ * @param {AppBase} app - The app.
53
+ * @returns {Map<Material, MaterialSources>} The materials, in the order found, with the assets and
54
+ * debug lines using each.
55
+ */
56
+ export function surveyMaterials(app: Material): Map<Material, MaterialSources>;
57
+ /**
58
+ * @param {Material[]} materials - The materials using something.
59
+ * @returns {PropertySection} A section listing them, each linking to the Materials tab.
60
+ */
61
+ export function usedByMaterialsSection(materials: Material[]): PropertySection;
62
+ import type { PropertySection } from './model.js';
63
+ import type { ListRow } from './list-view.js';
@@ -0,0 +1,95 @@
1
+ export type Buffer = VertexBuffer | IndexBuffer | BUFFER_DYNAMIC | StorageBuffer;
2
+ /**
3
+ * Something a buffer was found to belong to.
4
+ */
5
+ export type BufferOwner = {
6
+ /**
7
+ * - What the buffer holds for it, such as 'vertices'.
8
+ */
9
+ role: string;
10
+ /**
11
+ * - The owner's name.
12
+ */
13
+ label: string;
14
+ /**
15
+ * - What to link to, or null when there is nothing to
16
+ * show.
17
+ */
18
+ target: BUFFER_DYNAMIC | BUFFER_DYNAMIC | BUFFER_DYNAMIC | null;
19
+ };
20
+ /** What the list can be narrowed to, as selector options. */
21
+ export const BUFFER_KINDS: string[][];
22
+ /**
23
+ * @param {Buffer} buffer - A buffer.
24
+ * @returns {number} Its size in bytes.
25
+ */
26
+ export function bufferBytes(buffer: Buffer): number;
27
+ /**
28
+ * @param {*} buffer - A buffer.
29
+ * @returns {'vertex'|'index'|'uniform'|'storage'|null} Its kind, or null for anything else.
30
+ */
31
+ export function bufferKind(buffer: any): "vertex" | "index" | "uniform" | "storage" | null;
32
+ /**
33
+ * Finds what the buffers on the device belong to. No buffer records its owner, so the owners are
34
+ * found from the other end: every mesh instance of the components and layers, see
35
+ * {@link collectMeshInstances}, gives its mesh's geometry and its material's uniforms, the
36
+ * immediate renderer gives the batches of debug lines,
37
+ * loaded render assets give the geometry of meshes not drawn right now, and the device gives its
38
+ * own quad. Storage buffers and the per-draw uniform pool are
39
+ * held privately by their users and stay unattributed.
40
+ *
41
+ * @param {AppBase} app - The app.
42
+ * @returns {Map<Buffer, BufferOwner[]>} The owners of each attributed buffer.
43
+ */
44
+ export function bufferOwners(app: BUFFER_DYNAMIC): Map<Buffer, BufferOwner[]>;
45
+ /**
46
+ * One row per buffer, largest first, named after what uses it and dimmed when nothing was found.
47
+ *
48
+ * @param {GraphicsDevice} device - The device.
49
+ * @param {Map<Buffer, BufferOwner[]>} owners - The owners of each buffer.
50
+ * @param {string} kind - The kind to list, or 'all'.
51
+ * @returns {ListRow[]} The rows.
52
+ */
53
+ export function bufferRows(device: BUFFER_DYNAMIC, owners: Map<Buffer, BufferOwner[]>, kind: string): ListRow[];
54
+ /**
55
+ * Everything the property view shows for a buffer: its size and layout, what it was found to
56
+ * belong to (linked), and every other public property.
57
+ *
58
+ * @param {Buffer} buffer - The buffer.
59
+ * @param {{ app: AppBase }} ctx - The app, to find the buffer's owners.
60
+ * @returns {PropertySection[]} The sections.
61
+ */
62
+ export function buildBufferModel(buffer: Buffer, ctx: {
63
+ app: BUFFER_DYNAMIC;
64
+ }): PropertySection[];
65
+ /**
66
+ * Every buffer the device tracks, largest first. Uniform buffers appear only when persistent, as
67
+ * the rest are slices of the per-frame pool.
68
+ *
69
+ * @param {GraphicsDevice} device - The device.
70
+ * @param {string} [kind] - One of {@link BUFFER_KINDS}.
71
+ * @returns {Buffer[]} The buffers.
72
+ */
73
+ export function collectBuffers(device: BUFFER_DYNAMIC, kind?: string): Buffer[];
74
+ /**
75
+ * @param {Buffer} buffer - A buffer.
76
+ * @returns {number} An id that stays the same for the lifetime of the buffer, since buffers carry
77
+ * no name of their own.
78
+ */
79
+ export function idOf(buffer: Buffer): number;
80
+ /**
81
+ * The totals shown above the list: video memory by kind of resource, the per-frame uniform pool,
82
+ * and the counts of the device caches that grow with the variety of what is drawn.
83
+ *
84
+ * @param {GraphicsDevice} device - The device.
85
+ * @returns {string} The totals, one line per group.
86
+ */
87
+ export function memorySummary(device: BUFFER_DYNAMIC): string;
88
+ /**
89
+ * @param {GraphNode|null} node - The node a mesh instance draws at.
90
+ * @returns {string} Its name, after its parent's when it has one below the root: imported models
91
+ * often give every mesh node the same name, and the parent tells them apart.
92
+ */
93
+ export function nodeLabel(node: BUFFER_DYNAMIC | null): string;
94
+ import type { ListRow } from './list-view.js';
95
+ import type { PropertySection } from './model.js';
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Something a mesh was found to be used by.
3
+ */
4
+ export type MeshUser = {
5
+ /**
6
+ * - How it uses the mesh, such as 'render component'.
7
+ */
8
+ role: string;
9
+ /**
10
+ * - Its name.
11
+ */
12
+ label: string;
13
+ /**
14
+ * - What to link to, or null when there is nothing to show.
15
+ */
16
+ target: Mesh | Mesh | null;
17
+ /**
18
+ * - The mesh instance drawing the mesh, when there is one.
19
+ */
20
+ instance: Mesh | null;
21
+ };
22
+ /**
23
+ * The meshes found, with what uses each, and how complete the search was.
24
+ */
25
+ export type MeshSurvey = {
26
+ /**
27
+ * - The users of each mesh found.
28
+ */
29
+ users: Map<Mesh, MeshUser[]>;
30
+ /**
31
+ * - How many mesh instances were found drawing them.
32
+ */
33
+ instances: number;
34
+ /**
35
+ * - How many vertex buffers the device holds.
36
+ */
37
+ vertexBuffers: number;
38
+ /**
39
+ * - How many of those belong to no mesh found and to no instancing
40
+ * data or other known user: the buffers of meshes only the app's own code holds, or buffers made
41
+ * without a mesh.
42
+ */
43
+ unaccounted: number;
44
+ };
45
+ /**
46
+ * Everything the property view shows for a mesh: its geometry, down to the elements of its vertex
47
+ * format, and what uses it, with each mesh instance opening in place.
48
+ *
49
+ * @param {Mesh} mesh - The mesh.
50
+ * @param {{ app: AppBase }} ctx - The app, to find the mesh's users.
51
+ * @returns {PropertySection[]} The sections.
52
+ */
53
+ export function buildMeshModel(mesh: Mesh, ctx: {
54
+ app: Mesh;
55
+ }): PropertySection[];
56
+ /**
57
+ * @param {Mesh} mesh - A mesh.
58
+ * @returns {number} The bytes of its vertex buffer and index buffers.
59
+ */
60
+ export function meshBytes(mesh: Mesh): number;
61
+ /**
62
+ * One row per mesh found, largest first, dimmed when no mesh instance draws it.
63
+ *
64
+ * @param {MeshSurvey} survey - The meshes found.
65
+ * @returns {ListRow[]} The rows.
66
+ */
67
+ export function meshListRows(survey: MeshSurvey): ListRow[];
68
+ /**
69
+ * The line above the list: how many meshes were found, and whether any vertex buffer on the device
70
+ * belongs to none of them.
71
+ *
72
+ * @param {MeshSurvey} survey - The meshes found.
73
+ * @returns {string} The note, or an empty string when every vertex buffer is accounted for.
74
+ */
75
+ export function meshNote(survey: MeshSurvey): string;
76
+ /**
77
+ * Finds the meshes of the app. Nothing keeps a list of them, so they are found through what uses
78
+ * them: the mesh instances of the components and layers, see {@link collectMeshInstances}; the
79
+ * immediate renderer's batches of debug lines; and the loaded render and model assets, which hold
80
+ * meshes nothing may be drawing. A mesh only the app's own
81
+ * code holds cannot be found, but it still owns a vertex buffer on the device, so the vertex
82
+ * buffers no found mesh owns are counted to tell how complete the list is.
83
+ *
84
+ * @param {AppBase} app - The app.
85
+ * @returns {MeshSurvey} The meshes and what uses them.
86
+ */
87
+ export function surveyMeshes(app: Mesh): MeshSurvey;
88
+ import type { PropertySection } from './model.js';
89
+ import type { ListRow } from './list-view.js';
@@ -0,0 +1,104 @@
1
+ export type PropertyRow = object;
2
+ export type PropertySection = object;
3
+ /**
4
+ * @param {RenderTarget} rt - A render target.
5
+ * @param {GraphicsDevice} device - The device, to recognize the backbuffer.
6
+ * @returns {string} The attachments in the trace's notation, e.g. `[C×2][D][S]`.
7
+ */
8
+ export function attachmentsText(rt: pixelFormatInfo, device: pixelFormatInfo): string;
9
+ /**
10
+ * @param {number} bytes - A byte count.
11
+ * @returns {string} The count in the largest unit that keeps it above one, with two decimals.
12
+ */
13
+ export function formatBytes(bytes: number): string;
14
+ /**
15
+ * @param {number|undefined} format - A PIXELFORMAT_* constant.
16
+ * @returns {string} Its name, or the number when unknown.
17
+ */
18
+ export function formatName(format: number | undefined): string;
19
+ /** @import { FramePass } from 'playcanvas' */
20
+ /** @import { GraphicsDevice } from 'playcanvas' */
21
+ /** @import { RenderTarget } from 'playcanvas' */
22
+ /** @import { Described } from './describe.js' */
23
+ /**
24
+ * @typedef {object} PropertyRow
25
+ * @ignore
26
+ * @property {string} key - A key unique within the section, stable across refreshes.
27
+ * @property {string} label - The label.
28
+ * @property {Described} value - The value.
29
+ * @property {number} [depth] - How far the row is indented below the row above it.
30
+ * @property {boolean} [group] - Whether the row starts an entry of the collection above it, drawn
31
+ * with a divider so the entries of an expanded array read apart.
32
+ */
33
+ /**
34
+ * @typedef {object} PropertySection
35
+ * @ignore
36
+ * @property {string} key - A key unique within the view, stable across refreshes.
37
+ * @property {string} title - The title.
38
+ * @property {PropertyRow[]} rows - The rows.
39
+ * @property {boolean} [collapsed] - Whether the section starts out collapsed.
40
+ */
41
+ /**
42
+ * @param {string} key - The section key.
43
+ * @param {string} title - The section title.
44
+ * @param {boolean} [collapsed] - Whether the section starts out collapsed.
45
+ * @returns {PropertySection} An empty section.
46
+ */
47
+ export function makeSection(key: string, title: string, collapsed?: boolean): PropertySection;
48
+ /**
49
+ * Passes are named after their class unless given a name, so the class-family prefix carries no
50
+ * information in a list of passes.
51
+ *
52
+ * @param {FramePass} pass - The pass.
53
+ * @returns {string} The name without a leading 'RenderPass' or 'FramePass'.
54
+ */
55
+ export function passDisplayName(pass: pixelFormatInfo): string;
56
+ /**
57
+ * Appends a row to a section, followed by one indented row per expanded collection entry.
58
+ *
59
+ * @param {PropertySection} section - The section.
60
+ * @param {string} label - The label.
61
+ * @param {Described} value - The value.
62
+ */
63
+ export function push(section: PropertySection, label: string, value: Described): void;
64
+ /**
65
+ * Appends a row to a list, followed by one indented row per expanded collection entry.
66
+ *
67
+ * @param {PropertyRow[]} rows - The rows to append to.
68
+ * @param {string} label - The label.
69
+ * @param {Described} value - The value.
70
+ */
71
+ export function pushRow(rows: PropertyRow[], label: string, value: Described): void;
72
+ /**
73
+ * Reads a property, turning a throwing getter into an error value rather than a broken panel.
74
+ *
75
+ * @param {object} obj - The object.
76
+ * @param {string} name - The property name.
77
+ * @returns {Described} The described value.
78
+ */
79
+ export function read(obj: object, name: string): Described;
80
+ /**
81
+ * Appends one row per public property of an object, see {@link collectProperties}.
82
+ *
83
+ * @param {PropertyRow[]} rows - The rows to append to.
84
+ * @param {object} obj - The object to reflect on.
85
+ * @param {object[]} stopPrototypes - Prototypes at which to stop walking the chain.
86
+ * @param {string[]} [skip] - Property names to leave out.
87
+ */
88
+ export function reflectInto(rows: PropertyRow[], obj: object, stopPrototypes: object[], skip?: string[]): void;
89
+ /**
90
+ * Appends one row per public property of an object, see {@link collectProperties}.
91
+ *
92
+ * @param {PropertySection} section - The section.
93
+ * @param {object} obj - The object to reflect on.
94
+ * @param {object[]} stopPrototypes - Prototypes at which to stop walking the chain.
95
+ * @param {string[]} [skip] - Property names to leave out.
96
+ */
97
+ export function reflectRows(section: PropertySection, obj: object, stopPrototypes: object[], skip?: string[]): void;
98
+ /**
99
+ * @param {RenderTarget|null} rt - A render target, or null for an unknown backbuffer.
100
+ * @param {GraphicsDevice} device - The device, to recognize the backbuffer.
101
+ * @returns {string} A one-line summary: name, size, attachments, samples and mip level.
102
+ */
103
+ export function renderTargetSummary(rt: pixelFormatInfo | null, device: pixelFormatInfo): string;
104
+ import type { Described } from './describe.js';
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Everything the property view shows for a node: identity, transform, one section per component
3
+ * and one per script instance. A component's mesh instances open in place, each into its own
4
+ * properties, with its mesh and material linking to their tabs.
5
+ *
6
+ * @param {GraphNode} node - The node.
7
+ * @returns {PropertySection[]} The sections.
8
+ */
9
+ export function buildNodeModel(node: Component): PropertySection[];
10
+ /**
11
+ * The layers a component renders in. Components hold them as ids, which say nothing on their own,
12
+ * so each is named from the scene's layer composition.
13
+ *
14
+ * @param {number[]} ids - The layer ids.
15
+ * @param {LayerComposition|null} composition - The scene's composition.
16
+ * @returns {Described} The layers, named.
17
+ */
18
+ export function layersValue(ids: number[], composition: Component | null): Described;
19
+ /**
20
+ * @param {Material} material - A material.
21
+ * @returns {PropertyRow[]} Its rows, textures and compiled variants linking to their tabs.
22
+ */
23
+ export function materialRows(material: Component): PropertyRow[];
24
+ /**
25
+ * The textures a material samples: those set on its properties, such as the maps of a
26
+ * StandardMaterial, and those set as parameters, which is how a ShaderMaterial carries them.
27
+ *
28
+ * @param {Material} material - A material.
29
+ * @returns {Set<Texture>} The textures.
30
+ */
31
+ export function materialTextures(material: Component): Set<Texture>;
32
+ /**
33
+ * @param {MeshInstance} instance - A mesh instance.
34
+ * @returns {PropertyRow[]} Its rows, with the mesh and the material linking to their tabs.
35
+ */
36
+ export function meshInstanceRows(instance: MeshInstance): PropertyRow[];
37
+ /**
38
+ * @param {Mesh} mesh - A mesh.
39
+ * @returns {PropertyRow[]} Its rows, with the vertex format opening into its elements.
40
+ */
41
+ export function meshRows(mesh: Component): PropertyRow[];
42
+ /**
43
+ * @param {ScriptType|Script} script - A script instance.
44
+ * @returns {PropertyRow[]} Its rows: whether it is enabled, then its attributes.
45
+ */
46
+ export function scriptInstanceRows(script: ScriptType | Script): PropertyRow[];
47
+ /**
48
+ * @param {import('playcanvas').VertexFormat} format - A vertex format.
49
+ * @returns {Described} The format, expanding into one row per element.
50
+ */
51
+ export function vertexFormatValue(format: any): Described;
52
+ import type { PropertySection } from './model.js';
53
+ import type { Described } from './describe.js';
54
+ import type { PropertyRow } from './model.js';