windows-swca
Version:
JavaScript bindings for the undocumented SetWindowCompositionAttribute API
48 lines (47 loc) • 1.73 kB
TypeScript
/// <reference types="node" />
/**
* The possible accents.
*/
export declare enum ACCENT_STATE {
/**
* Default accent. No transparency, background is black.
*/
ACCENT_DISABLED = 0,
/**
* Background is determined by color. (alpha channel ignored)
*/
ACCENT_ENABLE_GRADIENT = 1,
/**
* Background is determined by color.
*/
ACCENT_ENABLE_TRANSPARENTGRADIENT = 2,
/**
* Background is determined by color, with a blur for transparent areas.
*/
ACCENT_ENABLE_BLURBEHIND = 3,
/**
* Background is determined by color, with an acrylic blur for transparent areas.
* Note that the module will replace an alpha of 0 with an alpha of 1 (out of 255)
* because Windows has bugs with a fully transparent alpha.
*/
ACCENT_ENABLE_ACRYLICBLURBEHIND = 4,
/**
* Behavior unknown, left for completeness's sake.
*/
ACCENT_ENABLE_HOSTBACKDROP = 5,
/**
* Fully transparent background.
* Note that this tends to be buggy and to change value across Windows versions
* (for example it was initially the value of {@link ACCENT_STATE#ACCENT_ENABLE_ACRYLICBLURBEHIND})
* so it is more reliable to use {@link ACCENT_STATE#ACCENT_ENABLE_TRANSPARENTGRADIENT} with an alpha of 0.
* (you also get the benefit of less bugs)
*/
ACCENT_INVALID_STATE = 6
}
/**
* Sets a window's composition attribute
* @param window The target window's native handle.
* @param accent The desired accent.
* @param color The background color in 0xRRGGBBAA.
*/
export declare function SetWindowCompositionAttribute(window: Buffer, accent: ACCENT_STATE, color: number): any;