mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 09:36:27 +00:00
24 lines
589 B
TypeScript
24 lines
589 B
TypeScript
import { Ace } from 'ace-builds';
|
|
import { Action } from 'redux';
|
|
|
|
export enum EditorActionType {
|
|
/**
|
|
* The current (active) editor changed.
|
|
*/
|
|
Current = 'editor.action.current',
|
|
}
|
|
|
|
export interface CurrentEditorAction extends Action<EditorActionType.Current> {
|
|
editSession: Ace.EditSession | undefined;
|
|
}
|
|
|
|
/**
|
|
* Sets the current (active) edit session.
|
|
* @param editSession The new edit session.
|
|
*/
|
|
export function setEditSession(
|
|
editSession: Ace.EditSession | undefined,
|
|
): CurrentEditorAction {
|
|
return { type: EditorActionType.Current, editSession };
|
|
}
|