import { Subject } from "rxjs"; import * as i0 from "@angular/core"; export declare class PrintOptions { printSectionId: string; printTitle: string; useExistingCss: boolean; bodyClass: string; printMethod: 'window' | 'tab' | 'iframe'; previewOnly: boolean; closeWindow: boolean; printDelay: number; constructor(options?: Partial); } /** For example: * { * 'h2': { 'border': 'solid 1px' }, * 'h1': { 'color': 'red', 'border': '1px solid' }, * */ export type PrintStyle = Record>; /** * Either a {@link PrintStyle} object, or a raw CSS string (e.g. `'h1 { color: red; }'`) * to be injected into the print document's tag. */ returnStyleValues(): string; /** * @returns string which contains the link tags containing the css which will * be injected later within tag. * */ private returnStyleSheetLinkTags; /** * Sets the style sheet file based on the provided CSS list. * * @param {string} cssList - CSS file or list of CSS files. * @protected */ protected setStyleSheetFile(cssList: string): void; private syncFormValues; /** * Converts a canvas element to an image and returns its HTML string. * * @param {HTMLCanvasElement} canvasElm - The canvas element to convert. * @returns {HTMLImageElement | null} - HTML Element of the image. * @private */ private canvasToImageHtml; /** * Includes canvas contents in the print section via img tags. * * @private * @param source * @param clone */ private updateCanvasToImage; /** * Retrieves the HTML content of a specified printing section. * * @param {string} printSectionId - Id of the printing section. * @returns {string | null} - HTML content of the printing section, or null if not found. * @private */ private getHtmlContents; /** * Retrieves the HTML content of elements with the specified tag. * * @param {keyof HTMLElementTagNameMap} tag - HTML tag name. * @returns {string} - Concatenated outerHTML of elements with the specified tag. * @private */ private getElementTag; /** * Prints the specified content using the provided print options. * * @public * @param printOptionInput - Options for printing. * @returns a Promise that resolves once this print job completes (the print dialog / window was closed). * It never settles if printing could not be started, or with `previewOnly` in iframe mode. */ protected print(printOptionInput?: Partial): Promise; /** * The steps shared by every print method: write the document, wait for it to load, * then open the print dialog after `printDelay` (unless `previewOnly`). */ private runPrint; private createWindowTarget; private createIframeTarget; private prepareDocumentComponents; private buildPrintDocument; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare namespace ngx_print_directive_d_exports { export { NgxPrintDirective }; } export declare class NgxPrintDirective extends PrintBase { /** * Prevents the print dialog from opening on the window */ readonly previewOnly: import("@angular/core").InputSignal; readonly printSectionId: import("@angular/core").InputSignal; readonly printTitle: import("@angular/core").InputSignal; readonly useExistingCss: import("@angular/core").InputSignal; /** * A delay in milliseconds to force the print dialog to wait before opened. Default: 0 */ readonly printDelay: import("@angular/core").InputSignal; /** * Whether to close the window after print() returns. */ readonly closeWindow: import("@angular/core").InputSignal; /** * Class attribute to apply to the body element. */ readonly bodyClass: import("@angular/core").InputSignal; /** * Which PrintMethod (iframe/window/tab) to use. */ readonly printMethod: import("@angular/core").InputSignal<"window" | "tab" | "iframe">; readonly printStyle: import("@angular/core").InputSignal; readonly styleSheetFile: import("@angular/core").InputSignal; readonly printCompleted: import("@angular/core").OutputEmitterRef; print(): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } export declare class NgxPrintModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } /** * Service for handling printing functionality in Angular applications. * Extends the base printing class (PrintBase). * * @export * @class NgxPrintService * @extends {PrintBase} */ export declare class NgxPrintService extends PrintBase { /** * Emits every time a print job completes. * * @deprecated The RxJS-based API will be removed in the next major version. * Use the Promise returned by {@link NgxPrintService.print} instead, which resolves when that print job completes: * * ```ts * // Before * this.printService.printComplete$.pipe(take(1)).subscribe(() => onDone()); * this.printService.print(options); * * // After * await this.printService.print(options); * onDone(); * // or: this.printService.print(options).then(() => onDone()); * ``` * * If you still need an Observable, wrap the Promise yourself: `from(this.printService.print(options))`. */ printComplete$: import("rxjs").Observable; /** * Initiates the printing process using the provided print options. * * @param {PrintOptions} printOptions - Options for configuring the printing process. * @memberof NgxPrintService * @returns {Promise} Resolves once this print job completes (the print dialog / window was closed). * It cannot tell whether the user printed or cancelled, and it never settles if printing * could not be started (e.g. blocked popup, missing print section). */ print(printOptions?: Partial): Promise; /** * Sets the print style for the printing process. * * @param values - Either a dictionary representing the print styles, or a raw CSS string. * @memberof NgxPrintService * @setter */ set printStyle(values: PrintStyleInput); /** * Sets the stylesheet file for the printing process. * * @param {string} cssList - A string representing the path to the stylesheet file. * @memberof NgxPrintService * @setter */ set styleSheetFile(cssList: string); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } //# sourceMappingURL=ngx-print.d.ts.map