Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Benricheson101/fluent-types

CLI tool for generating TypeScript types for Project Fluent language files
https://github.com/Benricheson101/fluent-types

Last synced: 9 days ago
JSON representation

CLI tool for generating TypeScript types for Project Fluent language files

Awesome Lists containing this project

README

        

💬 Fluent Types

Generate TypeScript type declarations for [Fluent](https://projectfluent.org) language files

## Example Usage
`fluent-types ./lang/en.ftl -o src/output.d.ts`

```ts
import {MessageNames, Placeholders} from './output';

const get(msg: Name, args: Placeholders): string {
const pattern = bundle.getMessage(msg);
return bundle.formatPattern(pattern.value, args);
};
```

## CLI Usage
```sh
Fluent Types
Generate TypeScript type declarations for Fluent language files

USAGE:
fluent-types [OPTIONS] ...

ARGS:
... input fluent files

OPTIONS:
-h, --help Print help information
-o the output file [default: -]
```