import { LoggerService } from '@sowatech/shared/logger'; import * as i0 from '@angular/core'; type CropType = 'square' | 'coords'; interface CropOptions { cropType?: string; cropCoords?: Coords; } interface Coords { left?: number; top?: number; width?: number; height?: number; } interface ImageTransformMarkerOptions extends Coords { lineWidth: number; markercolor?: string; markertype?: string; /** * @obsolete Use markercolor instead */ strokeStyle?: string; } /** * @obsolete Only used in ImageTransformService */ interface ImageTransformShrinkOptions { width: number; height: number; quality: number; } declare class ImageTransformBuilder { private imageType; private imageOrientation; private canvas; protected constructor(imageType: string, orientation: number, canvas: HTMLCanvasElement); static loadFromSrcStringAsync(base64SrcString: string): Promise; static loadFromFileAsync(file: File): Promise; toBase64(quality?: number): string; copyInstance(): ImageTransformBuilder; fixOrientation(): ImageTransformBuilder; shrinkTo(newWidth: number, newHeight: number): ImageTransformBuilder; crop(cropType: CropType, cropCoords?: Coords): ImageTransformBuilder; setMarker(options: ImageTransformMarkerOptions): ImageTransformBuilder; setWatermark(text: string, fontSize?: number): ImageTransformBuilder; rotate(angleInDegrees: -90 | 90 | 180 | 270): void; static createImageAsync(base64: string): Promise; private static initCanvasAsync; private static extractOrientationAsync; } /** * @deprecated Use ImageTransformBuilder instead */ declare class ImageTransformService { private logger; constructor(logger: LoggerService); getBase64FromFile(file: File): Promise; getBase64ImageSrcString(base64: string): string; getBase64FromImageSrcUrl(dataurlBase64: string): string; shrinkImage(base64: string, options: ImageTransformShrinkOptions): Promise; loadImage(base64: string): Promise; setMarkerOnImage(base64: string, options: ImageTransformMarkerOptions): Promise; fixOrientation(base64: string): Promise; private base64ToArrayBuffer; private reOrient; private rotateImage; setWatermark(base64: string, text: string, config?: { x: number; y: number; }): Promise; cropImage(base64: string, options: CropOptions): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { ImageTransformBuilder, ImageTransformService }; export type { Coords, CropOptions, CropType, ImageTransformMarkerOptions, ImageTransformShrinkOptions };