luna-dom-highlighter
Version:
Highlighter for html elements
58 lines (57 loc) • 1.53 kB
TypeScript
import type { PathCommands, ResetData } from './common';
import { Overlay } from './common';
import type { PathBounds } from './highlight_common';
interface Path {
path: PathCommands;
outlineColor: string;
fillColor: string;
name: string;
}
interface ContrastInfo {
backgroundColor: string;
fontSize: string;
fontWeight: string;
contrastAlgorithm: 'apca' | 'aa' | 'aaa';
textOpacity: number;
}
interface ElementInfo {
contrast?: ContrastInfo;
tagName: string;
idValue: string;
className?: string;
nodeWidth: number;
nodeHeight: number;
isLocked: boolean;
isLockedAncestor: boolean;
style: {
[key: string]: string | undefined;
};
showAccessibilityInfo: boolean;
isKeyboardFocusable: boolean;
accessibleName: string;
accessibleRole: string;
layoutObjectName?: string;
}
interface Highlight {
paths: Path[];
showRulers: boolean;
showExtensionLines: boolean;
elementInfo: ElementInfo;
colorFormat: string;
}
export declare class HighlightOverlay extends Overlay {
private tooltip;
private gridLabelState;
private _container;
setContainer(container: HTMLElement): void;
setPlatform(platform: string): void;
get container(): HTMLElement;
reset(resetData: ResetData): void;
install(): void;
uninstall(): void;
drawHighlight(highlight: Highlight): {
bounds: PathBounds;
};
private drawAxis;
}
export {};