From 209bda946381fd2544a4dcc035d9cd831c547713 Mon Sep 17 00:00:00 2001 From: Liam Ross Date: Wed, 19 Dec 2018 10:13:12 -0800 Subject: [PATCH] [node-polyglot] Fix `t` and `locale` overloads to allow optional arguments (#31522) * Updated node-polyglot types * bumped package version --- types/node-polyglot/index.d.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/types/node-polyglot/index.d.ts b/types/node-polyglot/index.d.ts index 3133def496..bb5fcced8e 100644 --- a/types/node-polyglot/index.d.ts +++ b/types/node-polyglot/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for node-polyglot v0.4.2 +// Type definitions for node-polyglot v0.4.3 // Project: https://github.com/airbnb/polyglot.js // Definitions by: Tim Jackson-Kiely +// Liam Ross // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - declare namespace Polyglot { interface InterpolationOptions { smart_count?: number | { length: number }; @@ -25,19 +25,13 @@ declare class Polyglot { extend(phrases: any): void; - t(phrase: string): string; - - t(phrase: string, smartCount: number): string; - - t(phrase: string, interpolationOptions: Polyglot.InterpolationOptions): string; + t(phrase: string, options?: number | Polyglot.InterpolationOptions): string; clear(): void; replace(phrases: any): void; - locale(): string; - - locale(locale: string): void; + locale(locale?: string): void; has(phrase: string): boolean; }