Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Commit

Permalink
Add TypeScript declarations to iron-validator-behavior. (#36)
Browse files Browse the repository at this point in the history
* Generate minimal package.json from bower.json
* Update and/or configure type declarations.
* Update Boolean annotation to boolean.
  • Loading branch information
aomarks authored Feb 17, 2018
1 parent 927e160 commit 5c1d4a8
Show file tree
Hide file tree
Showing 6 changed files with 1,031 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
bower_components*
bower-*.json
node_modules
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ sudo: required
before_script:
- npm install -g polymer-cli
- polymer install --variants
- >-
npm run update-types && git diff --exit-code || (echo -e
'\n\033[31mERROR:\033[0m Typings are stale. Please run "npm run
update-types".' && false)
env:
global:
- secure: >-
Expand Down
34 changes: 34 additions & 0 deletions iron-validator-behavior.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* DO NOT EDIT
*
* This file was automatically generated by
* https://github.com/Polymer/gen-typescript-declarations
*
* To modify these typings, edit the source file(s):
* iron-validator-behavior.html
*/

/// <reference path="../polymer/types/polymer.d.ts" />
/// <reference path="../iron-meta/iron-meta.d.ts" />

declare namespace Polymer {

/**
* Use `Polymer.IronValidatorBehavior` to implement a custom input/form validator. Element
* instances implementing this behavior will be registered for use in elements that implement
* `Polymer.IronValidatableBehavior`.
*/
interface IronValidatorBehavior {
ready(): void;

/**
* Implement custom validation logic in this function.
*
* @param values The value to validate. May be any type depending on the validation logic.
* @returns true if `values` is valid.
*/
validate(values: object|null): boolean;
}

const IronValidatorBehavior: object;
}
2 changes: 1 addition & 1 deletion iron-validator-behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/**
* Implement custom validation logic in this function.
* @param {Object} values The value to validate. May be any type depending on the validation logic.
* @return {Boolean} true if `values` is valid.
* @return {boolean} true if `values` is valid.
*/
validate: function(values) {
}
Expand Down
Loading

0 comments on commit 5c1d4a8

Please sign in to comment.