Update fluent definitions for v0.11 (#33859)

* update fluent definitions for v0.11

* remove circular reference

* add typescript version requiring fix

* downgrade ts version

definitelytyped-header-parser errors on prereleases versions but
TS v3.4 is not actually released so it also errors
This commit is contained in:
James Nimlos 2019-03-25 09:38:31 -07:00 committed by Sheetal Nandi
parent 30468b4db1
commit d9437c4fd6
4 changed files with 13 additions and 4 deletions

View File

@ -2,7 +2,7 @@
// Project: http://projectfluent.org
// Definitions by: Huy Nguyen <https://github.com/huy-nguyen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// TypeScript Version: 3.3
import * as React from 'react';
import {
@ -76,7 +76,7 @@ export type Matching<InjectedProps, DecorationTargetProps> = {
*/
export type Shared<
InjectedProps,
DecorationTargetProps extends Shared<InjectedProps, DecorationTargetProps>
DecorationTargetProps
> = {
[P in Extract<keyof InjectedProps, keyof DecorationTargetProps>]?: InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : never;
};

View File

@ -29,6 +29,7 @@ const bundle4 = new FluentBundle(['en-US'], {
// FluentBundle addMessages examples:
bundle1.addMessages('foo = Foo');
bundle2.hasMessage('foo');
bundle2.getMessage('foo');
// FluentBundle addResource examples:
@ -42,3 +43,8 @@ bundle1.addMessages('hello = Hello, { $name }!');
const hello = bundle2.getMessage('hello');
bundle3.format(hello, { name: 'Jane' }, errors2);
bundle3.format(hello, undefined, errors2);
for (const [id, message] of bundle1.messages) {
bundle1.getMessage(id);
bundle1.format(message);
}

View File

@ -1,6 +1,6 @@
// Type definitions for fluent 0.10
// Type definitions for fluent 0.11
// Project: http://projectfluent.org
// Definitions by: Huy Nguyen <https://github.com/huy-nguyen>
// Definitions by: Huy Nguyen <https://github.com/huy-nguyen>, James Nimlos <https://github.com/jamesnimlos>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
@ -28,6 +28,8 @@ export class FluentResource extends Map {
export class FluentBundle {
constructor(locales: string | string[], options?: FluentBundleContructorOptions);
messages: IterableIterator<[string, FluentNode[]]>;
hasMessage(source: string): boolean;
addMessages(source: string): string[];
getMessage(id: string): FluentNode[];
format(message: FluentNode[], args?: object, errors?: string[]): string;

View File

@ -4,6 +4,7 @@
"lib": [
"es6"
],
"target": "es6",
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,