vamp-utils
Version:
25 lines (24 loc) • 1.09 kB
TypeScript
import type { CSSProperties } from '@vue/runtime-dom';
import { BorderType, LabelStyle, TextStyle } from './definitions';
export declare function findParentNode(element: HTMLElement, classSelector: string): HTMLElement | null;
export interface ElementPosition {
left: number;
top: number;
}
export interface ElementSize {
width: number;
height: number;
}
export interface ElementMetadata extends ElementPosition, ElementSize {
}
export declare function resolvePosition(canvas: HTMLElement, childMetadata: ElementMetadata): ElementPosition;
export declare function resolveSize(canvas: HTMLElement, childMetadata: ElementMetadata): ElementSize;
export declare function calculateTextStyles(style?: TextStyle): CSSProperties;
export interface LabelStyleOptions {
borderType?: BorderType;
borderWidth?: number;
}
export declare function calculateLabelStyles(style?: LabelStyle, options?: LabelStyleOptions): CSSProperties;
export declare const mm2pxRate: number;
export declare function pixel2mm(pixels: number): number;
export declare function mm2pixel(mm: number): number;