mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
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:
parent
30468b4db1
commit
d9437c4fd6
4
types/fluent-react/index.d.ts
vendored
4
types/fluent-react/index.d.ts
vendored
@ -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;
|
||||
};
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
6
types/fluent/index.d.ts
vendored
6
types/fluent/index.d.ts
vendored
@ -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;
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user