summaryrefslogtreecommitdiff
path: root/chromium/ui/webui/resources/cr_elements/cr_input/cr_input.m.d.ts
blob: eeca05871855805568b4ba268e3340b859a671b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import {LegacyElementMixin} from 'chrome://resources/polymer/v3_0/polymer/lib/legacy/legacy-element-mixin.js';

interface CrInputElement extends LegacyElementMixin, HTMLElement {
  ariaDescription: string|undefined;
  autofocus: boolean;
  autoValidate: boolean|null|undefined;
  disabled: boolean;
  errorMessage: string|null|undefined;
  inputTabindex: number|null;
  invalid: boolean;
  max: number|null|undefined;
  min: number|null|undefined;
  maxlength: number|null|undefined;
  minlength: number|null|undefined;
  pattern: string|null|undefined;
  inputmode: string|null|undefined;
  label: string|null|undefined;
  placeholder: string|null;
  readonly: boolean|undefined;
  required: boolean|undefined;
  type: string|null|undefined;
  value: string;
  hostAttributes: object|null;
  readonly inputElement: HTMLInputElement;

  focusInput(): boolean;
  select(start?: number, end?: number): void;
  validate(): boolean;

  $: {
    error: HTMLElement,
    input: HTMLInputElement,
    label: HTMLElement,
    underline: HTMLElement,
  };
}

export {CrInputElement};

declare global {
  interface HTMLElementTagNameMap {
    'cr-input': CrInputElement;
  }
}