import { TemplateRef } from '@angular/core'; import { MotionOptions } from '@primeuix/motion'; import { PassThroughOption, PassThrough } from 'primeng/api'; /** * Custom pass-through(pt) options. * @template I Type of instance. * * @see {@link Image.pt} * @group Interface */ interface ImagePassThroughOptions { /** * Used to pass attributes to the root's DOM element. */ root?: PassThroughOption; /** * Used to pass attributes to the image's DOM element. */ image?: PassThroughOption; /** * Used to pass attributes to the preview mask button's DOM element. */ previewMask?: PassThroughOption; /** * Used to pass attributes to the preview icon's DOM element. */ previewIcon?: PassThroughOption; /** * Used to pass attributes to the mask's DOM element. */ mask?: PassThroughOption; /** * Used to pass attributes to the toolbar's DOM element. */ toolbar?: PassThroughOption; /** * Used to pass attributes to the rotate right button's DOM element. */ rotateRightButton?: PassThroughOption; /** * Used to pass attributes to the rotate left button's DOM element. */ rotateLeftButton?: PassThroughOption; /** * Used to pass attributes to the zoom out button's DOM element. */ zoomOutButton?: PassThroughOption; /** * Used to pass attributes to the zoom in button's DOM element. */ zoomInButton?: PassThroughOption; /** * Used to pass attributes to the close button's DOM element. */ closeButton?: PassThroughOption; /** * Used to pass attributes to the original/preview image's DOM element. */ original?: PassThroughOption; /** * Used to pass options to the motion component/directive. */ motion?: MotionOptions; } /** * Defines valid pass-through options in Image. * @see {@link ImagePassThroughOptions} * * @template I Type of instance. */ type ImagePassThrough = PassThrough>; /** * Custom image template context. * @group Interface */ interface ImageImageTemplateContext { /** * Callback to invoke on image error. */ errorCallback: (event: Event) => void; } /** * Custom preview template context. * @group Interface */ interface ImagePreviewTemplateContext { /** * Style class of the preview image element. */ class: string; /** * Inline style of the preview image element. */ style: { [key: string]: any; }; /** * Callback to invoke on preview image click. */ previewCallback: () => void; } /** * Defines valid templates in Image. * @group Templates */ interface ImageTemplates { /** * Custom indicator template. */ indicator(): TemplateRef; /** * Custom image template. * @param {Object} context - image context. */ image(context: ImageImageTemplateContext): TemplateRef; /** * Custom preview template. * @param {Object} context - preview context. */ preview(context: ImagePreviewTemplateContext): TemplateRef; /** * Custom rotate right icon template. */ rotaterighticon(): TemplateRef; /** * Custom rotate left icon template. */ rotatelefticon(): TemplateRef; /** * Custom zoom out icon template. */ zoomouticon(): TemplateRef; /** * Custom zoom in icon template. */ zoominicon(): TemplateRef; /** * Custom close icon template. */ closeicon(): TemplateRef; } export type { ImageImageTemplateContext, ImagePassThrough, ImagePassThroughOptions, ImagePreviewTemplateContext, ImageTemplates };