版博士V2.0程序
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.

HTMLTextAreaElement.d.ts 5.4 KiB

пре 1 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. import Event from '../../event/Event';
  2. import HTMLElement from '../html-element/HTMLElement';
  3. import IHTMLFormElement from '../html-form-element/IHTMLFormElement';
  4. import HTMLInputElementSelectionDirectionEnum from '../html-input-element/HTMLInputElementSelectionDirectionEnum';
  5. import HTMLInputElementSelectionModeEnum from '../html-input-element/HTMLInputElementSelectionModeEnum';
  6. import IHTMLTextAreaElement from './IHTMLTextAreaElement';
  7. /**
  8. * HTML Text Area Element.
  9. *
  10. * Reference:
  11. * https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement.
  12. */
  13. export default class HTMLTextAreaElement extends HTMLElement implements IHTMLTextAreaElement {
  14. readonly type = "textarea";
  15. defaultValue: string;
  16. oninput: (event: Event) => void | null;
  17. onselectionchange: (event: Event) => void | null;
  18. _value: any;
  19. _selectionStart: any;
  20. _selectionEnd: any;
  21. _selectionDirection: HTMLInputElementSelectionDirectionEnum;
  22. /**
  23. * Returns minlength.
  24. *
  25. * @returns Min length.
  26. */
  27. get minLength(): number;
  28. /**
  29. * Sets minlength.
  30. *
  31. * @param minLength Min length.
  32. */
  33. set minLength(minlength: number);
  34. /**
  35. * Returns maxlength.
  36. *
  37. * @returns Max length.
  38. */
  39. get maxLength(): number;
  40. /**
  41. * Sets maxlength.
  42. *
  43. * @param maxlength Max length.
  44. */
  45. set maxLength(maxLength: number);
  46. /**
  47. * Returns name.
  48. *
  49. * @returns Name.
  50. */
  51. get name(): string;
  52. /**
  53. * Sets name.
  54. *
  55. * @param name Name.
  56. */
  57. set name(name: string);
  58. /**
  59. * Returns placeholder.
  60. *
  61. * @returns Placeholder.
  62. */
  63. get placeholder(): string;
  64. /**
  65. * Sets placeholder.
  66. *
  67. * @param placeholder Placeholder.
  68. */
  69. set placeholder(placeholder: string);
  70. /**
  71. * Returns inputmode.
  72. *
  73. * @returns Inputmode.
  74. */
  75. get inputmode(): string;
  76. /**
  77. * Sets inputmode.
  78. *
  79. * @param inputmode Inputmode.
  80. */
  81. set inputmode(inputmode: string);
  82. /**
  83. * Returns cols.
  84. *
  85. * @returns Cols.
  86. */
  87. get cols(): string;
  88. /**
  89. * Sets cols.
  90. *
  91. * @param cols Cols.
  92. */
  93. set cols(cols: string);
  94. /**
  95. * Returns rows.
  96. *
  97. * @returns Rows.
  98. */
  99. get rows(): string;
  100. /**
  101. * Sets rows.
  102. *
  103. * @param rows Rows.
  104. */
  105. set rows(rows: string);
  106. /**
  107. * Returns autocomplete.
  108. *
  109. * @returns Autocomplete.
  110. */
  111. get autocomplete(): string;
  112. /**
  113. * Sets autocomplete.
  114. *
  115. * @param autocomplete Autocomplete.
  116. */
  117. set autocomplete(autocomplete: string);
  118. /**
  119. * Returns readOnly.
  120. *
  121. * @returns ReadOnly.
  122. */
  123. get readOnly(): boolean;
  124. /**
  125. * Sets readOnly.
  126. *
  127. * @param readOnly ReadOnly.
  128. */
  129. set readOnly(readOnly: boolean);
  130. /**
  131. * Returns disabled.
  132. *
  133. * @returns Disabled.
  134. */
  135. get disabled(): boolean;
  136. /**
  137. * Sets disabled.
  138. *
  139. * @param disabled Disabled.
  140. */
  141. set disabled(disabled: boolean);
  142. /**
  143. * Returns autofocus.
  144. *
  145. * @returns Autofocus.
  146. */
  147. get autofocus(): boolean;
  148. /**
  149. * Sets autofocus.
  150. *
  151. * @param autofocus Autofocus.
  152. */
  153. set autofocus(autofocus: boolean);
  154. /**
  155. * Returns required.
  156. *
  157. * @returns Required.
  158. */
  159. get required(): boolean;
  160. /**
  161. * Sets required.
  162. *
  163. * @param required Required.
  164. */
  165. set required(required: boolean);
  166. /**
  167. * Returns value.
  168. *
  169. * @returns Value.
  170. */
  171. get value(): string;
  172. /**
  173. * Sets value.
  174. *
  175. * @param value Value.
  176. */
  177. set value(value: string);
  178. /**
  179. * Returns selection start.
  180. *
  181. * @returns Selection start.
  182. */
  183. get selectionStart(): number;
  184. /**
  185. * Sets selection start.
  186. *
  187. * @param start Start.
  188. */
  189. set selectionStart(start: number);
  190. /**
  191. * Returns selection end.
  192. *
  193. * @returns Selection end.
  194. */
  195. get selectionEnd(): number;
  196. /**
  197. * Sets selection end.
  198. *
  199. * @param end End.
  200. */
  201. set selectionEnd(end: number);
  202. /**
  203. * Returns selection direction.
  204. *
  205. * @returns Selection direction.
  206. */
  207. get selectionDirection(): string;
  208. /**
  209. * Sets selection direction.
  210. *
  211. * @param direction Direction.
  212. */
  213. set selectionDirection(direction: string);
  214. /**
  215. * Returns the parent form element.
  216. *
  217. * @returns Form.
  218. */
  219. get form(): IHTMLFormElement;
  220. /**
  221. * Returns text length.
  222. *
  223. * @param Text Length.
  224. */
  225. get textLength(): number;
  226. /**
  227. * Set selection range.
  228. *
  229. * @param start Start.
  230. * @param end End.
  231. * @param [direction="none"] Direction.
  232. */
  233. setSelectionRange(start: number, end: number, direction?: string): void;
  234. /**
  235. * Set range text.
  236. *
  237. * @param replacement Replacement.
  238. * @param [start] Start.
  239. * @param [end] End.
  240. * @param [direction] Direction.
  241. * @param selectionMode
  242. */
  243. setRangeText(replacement: string, start?: number, end?: number, selectionMode?: HTMLInputElementSelectionModeEnum): void;
  244. /**
  245. * Checks validity.
  246. *
  247. * @returns "true" if validation does'nt fail.
  248. */
  249. checkValidity(): boolean;
  250. /**
  251. * Clones a node.
  252. *
  253. * @override
  254. * @param [deep=false] "true" to clone deep.
  255. * @returns Cloned node.
  256. */
  257. cloneNode(deep?: boolean): IHTMLTextAreaElement;
  258. }