* Uses webpack to bundle runtime library into a single file * Inject the entire file into the Debugee * Register runtime helpers (hediet_dbgVis)
32 lines
608 B
TypeScript
32 lines
608 B
TypeScript
import { getDataExtractorApi } from "@hediet/debug-visualizer-data-extraction";
|
|
|
|
// Registers all existing extractors.
|
|
getDataExtractorApi().registerDefaultExtractors();
|
|
|
|
getDataExtractorApi().registerExtractor({
|
|
id: "my-extractor",
|
|
getExtractions: (data, collector) => {
|
|
if (data instanceof Foo) {
|
|
collector.addExtraction({
|
|
id: "my-extractor",
|
|
name: "My Extractor",
|
|
priority: 2000,
|
|
extractData: () => ({ kind: { text: true }, text: "Foo" }),
|
|
});
|
|
}
|
|
},
|
|
});
|
|
|
|
setTimeout(() => {
|
|
new Main().run();
|
|
}, 0);
|
|
|
|
class Foo {}
|
|
|
|
class Main {
|
|
run() {
|
|
const f = new Foo();
|
|
debugger;
|
|
}
|
|
}
|