-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
44 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
type MessageDirect = string | ||
type MessageParams<P1, P2, P3, P4, P5, P6> = (arg1: P1, arg2: P2, arg3: P3, arg4: P4, arg5: P5, arg6: P6) => string | ||
|
||
/** | ||
* A message seen as function. | ||
*/ | ||
export type MessageFunction<T extends MessageDirect | MessageParams<any, any, any, any, any, any>> = T extends string | ||
? () => string | ||
: T | ||
export type MessageFunction< | ||
T extends string | ((...args: any[]) => string) | ||
> = T extends string ? () => string : T | ||
|
||
/** | ||
* The available messages for a given language. | ||
*/ | ||
export interface Messages { | ||
[key: string]: MessageDirect | MessageParams<any, any, any, any, any, any> | ||
[key: string]: string | ((...args: any[]) => string) | ||
} |