Skip to content
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

Merged
merged 4 commits into from
Mar 8, 2018

Conversation

aomarks
Copy link
Contributor

@aomarks aomarks commented Mar 8, 2018

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

Copy link
Contributor

@TimvdLippe TimvdLippe left a 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.

* value: The input value.
* invalid: True if the input value is invalid.
*/
update(state: {inputElement?: Element|null, value?: string, invalid: boolean}): void;
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

_ariaDescribedBy: string|null|undefined;
_ariaLabelledBy: string|null|undefined;
_inputId: string|null|undefined;
hostAttributes: object|null;
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

* Returns a reference to the focusable element.
*
*/
readonly _focusableElement: any;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should both be HTMLElement

_handleValue(inputElement: any): void;
_handleValueAndAutoValidate(inputElement: any): void;
_onIronInputValidate(event: any): void;
_invalidChanged(): void;
Copy link
Contributor

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.

Copy link
Contributor Author

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can also be HTMLElement

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

*/
maxRows: number|null|undefined;
selectionStart: any;
selectionEnd: any;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be number.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@aomarks aomarks merged commit 10e6826 into master Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants