<commit_before># gen-typescript-declarations

[![NPM version](https://img.shields.io/npm/v/@polymer/gen-typescript-declarations.svg)](https://www.npmjs.com/package/@polymer/gen-typescript-declarations)

A library which generates TypeScript declarations for Polymer and custom
elements.

## How do I use the typings?

### Polymer

Typings for Polymer 2 are planned for regular release starting with version
2.4, and are available in the
[`types/`](https://github.com/Polymer/polymer/tree/master/types) directory on
the `master` branch now.

Once Polymer 2.4 is released, to use the typings, install Polymer normally from
Bower, and add a [triple-slash
directive](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html)
anywhere in your TypeScript project for the typings you require. Each HTML
import from Polymer has a corresponding typings file. For example, if you
depend on `polymer-element.html`:

```ts
/// <reference path="./bower_components/polymer/types/polymer-element.d.ts" />`

class MyElement extends Polymer.Element {
  ...
}
```

Alternatively, you can add the dependency to `tsconfig.json` in the root of your project:

```javascript
{
...
	"include": [
		"src/**/*.ts",
		"src/bower_components/polymer/**/*.d.ts",
	]
}
```

Typings for Polymer 3 are planned but not yet available (see
[#18](https://github.com/Polymer/gen-typescript-declarations/issues/18)).

You may also be interested in the [Polymer
decorators](https://github.com/Polymer/polymer-decorators).
<commit_msg>Tweak README.<commit_after># gen-typescript-declarations

[![NPM version](https://img.shields.io/npm/v/@polymer/gen-typescript-declarations.svg)](https://www.npmjs.com/package/@polymer/gen-typescript-declarations)

A library which generates TypeScript declarations for Polymer and custom
elements.

## How do I use the typings?

### Polymer

To use the typings, install Polymer normally from Bower (versions 2.4 and
above), and add a [triple-slash
directive](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html)
anywhere in your TypeScript project for the typings you require. Each HTML
import from Polymer has a corresponding typings file. For example, if you depend
on `polymer-element.html`:

```ts
/// <reference path="./bower_components/polymer/types/polymer-element.d.ts" />`

class MyElement extends Polymer.Element {
  ...
}
```

Alternatively, you can add the dependency to `tsconfig.json` in the root of your project:

```javascript
{
...
	"include": [
		"src/**/*.ts",
		"src/bower_components/polymer/**/*.d.ts",
	]
}
```

Typings for Polymer 3 are planned but not yet available (see
[#18](https://github.com/Polymer/gen-typescript-declarations/issues/18)).

You may also be interested in the [Polymer
decorators](https://github.com/Polymer/polymer-decorators).

{'fraction_non_alphanumeric': 0.13368983957219252, 'fraction_numerical': 0.006060606060606061, 'mean_word_length': 4.578528827037774, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 11, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3305387', 'n_tokens_mistral': 931, 'n_tokens_neox': 857, 'n_words': 253}