<commit_before># Clutz - Closure to TypeScript Declarations (`.d.ts`) generator.

[![Build Status](https://circleci.com/gh/angular/clutz.svg?style=svg)](https://circleci.com/gh/angular/clutz)

This project uses the
[Closure Compiler](https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler)
to parse Closure-style JSDoc type annotations from ES5/ES2015 code, and
generates a suitable TypeScript type definition file (`.d.ts`) for the exported
API.

The intent is to allow TypeScript code to import libraries written with
Closure-style type declarations. Having the clutz generated declarations allows
type-checking in the TypeScript compiler and IDE tooling (for highlighting
errors and type-sensitive auto-complete) as if the imported code was written in
TypeScript.

## Supported versions

We lack the resources to make Clutz releases or support multiple versions of
dependent tools simultaneously. You'll have the most success with Clutz if you
use it with:

-   Closure Compiler at HEAD: whatever maven thinks -SNAPSHOT is.
-   A recent version of TypeScript: the test suite runs against the version of
    `typescript` in `npm-shrinkwrap.json`, so that is always a good choice.

## Example usage

We don't offer a binary distribution, so first you need to build from source:

```shell
$ npm install
$ ./gradlew build installDist # or just "gradlew" on Windows
...
BUILD SUCCESSFUL
```

You can use Clutz from the command line using the wrapper script produced by
Grade or by executing the JAR file in `build/libs/` yourself. Here is a sample
execution:<commit_msg>Added instruction to readme (#858)<commit_after># Clutz - Closure to TypeScript Declarations (`.d.ts`) generator.

[![Build Status](https://circleci.com/gh/angular/clutz.svg?style=svg)](https://circleci.com/gh/angular/clutz)

This project uses the
[Closure Compiler](https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler)
to parse Closure-style JSDoc type annotations from ES5/ES2015 code, and
generates a suitable TypeScript type definition file (`.d.ts`) for the exported
API.

The intent is to allow TypeScript code to import libraries written with
Closure-style type declarations. Having the clutz generated declarations allows
type-checking in the TypeScript compiler and IDE tooling (for highlighting
errors and type-sensitive auto-complete) as if the imported code was written in
TypeScript.

## Supported versions

We lack the resources to make Clutz releases or support multiple versions of
dependent tools simultaneously. You'll have the most success with Clutz if you
use it with:

-   Closure Compiler at HEAD: whatever maven thinks -SNAPSHOT is.
-   A recent version of TypeScript: the test suite runs against the version of
    `typescript` in `npm-shrinkwrap.json`, so that is always a good choice.

## Example usage

We don't offer a binary distribution, so first you need to build from source.
From the root directory run:

```shell
$ npm install
$ ./gradlew build installDist # or just "gradlew" on Windows
...
BUILD SUCCESSFUL
```

You can use Clutz from the command line using the wrapper script produced by
Grade or by executing the JAR file in `build/libs/` yourself. Here is a sample
execution:
{'fraction_non_alphanumeric': 0.0747091243110839, 'fraction_numerical': 0.003980404164115126, 'mean_word_length': 4.60377358490566, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, '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': '1478184', 'n_tokens_mistral': 944, 'n_tokens_neox': 875, 'n_words': 412}