mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 15:00:26 +00:00
Merge pull request #24621 from danielbischoff/master
node-polyglot: Added method *has* to interface
This commit is contained in:
Vendored
+3
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for node-polyglot v0.4.1
|
||||
// Type definitions for node-polyglot v0.4.2
|
||||
// Project: https://github.com/airbnb/polyglot.js
|
||||
// Definitions by: Tim Jackson-Kiely <https://github.com/timjk>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -38,6 +38,8 @@ declare class Polyglot {
|
||||
locale(): string;
|
||||
|
||||
locale(locale: string): void;
|
||||
|
||||
has(phrase: string): boolean;
|
||||
}
|
||||
|
||||
export = Polyglot;
|
||||
|
||||
@@ -47,6 +47,9 @@ function translate(): void {
|
||||
_: "I like to write in %{language}.",
|
||||
language: "Javascript"
|
||||
});
|
||||
|
||||
polyglot.has("hello");
|
||||
polyglot.has("world");
|
||||
|
||||
polyglot.replace({
|
||||
"hello": "hey",
|
||||
|
||||
Reference in New Issue
Block a user