-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.d.ts
80 lines (74 loc) · 2.13 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Type definitions for lioness 0.2.13
// Project: https://github.com/alexanderwallin/lioness
// Definitions by: Alex Goooseman <https://github.com/goooseman>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.2
declare module 'lioness' {
import * as React from 'react'
type TransformInput = (input: string) => string
export interface WithTranslators {
locale: string
t(message: string, scope?: Object): string
tn(message: string, other: string, count: number, scope?: Object): string
tp(context: string, message: string, scope?: Object): string
tnp(
context: string,
one: string,
other: string,
count: number,
scope?: Object
): string
tc(message: string, scope?: Object): string
tcn(message: string, other: string, count: number, scope?: Object): string
tcp(context: string, message: string, scope?: Object): string
tcnp(
context: string,
one: string,
other: string,
count: number,
scope?: Object
): string
}
export const withTranslators: <T>(
component: React.ComponentType<T & WithTranslators>,
) => React.ComponentType<T>;
namespace T {
export interface Props {
message: string
messagePlural?: string
context?: string
count?: number
tcnp?: WithTranslators['tcnp']
transformInput?: TransformInput
}
}
class T extends React.Component<T.Props> {}
namespace LionessProvider {
export interface Props {
messages: {
[locale: string]: {
headers: Object
charset: string
translations: {
[key: string]: {
[key: string]: {
msgid: string
msgid_plural?: string
msgctxt?: string
msgstr?: string[]
comments?: {
reference: string
}
}
}
}
}
}
locale: string
children: React.ReactNode
debug?: boolean
transformInput?: TransformInput
}
}
class LionessProvider extends React.Component<LionessProvider.Props> {}
}