import * as i0 from '@angular/core'; import { OnInit } from '@angular/core'; import * as i9 from 'hslayers-ng/common/panels'; import { HsPanelBaseComponent } from 'hslayers-ng/common/panels'; import { Units } from 'ol/control/ScaleLine'; import { ColorEvent } from 'ngx-color'; import { HsLanguageService } from 'hslayers-ng/services/language'; import * as i6 from '@angular/common'; import * as i7 from '@angular/forms'; import * as i8 from '@ngx-translate/core'; import { Subject, Subscription } from 'rxjs'; import { Control } from 'ol/control'; declare const xpos: readonly ["left", "right", "center"]; type xPos = (typeof xpos)[number]; declare const ypos: readonly ["top", "middle", "bottom"]; type yPos = (typeof ypos)[number]; type TextStyle = { textColor?: string; bcColor?: string; textSize?: string; fontFamily?: string; fontStyle?: string; textDraw?: 'fill' | 'stroke'; posX?: xPos; posY?: yPos; }; type ImprintObj = { include?: boolean; author?: string; width?: number; height?: number; abstract?: string; textStyle?: TextStyle; }; type LegendObj = { include?: boolean; width?: number; bcColor?: string; posX?: xPos; posY?: yPos; }; type ScaleObj = { include?: boolean; scaleType?: 'scaleline' | 'scalebar'; scaleBarSteps?: number; scaleBarText?: boolean; scaleUnits?: Units; }; type TitleObj = { text?: string; textStyle: TextStyle; }; type PrintModel = { titleObj?: TitleObj; scaleObj?: ScaleObj; legendObj?: LegendObj; imprintObj?: ImprintObj; }; type Styler = { visible: boolean; name: 'title' | 'legend' | 'imprint' | 'scale'; }; declare class HsPrintComponent extends HsPanelBaseComponent implements OnInit { private hsPrintService; private hsPrintScaleService; private hsPrintLegendService; name: string; stylers: Styler[]; print: PrintModel; ngOnInit(): void; /** * Set print object to default values */ setToDefault(): void; /** * Cancel loading print layout image */ cancelLoading(): void; /** * Print or preview print layout * @param complete - Indicates whether the user wants to print or preview the image */ printLayout(complete: boolean): Promise; /** * Download print layout as png image */ download(): Promise; isLoading(): boolean; /** * Set styler visibility * @param stylerVisible - Selected styler name, that is being toggled */ setStylerVisible(stylerVisible: string): void; /** * Get styler visibility * @param stylerVisible - Selected styler name, that is being toggled */ getStylerVisible(stylerVisible: string): boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class HsPrintService { private hsMapService; private hsShareThumbnailService; private hsPrintLegendService; private hsPrintScaleService; private hsPrintTitleService; private hsPrintImprintService; /** * Print styled print layout * @param print - Print object * @param complete - If true, generated image will be opened and printing interface will be created */ print(print: PrintModel, complete?: boolean): Promise; /** * Download map print layout as png image * @param print - Print object */ download(print: PrintModel): Promise; /** * Create map image with additional styled text, optional scale, legend or imprint * @param print - Print object */ createMapImage(print: PrintModel): Promise; /** * Get child canvas position relative to parent canvas * @param parentC - Parent HTMLCanvasElement * @param childC - Child HTMLCanvasElement * @param xPos - X pixels * @param yPos - Y pixels */ private getChildPosition; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class HsPrintImprintStylerComponent { imprintObj: ImprintObj; sizes: number[]; constructor(); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class HsPrintLegendStylerComponent { hsLanguageService: HsLanguageService; private hsColorPickerService; bcColor: string; fillPickerVisible: boolean; positionOptions: { positionsX: string[]; positionsY: string[]; }; legendWidths: number[]; legendObj: LegendObj; /** * Triggered when color picker value has been selected * @param $event - ColorEvent */ onPick($event: ColorEvent): void; /** * Get color picker style values for DOM styling */ getColorPickerStyle(): any; /** * Get translation for the value string * @param module - Translation module * @param text - Text to translate */ getTranslation(module: string, text: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare enum ColorPickers { Fill = "fill", Background = "background" } declare class HsPrintTextStylerComponent { private hsColorPickerService; private hsLanguageService; textStyle: TextStyle; objectName: string; fillPickerVisible: boolean; bcPickerVisible: boolean; textColor: string; backgroundColor: string; stylingOptions: { fonts: string[]; fontStyles: string[]; textDrawTypes: string[]; textSizes: string[]; }; positionOptions: { positionsX: string[]; positionsY: string[]; }; /** * Triggered when color picker value has been selected * @param $event - ColorEvent * @param type - color picker type selected */ onPick($event: ColorEvent, type: 'fill' | 'background'): void; /** * Get color picker style values for DOM styling * @param type - color picker type selected */ getColorPickerStyle(type: 'fill' | 'background'): any; /** * Set color picker visibility * @param type - color picker type selected */ setColorPickerVisible(type: 'fill' | 'background'): void; /** * Get translation for the value string * @param module - Translation module * @param text - Text to translate */ getTranslation(module: string, text: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class HsPrintScaleStylerComponent { private hsPrintScaleService; private hsLanguageService; scaleObj: ScaleObj; stylingOptions: { scaleType: string[]; scaleUnits: { name: string; value: string; }[]; scaleBarSteps: number[]; }; /** * Triggered when scale object values have been changed */ scaleObjChanged(): void; /** * Get translation for the value string * @param module - Translation module * @param text - Text to translate */ getTranslation(module: string, text: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class PrintModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class PrintLegendParams { legendWidth: number; loadingExternalImages: boolean; cancelRequest: Subject; subscriptions: Subscription[]; } declare class HsPrintLegendService extends PrintLegendParams { private hsMapService; private hsLegendService; private hsLegendLayerStaticService; private hsLanguageService; private hsShareThumbnailService; constructor(); /** * Convert svg to image * @param svgSource - Svg source */ svgToImage(svgSource: string): Promise; /** * Draw legend canvas * @param legendObj - Legend object */ drawLegendCanvas(legendObj: LegendObj): Promise; /** * Fill legend canvas with images * @param ctx - Legend canvas context * @param legendImages - All available legend images */ private fillLegendCanvas; /** * Style legend canvas background * @param canvas - Legend canvas * @param legendObj - Legend object */ private styleLegendCanvas; /** * Get legend images from layer legend descriptors */ private getLegendImages; /** * Get Vector layer legend svg source * @param desc - HsLegendDescriptor */ private getVectorSvgSource; /** * Get Static layer legend svg source * @param desc - HsLegendDescriptor */ private getStaticSvgSource; /** * Create svg from legend source and layer title * @param source - Legend source * @param layerTitle - Layer title */ private legendToSvg; /** * Create svg from sparqlJson source and layer title * @param category - Category property for sparqlJson layer * @param layerTitle - Layer title */ private sparqlJsonToSvg; /** * Create svg from image url (external source) and layer title * @param imageUrl - Image url * @param layerTitle - Layer title */ private legendImageToSvg; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class HsPrintScaleService { private hsMapService; private hsPrintLegendService; defaultScaleLine: Control; scaleBarCSS: string; scaleLineCSS: string; constructor(); /** * Set original map scale if it exists */ setToDefaultScale(): void; /** * Triggered when the scale type or its values have been changed by the user * @param scaleObj - Scale object */ scaleChanged(scaleObj: ScaleObj): void; /** * Draw canvas with scale DOM element * @param scaleObj - Scale object */ drawScaleCanvas(scaleObj: ScaleObj): Promise; /** * Create svg source from scale DOM element * @param type - Scale type * @param scaleElem - Scale element from OpenLayers map DOM * @param cssClasses - CSS classes taken from OpenLayers css */ private createScaleSvgSource; /** * Draw scale image from svg source into a canvas * @param canvas - HTMLCanvasElement * @param svgSource - SVG source string */ private drawScaleImage; /** * Get current map scale Control */ private getMapScale; /** * Create new scale control for the map * @param scaleObj - Scale object */ private createNewScaleControl; /** * Set map scale to a new scale object * @param newControl - Control */ private setMapScale; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { ColorPickers, HsPrintComponent, HsPrintImprintStylerComponent, HsPrintLegendService, HsPrintLegendStylerComponent, HsPrintScaleService, HsPrintScaleStylerComponent, HsPrintService, HsPrintTextStylerComponent, PrintLegendParams, PrintModule };