Skip to content

Commit

Permalink
Merge pull request #24 from onivim/bryphe/docs/recorder
Browse files Browse the repository at this point in the history
Add recorder API and document
  • Loading branch information
bryphe authored Feb 26, 2018
2 parents 39cca47 + a9da1e8 commit c4cc2a0
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oni-api",
"version": "0.0.32",
"version": "0.0.33",
"description": "Oni's API layer",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
36 changes: 36 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,41 @@ export interface Log {
enableVerboseLogging(): void
}

/**
* The `recorder` API enables the taking of screenshot or recording a video.
*
* The output defaults to the `os.tmpdir()` directory, but can be overridden
* by the `recorder.outputPath` option.
*/
export interface Recorder {

/**
* Returns `true` if a recording is in progress, `false` otherwise
*/
isRecording: boolean

/**
* Start recording a video.
*
* Videos are recorded in `.webm` format.
*/
startRecording(): void

/**
* Stop recording a video.
*
* Optionally specify the destination `fileName`.
*/
stopRecording(fileName?: string): Promise<void>

/**
* Take a screenshot.
*
* Optionally specify the destination `fileName.
*/
takeScreenshot(fileName?: string): void
}

export interface StatusBar {
getItem(globalId?: string): StatusBarItem
createItem(alignment: number, globalId?: string): StatusBarItem
Expand Down Expand Up @@ -454,6 +489,7 @@ export namespace Plugin {
plugins: IPluginManager
menu: Menu.Api
process: Process
recorder: Recorder
statusBar: StatusBar
windows: IWindowManager
workspace: Workspace
Expand Down

0 comments on commit c4cc2a0

Please sign in to comment.