primeng
Version:
PrimeNG is an open source UI library for Angular featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeB
73 lines (70 loc) • 2.02 kB
TypeScript
import { TemplateRef } from '@angular/core';
import { PassThroughOption, PassThrough } from 'primeng/api';
import { ButtonPassThrough } from 'primeng/types/button';
/**
* Custom pass-through(pt) options.
* @template I Type of instance.
*
* @see {@link Inplace.pt}
* @group Interface
*/
interface InplacePassThroughOptions<I = unknown> {
/**
* Used to pass attributes to the host's DOM element.
*/
host?: PassThroughOption<HTMLElement, I>;
/**
* Used to pass attributes to the root's DOM element.
*/
root?: PassThroughOption<HTMLDivElement, I>;
/**
* Used to pass attributes to the display's DOM element.
*/
display?: PassThroughOption<HTMLDivElement, I>;
/**
* Used to pass attributes to the content's DOM element.
*/
content?: PassThroughOption<HTMLDivElement, I>;
/**
* Used to pass attributes to the Button component.
* @see {@link ButtonPassThrough}
*/
pcButton?: ButtonPassThrough;
}
/**
* Defines valid pass-through options in Inplace.
* @see {@link InplacePassThroughOptions}
*
* @template I Type of instance.
*/
type InplacePassThrough<I = unknown> = PassThrough<I, InplacePassThroughOptions<I>>;
/**
* Custom content template context.
* @group Interface
*/
interface InplaceContentTemplateContext {
/**
* Callback to invoke to close the inplace content.
*/
closeCallback: (event: MouseEvent) => void;
}
/**
* Defines valid templates in Inplace.
* @group Templates
*/
interface InplaceTemplates {
/**
* Custom display template.
*/
display(): TemplateRef<void>;
/**
* Custom content template.
* @param {Object} context - content context.
*/
content(context: InplaceContentTemplateContext): TemplateRef<InplaceContentTemplateContext>;
/**
* Custom close icon template.
*/
closeicon(): TemplateRef<void>;
}
export type { InplaceContentTemplateContext, InplacePassThrough, InplacePassThroughOptions, InplaceTemplates };