import * as i0 from '@angular/core'; import { Injector, ElementRef, InputSignal, InjectionToken, OnInit, AfterViewInit, OnDestroy, Signal } from '@angular/core'; import { SafeUrl } from '@angular/platform-browser'; import { ThyAbstractOverlayConfig, ThyAbstractOverlayOptions } from 'ngx-tethys/core'; import * as i5 from 'ngx-tethys/dialog'; import { ThyDialog, ThyDialogRef } from 'ngx-tethys/dialog'; import * as i8 from 'ngx-tethys/copy'; import { ThyCopyEvent } from 'ngx-tethys/copy'; import { ThyFullscreen } from 'ngx-tethys/fullscreen'; import { Observable } from 'rxjs'; import { ThyImageLocale } from 'ngx-tethys/i18n'; import * as i1 from '@angular/common'; import * as i2 from '@angular/cdk/portal'; import * as i3 from '@angular/cdk/drag-drop'; import * as i4 from 'ngx-tethys/icon'; import * as i6 from 'ngx-tethys/divider'; import * as i7 from 'ngx-tethys/tooltip'; import * as i9 from 'ngx-tethys/loading'; import * as i10 from 'ngx-tethys/action'; interface ThyImageMeta { name?: string; size?: string | number; } interface ThyImageInfo extends ThyImageMeta { src: string; width?: string | number; height?: string | number; alt?: string; origin?: { src: string; width?: string | number; height?: string | number; alt?: string; }; } interface InternalImageInfo extends ThyImageInfo { objectURL?: SafeUrl; blob?: Blob; } interface ThyImagePreviewOptions { closeOnNavigation?: boolean; disableClose?: boolean; disableKeyboardSelectable?: boolean; zoom?: number; rotate?: number; operations?: (ThyImagePreviewOperationType | ThyImagePreviewOperation)[]; resolveSize?: boolean; } interface ThyImagePreviewOperation { icon: string; name: string; action?: (image: ThyImageInfo) => void; type?: ThyImagePreviewOperationType; } type ThyImagePreviewMode = 'original-scale' | 'fit-screen'; type ThyImagePreviewOperationType = 'zoom-out' | 'zoom-in' | 'rotate-right' | 'download' | ThyImagePreviewMode | 'copyLink' | 'view-original' | 'full-screen'; interface IThyImageDirective { previewable: boolean; thySrc: InputSignal; thyPreviewSrc: InputSignal; thyOriginSrc: InputSignal; thyImageMeta: InputSignal; } interface IThyImageGroupComponent { injector: Injector; element: ElementRef; images: IThyImageDirective[]; addImage: (image: IThyImageDirective, index: number) => void; removeImage: (index: number) => void; } /** * 图片分组,提供 thyImageGroup 指令和 thy-image-group 标签两种使用方式 * @name thy-image-group,[thyImageGroup] */ declare class ThyImageGroup implements IThyImageGroupComponent { injector: Injector; element: ElementRef; images: IThyImageDirective[]; addImage(image: IThyImageDirective, index: number): void; removeImage(index: number): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ThyImagePreviewConfig extends ThyAbstractOverlayConfig { closeOnNavigation?: boolean; disableClose?: boolean; disableKeyboardSelectable?: boolean; zoom?: number; rotate?: number; } declare const THY_IMAGE_DEFAULT_PREVIEW_OPTIONS: InjectionToken>; declare const THY_IMAGE_DEFAULT_PREVIEW_OPTIONS_PROVIDER: { provide: InjectionToken>; useValue: { hasBackdrop: boolean; closeOnNavigation: boolean; disableClose: boolean; disableKeyboardSelectable: boolean; restoreFocus: boolean; }; }; declare const imageAbstractOverlayOptions: ThyAbstractOverlayOptions; /** * thyImage: 预览图片指令,只可绑定到 img 标签上 * @name img[thyImage] * @order 10 */ declare class ThyImageDirective implements IThyImageDirective, OnInit, AfterViewInit, OnDestroy { private thyImageService; private injector; private elementRef; /** * 图片地址 */ readonly thySrc: i0.InputSignal; /** * 预览图片地址 */ readonly thyPreviewSrc: i0.InputSignal; /** * 图片原图地址 */ readonly thyOriginSrc: i0.InputSignal; /** * 图片附加信息,包含 { name: string, size?: string | number; } */ readonly thyImageMeta: i0.InputSignal; /** * 是否禁止预览 * @default false */ readonly thyDisablePreview: i0.InputSignalWithTransform; /** * 是否自动计算图片资源大小 */ readonly thyResolveSize: i0.InputSignalWithTransform; get previewable(): boolean; private parentGroup; constructor(); ngOnInit(): void; ngAfterViewInit(): void; getParentGroup(): void; addParentImage(): void; onPreview(event: MouseEvent): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * 图片预览组件 * @name thy-image-preview * @order 20 */ declare class ThyImagePreview implements OnInit { thyDialog: ThyDialog; thyFullscreen: ThyFullscreen; private cdr; private ngZone; private notifyService; private host; private sanitizer; locale: Signal; readonly downloadClicked: i0.OutputEmitterRef; private readonly destroyRef; images: InternalImageInfo[]; previewIndex: number; previewConfig: ThyImagePreviewOptions; previewImageTransform: string; previewImageWrapperTransform: string; zoomDisabled: boolean; zoom: number; position: { x: number; y: number; }; isDragging: boolean; isLoadingDone: boolean; isFullScreen: boolean; isInsideScreen: boolean; currentImageMode: ThyImagePreviewMode; previewOperations: ThyImagePreviewOperation[]; defaultPreviewOperations: ThyImagePreviewOperation[]; private rotate; get previewImage(): InternalImageInfo; get previewImageOriginSrc(): string; get defaultZoom(): number | undefined; imageRef: ElementRef; imagePreviewWrapper: ElementRef; ngOnInit(): void; setOriginalSize(): void; setFitScreen(): void; useDefaultZoomUpdate(isUpdateImageWrapper: boolean): void; useCalculateZoomUpdate(isUpdateImageWrapper?: boolean): void; updatePreviewImage(): void; resolvePreviewImage(): Observable; initPreview(): void; download(image: ThyImageInfo): void; zoomIn(): void; zoomOut(): void; calculateInsideScreen(): void; viewOriginal(): void; rotateRight(): void; fullScreen(): void; copyLink(event: ThyCopyEvent): void; prev(): void; next(): void; dragReleased(): void; private reset; private updatePreviewImageTransform; private updatePreviewImageWrapperTransform; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ThyImagePreviewRef { previewInstance: ThyImagePreview; private config; private dialogRef; get componentInstance(): ThyImagePreview; constructor(previewInstance: ThyImagePreview, config: ThyImagePreviewOptions, dialogRef: ThyDialogRef); next(): void; prev(): void; downloadClicked(): Observable; } /** * 图片预览服务 */ declare class ThyImageService implements OnDestroy { thyDialog: ThyDialog; /** * 图片预览默认配置,外部可通过注入 THY_IMAGE_DEFAULT_PREVIEW_OPTIONS 进行配置 */ defaultConfig: ThyImagePreviewConfig; private downloadClicked$; private ngUnsubscribe$; constructor(); /** * 图片预览方法 */ preview(images: ThyImageInfo[], options?: ThyImagePreviewOptions & { startIndex?: number; }): ThyImagePreviewRef; downloadClicked(): Observable; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class ThyImageModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { THY_IMAGE_DEFAULT_PREVIEW_OPTIONS, THY_IMAGE_DEFAULT_PREVIEW_OPTIONS_PROVIDER, ThyImageDirective, ThyImageGroup, ThyImageModule, ThyImagePreview, ThyImagePreviewConfig, ThyImagePreviewRef, ThyImageService, imageAbstractOverlayOptions }; export type { InternalImageInfo, ThyImageInfo, ThyImageMeta, ThyImagePreviewMode, ThyImagePreviewOperation, ThyImagePreviewOperationType, ThyImagePreviewOptions };