You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
2.7 KiB
67 lines
2.7 KiB
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
import { Platform } from '@angular/cdk/platform';
|
|
import { ElementRef, EventEmitter, NgZone, OnDestroy, OnInit } from '@angular/core';
|
|
import { Observable } from 'rxjs';
|
|
/** An event that is emitted when the autofill state of an input changes. */
|
|
import * as ɵngcc0 from '@angular/core';
|
|
export declare type AutofillEvent = {
|
|
/** The element whose autofill state changes. */
|
|
target: Element;
|
|
/** Whether the element is currently autofilled. */
|
|
isAutofilled: boolean;
|
|
};
|
|
/**
|
|
* An injectable service that can be used to monitor the autofill state of an input.
|
|
* Based on the following blog post:
|
|
* https://medium.com/@brunn/detecting-autofilled-fields-in-javascript-aed598d25da7
|
|
*/
|
|
export declare class AutofillMonitor implements OnDestroy {
|
|
private _platform;
|
|
private _ngZone;
|
|
private _monitoredElements;
|
|
constructor(_platform: Platform, _ngZone: NgZone);
|
|
/**
|
|
* Monitor for changes in the autofill state of the given input element.
|
|
* @param element The element to monitor.
|
|
* @return A stream of autofill state changes.
|
|
*/
|
|
monitor(element: Element): Observable<AutofillEvent>;
|
|
/**
|
|
* Monitor for changes in the autofill state of the given input element.
|
|
* @param element The element to monitor.
|
|
* @return A stream of autofill state changes.
|
|
*/
|
|
monitor(element: ElementRef<Element>): Observable<AutofillEvent>;
|
|
/**
|
|
* Stop monitoring the autofill state of the given input element.
|
|
* @param element The element to stop monitoring.
|
|
*/
|
|
stopMonitoring(element: Element): void;
|
|
/**
|
|
* Stop monitoring the autofill state of the given input element.
|
|
* @param element The element to stop monitoring.
|
|
*/
|
|
stopMonitoring(element: ElementRef<Element>): void;
|
|
ngOnDestroy(): void;
|
|
static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<AutofillMonitor, never>;
|
|
}
|
|
/** A directive that can be used to monitor the autofill state of an input. */
|
|
export declare class CdkAutofill implements OnDestroy, OnInit {
|
|
private _elementRef;
|
|
private _autofillMonitor;
|
|
/** Emits when the autofill state of the element changes. */
|
|
readonly cdkAutofill: EventEmitter<AutofillEvent>;
|
|
constructor(_elementRef: ElementRef<HTMLElement>, _autofillMonitor: AutofillMonitor);
|
|
ngOnInit(): void;
|
|
ngOnDestroy(): void;
|
|
static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<CdkAutofill, never>;
|
|
static ɵdir: ɵngcc0.ɵɵDirectiveDeclaration<CdkAutofill, "[cdkAutofill]", never, {}, { "cdkAutofill": "cdkAutofill"; }, never>;
|
|
}
|
|
|
|
//# sourceMappingURL=autofill.d.ts.map
|