-
-
Save alexweininger/d846d10d53744d3c6c05f2a85e567bfd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { GenericResource } from '@azure/arm-resources'; | |
import { AzExtTreeItem } from '@microsoft/vscode-azext-utils'; | |
import * as vscode from 'vscode'; | |
interface TreeNodeConfiguration { | |
readonly label: string; | |
readonly description?: string; | |
readonly icon?: vscode.ThemeIcon; | |
readonly contextValue?: string; | |
} | |
interface ApplicationResource extends TreeNodeConfiguration { | |
getChildren?(): vscode.ProviderResult<AzExtTreeItem[]>; | |
resolveTooltip?(): Thenable<string | vscode.MarkdownString>; | |
} | |
export interface GroupableApplicationResource extends ApplicationResource { | |
readonly rootGroupConfig: TreeNodeConfiguration; | |
readonly subGroupConfig: { | |
readonly resourceGroup: TreeNodeConfiguration; | |
readonly resourceType: TreeNodeConfiguration; | |
readonly [label: string]: TreeNodeConfiguration; // Don't need to support right off the bat but we can put it in the interface | |
} | |
} | |
export type LocalResource = AzExtTreeItem; | |
export declare interface ApplicationResourceProvider { | |
matchesResource?(resource: GenericResource): boolean; | |
// resource comes from a list returned from an @azure/arm-resources listByResourceGroup call | |
resolveResource(resource: GenericResource): vscode.ProviderResult<GroupableApplicationResource | undefined>; | |
} | |
export interface LocalResourceProvider { | |
provideResources(): vscode.ProviderResult<LocalResource[] | undefined>; | |
} | |
// to be implemented in and exported from host | |
export interface AzExtProviderApi { | |
registerLocalResourceProvider(provider: LocalResourceProvider): vscode.Disposable; | |
registerApplicationResourceProvider(resourceType: string, provider: ApplicationResourceProvider): vscode.Disposable; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment