UNPKG

2.66 kBTypeScriptView Raw
1import { TextBase } from '../text-base';
2import { Color } from '../../color';
3import { FormattedString } from '../text-base/formatted-string';
4import { Style } from '../styling/style';
5import { Property, CssProperty } from '../core/properties';
6import { CoreTypes } from '../../core-types';
7
8/**
9 * Represents the base class for all editable text views.
10 */
11export class EditableTextBase extends TextBase {
12 public static blurEvent: string;
13 public static focusEvent: string;
14 public static textChangeEvent: string;
15
16 /**
17 * Gets or sets the soft keyboard type.
18 */
19 keyboardType: CoreTypes.KeyboardInputType;
20
21 /**
22 * Gets or sets the soft keyboard return key flavor.
23 */
24 returnKeyType: CoreTypes.ReturnKeyButtonType;
25
26 /**
27 * Gets or sets a value indicating when the text property will be updated.
28 */
29 updateTextTrigger: CoreTypes.UpdateTextTriggerType;
30
31 /**
32 * Gets or sets the autocapitalization type.
33 */
34 autocapitalizationType: CoreTypes.AutocapitalizationInputType;
35
36 /**
37 * Gets or sets the autofill type.
38 */
39 autofillType: CoreTypes.AutofillType;
40
41 /**
42 * Gets or sets whether the instance is editable.
43 */
44 editable: boolean;
45
46 /**
47 * Enables or disables autocorrection.
48 */
49 autocorrect: boolean;
50
51 /**
52 * Gets or sets the placeholder text.
53 */
54 hint: string;
55
56 /**
57 * Limits input to a certain number of characters.
58 */
59 maxLength: number;
60
61 /**
62 * Hides the soft input method, ususally a soft keyboard.
63 */
64 dismissSoftInput(): void;
65
66 //@private
67 /**
68 * @private
69 */
70 public _setInputType(inputType: number): void;
71 //@endprivate
72
73 /**
74 * Set the selection anchor to start and the selection edge to stop
75 */
76 public setSelection(start: number, stop?: number);
77}
78
79export const keyboardTypeProperty: Property<EditableTextBase, CoreTypes.KeyboardInputType>;
80export const returnKeyTypeProperty: Property<EditableTextBase, CoreTypes.ReturnKeyButtonType>;
81export const editableProperty: Property<EditableTextBase, boolean>;
82export const updateTextTriggerProperty: Property<EditableTextBase, CoreTypes.UpdateTextTriggerType>;
83export const autocapitalizationTypeProperty: Property<EditableTextBase, CoreTypes.AutocapitalizationInputType>;
84export const autocorrectProperty: Property<EditableTextBase, boolean>;
85export const hintProperty: Property<EditableTextBase, string>;
86export const placeholderColorProperty: CssProperty<Style, Color>;
87export const maxLengthProperty: Property<EditableTextBase, number>;
88
89//@private
90/**
91 * @private
92 */
93export function _updateCharactersInRangeReplacementString(formattedText: FormattedString, rangeLocation: number, rangeLength: number, replacementString: string): void;
94//@endprivate