-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add TypeScript declarations to paper-input. #629
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only nits. I am okay with merging now and fixing them later as well, if you prefer that.
paper-input-addon-behavior.d.ts
Outdated
* value: The input value. | ||
* invalid: True if the input value is invalid. | ||
*/ | ||
update(state: {inputElement?: Element|null, value?: string, invalid: boolean}): void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: put invalid first as that one is required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
paper-input-behavior.d.ts
Outdated
_ariaDescribedBy: string|null|undefined; | ||
_ariaLabelledBy: string|null|undefined; | ||
_inputId: string|null|undefined; | ||
hostAttributes: object|null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these should be private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
paper-input-behavior.d.ts
Outdated
* Returns a reference to the focusable element. | ||
* | ||
*/ | ||
readonly _focusableElement: any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should both be HTMLElement
paper-input-container.d.ts
Outdated
_handleValue(inputElement: any): void; | ||
_handleValueAndAutoValidate(inputElement: any): void; | ||
_onIronInputValidate(event: any): void; | ||
_invalidChanged(): void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of methods which should be private I suppose? We can remove these later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done (some of them anyway).
paper-input.d.ts
Outdated
* to correctly focus the native input. | ||
* | ||
*/ | ||
readonly _focusableElement: any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can also be HTMLElement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
paper-textarea.d.ts
Outdated
*/ | ||
maxRows: number|null|undefined; | ||
selectionStart: any; | ||
selectionEnd: any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
This PR adds TypeScript declarations generated by https://github.com/Polymer/gen-typescript-declarations/
These declarations can be re-generated by running
npm run update-types
.Tracker: https://github.com/Polymer/gen-typescript-declarations/issues/79