ngx-extended-pdf-viewer
Version:
Embedding PDF files in your Angular application. Highly configurable viewer including the toolbar, sidebar, and all the features you're used to.
62 lines (61 loc) • 3.88 kB
TypeScript
import { AfterViewInit, ChangeDetectorRef, ElementRef, OnDestroy, TemplateRef } from '@angular/core';
import { NgxExtendedPdfViewerService } from '../../ngx-extended-pdf-viewer.service';
import { PdfShyButtonService } from '../../toolbar/pdf-shy-button/pdf-shy-button-service';
import { PDFNotificationService } from './../../pdf-notification-service';
import * as i0 from "@angular/core";
export declare class PdfSecondaryToolbarComponent implements AfterViewInit, OnDestroy {
private readonly element;
notificationService: PDFNotificationService;
private readonly platformId;
pdfShyButtonService: PdfShyButtonService;
private readonly ngxExtendedPdfViewerService;
private readonly cdr;
customSecondaryToolbar: import("@angular/core").InputSignal<TemplateRef<any> | undefined>;
secondaryToolbarTop: import("@angular/core").InputSignal<any>;
mobileFriendlyZoomScale: import("@angular/core").InputSignal<number>;
localizationInitialized: import("@angular/core").InputSignal<boolean>;
spreadChange: import("@angular/core").OutputEmitterRef<"off" | "even" | "odd">;
disablePreviousPage: boolean;
disableNextPage: boolean;
get secondaryToolbarMaxHeight(): string;
private classMutationObserver;
private PDFViewerApplication;
private eventBusAbortController;
constructor(element: ElementRef, notificationService: PDFNotificationService, platformId: Object, pdfShyButtonService: PdfShyButtonService, ngxExtendedPdfViewerService: NgxExtendedPdfViewerService, cdr: ChangeDetectorRef);
/**
* Runs `callback` and re-renders this component.
*
* The callback is scheduled from a pdf.js event bus listener, which runs
* outside Angular's zone, so neither zone.js nor a signal write schedules a
* change detection run for us - the button kept showing the previous state
* until an unrelated click happened to trigger one. The view can already be
* destroyed by the time a queued callback runs, and `detectChanges()` throws
* on a destroyed view, so that case is skipped.
*/
private asyncWithCD;
onPdfJsInit(): void;
updateUIState(): void;
onSpreadChange(newSpread: 'off' | 'odd' | 'even'): void;
onResize(): void;
ngAfterViewInit(): void;
ngOnDestroy(): void;
checkVisibility(): void;
private checkVisibilityRecursively;
/**
* Checks if a responsive visibility class (e.g. visibleSmallView) is currently
* hidden at the current viewport width. These classes make buttons visible only
* at smaller viewports via CSS media queries (max-width). We can't use
* getComputedStyle because the secondary toolbar itself is hidden, so we
* extract the actual breakpoint from the dynamic CSS and compare it to the
* current viewport width.
*/
private isResponsiveClassHidden;
/**
* Checks if the given responsive class is currently active by evaluating
* the matching CSS @media rule from the dynamic stylesheet.
*/
private isResponsiveBreakpointActive;
onClick(htmlevent: Event, action: undefined | ((htmlevent: Event, secondaryToolbar: boolean) => void), eventBusName?: string, closeOnClick?: boolean): void;
static ɵfac: i0.ɵɵFactoryDeclaration<PdfSecondaryToolbarComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<PdfSecondaryToolbarComponent, "pdf-secondary-toolbar", never, { "customSecondaryToolbar": { "alias": "customSecondaryToolbar"; "required": false; "isSignal": true; }; "secondaryToolbarTop": { "alias": "secondaryToolbarTop"; "required": false; "isSignal": true; }; "mobileFriendlyZoomScale": { "alias": "mobileFriendlyZoomScale"; "required": true; "isSignal": true; }; "localizationInitialized": { "alias": "localizationInitialized"; "required": true; "isSignal": true; }; }, { "spreadChange": "spreadChange"; }, never, never, false, never>;
}