-
Notifications
You must be signed in to change notification settings - Fork 189
Expand file tree
/
Copy pathvariableNode.ts
More file actions
22 lines (19 loc) · 1.02 KB
/
variableNode.ts
File metadata and controls
22 lines (19 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import * as vscode from "vscode";
import {GitHubRepoContext} from "../../git/repository";
import {Environment, EnvironmentVariable, OrgVariable, RepoVariable} from "../../model";
export type VariableCommandArgs = Pick<VariableNode, "gitHubRepoContext" | "variable" | "environment">;
export class VariableNode extends vscode.TreeItem {
constructor(gitHubRepoContext: GitHubRepoContext, variable: RepoVariable);
constructor(gitHubRepoContext: GitHubRepoContext, variable: EnvironmentVariable, environment: Environment);
constructor(githubRepoContext: GitHubRepoContext, variable: OrgVariable, environment: undefined, org: true);
constructor(
public readonly gitHubRepoContext: GitHubRepoContext,
public readonly variable: EnvironmentVariable | RepoVariable | OrgVariable,
public readonly environment?: Environment,
public readonly org?: boolean
) {
super(variable.name);
this.description = variable.value;
this.contextValue = environment ? "env-variable" : org ? "org-variable" : "repo-variable";
}
}