import { TemplateRef } from '@angular/core'; import { PassThroughOption, PassThrough } from 'primeng/api'; /** * Custom passthrough(pt) options. * @template I Type of instance. * * @see {@link ToggleSwitch.pt} * @group Interface */ interface ToggleSwitchPassThroughOptions { /** * Used to pass attributes to the root's DOM element. */ root?: PassThroughOption; /** * Used to pass attributes to the input's DOM element. */ input?: PassThroughOption; /** * Used to pass attributes to the slider's DOM element. */ slider?: PassThroughOption; /** * Used to pass attributes to the handle's DOM element. */ handle?: PassThroughOption; } /** * Defines valid pass-through options in ToggleSwitch component. * @see {@link ToggleSwitchPassThroughOptions} * * @template I Type of instance. */ type ToggleSwitchPassThrough = PassThrough>; /** * Custom change event. * @see {@link ToggleSwitch.onChange} * @group Events */ interface ToggleSwitchChangeEvent { /** * Browser event */ originalEvent: Event; /** * Checked state as a boolean. */ checked: boolean; } /** * Custom handle template context. * @group Interface */ interface ToggleSwitchHandleTemplateContext { /** * Checked state of the toggle switch. */ checked: boolean; } /** * Defines valid templates in ToggleSwitch. * @group Templates */ interface ToggleSwitchTemplates { /** * Custom handle template. * @param {ToggleSwitchHandleTemplateContext} context - handle context. */ handle(context: ToggleSwitchHandleTemplateContext): TemplateRef; } export type { ToggleSwitchChangeEvent, ToggleSwitchHandleTemplateContext, ToggleSwitchPassThrough, ToggleSwitchPassThroughOptions, ToggleSwitchTemplates };