UNPKG

@dlr-eoc/utils-browser

Version:

This library contains a collection of utilities like download data as blob and Paper layout.

21 lines (20 loc) 815 B
export type PaperFormat = 'A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6'; export type Orientation = 'landscape' | 'portrait'; export type Resolution = number; /** * A utility class intended to help with getting the dimensions of a paper. * Especially useful for preparing html that needs to be printed. */ export declare class Paper { readonly format: PaperFormat; readonly resolution: Resolution; readonly orientation: Orientation; readonly widthCm: number; readonly heightCm: number; readonly widthPx: number; readonly heightPx: number; constructor(format: PaperFormat, resolution: Resolution, orientation: Orientation); updateFormat(format: PaperFormat): Paper; updateResolution(resolution: Resolution): Paper; updateOrientation(orientation: Orientation): Paper; }