import * as _angular_core from '@angular/core'; import { AfterViewInit, EventEmitter } from '@angular/core'; import { ZIcon } from '@shival99/z-ui/components/z-icon'; import { ClassValue } from 'clsx'; import { LayoutConfig, ThemeConfig, ControlVisibilityConfig, GroupVisibilityConfig, AutoActionConfig, ViewerConfig, PdfJsViewerComponent } from 'ng2-pdfjs-viewer'; import * as _shival99_z_ui_components_z_gallery from '@shival99/z-ui/components/z-gallery'; import { SafeHtml } from '@angular/platform-browser'; import { OverlayRef } from '@angular/cdk/overlay'; import * as class_variance_authority_types from 'class-variance-authority/types'; import { VariantProps } from 'class-variance-authority'; type ZGalleryMode = 'grid' | 'list'; type ZGallerySize = 'sm' | 'default' | 'lg'; type ZGalleryToggleSize = 'xs' | 'sm' | 'default' | 'lg'; type ZGalleryPdfViewerZoom = 'auto' | 'page-fit' | 'page-width' | 'page-actual' | `${number}%`; type ZGalleryPdfViewerCursor = 'select' | 'hand' | 'zoom'; type ZGalleryPdfViewerScroll = 'vertical' | 'horizontal' | 'wrapped' | 'page'; type ZGalleryPdfViewerSpread = 'none' | 'odd' | 'even'; type ZGalleryPdfViewerPageMode = 'none' | 'thumbs' | 'bookmarks' | 'attachments'; interface ZGalleryPdfViewerConfig { viewerFolder?: string; locale?: string; showSpinner?: boolean; useOnlyCssZoom?: boolean; diagnosticLogs?: boolean; showOpenFile?: boolean; showAnnotations?: boolean; showDownload?: boolean; showViewBookmark?: boolean; showPrint?: boolean; showFullScreen?: boolean; showFind?: boolean; downloadOnLoad?: boolean; printOnLoad?: boolean; rotateCW?: boolean; rotateCCW?: boolean; showLastPageOnLoad?: boolean; showToolbarLeft?: boolean; showToolbarMiddle?: boolean; showToolbarRight?: boolean; showSecondaryToolbarToggle?: boolean; showSidebar?: boolean; showSidebarLeft?: boolean; showSidebarRight?: boolean; toolbarDensity?: LayoutConfig['toolbarDensity']; sidebarWidth?: string; toolbarPosition?: LayoutConfig['toolbarPosition']; sidebarPosition?: LayoutConfig['sidebarPosition']; responsiveBreakpoint?: string | number; zoom?: ZGalleryPdfViewerZoom; rotation?: 0 | 90 | 180 | 270; cursor?: ZGalleryPdfViewerCursor; scroll?: ZGalleryPdfViewerScroll; spread?: ZGalleryPdfViewerSpread; pageMode?: ZGalleryPdfViewerPageMode; page?: number; iframeBorder?: string | number; theme?: ThemeConfig['theme']; primaryColor?: string; backgroundColor?: string; pageBorderColor?: string; pageSpacing?: ThemeConfig['pageSpacing']; toolbarColor?: string; textColor?: string; borderRadius?: string; customCSS?: string; cspNonce?: string; iframeTitle?: string; urlValidation?: boolean; controlVisibility?: ControlVisibilityConfig; groupVisibility?: GroupVisibilityConfig; autoActions?: AutoActionConfig; viewerConfig?: ViewerConfig; themeConfig?: ThemeConfig; layoutConfig?: LayoutConfig; } interface ZGalleryFile { id: string; name: string; size: number; type: string; url?: string; downloadUrl?: string; thumbnailUrl?: string; createdAt?: Date; updatedAt?: Date; } type ZFileCategory = 'image' | 'pdf' | 'word' | 'excel' | 'powerpoint' | 'video' | 'audio' | 'archive' | 'code' | 'text' | 'unknown'; interface ZFileCategoryStyle { bg: string; text: string; label: string; icon: string; } declare const FILE_CATEGORY_STYLES: Record; interface ZGalleryControl { setMode: (mode: ZGalleryMode) => void; getMode: () => ZGalleryMode; getFiles: () => ZGalleryFile[]; openPreview: (file: ZGalleryFile) => void; closePreview: () => void; selectAll: () => void; deselectAll: () => void; toggleSelection: (file: ZGalleryFile) => void; getSelectedFiles: () => ZGalleryFile[]; isSelected: (file: ZGalleryFile) => boolean; } /** * Action types emitted by gallery events */ type ZGalleryActionType = 'select' | 'deselect' | 'select-all' | 'deselect-all' | 'delete' | 'download' | 'preview'; /** * Event payload for zOnAction output */ interface ZGalleryActionEvent { type: ZGalleryActionType; file?: ZGalleryFile; files?: ZGalleryFile[]; } /** * Selection change event */ interface ZGallerySelectionChange { selectedFiles: ZGalleryFile[]; addedFiles?: ZGalleryFile[]; removedFiles?: ZGalleryFile[]; } interface ZGalleryPreviewOptions { file: ZGalleryFile; files?: ZGalleryFile[]; zDownload?: boolean; zShowRemove?: boolean; zPdfViewerConfig?: ZGalleryPdfViewerConfig; zTrustedResourceOrigins?: string[]; zOnClose?: () => void; zOnDownload?: (file: ZGalleryFile) => void; zOnNavigate?: (file: ZGalleryFile) => void; zOnRemove?: (file: ZGalleryFile) => void; } type ZGalleryPreviewItemOptions = Omit; declare class ZGalleryComponent implements AfterViewInit { private readonly _destroyRef; private readonly _previewService; private _previewRef; readonly zFiles: _angular_core.InputSignal; readonly zMode: _angular_core.ModelSignal; readonly zSize: _angular_core.InputSignal; readonly zColumns: _angular_core.InputSignal; readonly zItemWidth: _angular_core.InputSignal; readonly zLoading: _angular_core.InputSignal; readonly zSkeletonRows: _angular_core.InputSignal; readonly zSkeletonItems: _angular_core.InputSignal; readonly zShowDownload: _angular_core.InputSignal; readonly zShowPreview: _angular_core.InputSignal; readonly zShowRemove: _angular_core.InputSignal; readonly zPdfViewerConfig: _angular_core.InputSignal; readonly zTrustedResourceOrigins: _angular_core.InputSignal; readonly zShowModeToggle: _angular_core.InputSignal; readonly zShowSearch: _angular_core.InputSignal; readonly zServerSearch: _angular_core.InputSignal; readonly zSearchDebounce: _angular_core.InputSignal; readonly zSearchPlaceholder: _angular_core.InputSignal; readonly zToggleSize: _angular_core.InputSignal; readonly zTitle: _angular_core.InputSignal; readonly zEmptyText: _angular_core.InputSignal; readonly zEmptyIcon: _angular_core.InputSignal; readonly zClass: _angular_core.InputSignal; readonly zSelectable: _angular_core.InputSignal; readonly zSelectedFiles: _angular_core.ModelSignal; readonly zOnDownload: _angular_core.OutputEmitterRef; readonly zOnPreview: _angular_core.OutputEmitterRef; readonly zOnRemove: _angular_core.OutputEmitterRef; readonly zModeChange: _angular_core.OutputEmitterRef; readonly zSearchChange: _angular_core.OutputEmitterRef; readonly zControl: _angular_core.OutputEmitterRef; readonly zSelectionChange: _angular_core.OutputEmitterRef; readonly zOnAction: _angular_core.OutputEmitterRef; protected readonly modeIndex: _angular_core.WritableSignal; protected readonly searchInputQuery: _angular_core.WritableSignal; protected readonly searchQuery: _angular_core.WritableSignal; protected readonly skeletonItems: _angular_core.Signal; protected readonly currentMode: _angular_core.Signal; protected readonly gridColumnsClass: _angular_core.Signal; protected readonly gridTemplateColumns: _angular_core.Signal; protected readonly containerClasses: _angular_core.Signal; protected readonly showHeader: _angular_core.Signal; protected readonly headerControlHeight: _angular_core.Signal<"1.75rem" | "2rem" | "2.5rem" | "2.25rem">; protected readonly skeletonMediaHeight: _angular_core.Signal<"9rem" | "14rem" | "11rem">; protected readonly toggleIconSize: _angular_core.Signal<"14" | "16" | "20" | "18">; protected readonly searchInputSize: _angular_core.Signal<"sm" | "default" | "lg">; protected readonly filteredFiles: _angular_core.Signal; protected readonly selectedIds: _angular_core.Signal>; protected readonly isAllSelected: _angular_core.Signal; protected readonly isIndeterminate: _angular_core.Signal; protected readonly selectedCount: _angular_core.Signal; ngAfterViewInit(): void; protected onSearchChange(query: string | number | null): void; protected onDownload(file: ZGalleryFile): void; protected onPreview(file: ZGalleryFile): void; protected onRemove(file: ZGalleryFile): void; protected closePreview(): void; protected onRemoveFromPreview(file: ZGalleryFile): void; private _openPreview; protected isFileSelected(file: ZGalleryFile): boolean; protected toggleSelection(file: ZGalleryFile): void; protected selectAll(): void; protected deselectAll(): void; protected toggleSelectAll(): void; protected onBulkDelete(): void; protected onBulkDownload(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class ZGalleryItemComponent { readonly file: _angular_core.InputSignal; readonly zMode: _angular_core.InputSignal; readonly zSize: _angular_core.InputSignal; readonly zShowDownload: _angular_core.InputSignal; readonly zShowPreview: _angular_core.InputSignal; readonly zShowRemove: _angular_core.InputSignal; readonly zSelectable: _angular_core.InputSignal; readonly zSelected: _angular_core.InputSignal; readonly zOnDownload: _angular_core.OutputEmitterRef; readonly zOnPreview: _angular_core.OutputEmitterRef; readonly zOnRemove: _angular_core.OutputEmitterRef; readonly zOnSelect: _angular_core.OutputEmitterRef; protected readonly isLoading: _angular_core.WritableSignal; protected readonly formattedSize: _angular_core.Signal; protected readonly category: _angular_core.Signal<_shival99_z_ui_components_z_gallery.ZFileCategory>; protected readonly isImage: _angular_core.Signal; protected readonly fileExtension: _angular_core.Signal; protected readonly mediaHeightClass: _angular_core.Signal<"h-36" | "h-56" | "h-44">; protected readonly formattedDate: _angular_core.Signal; protected readonly categoryStyle: _angular_core.Signal; protected readonly fileTypeClasses: _angular_core.Signal; protected readonly canPreview: _angular_core.Signal; protected onImageLoad(): void; protected onImageError(): void; protected onDownload(event: Event): void; protected onPreviewClick(event: Event): void; protected onPreview(): void; protected onItemClick(): void; protected onRemove(event: Event): void; protected onSelectClick(event: Event): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class ZGalleryFileIconComponent { readonly file: _angular_core.InputSignal; readonly zSize: _angular_core.InputSignal; readonly zMode: _angular_core.InputSignal; protected readonly imageError: _angular_core.WritableSignal; protected readonly isLoading: _angular_core.WritableSignal; protected readonly category: _angular_core.Signal; protected readonly style: _angular_core.Signal<_shival99_z_ui_components_z_gallery.ZFileCategoryStyle>; protected readonly showThumbnail: _angular_core.Signal; protected readonly containerClasses: _angular_core.Signal; protected onImageLoad(): void; protected onImageError(event: Event): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class ZGalleryPreviewItemDirective { readonly zGalleryPreviewItem: _angular_core.InputSignal; readonly zGalleryPreviewFiles: _angular_core.InputSignal; readonly zGalleryPreviewOptions: _angular_core.InputSignal; readonly zDisabled: _angular_core.InputSignalWithTransform; readonly zOnPreview: _angular_core.OutputEmitterRef; private readonly _elementRef; private readonly _previewService; protected readonly hostRole: _angular_core.Signal<"button" | null>; protected readonly hostTabIndex: _angular_core.Signal<0 | -1 | null>; protected readonly hostAriaDisabled: _angular_core.Signal; protected openPreview(event?: Event): void; private _isNativeInteractive; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class ZGalleryPreviewComponent { private readonly _document; private readonly _sanitizer; readonly file: _angular_core.InputSignal; readonly files: _angular_core.InputSignal; readonly zShowRemove: _angular_core.InputSignal; readonly zPdfViewerConfig: _angular_core.InputSignal; readonly zTrustedResourceOrigins: _angular_core.InputSignal; readonly zOnClose: _angular_core.OutputEmitterRef; readonly zOnDownload: _angular_core.OutputEmitterRef; readonly zOnNavigate: _angular_core.OutputEmitterRef; readonly zOnRemove: _angular_core.OutputEmitterRef; protected readonly zoomed: _angular_core.WritableSignal; protected readonly isLoading: _angular_core.WritableSignal; protected readonly rotation: _angular_core.WritableSignal; protected readonly isConverting: _angular_core.WritableSignal; protected readonly conversionError: _angular_core.WritableSignal; protected readonly previewError: _angular_core.WritableSignal; protected readonly docHtmlContent: _angular_core.WritableSignal; protected readonly textContent: _angular_core.WritableSignal; protected readonly pdfViewer: _angular_core.Signal; private readonly _mediaLoaded; private _loadingStartTime; private readonly _minLoadingTime; constructor(); private _loadFileContent; private _loadDocx; private _loadExcel; private _loadText; private _assertSuccessfulResponse; private _completeLoading; protected readonly currentIndex: _angular_core.Signal; protected readonly hasPrev: _angular_core.Signal; protected readonly hasNext: _angular_core.Signal; protected readonly isImageFile: _angular_core.Signal; protected readonly isPdf: _angular_core.Signal; protected readonly pdfUrl: _angular_core.Signal; protected readonly pdfViewerId: _angular_core.Signal; protected readonly pdfViewerConfig: _angular_core.Signal; private _mergePdfViewerCss; protected readonly isVideo: _angular_core.Signal; protected readonly isWordFile: _angular_core.Signal; protected readonly isExcelFile: _angular_core.Signal; protected readonly isTextFile: _angular_core.Signal; protected readonly canPreview: _angular_core.Signal; protected readonly formattedSize: _angular_core.Signal; protected readonly imageTransform: _angular_core.Signal; private _isAllowedResourceUrl; private readonly _trustedOrigins; private _normalizeOrigin; protected readonly fileIcon: _angular_core.Signal; protected onKeyDown(event: KeyboardEvent): void; protected close(): void; protected navigate(direction: -1 | 1): void; protected toggleZoom(): void; protected rotateLeft(): void; protected rotateRight(): void; protected onImageLoad(): void; protected onVideoLoad(): void; protected onPdfLoad(): void; protected onMediaError(): void; protected download(): void; protected remove(): void; protected onBackdropClick(event: Event): void; private _queueMobilePdfFit; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class ZGalleryPreviewRef { private readonly _overlayRef; private _closed; componentInstance: ZGalleryPreviewComponent | null; readonly zAfterClose: EventEmitter; constructor(_overlayRef: OverlayRef | null); close(): void; } declare class ZGalleryPreviewService { private readonly _document; private readonly _injector; private readonly _overlay; private readonly _platformId; private readonly _zIndexService; open(file: ZGalleryFile, options?: Omit): ZGalleryPreviewRef; open(options: ZGalleryPreviewOptions): ZGalleryPreviewRef; private _createOverlay; private _normalizeOptions; private _handleDownload; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵprov: _angular_core.ɵɵInjectableDeclaration; } declare const getFileCategory: (file: ZGalleryFile) => ZFileCategory; declare const formatFileSize: (bytes: number) => string; declare const isPreviewable: (file: ZGalleryFile) => boolean; declare const isImage: (file: ZGalleryFile) => boolean; declare const zGalleryVariants: (props?: ({ zSize?: "sm" | "default" | "lg" | null | undefined; } & class_variance_authority_types.ClassProp) | undefined) => string; type ZGalleryVariants = VariantProps; declare const zGalleryItemVariants: (props?: ({ zMode?: "grid" | "list" | null | undefined; zSize?: "sm" | "default" | "lg" | null | undefined; } & class_variance_authority_types.ClassProp) | undefined) => string; type ZGalleryItemVariants = VariantProps; declare const zGalleryFileIconVariants: (props?: ({ zSize?: "sm" | "default" | "lg" | null | undefined; zMode?: "grid" | "list" | null | undefined; } & class_variance_authority_types.ClassProp) | undefined) => string; type ZGalleryFileIconVariants = VariantProps; export { FILE_CATEGORY_STYLES, ZGalleryComponent, ZGalleryFileIconComponent, ZGalleryItemComponent, ZGalleryPreviewComponent, ZGalleryPreviewItemDirective, ZGalleryPreviewRef, ZGalleryPreviewService, formatFileSize, getFileCategory, isImage, isPreviewable, zGalleryFileIconVariants, zGalleryItemVariants, zGalleryVariants }; export type { ZFileCategory, ZFileCategoryStyle, ZGalleryActionEvent, ZGalleryActionType, ZGalleryControl, ZGalleryFile, ZGalleryFileIconVariants, ZGalleryItemVariants, ZGalleryMode, ZGalleryPdfViewerConfig, ZGalleryPdfViewerCursor, ZGalleryPdfViewerPageMode, ZGalleryPdfViewerScroll, ZGalleryPdfViewerSpread, ZGalleryPdfViewerZoom, ZGalleryPreviewItemOptions, ZGalleryPreviewOptions, ZGallerySelectionChange, ZGallerySize, ZGalleryToggleSize, ZGalleryVariants };