Skip to content

Commit

Permalink
plugin: cleanup proposed api files
Browse files Browse the repository at this point in the history
Signed-off-by: vince-fugnitto <[email protected]>
  • Loading branch information
vince-fugnitto committed May 19, 2023
1 parent 248f6b6 commit 85111c2
Show file tree
Hide file tree
Showing 19 changed files with 1,221 additions and 764 deletions.
2 changes: 2 additions & 0 deletions packages/plugin-ext/src/plugin/plugin-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ import { FilePermission } from '@theia/filesystem/lib/common/files';
import { TabsExtImpl } from './tabs';
import { LocalizationExtImpl } from './localization-ext';
import { TelemetryExtImpl } from './telemetry-ext';
import { TerminalOutputAnchor } from '@theia/plugin';

export function createAPIFactory(
rpc: RPCProtocol,
Expand Down Expand Up @@ -1373,6 +1374,7 @@ export function createAPIFactory(
TabInputWebview: WebviewEditorTabInput,
TabInputTerminal: TerminalEditorTabInput,
TerminalLocation,
TerminalOutputAnchor,
TerminalExitReason,
DocumentPasteEdit,
ExternalUriOpenerPriority,
Expand Down
6 changes: 6 additions & 0 deletions packages/plugin-ext/src/plugin/types-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2049,6 +2049,12 @@ export enum TerminalLocation {
Panel = 1,
Editor = 2
}

export enum TerminalOutputAnchor {
Top = 0,
Bottom = 1
}

export class TerminalProfile {
/**
* Creates a new terminal profile.
Expand Down
86 changes: 86 additions & 0 deletions packages/plugin/src/theia-extra.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,5 +293,91 @@ export module '@theia/plugin' {
readonly logUri: Uri;
}

export namespace commands {

/**
* Get the keybindings associated to commandId.
* @param commandId The ID of the command for which we are looking for keybindings.
*/
export function getKeyBinding(commandId: string): Thenable<CommandKeyBinding[] | undefined>;
}

/**
* Key Binding of a command
*/
export interface CommandKeyBinding {
/**
* Identifier of the command.
*/
id: string;
/**
* Value of the keyBinding
*/
value: string;
}

/**
* Enumeration of the supported operating systems.
*/
export enum OperatingSystem {
Windows = 'Windows',
Linux = 'Linux',
OSX = 'OSX'
}

export namespace env {

/**
* Returns the type of the operating system on the client side (like browser'OS if using browser mode). If it is neither [Windows](isWindows) nor [OS X](isOSX), then
* it always return with the `Linux` OS type.
*/
export function getClientOperatingSystem(): Thenable<OperatingSystem>;

}

export interface DecorationData {
letter?: string;
title?: string;
color?: ThemeColor;
priority?: number;
bubble?: boolean;
source?: string;
}

export interface SourceControl {

/**
* Whether the source control is selected.
*/
readonly selected: boolean;

/**
* An event signaling when the selection state changes.
*/
readonly onDidChangeSelection: Event<boolean>;
}

export interface SourceControlResourceDecorations {
source?: string;
letter?: string;
color?: ThemeColor;
}

}

/**
* Thenable is a common denominator between ES6 promises, Q, jquery.Deferred, WinJS.Promise,
* and others. This API makes no assumption about what promise library is being used which
* enables reusing existing code without migrating to a specific promise implementation. Still,
* we recommend the use of native promises which are available in this editor.
*/
interface Thenable<T> {
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>;
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>;
}
Loading

0 comments on commit 85111c2

Please sign in to comment.