-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.d.ts
59 lines (55 loc) · 1.72 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
import { BackendModule, ReadCallback } from "i18next";
export interface ChainedBackendOptions {
/**
* array of existing i18next backends from https://www.i18next.com/plugins-and-utils.html#backends
*/
backends?: any[];
/**
* array of options in order of backends above
*/
backendOptions?: any[];
/**
* In case of caching it tries to:
* refresh: refresh the cache by loading from the next backend and updates the cache
* refreshAndUpdateStore: refresh the cache by loading from the next backend, updates the cache and also update the i18next resource store
* @default 'none'
*/
cacheHitMode?: 'none' | 'refresh' | 'refreshAndUpdateStore';
/**
* can be used to reload resources in a specific
* interval (useful in server environments)
* @default false
*/
reloadInterval?: false | number;
/**
* In case of caching with 'refresh' or 'refreshAndUpdateStore', it will only fetch from the next backend if the cached namespace is expired.
* Only supported if the backend returns the saved timestamp, like i18next-fs-backend, i18next-localstorage-backend
* @default undefined
*/
refreshExpirationTime?: number;
}
export default class I18NextChainedBackend
implements BackendModule<ChainedBackendOptions> {
static type: "backend";
constructor(services?: any, options?: ChainedBackendOptions);
init(
services?: any,
options?: ChainedBackendOptions,
i18nextOptions?: any
): void;
read(
language: string,
namespace: string,
callback: ReadCallback
): void;
create(
languages: string[],
namespace: string,
key: string,
fallbackValue: string
): void;
type: "backend";
services: any;
backends: any[];
options: ChainedBackendOptions;
}