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

Commit 5c1d4a8

Browse files
authored
Add TypeScript declarations to iron-validator-behavior. (#36)
* Generate minimal package.json from bower.json * Update and/or configure type declarations. * Update Boolean annotation to boolean.
1 parent 927e160 commit 5c1d4a8

6 files changed

+1031
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
bower_components*
22
bower-*.json
3+
node_modules

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ sudo: required
33
before_script:
44
- npm install -g polymer-cli
55
- polymer install --variants
6+
- >-
7+
npm run update-types && git diff --exit-code || (echo -e
8+
'\n\033[31mERROR:\033[0m Typings are stale. Please run "npm run
9+
update-types".' && false)
610
env:
711
global:
812
- secure: >-

iron-validator-behavior.d.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* DO NOT EDIT
3+
*
4+
* This file was automatically generated by
5+
* https://github.com/Polymer/gen-typescript-declarations
6+
*
7+
* To modify these typings, edit the source file(s):
8+
* iron-validator-behavior.html
9+
*/
10+
11+
/// <reference path="../polymer/types/polymer.d.ts" />
12+
/// <reference path="../iron-meta/iron-meta.d.ts" />
13+
14+
declare namespace Polymer {
15+
16+
/**
17+
* Use `Polymer.IronValidatorBehavior` to implement a custom input/form validator. Element
18+
* instances implementing this behavior will be registered for use in elements that implement
19+
* `Polymer.IronValidatableBehavior`.
20+
*/
21+
interface IronValidatorBehavior {
22+
ready(): void;
23+
24+
/**
25+
* Implement custom validation logic in this function.
26+
*
27+
* @param values The value to validate. May be any type depending on the validation logic.
28+
* @returns true if `values` is valid.
29+
*/
30+
validate(values: object|null): boolean;
31+
}
32+
33+
const IronValidatorBehavior: object;
34+
}

iron-validator-behavior.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/**
3030
* Implement custom validation logic in this function.
3131
* @param {Object} values The value to validate. May be any type depending on the validation logic.
32-
* @return {Boolean} true if `values` is valid.
32+
* @return {boolean} true if `values` is valid.
3333
*/
3434
validate: function(values) {
3535
}

0 commit comments

Comments
 (0)