@cmusei/console-forge 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/LICENSE.md +18 -0
  2. package/README.md +6 -0
  3. package/fesm2022/cmusei-console-forge.mjs +1397 -0
  4. package/fesm2022/cmusei-console-forge.mjs.map +1 -0
  5. package/index.d.ts +5 -0
  6. package/lib/components/console/console.component.d.ts +50 -0
  7. package/lib/components/console-status/console-status.component.d.ts +7 -0
  8. package/lib/components/console-toolbar/console-toolbar.component.d.ts +40 -0
  9. package/lib/components/console-toolbar-default/console-toolbar-default-button/console-toolbar-default-button.component.d.ts +9 -0
  10. package/lib/components/console-toolbar-default/console-toolbar-default.component.d.ts +30 -0
  11. package/lib/config/console-forge-config.d.ts +20 -0
  12. package/lib/config/provide-console-forge.d.ts +4 -0
  13. package/lib/directives/class-on-hover.directive.d.ts +10 -0
  14. package/lib/injection/window.injection-token.d.ts +2 -0
  15. package/lib/models/console-client-type.d.ts +1 -0
  16. package/lib/models/console-component-config.d.ts +24 -0
  17. package/lib/models/console-component-network-config.d.ts +4 -0
  18. package/lib/models/console-connection-options.d.ts +7 -0
  19. package/lib/models/console-connection-status.d.ts +1 -0
  20. package/lib/models/console-credentials.d.ts +4 -0
  21. package/lib/models/console-power-request.d.ts +1 -0
  22. package/lib/models/console-supported-features.d.ts +4 -0
  23. package/lib/models/console-toolbar-component-base.d.ts +5 -0
  24. package/lib/models/console-toolbar-context.d.ts +30 -0
  25. package/lib/models/console-toolbar-position.d.ts +1 -0
  26. package/lib/models/console-user-settings.d.ts +10 -0
  27. package/lib/models/log-level.d.ts +6 -0
  28. package/lib/services/browser-notifications/browser-notifications.service.d.ts +10 -0
  29. package/lib/services/browser-notifications/send-browser-notification.d.ts +9 -0
  30. package/lib/services/canvas-recorder/canvas-recorder.service.d.ts +14 -0
  31. package/lib/services/canvas-recorder/canvas-recording-settings.d.ts +9 -0
  32. package/lib/services/canvas-recorder/canvas-recording.d.ts +13 -0
  33. package/lib/services/canvas.service.d.ts +9 -0
  34. package/lib/services/clipboard/clipboard.helpers.d.ts +14 -0
  35. package/lib/services/clipboard/clipboard.service.d.ts +15 -0
  36. package/lib/services/console-clients/console-client-factory.service.d.ts +9 -0
  37. package/lib/services/console-clients/console-client.service.d.ts +23 -0
  38. package/lib/services/console-clients/vmware/vmware-console-client.service.d.ts +36 -0
  39. package/lib/services/console-clients/vnc-console-client/vnc-console-client.service.d.ts +33 -0
  40. package/lib/services/full-screen.service.d.ts +11 -0
  41. package/lib/services/logger.service.d.ts +9 -0
  42. package/lib/services/object.helpers.d.ts +4 -0
  43. package/lib/services/user-settings.service.d.ts +15 -0
  44. package/lib/services/uuid.service.d.ts +6 -0
  45. package/lib/shims/vmware-mks.models.d.ts +34 -0
  46. package/lib/shims/vmware-wmks.shim.d.ts +61 -0
  47. package/package.json +32 -0
  48. package/public-api.d.ts +17 -0
  49. package/vendor/vmware-wmks/css/extended-keypad.css +318 -0
  50. package/vendor/vmware-wmks/css/main-ui.css +180 -0
  51. package/vendor/vmware-wmks/css/trackpad.css +192 -0
  52. package/vendor/vmware-wmks/css/wmks-all.css +684 -0
  53. package/vendor/vmware-wmks/js/wmks.min.js +8 -0
