Skip to content

Commit 3da4d24

Browse files
authored
Add TypeScript declarations to iron-media-query. (#44)
* Generate minimal package.json from bower.json * Update and/or configure type declarations.
1 parent 3813c20 commit 3da4d24

5 files changed

+1047
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
bower_components*
22
bower-*.json
3+
node_modules

.travis.yml

+4
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-media-query.d.ts

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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-media-query.html
9+
*/
10+
11+
/// <reference path="../polymer/types/polymer.d.ts" />
12+
13+
/**
14+
* `iron-media-query` can be used to data bind to a CSS media query.
15+
* The `query` property is a bare CSS media query.
16+
* The `query-matches` property is a boolean representing whether the page matches that media query.
17+
*
18+
* Example:
19+
*
20+
* <iron-media-query query="(min-width: 600px)" query-matches="{{queryMatches}}"></iron-media-query>
21+
*/
22+
interface IronMediaQueryElement extends Polymer.Element {
23+
24+
/**
25+
* The Boolean return value of the media query.
26+
*/
27+
readonly queryMatches: boolean|null|undefined;
28+
29+
/**
30+
* The CSS media query to evaluate.
31+
*/
32+
query: string|null|undefined;
33+
34+
/**
35+
* If true, the query attribute is assumed to be a complete media query
36+
* string rather than a single media feature.
37+
*/
38+
full: boolean|null|undefined;
39+
_boundMQHandler: (p0: MediaQueryList|null) => any;
40+
_mq: MediaQueryList|null;
41+
attached(): void;
42+
detached(): void;
43+
_add(): void;
44+
_remove(): void;
45+
queryChanged(): void;
46+
queryHandler(mq: any): void;
47+
}
48+
49+
interface HTMLElementTagNameMap {
50+
"iron-media-query": IronMediaQueryElement;
51+
}

0 commit comments

Comments
 (0)