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
82 lines (79 loc) • 1.98 kB
TypeScript
import { TemplateRef } from '@angular/core';
import { PassThroughOption, PassThrough } from 'primeng/api';
/**
* Custom change event.
* @see {@link Checkbox.onChange}
* @group Events
*/
interface CheckboxChangeEvent {
/**
* Checked value.
*/
checked?: any;
/**
* Browser event.
*/
originalEvent?: Event;
}
/**
* Custom checkbox icon template context.
* @group Interface
*/
interface CheckboxIconTemplateContext {
/**
* State of the checkbox.
*/
checked: boolean;
/**
* Style class of the icon.
*/
class: string;
/**
* DataP attributes.
*/
dataP: string;
}
/**
* Defines valid templates in Checkbox.
* @group Templates
*/
interface CheckboxTemplates {
/**
* Custom checkbox icon template.
* @param {Object} context - icon context.
*/
icon(context: CheckboxIconTemplateContext): TemplateRef<CheckboxIconTemplateContext>;
}
/**
* Custom pass-through(pt) options.
* @template I Type of instance.
*
* @see {@link CheckboxProps.pt}
* @group Interface
*/
interface CheckboxPassThroughOptions<I = unknown> {
/**
* Used to pass attributes to the root's DOM element.
*/
root?: PassThroughOption<HTMLElement, I>;
/**
* Used to pass attributes to the input's DOM element.
*/
input?: PassThroughOption<HTMLInputElement, I>;
/**
* Used to pass attributes to the box's DOM element.
*/
box?: PassThroughOption<HTMLDivElement, I>;
/**
* Used to pass attributes to the icon's DOM element.
*/
icon?: PassThroughOption<HTMLElement, I>;
}
/**
* Defines valid pass-through options in Checkbox.
* @see {@link CheckboxPassThroughOptions}
*
* @template I Type of instance.
*/
type CheckboxPassThrough<I = unknown> = PassThrough<I, CheckboxPassThroughOptions<I>>;
export type { CheckboxChangeEvent, CheckboxIconTemplateContext, CheckboxPassThrough, CheckboxPassThroughOptions, CheckboxTemplates };