import { createLogger } from './debug/createLogger'; /** * Virtual representation of the pixels of the page. Its length is the page's width*height * and contains one pixel marker for each page's pixel. The pixel markers are used to identify the * type of component. * * @example This could be the content of a 10x10 pixel page with a header and a button. * [ * 0,1,1,1,1,1,1,1,1,1,0, * 0,1,0,0,0,0,0,0,0,1,0, * 0,1,1,1,1,1,1,1,1,1,0, * 0,0,0,0,0,0,0,0,0,0,0, * 0,0,0,0,0,4,4,4,4,4,0, * 0,0,0,0,0,4,0,0,0,4,0, * 0,0,0,0,0,4,4,4,4,4,0, * 0,0,0,0,0,0,0,0,0,0,0, * 0,0,0,0,0,0,0,0,0,0,0, * 0,0,0,0,0,0,0,0,0,0,0, * ] */ export type Bitmap = Uint8Array | Uint16Array | Uint32Array; export type EmptyPixel = 0; export type Pixel = number; export type Warning = 'doesNotContainChildren' | 'zeroTotalPixels' | 'onlyEmptyPixels' | 'hasNoSize'; export type DsVisualCoverageResult = { duration: Duration; warnings: Warning[]; childrenData: ChildData[]; pixelCounts: PixelCounts; pixelByComponentName: Record; nonDsComponentsPixel: number; elementRect: Rect; }; type Percentage = number; export type Coverage = Percentage; export type CoverageContainer = string; export type DsVisualCoverageDeNormalizedResult = DsVisualCoverageResult & { coverage: Coverage; debugInfo: string; totalDuration: Milliseconds; readablePixelCounts: Record; coverageContainerAttributeValue: string | null; }; export type DsVisualCoverageRunResult = { stopped: boolean; totalDuration: Milliseconds; dsVisualCoverageResults: DsVisualCoverageDeNormalizedResult[]; }; export type Logger = ReturnType; export type PixelCounts = Uint32Array; export type Coordinates = { top: number; left: number; width: number; height: number; }; export type TopLeftWidthHeight = Uint16Array; export type Rect = TopLeftWidthHeight; export type Milliseconds = number; export type Duration = { blockingDuration: Milliseconds; nonBlockingDuration: Milliseconds; countPixelsDuration: Milliseconds; loopOverDomChildrenDuration: Milliseconds; }; export type ChildData = { rect: Rect; weight: number; dsComponentName: string | null; debugInfo: string; debugColor: ComponentColor; }; export type ComponentColor = 'red' | 'orange' | 'yellow' | 'green' | 'blue' | 'purple' | 'brown'; export type GetComponentData = (params: { component: COMPONENT; parentsData: ChildData[]; }) => GetComponentDataResult; type GetComponentDataResult = { result: 'ignoreComponent'; } | ({ result: 'countComponent'; } & Omit); export type GetContainerData = (params: { component: COMPONENT; }) => GetContainerDataResult; type GetContainerDataResult = { result: 'isNotCoverageContainer'; } | { result: 'isCoverageContainer'; coverageContainer: CoverageContainer; } | { /** * The container will be completely ignored by the DS coverage. It's useful to exclude * some third parties UIs. */ result: 'ignoreCoverageContainer'; coverageContainer: CoverageContainer; }; export {}; //# sourceMappingURL=types.d.ts.map