@sprkl/vscode-agent-mock
v0.0.26
Published
```bash npm install --save @sprkl/vscode-agent-mock # mock npm install --save-dev @sprkl/vscode-model # types ``` # Usage
Downloads
5
Keywords
Readme
Install
npm install --save @sprkl/vscode-agent-mock # mock
npm install --save-dev @sprkl/vscode-model # types
Usage
/*
There are 2 packages relevant here:
- vscode-agent-mock: which mocks the sprkl agent on vscode
- vscode-model: the data model (interfaces) of the vscode
*/
import {AgentClient} from '@sprkl/vscode-agent-mock'
import {Dashboard, Histogram} from '@sprkl/vscode-model'
/*
The agent client exposes 2 APIs:
- getHistogram(): get histogram data
- getDashboard(): get dashboard data
*/
const agentClient = new AgentClient();
const histogram: Histogram = await agentClient.getHistogram({
startTime: new Date(),
endTime: new Date(),
numOfColumns: 10,
})
const dashboard: Dashboard = await agentClient.getDashboard({
startTime: new Date(),
endTime: new Date(),
})