Skip to content

Commit

Permalink
Add TypeScript declarations to iron-media-query. (#44)
Browse files Browse the repository at this point in the history
* Generate minimal package.json from bower.json
* Update and/or configure type declarations.
  • Loading branch information
aomarks authored Feb 23, 2018
1 parent 3813c20 commit 3da4d24
Show file tree
Hide file tree
Showing 5 changed files with 1,047 additions and 0 deletions.
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
51 changes: 51 additions & 0 deletions iron-media-query.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* 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-media-query.html
*/

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

/**
* `iron-media-query` can be used to data bind to a CSS media query.
* The `query` property is a bare CSS media query.
* The `query-matches` property is a boolean representing whether the page matches that media query.
*
* Example:
*
* <iron-media-query query="(min-width: 600px)" query-matches="{{queryMatches}}"></iron-media-query>
*/
interface IronMediaQueryElement extends Polymer.Element {

/**
* The Boolean return value of the media query.
*/
readonly queryMatches: boolean|null|undefined;

/**
* The CSS media query to evaluate.
*/
query: string|null|undefined;

/**
* If true, the query attribute is assumed to be a complete media query
* string rather than a single media feature.
*/
full: boolean|null|undefined;
_boundMQHandler: (p0: MediaQueryList|null) => any;
_mq: MediaQueryList|null;
attached(): void;
detached(): void;
_add(): void;
_remove(): void;
queryChanged(): void;
queryHandler(mq: any): void;
}

interface HTMLElementTagNameMap {
"iron-media-query": IronMediaQueryElement;
}
Loading

0 comments on commit 3da4d24

Please sign in to comment.