1
|
/**
|
2
|
* @license
|
3
|
* Copyright Google Inc. All Rights Reserved.
|
4
|
*
|
5
|
* Use of this source code is governed by an MIT-style license that can be
|
6
|
* found in the LICENSE file at https://angular.io/license
|
7
|
*/
|
8
|
import { ElementRef, InjectionToken, Renderer2 } from '@angular/core';
|
9
|
import { ControlValueAccessor } from './control_value_accessor';
|
10
|
export declare const DEFAULT_VALUE_ACCESSOR: any;
|
11
|
/**
|
12
|
* Turn this mode on if you want form directives to buffer IME input until compositionend
|
13
|
* @experimental
|
14
|
*/
|
15
|
export declare const COMPOSITION_BUFFER_MODE: InjectionToken<boolean>;
|
16
|
/**
|
17
|
* The default accessor for writing a value and listening to changes that is used by the
|
18
|
* {@link NgModel}, {@link FormControlDirective}, and {@link FormControlName} directives.
|
19
|
*
|
20
|
* ### Example
|
21
|
* ```
|
22
|
* <input type="text" name="searchQuery" ngModel>
|
23
|
* ```
|
24
|
*
|
25
|
* @stable
|
26
|
*/
|
27
|
export declare class DefaultValueAccessor implements ControlValueAccessor {
|
28
|
private _renderer;
|
29
|
private _elementRef;
|
30
|
private _compositionMode;
|
31
|
onChange: (_: any) => void;
|
32
|
onTouched: () => void;
|
33
|
/** Whether the user is creating a composition string (IME events). */
|
34
|
private _composing;
|
35
|
constructor(_renderer: Renderer2, _elementRef: ElementRef, _compositionMode: boolean);
|
36
|
writeValue(value: any): void;
|
37
|
registerOnChange(fn: (_: any) => void): void;
|
38
|
registerOnTouched(fn: () => void): void;
|
39
|
setDisabledState(isDisabled: boolean): void;
|
40
|
}
|