UNPKG

@circe/core

Version:

Circe Components for Angular :: Core Services and Tools

102 lines (101 loc) 3.24 kB
import { NpaElement } from '../_types/element.types'; export interface SizeObject { width: ProcessedUnitObject; height: ProcessedUnitObject; } export interface SizeUnitsObject { height: string; width: string; } export interface ProcessedUnitObject { value: number; unit: string; } export declare type ElementId = NpaElement | Array<NpaElement>; export declare type BoxModelType = 'horizontal' | 'vertical'; export interface BoxModelSwapObject { type: BoxModelType; boxModel: number; boxModelAdditions: number; boxModelAggregated: number; boxModelExtracted: number; boxModelAdditionsInside: number; boxModelAdditionsOutside: number; boxModelAggregatedInside: number; boxModelAggregatedOutside: number; boxModelExtractedInside: number; boxModelExtractedOutside: number; } export interface BoxModelAdditionObject { boxModelAdditionInside: number; boxModelAdditionOutside: number; } export interface SpecialRuleObject { applyOnElements: Array<string>; boxModelType: BoxModelType; } export declare const boxModelTypeConstants: { HORIZONTAL: BoxModelType; VERTICAL: BoxModelType; }; export declare class BoxModelService { private readonly _defaultBoxModelType; private readonly _defaultElementHashType; private readonly _defaultComputedStylePropertyProcessed; private readonly _allowCssUnits; private readonly _additionHorizontalInsideClasses; private readonly _additionHorizontalOutsideClasses; private readonly _additionVerticalInsideClasses; private readonly _additionVerticalOutsideClasses; private readonly _fontSizeRule; constructor(); /** * _isElementHash * * @description * Checks if element given param is ElementHash type. */ static _isElementHash(element: NpaElement): boolean; /** * _isElementQuery * * @description * Checks if element given param is ElementQuery type. */ static _isElementQuery(element: NpaElement): boolean; /** * _isNativeDomElement * * @description * Checks if element given param is a native DOM element. */ static _isNativeDomElement(param: any): param is Element; /** * getSizeValues * * @description * Get computed height and width from a SizeObject. */ static getSizeUnits(sizeObject: SizeObject): SizeUnitsObject; /** * _convertToElementIdArray * * @description * Transform elementId type to array of Dom elements. */ private _convertToElementIdArray; private _getElementAdditions; getComputedStyleProperty(element: Element, property: string, processed?: boolean): string | ProcessedUnitObject; processElementForSpecialRules(element: Element): Element; readCssUnits(expression: string): ProcessedUnitObject; processSizeString(sizeString: string): SizeObject; /** * getElement * * @description * Returns an element DOM native object from different types of given params. */ getElement(element: NpaElement): Element; getDimensions(element: NpaElement): SizeObject; getBoxModel(elementId: ElementId, boxModelType?: BoxModelType): BoxModelSwapObject; }