@@ -0,0 +1,24 @@
1
+ import { ConsoleCredentials } from "./console-credentials";
2
+ import { ConsoleClientType } from "./console-client-type";
3
+ export interface ConsoleComponentConfig {
4
+ /**
5
+ * If true, the client will attempt to set control focus on the console session after connection. Defaults to false.
6
+ */
7
+ autoFocusOnConnect?: boolean;
8
+ /**
9
+ * Specifies the client that will be used to connect to the console (e.g. VNC, VMWare WMKS, etc.) Note that
10
+ * you can configure a default for all ConsoleForge consoles in your app or module by using the `provideConsoleForgeConfig`
11
+ * provider.
12
+ */
13
+ consoleClientType?: ConsoleClientType;
14
+ /**
15
+ * An optional username, password, or sessionId to use to authenticate to the console. Configuration here is specific
16
+ * to the protocol being used and the configuration of the target virtual console. See ConsoleForge's documentation
17
+ * for details.
18
+ */
19
+ credentials?: ConsoleCredentials;
20
+ /**
21
+ * The URL of the console's accessible web socket interface.
22
+ */
23
+ url: string;
24
+ }
@@ -0,0 +1,4 @@
1
+ export interface ConsoleComponentNetworkConfig {
2
+ available: string[];
3
+ current?: string;
4
+ }
@@ -0,0 +1,7 @@
1
+ import { ConsoleCredentials } from "./console-credentials";
2
+ export interface ConsoleConnectionOptions {
3
+ autoFocusOnConnect?: boolean;
4
+ backgroundStyle?: string;
5
+ credentials?: ConsoleCredentials;
6
+ hostElement: HTMLElement;
7
+ }
@@ -0,0 +1 @@
1
+ export type ConsoleConnectionStatus = "connected" | "connecting" | "disconnected";
@@ -0,0 +1,4 @@
1
+ export interface ConsoleCredentials {
2
+ accessTicket?: string;
3
+ password?: string;
4
+ }
@@ -0,0 +1 @@
1
+ export type ConsolePowerRequest = "reboot" | "rebootHard" | "shutdown";
@@ -0,0 +1,4 @@
1
+ export interface ConsoleSupportedFeatures {
2
+ onScreenKeyboard: boolean;
3
+ powerManagement: boolean;
4
+ }
@@ -0,0 +1,5 @@
1
+ import { InputSignal } from "@angular/core";
2
+ import { ConsoleToolbarContext } from "../models/console-toolbar-context";
3
+ export interface ConsoleToolbarComponentBase {
4
+ consoleContext: InputSignal<ConsoleToolbarContext>;
5
+ }
@@ -0,0 +1,30 @@
1
+ import { Signal } from "@angular/core";
2
+ import { CanvasRecording } from "../services/canvas-recorder/canvas-recording";
3
+ import { ConsolePowerRequest } from "./console-power-request";
4
+ import { ConsoleSupportedFeatures } from "./console-supported-features";
5
+ import { ConsoleComponentNetworkConfig } from "./console-component-network-config";
6
+ import { UserSettingsService } from "../services/user-settings.service";
7
+ export interface ConsoleToolbarContext {
8
+ console: {
9
+ copyScreenshot(): Promise<void>;
10
+ recordScreenStart(): void;
11
+ recordScreenStop(): Promise<Blob>;
12
+ sendCtrlAltDel(): Promise<void>;
13
+ sendPowerRequest(request: ConsolePowerRequest): Promise<void>;
14
+ sendTextToClipboard(text: string): Promise<void>;
15
+ supportedFeatures: Signal<ConsoleSupportedFeatures>;
16
+ toggleFullscreen(): Promise<void>;
17
+ };
18
+ networks: {
19
+ config: Signal<ConsoleComponentNetworkConfig | undefined>;
20
+ connectionRequested(networkName: string): void;
21
+ disconnectRequested(): void;
22
+ };
23
+ state: {
24
+ activeConsoleRecording: Signal<CanvasRecording | undefined>;
25
+ isConnected: Signal<boolean>;
26
+ isFullscreenAvailable: Signal<boolean>;
27
+ isRecordingAvailable: Signal<boolean>;
28
+ };
29
+ userSettings: UserSettingsService;
30
+ }
@@ -0,0 +1 @@
1
+ export type ConsoleToolbarPosition = "left" | "right" | "top" | "bottom";
@@ -0,0 +1,10 @@
1
+ import { ConsoleToolbarPosition } from "./console-toolbar-position";
2
+ export interface ConsoleUserSettings {
3
+ console: {
4
+ allowCopyToLocalClipboard: boolean;
5
+ preserveAspectRatioOnScale: boolean;
6
+ };
7
+ toolbar: {
8
+ dockTo: ConsoleToolbarPosition;
9
+ };
10
+ }
@@ -0,0 +1,6 @@
1
+ export declare enum LogLevel {
2
+ DEBUG = 0,
3
+ INFO = 1,
4
+ WARNING = 2,
5
+ ERROR = 3
6
+ }
@@ -0,0 +1,10 @@
1
+ import { SendBrowserNotificationArgs } from './send-browser-notification';
2
+ import * as i0 from "@angular/core";
3
+ export declare class BrowserNotificationsService {
4
+ private config;
5
+ private logger;
6
+ private window;
7
+ send(args: SendBrowserNotificationArgs): Promise<void>;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<BrowserNotificationsService, never>;
9
+ static ɵprov: i0.ɵɵInjectableDeclaration<BrowserNotificationsService>;
10
+ }
@@ -0,0 +1,9 @@
1
+ export interface SendBrowserNotificationArgs {
2
+ title: string;
3
+ body: string;
4
+ href?: {
5
+ url: string | URL;
6
+ target?: string;
7
+ };
8
+ tag?: string;
9
+ }
@@ -0,0 +1,14 @@
1
+ import { CanvasRecording } from './canvas-recording';
2
+ import * as i0 from "@angular/core";
3
+ export declare class CanvasRecorderService {
4
+ private readonly cfConfig;
5
+ private readonly uuids;
6
+ private readonly window;
7
+ private readonly activeRecordings;
8
+ private readonly _isRecording;
9
+ readonly isRecording: import("@angular/core").Signal<boolean>;
10
+ startRecord(canvas: HTMLCanvasElement): CanvasRecording;
11
+ private recordingStopped;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<CanvasRecorderService, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<CanvasRecorderService>;
14
+ }
@@ -0,0 +1,9 @@
1
+ export interface CanvasRecordingSettings {
2
+ id: string;
3
+ stream: MediaStream;
4
+ window: Window;
5
+ mimeType: string;
6
+ chunkLength: number;
7
+ maxDuration: number;
8
+ onStopCallback: () => void;
9
+ }
@@ -0,0 +1,13 @@
1
+ import { CanvasRecordingSettings } from "./canvas-recording-settings";
2
+ export declare class CanvasRecording {
3
+ private readonly chunks;
4
+ private readonly mimeType;
5
+ private readonly recorder;
6
+ private readonly window;
7
+ private autostopTimeoutRef?;
8
+ private stopPromise?;
9
+ private stopResolveFn?;
10
+ readonly settings: CanvasRecordingSettings;
11
+ constructor(settings: CanvasRecordingSettings);
12
+ stop(): Promise<Blob>;
13
+ }
@@ -0,0 +1,9 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class CanvasService {
3
+ private readonly _canvas;
4
+ readonly canvas: import("@angular/core").Signal<HTMLCanvasElement | null>;
5
+ clearCanvas(): void;
6
+ setCanvas(canvas: HTMLCanvasElement): void;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<CanvasService, never>;
8
+ static ɵprov: i0.ɵɵInjectableDeclaration<CanvasService>;
9
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Extracts plain text from a ClipboardItem, if available.
3
+ *
4
+ * @param clipboardItem - The ClipboardItem to extract text from.
5
+ * @returns A promise that resolves to the extracted text, or null if no text is present.
6
+ *
7
+ * @example
8
+ * const text = await getTextFromClipboardItem(item);
9
+ * if (text) {
10
+ * console.log("Clipboard text:", text);
11
+ * }
12
+ */
13
+ export declare function getTextFromClipboardItem(clipboardItem?: ClipboardItem): Promise<string | null>;
14
+ export declare function getClipboardItemFromText(text: string): ClipboardItem;
@@ -0,0 +1,15 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class ClipboardService {
3
+ private readonly cfConfig;
4
+ private readonly document;
5
+ private readonly userSettings;
6
+ private _localClipboardContentWritten;
7
+ localClipboardContentWritten: import("@angular/core").Signal<ClipboardItem | undefined>;
8
+ copyBlob(blob: Blob): void;
9
+ copyText(text: string): void;
10
+ readText(): Promise<string>;
11
+ private getClipboard;
12
+ private writeToClipboard;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<ClipboardService, never>;
14
+ static ɵprov: i0.ɵɵInjectableDeclaration<ClipboardService>;
15
+ }
@@ -0,0 +1,9 @@
1
+ import { ConsoleClientService } from './console-client.service';
2
+ import { ConsoleClientType } from '../../models/console-client-type';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ConsoleClientFactoryService {
5
+ private injector;
6
+ get(consoleClientType: ConsoleClientType): ConsoleClientService;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConsoleClientFactoryService, never>;
8
+ static ɵprov: i0.ɵɵInjectableDeclaration<ConsoleClientFactoryService>;
9
+ }
@@ -0,0 +1,23 @@
1
+ import { Signal } from "@angular/core";
2
+ import { ConsoleConnectionOptions } from "../../models/console-connection-options";
3
+ import { ConsoleConnectionStatus } from "../../models/console-connection-status";
4
+ import { ConsolePowerRequest } from "../../models/console-power-request";
5
+ import { ConsoleSupportedFeatures } from "../../models/console-supported-features";
6
+ export interface ConsoleClientService {
7
+ readonly connectionStatus: Signal<ConsoleConnectionStatus>;
8
+ readonly consoleClipboardUpdated: Signal<string>;
9
+ readonly supportedFeatures: Signal<ConsoleSupportedFeatures>;
10
+ connect(url: string, options: ConsoleConnectionOptions): Promise<ConsoleSupportedFeatures>;
11
+ copyVmClipboard(): Promise<void>;
12
+ disconnect(): Promise<void>;
13
+ sendClipboardText(text: string): Promise<void>;
14
+ sendCtrlAltDelete(): Promise<void>;
15
+ sendPowerRequest(request: ConsolePowerRequest): Promise<void>;
16
+ setPreserveAspectRatioOnScale(preserve: boolean): Promise<void>;
17
+ setIsViewOnly(isViewOnly: boolean): Promise<void>;
18
+ /**
19
+ * Automatically called by the console component on destroy. Disconnect any clients/websocket usage here
20
+ * (or just do it in your disconnect logic and call that internally in your implementation).
21
+ */
22
+ dispose(): Promise<void>;
23
+ }
@@ -0,0 +1,36 @@
1
+ import { ConsoleClientService } from '../console-client.service';
2
+ import { ConsoleConnectionOptions } from '../../../models/console-connection-options';
3
+ import { ConsoleConnectionStatus } from '../../../models/console-connection-status';
4
+ import { ConsolePowerRequest } from '../../../models/console-power-request';
5
+ import { ConsoleSupportedFeatures } from '../../../models/console-supported-features';
6
+ import * as i0 from "@angular/core";
7
+ export declare class VmWareConsoleClientService implements ConsoleClientService {
8
+ private readonly cfConfig;
9
+ private readonly clipboardService;
10
+ private readonly logger;
11
+ private readonly document;
12
+ private readonly window;
13
+ private wmksClient?;
14
+ private readonly _connectionStatus;
15
+ readonly connectionStatus: import("@angular/core").Signal<ConsoleConnectionStatus>;
16
+ private readonly _consoleClipboardUpdated;
17
+ readonly consoleClipboardUpdated: import("@angular/core").Signal<string>;
18
+ private readonly _supportedFeatures;
19
+ readonly supportedFeatures: import("@angular/core").Signal<ConsoleSupportedFeatures>;
20
+ private readonly _needsCanvasSizeUpdate;
21
+ private readonly _needsCanvasSizeUpdateSub;
22
+ connect(url: string, options: ConsoleConnectionOptions): Promise<ConsoleSupportedFeatures>;
23
+ disconnect(): Promise<void>;
24
+ copyVmClipboard(): Promise<void>;
25
+ sendClipboardText(text: string): Promise<void>;
26
+ sendCtrlAltDelete(): Promise<void>;
27
+ sendPowerRequest(request: ConsolePowerRequest): Promise<void>;
28
+ setIsViewOnly(isViewOnly: boolean): Promise<void>;
29
+ setPreserveAspectRatioOnScale(scaleToContainerSize: boolean): Promise<void>;
30
+ dispose(): Promise<void>;
31
+ private doPostConnectionConfig;
32
+ private doPostDisconnectionConfig;
33
+ private handleWindowSizeChange;
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<VmWareConsoleClientService, never>;
35
+ static ɵprov: i0.ɵɵInjectableDeclaration<VmWareConsoleClientService>;
36
+ }
@@ -0,0 +1,33 @@
1
+ import { ConsoleConnectionOptions } from '../../../models/console-connection-options';
2
+ import { ConsoleConnectionStatus } from '../../../models/console-connection-status';
3
+ import { ConsolePowerRequest } from '../../../models/console-power-request';
4
+ import { ConsoleSupportedFeatures } from '../../../models/console-supported-features';
5
+ import { ConsoleClientService } from '../../../services/console-clients/console-client.service';
6
+ import * as i0 from "@angular/core";
7
+ export declare class VncConsoleClientService implements ConsoleClientService {
8
+ private readonly _consoleClipboardUpdated;
9
+ readonly consoleClipboardUpdated: import("@angular/core").Signal<string>;
10
+ private readonly _connectionStatus;
11
+ readonly connectionStatus: import("@angular/core").Signal<ConsoleConnectionStatus>;
12
+ private readonly _supportedFeatures;
13
+ readonly supportedFeatures: import("@angular/core").Signal<ConsoleSupportedFeatures>;
14
+ private readonly cfConfig;
15
+ private readonly clipboardService;
16
+ private readonly logger;
17
+ private readonly userSettings;
18
+ private noVncClient?;
19
+ connect(url: string, options: ConsoleConnectionOptions): Promise<ConsoleSupportedFeatures>;
20
+ disconnect(): Promise<void>;
21
+ dispose(): Promise<void>;
22
+ copyVmClipboard(): Promise<void>;
23
+ sendClipboardText(text: string): Promise<void>;
24
+ sendCtrlAltDelete(): Promise<void>;
25
+ sendPowerRequest(request: ConsolePowerRequest): Promise<void>;
26
+ setIsViewOnly(isViewOnly: boolean): Promise<void>;
27
+ setPreserveAspectRatioOnScale(preserve: boolean): Promise<void>;
28
+ private doPreConnectionConfig;
29
+ private doPostConnectionConfig;
30
+ private handleDisconnect;
31
+ static ɵfac: i0.ɵɵFactoryDeclaration<VncConsoleClientService, never>;
32
+ static ɵprov: i0.ɵɵInjectableDeclaration<VncConsoleClientService>;
33
+ }
@@ -0,0 +1,11 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class FullScreenService {
3
+ private doc;
4
+ private readonly _isAvailable;
5
+ readonly isAvailable: import("@angular/core").Signal<boolean>;
6
+ constructor();
7
+ exitFullscreen(): Promise<void>;
8
+ tryFullscreen(element: Element): Promise<void>;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<FullScreenService, never>;
10
+ static ɵprov: i0.ɵɵInjectableDeclaration<FullScreenService>;
11
+ }
@@ -0,0 +1,9 @@
1
+ import { LogLevel } from '../models/log-level';
2
+ import * as i0 from "@angular/core";
3
+ export declare class LoggerService {
4
+ private libConfig;
5
+ log(logLevel: LogLevel, message: string, ...addl: any[]): void;
6
+ private resolveLoggingFunction;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<LoggerService, never>;
8
+ static ɵprov: i0.ɵɵInjectableDeclaration<LoggerService>;
9
+ }
@@ -0,0 +1,4 @@
1
+ export type DeepPartial<T> = {
2
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
3
+ };
4
+ export declare function deepMerge<T>(target: T, patch: DeepPartial<T>): T;
@@ -0,0 +1,15 @@
1
+ import { ConsoleUserSettings } from '../models/console-user-settings';
2
+ import { DeepPartial } from "./object.helpers";
3
+ import * as i0 from "@angular/core";
4
+ export declare class UserSettingsService {
5
+ private readonly _settings;
6
+ readonly settings: import("@angular/core").Signal<ConsoleUserSettings>;
7
+ private readonly logger;
8
+ private readonly settingsKey;
9
+ private readonly window;
10
+ constructor();
11
+ patch(patch: DeepPartial<ConsoleUserSettings>): void;
12
+ update(update: Partial<ConsoleUserSettings>): void;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<UserSettingsService, never>;
14
+ static ɵprov: i0.ɵɵInjectableDeclaration<UserSettingsService>;
15
+ }
@@ -0,0 +1,6 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class UuidService {
3
+ get(): `${string}-${string}-${string}-${string}-${string}`;
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<UuidService, never>;
5
+ static ɵprov: i0.ɵɵInjectableDeclaration<UuidService>;
6
+ }
@@ -0,0 +1,34 @@
1
+ export declare enum WmksAudioEncodingType {
2
+ AAC = "aac",
3
+ OPUS = "opus",
4
+ VORBIS = "vorbis"
5
+ }
6
+ export declare enum WmksConnectionState {
7
+ CONNECTED = "connected",
8
+ CONNECTING = "connecting",
9
+ DISCONNECTED = "disconnected"
10
+ }
11
+ export declare enum WmksErrorType {
12
+ AUTHENTICATION_FAILED = "authenticationfailed",
13
+ PROTOCOL_ERROR = "protocolerror",
14
+ WEBSOCKET_ERROR = "websocketerror"
15
+ }
16
+ export declare enum WmksEvents {
17
+ AUDIO = "audio",
18
+ CONNECTION_STATE_CHANGE = "connectionstatechange",
19
+ COPY = "copy",
20
+ ERROR = "error",
21
+ FULL_SCREEN_CHANGE = "fullscreenchange",
22
+ HEARTBEAT = "heartbeat",
23
+ KEYBOARD_LEDS_CHANGE = "keyboardledschanged",
24
+ REMOTE_SCREEN_SIZE_CHANGE = "screensizechange",
25
+ TOGGLE = "toggle"
26
+ }
27
+ export interface WmksEventData {
28
+ state: WmksConnectionState;
29
+ }
30
+ export declare enum WmksPosition {
31
+ CENTER = 0,
32
+ LEFT_TOP = 1
33
+ }
34
+ export type WmksSettableOptions = "changeResolution" | "position" | "rescale";
@@ -0,0 +1,61 @@
1
+ import { WmksConnectionState, WmksEvents, WmksPosition, WmksSettableOptions } from "./vmware-mks.models";
2
+ export declare function createWmksClient(hostElementId: string, options?: WmksClientCreateOptions): WmksClient;
3
+ export interface WmksClient {
4
+ connect(url: string): Promise<void>;
5
+ destroy(): void;
6
+ disconnect(): void;
7
+ getConnectionState(): WmksConnectionState;
8
+ /**
9
+ * This function is not documented by Broadcom but seems to exist and may be strictly related to
10
+ * focus on the virtual console OR clipboard reading OR both OR neither.
11
+ */
12
+ grab(): void;
13
+ register(event: WmksEvents, handler: WmksEventHandler): WmksClient;
14
+ /**
15
+ * Sends a Ctrl+Alt+Del key combination to the remote machine.
16
+ */
17
+ sendCAD(): void;
18
+ /**
19
+ * Sends a string as keyboard input to the server.
20
+ */
21
+ sendInputString(input: string): void;
22
+ /**
23
+ * Set an option WMKS client.
24
+ *
25
+ * @param option - which option's value to update.
26
+ * @param value - a boolean value enabling/disabling the option.
27
+ */
28
+ setOption(option: WmksSettableOptions, value: boolean): void;
29
+ showKeyboard(): void;
30
+ /**
31
+ * Forcibly remove focus from the remote console (I think)
32
+ */
33
+ ungrab(): void;
34
+ /**
35
+ * Broadcom's description: Changes the resolution or rescales the remote screen to match the container size. Behavior depends on settings for changeResolution, rescale, and position options described in createMKS Options.
36
+ *
37
+ * See: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere-sdks-tools/8-0/html-console-sdk-programming-guide/html-console-sdk-api/display-related-apis.html
38
+ */
39
+ updateScreen(): void;
40
+ }
41
+ export interface WmksClientCreateOptions {
42
+ changeResolution?: boolean;
43
+ position?: WmksPosition;
44
+ /**
45
+ * Indicates whether to rescale the remote screen to fit the container size. (Defaults to true)
46
+ */
47
+ rescale?: boolean;
48
+ useNativePixels?: boolean;
49
+ useVNCHandshake?: boolean;
50
+ }
51
+ export interface WMKS {
52
+ get version(): string;
53
+ /**
54
+ * Create a client which connects to a remote console hosted on a VMWare cluster.
55
+ *
56
+ * @param hostElementId The ID of a DOM element that will have a canvas injected into it by Broadcom's HTML Console SDK upon successful connection.
57
+ * @param options Options which identify and specify the behavior of the virtual console.
58
+ */
59
+ createWMKS(hostElementId: string, options?: WmksClientCreateOptions): WmksClient;
60
+ }
61
+ export type WmksEventHandler = (e: any, data: any) => void;
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@cmusei/console-forge",
3
+ "version": "0.0.1",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/cmu-sei/console-forge.git"
7
+ },
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "peerDependencies": {
12
+ "@angular/common": "^19.2.0",
13
+ "@angular/core": "^19.2.0",
14
+ "@novnc/novnc": "^1.4.0"
15
+ },
16
+ "dependencies": {
17
+ "tslib": "^2.3.0",
18
+ "@picocss/pico": "^2.1.1"
19
+ },
20
+ "sideEffects": false,
21
+ "module": "fesm2022/cmusei-console-forge.mjs",
22
+ "typings": "index.d.ts",
23
+ "exports": {
24
+ "./package.json": {
25
+ "default": "./package.json"
26
+ },
27
+ ".": {
28
+ "types": "./index.d.ts",
29
+ "default": "./fesm2022/cmusei-console-forge.mjs"
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,17 @@
1
+ export * from "./lib/components/console/console.component";
2
+ export * from "./lib/models/console-component-config";
3
+ export * from "./lib/directives/class-on-hover.directive";
4
+ export * from "./lib/config/provide-console-forge";
5
+ export * from "./lib/models/console-client-type";
6
+ export * from "./lib/models/console-connection-options";
7
+ export * from "./lib/models/console-connection-status";
8
+ export * from "./lib/models/console-credentials";
9
+ export * from "./lib/models/console-component-network-config";
10
+ export * from "./lib/models/console-power-request";
11
+ export * from "./lib/models/console-supported-features";
12
+ export * from "./lib/models/console-toolbar-position";
13
+ export * from "./lib/models/console-toolbar-component-base";
14
+ export * from "./lib/models/console-toolbar-context";
15
+ export * from "./lib/models/log-level";
16
+ export * from "./lib/services/user-settings.service";
17
+ export * from "./lib/services/clipboard/clipboard.helpers";