open-index/open-npm huggingface dataset:
npm package: @sprkl/vscode-agent-mock
Description: ```bash npm install --save @sprkl/vscode-agent-mock # mock npm install --save-dev @sprkl/vscode-model # types ``` # Usage
Latest version: 0.0.26

# Install

```bash
npm install --save @sprkl/vscode-agent-mock # mock
npm install --save-dev @sprkl/vscode-model # types
```
# Usage

```typescript
/*
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(),
})
```