UNPKG

@nodert-win11/windows.ui.xaml.hosting

Version:

Use the Windows.UI.Xaml.Hosting UWP API directly from Node.js

223 lines (139 loc) 6.06 kB
declare module "windows.ui.xaml.hosting" { export class Size { constructor(); } export class Rect { constructor(); } export class HostingContract { constructor(); } export enum DesignerAppViewState { visible, hidden, } export enum XamlSourceFocusNavigationReason { programmatic, restore, first, last, left, up, right, down, } export class DesignerAppExitedEventArgs { exitCode: Number; constructor(); } export class DesignerAppManager { appUserModelId: String; constructor(); constructor(appUserModelId: String); createNewViewAsync(initialViewState: DesignerAppViewState, initialViewSize: Object, callback: (error: Error, result: DesignerAppView) => void): void ; loadObjectIntoAppAsync(dllName: String, classId: String, initializationData: String, callback: (error: Error) => void): void ; close(): void; addListener(type: "DesignerAppExited", listener: (ev: Event) => void): void ; removeListener(type: "DesignerAppExited", listener: (ev: Event) => void): void ; on(type: "DesignerAppExited", listener: (ev: Event) => void): void ; off(type: "DesignerAppExited", listener: (ev: Event) => void): void ; addListener(type: string, listener: (ev: Event) => void): void ; removeListener(type: string, listener: (ev: Event) => void): void ; on(type: string, listener: (ev: Event) => void): void ; off(type: string, listener: (ev: Event) => void): void ; } export class DesignerAppView { appUserModelId: String; applicationViewId: Number; viewSize: Object; viewState: DesignerAppViewState; constructor(); updateViewAsync(viewState: DesignerAppViewState, viewSize: Object, callback: (error: Error) => void): void ; close(): void; } export class DesktopWindowXamlSource { content: Object; hasFocus: Boolean; constructor(); navigateFocus(request: XamlSourceFocusNavigationRequest): XamlSourceFocusNavigationResult; close(): void; addListener(type: "GotFocus", listener: (ev: Event) => void): void ; removeListener(type: "GotFocus", listener: (ev: Event) => void): void ; on(type: "GotFocus", listener: (ev: Event) => void): void ; off(type: "GotFocus", listener: (ev: Event) => void): void ; addListener(type: "TakeFocusRequested", listener: (ev: Event) => void): void ; removeListener(type: "TakeFocusRequested", listener: (ev: Event) => void): void ; on(type: "TakeFocusRequested", listener: (ev: Event) => void): void ; off(type: "TakeFocusRequested", listener: (ev: Event) => void): void ; addListener(type: string, listener: (ev: Event) => void): void ; removeListener(type: string, listener: (ev: Event) => void): void ; on(type: string, listener: (ev: Event) => void): void ; off(type: string, listener: (ev: Event) => void): void ; } export class DesktopWindowXamlSourceGotFocusEventArgs { request: XamlSourceFocusNavigationRequest; constructor(); } export class DesktopWindowXamlSourceTakeFocusRequestedEventArgs { request: XamlSourceFocusNavigationRequest; constructor(); } export class ElementCompositionPreview { constructor(); static setAppWindowContent(appWindow: Object, xamlContent: Object): void; static getAppWindowContent(appWindow: Object): Object; static setImplicitShowAnimation(element: Object, animation: Object): void; static setImplicitHideAnimation(element: Object, animation: Object): void; static setIsTranslationEnabled(element: Object, value: Boolean): void; static getPointerPositionPropertySet(targetElement: Object): Object; static getElementVisual(element: Object): Object; static getElementChildVisual(element: Object): Object; static setElementChildVisual(element: Object, visual: Object): void; static getScrollViewerManipulationPropertySet(scrollViewer: Object): Object; } export class IXamlUIPresenterHost { constructor(); resolveFileResource(path: String): String; } export class IXamlUIPresenterHost2 { constructor(); getGenericXamlFilePath(): String; } export class IXamlUIPresenterHost3 { constructor(); resolveDictionaryResource(dictionary: Object, dictionaryKey: Object, suggestedValue: Object): Object; } export class WindowsXamlManager { constructor(); static initializeForCurrentThread(): WindowsXamlManager; close(): void; } export class XamlSourceFocusNavigationRequest { correlationId: String; hintRect: Object; reason: XamlSourceFocusNavigationReason; constructor(); constructor(reason: XamlSourceFocusNavigationReason); constructor(reason: XamlSourceFocusNavigationReason, hintRect: Object); constructor(reason: XamlSourceFocusNavigationReason, hintRect: Object, correlationId: String); } export class XamlSourceFocusNavigationResult { wasFocusMoved: Boolean; constructor(); constructor(focusMoved: Boolean); } export class XamlUIPresenter { static completeTimelinesAutomatically: Boolean; themeResourcesXaml: String; themeKey: String; rootElement: Object; constructor(); static getFlyoutPlacementTargetInfo(placementTarget: Object, preferredPlacement: Number, targetPreferredPlacement: Number, allowFallbacks: Boolean): Object; static getFlyoutPlacement(placementTargetBounds: Object, controlSize: Object, minControlSize: Object, containerRect: Object, targetPreferredPlacement: Number, allowFallbacks: Boolean, chosenPlacement: Number): Object; static setHost(host: IXamlUIPresenterHost): void; static notifyWindowSizeChanged(): void; setSize(width: Number, height: Number): void; render(): void; present(): void; } }