UNPKG

ngx-print

Version:

Plug n' Play Angular (2++) directive to print your stuff

106 lines 3.51 kB
import { PrintOptions } from './print-options'; import { Subject } from 'rxjs'; import * as i0 from "@angular/core"; export declare class PrintBase { private nonce?; private _printStyle; private _styleSheetFile; protected printComplete: Subject<void>; constructor(nonce?: string | null | undefined); /** * Sets the print styles based on the provided values. * * @param {Object} values - Key-value pairs representing print styles. * @protected */ protected setPrintStyle(values: { [key: string]: { [key: string]: string; }; }): void; /** * * * @returns the string that create the stylesheet which will be injected * later within <style></style> tag. * * -join/replace to transform an array objects to css-styled string */ returnStyleValues(): string; /** * @returns string which contains the link tags containing the css which will * be injected later within <head></head> 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; /** * Updates the default values for input elements. * * @param {HTMLCollectionOf<HTMLInputElement>} elements - Collection of input elements. * @private */ private updateInputDefaults; /** * Updates the default values for select elements. * * @param {HTMLCollectionOf<HTMLSelectElement>} elements - Collection of select elements. * @private */ private updateSelectDefaults; /** * Updates the default values for textarea elements. * * @param {HTMLCollectionOf<HTMLTextAreaElement>} elements - Collection of textarea elements. * @private */ private updateTextAreaDefaults; /** * Converts a canvas element to an image and returns its HTML string. * * @param {HTMLCanvasElement} element - The canvas element to convert. * @returns {string} - HTML string of the image. * @private */ private canvasToImageHtml; /** * Includes canvas contents in the print section via img tags. * * @param {HTMLCollectionOf<HTMLCanvasElement>} elements - Collection of canvas elements. * @private */ 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; protected notifyPrintComplete(): void; /** * Prints the specified content using the provided print options. * * @param {PrintOptions} printOptions - Options for printing. * @public */ protected print(printOptions: PrintOptions): void; static ɵfac: i0.ɵɵFactoryDeclaration<PrintBase, [{ optional: true; }]>; static ɵprov: i0.ɵɵInjectableDeclaration<PrintBase>; } //# sourceMappingURL=ngx-print.base.d.ts.map