API Reference
Welcome to the 3Lens API reference documentation. This section provides detailed information about all public APIs, types, and interfaces.
Packages
3Lens is organized into several packages:
| Package | Description | Documentation |
|---|---|---|
@3lens/core | Core probe engine and metrics collection | View → |
@3lens/overlay | Visual devtools panel UI | View → |
@3lens/react-bridge | React/R3F integration hooks | View → |
@3lens/vue-bridge | Vue/TresJS composables | View → |
@3lens/angular-bridge | Angular services and directives | View → |
@3lens/ui | Reusable UI components | View → |
Quick Reference
Core APIs
ts
import { createProbe } from '@3lens/core'
// Create a probe instance
const probe = createProbe(config?)
// Connect to renderer and scene
probe.observeRenderer(renderer)
probe.observeScene(scene)
// Access metrics
probe.on('frame', (stats: FrameStats) => { })
probe.getLatestStats()
// Selection
probe.selectObject(object)
probe.clearSelection()
probe.on('select', (object) => { })
// Inspect mode
probe.setInspectModeEnabled(true)
// Lifecycle
probe.dispose()1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Overlay APIs
ts
import { createOverlay, bootstrapOverlay } from '@3lens/overlay'
// Quick setup
bootstrapOverlay(probe)
// Or manual control
const overlay = createOverlay(probe, options?)
overlay.show()
overlay.hide()
overlay.toggle()
overlay.dispose()1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
React Hooks
ts
import {
ThreeLensProvider,
useThreeLensProbe,
useDevtoolEntity,
useFPS,
useDrawCalls,
useSelectedObject,
} from '@3lens/react-bridge'1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
Vue Composables
ts
import {
createThreeLens,
useThreeLens,
useDevtoolEntity,
useFPS,
useDrawCalls,
} from '@3lens/vue-bridge'1
2
3
4
5
6
7
2
3
4
5
6
7
Angular Service
ts
import {
ThreeLensService,
ThreeLensModule,
THREELENS_PROBE,
THREELENS_CONFIG,
} from '@3lens/angular-bridge'1
2
3
4
5
6
2
3
4
5
6
Type Definitions
All packages include TypeScript definitions. Key types:
ProbeConfig- Configuration optionsFrameStats- Per-frame metricsSceneSnapshot- Full scene stateDevtoolPlugin- Plugin interface
Generated API Docs
For auto-generated API documentation from TypeDoc, see:
- TypeDoc Reference - Full generated documentation
INFO
The TypeDoc reference is generated directly from source code JSDoc comments and provides complete type information for all exports.
See Also
- Getting Started - Installation and basic setup
- Architecture - Technical design overview
- Plugin Development - Building custom plugins