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 typings to Polymer 3 #5306

Merged
merged 1 commit into from
Jul 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ npm-debug.log

# Analyzer output used in the docs
analysis.json

# NPM artifact
polymer-polymer-*.tgz

# Typings are generated upon publish to NPM
*.d.ts
20 changes: 20 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# dependencies
bower_components
node_modules

# compiled output
dist

# IDEs
.idea
.vscode

# misc
.DS_Store
npm-debug.log

# Analyzer output used in the docs
analysis.json

# NPM artifact
polymer-polymer-*.tgz
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ before_script:
- npm install -g gulp-cli@1
- gulp lint-eslint
script:
- npm run generate-types
- node ./node_modules/.bin/polymer test --npm --module-resolution=node -l chrome
- node ./node_modules/.bin/polymer test --npm --module-resolution=node -l firefox
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then travis_wait 30 ./util/travis-sauce-test.sh; fi
Expand Down
2 changes: 1 addition & 1 deletion externs/closure-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ Polymer_TemplateStamp.prototype._addMethodEventListenerToNode = function(node, e
*/
Polymer_TemplateStamp.prototype._addEventListenerToNode = function(node, eventName, handler){};
/**
* @param {Node} node Node to remove event listener from
* @param {!Node} node Node to remove event listener from
* @param {string} eventName Name of event
* @param {function (!Event): void} handler Listener function to remove
* @return {void}
Expand Down
8 changes: 4 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ gulp.task('generate-externs', gulp.series('clean', async () => {

gulp.task('generate-typescript', async () => {
let genTs = require('@polymer/gen-typescript-declarations').generateDeclarations;
await del(['types/**/*.d.ts', '!types/extra-types.d.ts']);
const config = await fs.readJson('gen-tsd.json');
const files = await genTs('.', config);
await del(['**/*.d.ts', '!interfaces.d.ts', '!node_modules/**']);
const config = await fs.readJson(path.join(__dirname, 'gen-tsd.json'));
const files = await genTs(__dirname, config);
for (const [filePath, contents] of files) {
await fs.outputFile(path.join('types', filePath), contents);
await fs.outputFile(path.join(__dirname, filePath), contents);
}
});

Expand Down
4 changes: 2 additions & 2 deletions lib/mixins/property-effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -1678,9 +1678,9 @@ export const PropertyEffects = dedupingMixin(superClass => {
* a specific order (compute, propagate, reflect, observe, notify).
*
* @param {!Object} currentProps Bag of all current accessor values
* @param {!Object} changedProps Bag of properties changed since the last
* @param {?Object} changedProps Bag of properties changed since the last
* call to `_propertiesChanged`
* @param {!Object} oldProps Bag of previous values for each property
* @param {?Object} oldProps Bag of previous values for each property
* in `changedProps`
* @return {void}
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/mixins/template-stamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ export const TemplateStamp = dedupingMixin(
/**
* Override point for adding custom or simulated event handling.
*
* @param {Node} node Node to remove event listener from
* @param {!Node} node Node to remove event listener from
* @param {string} eventName Name of event
* @param {function(!Event):void} handler Listener function to remove
* @return {void}
Expand Down
Loading