@rxap/directives
Version:
This package provides a set of Angular directives to simplify common tasks such as setting background images, confirming clicks, making elements contenteditable, and more. It includes directives for handling UI interactions, applying styles, and managing
29 lines (28 loc) • 1.69 kB
TypeScript
import { ChangeDetectorRef, OnChanges, SimpleChanges, TemplateRef, ViewContainerRef } from '@angular/core';
import { Method } from '@rxap/pattern';
import * as i0 from "@angular/core";
export interface IfTruthyDirectiveTemplateContext<Data> {
$implicit: Data;
}
export declare class IfTruthyDirective<Data, Parameters = any> implements OnChanges {
private readonly templateRef;
private readonly viewContainerRef;
private readonly cdr;
method: Method<Data, Parameters>;
parameters: Parameters;
trackBy: (data: Data) => any;
private _last?;
constructor(templateRef: TemplateRef<IfTruthyDirectiveTemplateContext<Data>>, viewContainerRef: ViewContainerRef, cdr: ChangeDetectorRef);
/**
* Asserts the correct type of the context for the template that `NgForOf` will render.
*
* The presence of this method is a signal to the Ivy template type-check compiler that the
* `NgForOf` structural directive renders its template with a specific context type.
*/
static ngTemplateContextGuard<T>(dir: IfTruthyDirective<T>, ctx: any): ctx is IfTruthyDirectiveTemplateContext<T>;
ngOnChanges(changes: SimpleChanges): void;
protected execute(): Promise<void>;
protected hasChanged(current: Data): boolean;
static ɵfac: i0.ɵɵFactoryDeclaration<IfTruthyDirective<any, any>, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<IfTruthyDirective<any, any>, "[rxapIfTruthy]", never, { "method": { "alias": "rxapIfTruthy"; "required": false; }; "parameters": { "alias": "rxapIfTruthyParameters"; "required": false; }; "trackBy": { "alias": "rxapIfTruthyTrackBy"; "required": false; }; }, {}, never, never, true, never>;
}