Skip to content

Latest commit

 

History

History
228 lines (124 loc) · 6.07 KB

ArduinoContext.md

File metadata and controls

228 lines (124 loc) · 6.07 KB

Interface: ArduinoContext

Provides access to the current state of the Arduino IDE such as the sketch path, the currently selected board, and port, and etc.

Hierarchy

Table of contents

Properties

Methods

Properties

boardDetails

Readonly boardDetails: undefined | BoardDetails

Lightweight representation of the board's detail. This information is provided by the Arduino CLI for the currently selected board. It can be undefined if the fqbn is defined but the platform is not installed.

Deprecated

Use arduinoContext?.currentSketch?.boardDetails instead.

Inherited from

ArduinoState.boardDetails


compileSummary

Readonly compileSummary: undefined | CompileSummary

The summary of the latest sketch compilation. When the sketchPath is available but the sketch has not been verified (compiled), the buildPath can be undefined.

Deprecated

Use arduinoContext?.currentSketch?.compileSummary instead.

Inherited from

ArduinoState.compileSummary


config

Readonly config: CliConfig

The currently configured Arduino CLI configuration.


currentSketch

Readonly currentSketch: undefined | SketchFolder

The currently active sketch (folder) or undefined. The current sketch is the one that currently has focus or most recently had focus. The current sketch is in the opened sketches.


dataDirPath

Readonly dataDirPath: undefined | string

Filesystem path to the directories.data location.

Deprecated

Use arduinoContext?.config?.dataDirPath instead.

Inherited from

ArduinoState.dataDirPath


fqbn

Readonly fqbn: undefined | string

The Fully Qualified Board Name (FQBN) of the currently selected board in the Arduino IDE.

Deprecated

Use arduinoContext?.currentSketch?.board?.fqbn instead.

Inherited from

ArduinoState.fqbn


onDidChangeConfig

Readonly onDidChangeConfig: Event<ChangeEvent<CliConfig>>

An event that is emitter when the sketchbook (directories.data) or the data directory (directories.data) path has changed.


onDidChangeCurrentSketch

Readonly onDidChangeCurrentSketch: Event<undefined | SketchFolder>

An Event that is emitted when the current sketch has changed. Note that the event also fires when the active editor changes to undefined.


onDidChangeSketch

Readonly onDidChangeSketch: Event<ChangeEvent<SketchFolder>>

An event that is emitted when the selected board, port, etc., has changed in the sketch folder.


onDidChangeSketchFolders

Readonly onDidChangeSketchFolders: Event<SketchFoldersChangeEvent>

An event that is emitted when sketch folders are added or removed.


openedSketches

Readonly openedSketches: readonly SketchFolder[]

All opened sketch folders in the window.


port

Readonly port: undefined | Port

The currently selected port in the Arduino IDE.

Deprecated

Use arduinoContext?.currentSketch?.port instead.

Inherited from

ArduinoState.port


sketchPath

Readonly sketchPath: undefined | string

Absolute filesystem path of the sketch folder.

Deprecated

Use arduinoContext?.currentSketch?.sketchPath instead.

Inherited from

ArduinoState.sketchPath


userDirPath

Readonly userDirPath: undefined | string

Filesystem path to the directories.user location. This is the sketchbook path.

Deprecated

Use arduinoContext?.config?.userDirPath instead.

Inherited from

ArduinoState.userDirPath

Methods

onDidChange

onDidChange<T>(property): Event<ArduinoState[T]>

Type parameters

Name Type
T extends keyof ArduinoState

Parameters

Name Type
property T

Returns

Event<ArduinoState[T]>

Deprecated

Use onDidChangeSketch and onDidChangeConfig instead.