🤖 Merge PR #65630 Update two types for nova-editor-node by @edwardloveall

* Add shell option to TaskProcessAction

* Add config option to TaskActionResolveContext
This commit is contained in:
Edward Loveall
2023-05-29 10:58:18 -04:00
committed by GitHub
parent a2fc2d871e
commit 460eda9891
2 changed files with 17 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
// Type definitions for non-npm package nova-editor-node 5.0
// Type definitions for non-npm package nova-editor-node 5.1
// Project: https://docs.nova.app/api-reference/
// Definitions by: Cameron Little <https://github.com/apexskier>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -822,6 +822,7 @@ declare class Task {
interface TaskActionResolveContext<T extends Transferrable> {
action: TaskName;
config: Configuration;
readonly data?: T;
}
@@ -845,6 +846,7 @@ declare class TaskProcessAction {
cwd?: string;
stdio?: ['pipe' | 'ignore', 'pipe' | 'ignore', 'pipe' | 'ignore'] | 'pipe' | 'ignore' | 'jsonrpc' | number;
matchers?: ReadonlyArray<string>;
shell?: boolean | string;
},
);
}

View File

@@ -316,6 +316,7 @@ task.setAction(
new TaskProcessAction('/usr/bin/say', {
args: ["I'm Building!"],
env: {},
shell: true,
}),
);
@@ -481,3 +482,16 @@ nova.assistants.registerTaskAssistant(tasks, {
identifier: 'com.my-command',
name: 'My command',
});
// Unable to cleanly create a TaskName directly to it need to be built
// implicitly with `any` to add the `__type` property then coerced into
// `taskName`
const tmpTaskName: any = "MyTask";
tmpTaskName.__type = "TaskName";
const taskName: TaskName = tmpTaskName;
const taskActionResolveContext: TaskActionResolveContext<any> = {
config: nova.config,
action: taskName,
};
taskActionResolveContext.config;