// Generated by dts-bundle-generator v9.5.1 export type NotificationSeverity = "INFO" | "WARNING" | "ERROR" | "SUCCESS" | "HINT"; export type NotificationType = "PROBLEM" | "ALERT"; interface Notification$1 { normalizedPosixPathRelativeToTheWorkspaceRoot: string; severity: NotificationSeverity; message: string; type: NotificationType; position?: Position; } export interface Position { startLineNumber: number; startColumn: number; endLineNumber: number; endColumn: number; } declare enum EditorTheme { DARK = 0, LIGHT = 1, HIGH_CONTRAST = 2, HIGH_CONTRAST_LIGHT = 3 } export interface EditorApi { setContent(normalizedPosixPathRelativeToTheWorkspaceRoot: string, content: string): Promise; getContent(): Promise; getPreview(): Promise; undo(): Promise; redo(): Promise; validate(): Promise; setTheme(theme: EditorTheme): Promise; } export interface EditorContent { content: string; normalizedPosixPathRelativeToTheWorkspaceRoot: string; context?: Map; } export interface ChannelKeyboardEvent { altKey: boolean; ctrlKey: boolean; shiftKey: boolean; metaKey: boolean; code: string; type: string; channelOriginalTargetTagName?: string; } export interface KeyboardShortcutsEnvelopeApi { kogitoKeyboardShortcuts_channelKeyboardEvent(channelKeyboardEvent: ChannelKeyboardEvent): void; } export interface I18nEnvelopeApi { kogitoI18n_localeChange(locale: string): void; } export interface Association { origin: string; envelopeServerId: string; } declare enum ChannelType { VSCODE_DESKTOP = "VSCODE_DESKTOP", VSCODE_WEB = "VSCODE_WEB", ONLINE = "ONLINE", GITHUB = "GITHUB", EMBEDDED = "EMBEDDED", OTHER = "OTHER", ONLINE_MULTI_FILE = "ONLINE_MULTI_FILE", STANDALONE = "STANDALONE" } export interface EditorInitArgs { resourcesPathPrefix: string; fileExtension: string; initialLocale: string; isReadOnly: boolean; channel: ChannelType; workspaceRootAbsolutePosixPath: string; } export interface KogitoEditorEnvelopeApi extends KeyboardShortcutsEnvelopeApi, I18nEnvelopeApi { kogitoEditor_contentChanged(content: EditorContent, args: { showLoadingOverlay: boolean; }): Promise; kogitoEditor_editorUndo(): void; kogitoEditor_editorRedo(): void; kogitoEditor_initRequest(association: Association, editorInit: EditorInitArgs): Promise; kogitoEditor_contentRequest(): Promise; kogitoEditor_previewRequest(): Promise; kogitoEditor_validate(): Promise; } export type SharedValueProviderPropertyNames> = { [K in keyof T]: ReturnType extends SharedValueProvider ? K : never; }[keyof T]; export type NotificationPropertyNames> = { [K in keyof T]: ReturnType extends void ? K : never; }[keyof T]; export type RequestPropertyNames> = { [K in keyof T]: ReturnType extends Promise ? K : never; }[keyof T]; export interface SharedValueConsumer { subscribe(callback: (newValue: T) => void): (newValue: T) => any; unsubscribe(subscription: (newValue: T) => void): void; set(t: T): void; } export interface SharedValueProvider { defaultValue: T; } export type ApiDefinition = { [P in keyof T]: (...a: any) => Promise | SharedValueProvider | void; }; export type ArgsType = T extends (...args: infer A) => any ? A : never; export type ApiRequests> = Pick>; export type ApiNotificationConsumers> = Pick, NotificationPropertyNames>; export type ApiSharedValueConsumers> = Pick, SharedValueProviderPropertyNames>; export type WithSharedValueConsumers> = { [K in keyof T]: ReturnType extends SharedValueProvider ? SharedValueConsumer : never; }; export interface NotificationConsumer { subscribe(callback: (...newValue: ArgsType) => void): (...newValue: ArgsType) => any; unsubscribe(subscription: (...newValue: ArgsType) => void): void; send(...args: ArgsType): void; } export type WithNotificationConsumers> = { [K in keyof T]: ReturnType extends void ? NotificationConsumer : never; }; export interface MessageBusClientApi> { requests: ApiRequests; notifications: ApiNotificationConsumers; shared: ApiSharedValueConsumers; } export interface Command { id: string; undo?: () => void; redo?: () => void; } declare class StateControl { private commandStack; private currentCommand?; private savedCommand?; private registeredCallbacks; constructor(); subscribe(callback: (isDirty: boolean) => void): (isDirty: boolean) => void; unsubscribe(callback: (isDirty: boolean) => void): void; getSavedCommand(): Command | undefined; getCurrentCommand(): Command | undefined; getCommandStack(): Command[]; getRegisteredCallbacks(): ((isDirty: boolean) => void)[]; setSavedCommand(): void; private setCurrentCommand; isDirty(): boolean; undo(): void; redo(): void; private eraseRedoCommands; updateCommandStack(command: Command): void; } export interface StandaloneEditorApi extends EditorApi { subscribeToContentChanges: StateControl["subscribe"]; unsubscribeToContentChanges: StateControl["unsubscribe"]; markAsSaved: StateControl["setSavedCommand"]; envelopeApi: MessageBusClientApi; close: () => void; } export type EditorStandaloneResource = { contentType: "text" | "binary"; content: Promise; }; export interface Editor { open: (args: { container: Element; initialContent: Promise; readOnly: boolean; origin?: string; resources?: Map; }) => StandaloneEditorApi; } export declare const createEditor: (envelopeApi: MessageBusClientApi, stateControl: StateControl, listener: (message: MessageEvent) => void, iframe: HTMLIFrameElement) => StandaloneEditorApi; export {};