@tolgee/core 5.16.3 → 5.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Controller/Cache/Cache.d.ts +1 -1
- package/lib/Controller/Controller.d.ts +2 -2
- package/lib/Controller/Events/EventEmitter.d.ts +1 -1
- package/lib/Controller/Events/EventEmitterSelective.d.ts +1 -1
- package/lib/Controller/Events/Events.d.ts +1 -1
- package/lib/Controller/Plugins/Plugins.d.ts +1 -1
- package/lib/Controller/State/State.d.ts +1 -1
- package/lib/Controller/State/initState.d.ts +4 -4
- package/lib/Controller/State/observerOptions.d.ts +3 -3
- package/lib/Controller/ValueObserver.d.ts +1 -1
- package/lib/FormatSimple/FormatError.d.ts +1 -1
- package/lib/TolgeeCore.d.ts +2 -2
- package/lib/types/cache.d.ts +9 -9
- package/lib/types/events.d.ts +7 -7
- package/lib/types/general.d.ts +16 -16
- package/lib/types/plugin.d.ts +36 -36
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CacheDescriptor, NsFallback, TolgeeOptions, TFnType, NsType, KeyAndNamespacesInternal, TranslationDescriptor } from '../types';
|
|
2
|
-
|
|
2
|
+
type StateServiceProps = {
|
|
3
3
|
options?: Partial<TolgeeOptions>;
|
|
4
4
|
};
|
|
5
5
|
export declare function Controller({ options }: StateServiceProps): Readonly<{
|
|
@@ -100,5 +100,5 @@ export declare function Controller({ options }: StateServiceProps): Readonly<{
|
|
|
100
100
|
setEmitterActive: (active: boolean) => void;
|
|
101
101
|
on: import("../types").TolgeeOn<keyof import("../types").EventType>;
|
|
102
102
|
}>;
|
|
103
|
-
export
|
|
103
|
+
export type ControllerInstance = ReturnType<typeof Controller>;
|
|
104
104
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Subscription, Listener } from '../../types';
|
|
2
2
|
export declare function EventEmitter<T>(isActive: () => boolean): EventEmitterInstance<T>;
|
|
3
|
-
export
|
|
3
|
+
export type EventEmitterInstance<T> = {
|
|
4
4
|
readonly listen: (handler: Listener<T>) => Subscription;
|
|
5
5
|
readonly emit: (data: T) => void;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Subscription, Listener, SubscriptionSelective } from '../../types';
|
|
2
2
|
export declare function EventEmitterSelective(isActive: () => boolean, getFallbackNs: () => string[], getDefaultNs: () => string): EventEmitterSelectiveInstance;
|
|
3
|
-
export
|
|
3
|
+
export type EventEmitterSelectiveInstance = {
|
|
4
4
|
readonly listenSome: (handler: Listener<undefined>) => SubscriptionSelective;
|
|
5
5
|
readonly listen: (handler: Listener<undefined>) => Subscription;
|
|
6
6
|
readonly emit: (ns?: string[], delayed?: boolean) => void;
|
|
@@ -12,4 +12,4 @@ export declare function Events(getFallbackNs: () => string[], getDefaultNs: () =
|
|
|
12
12
|
setEmitterActive(active: boolean): void;
|
|
13
13
|
on: TolgeeOn<keyof import("../../types").EventType>;
|
|
14
14
|
}>;
|
|
15
|
-
export
|
|
15
|
+
export type EventsInstance = ReturnType<typeof Events>;
|
|
@@ -25,4 +25,4 @@ export declare function Plugins(getLanguage: () => string | undefined, getInitia
|
|
|
25
25
|
formatEnabled?: boolean | undefined;
|
|
26
26
|
}): string;
|
|
27
27
|
}>;
|
|
28
|
-
export
|
|
28
|
+
export type PluginsInstance = ReturnType<typeof Plugins>;
|
|
@@ -39,4 +39,4 @@ export declare function State(onLanguageChange: EventEmitterInstance<string>, on
|
|
|
39
39
|
withDefaultNs(descriptor: CacheDescriptor): CacheDescriptorInternal;
|
|
40
40
|
overrideCredentials(credentials: DevCredentials): void;
|
|
41
41
|
}>;
|
|
42
|
-
export
|
|
42
|
+
export type StateInstance = ReturnType<typeof State>;
|
|
@@ -3,10 +3,10 @@ import { ObserverOptions, ObserverOptionsInternal } from './observerOptions';
|
|
|
3
3
|
export declare const DEFAULT_FORMAT_ERROR = "invalid";
|
|
4
4
|
export declare const DEFAULT_API_URL = "https://app.tolgee.io";
|
|
5
5
|
export declare const DEFAULT_MISSING_TRANSLATION: MissingTranslationHandler;
|
|
6
|
-
export
|
|
6
|
+
export type TolgeeStaticData = {
|
|
7
7
|
[key: string]: TreeTranslationsData | (() => Promise<TreeTranslationsData>);
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type TolgeeOptionsInternal = {
|
|
10
10
|
/**
|
|
11
11
|
* Initial language
|
|
12
12
|
*/
|
|
@@ -83,10 +83,10 @@ export declare type TolgeeOptionsInternal = {
|
|
|
83
83
|
*/
|
|
84
84
|
fetch: FetchFn;
|
|
85
85
|
};
|
|
86
|
-
export
|
|
86
|
+
export type TolgeeOptions = Partial<Omit<TolgeeOptionsInternal, 'observerOptions'>> & {
|
|
87
87
|
observerOptions?: ObserverOptions;
|
|
88
88
|
};
|
|
89
|
-
export
|
|
89
|
+
export type State = {
|
|
90
90
|
initialOptions: TolgeeOptionsInternal;
|
|
91
91
|
activeNamespaces: Map<string, number>;
|
|
92
92
|
language: string | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ObserverOptionsInternal = {
|
|
2
2
|
/**
|
|
3
3
|
* Attributes that are observed on html elements
|
|
4
4
|
*/
|
|
@@ -40,6 +40,6 @@ export declare type ObserverOptionsInternal = {
|
|
|
40
40
|
*/
|
|
41
41
|
fullKeyEncode: boolean;
|
|
42
42
|
};
|
|
43
|
-
export
|
|
44
|
-
export
|
|
43
|
+
export type ObserverOptions = Partial<ObserverOptionsInternal>;
|
|
44
|
+
export type ModifierKey = 'Alt' | 'Control' | 'Shift' | 'Meta';
|
|
45
45
|
export declare const defaultObserverOptions: ObserverOptionsInternal;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const ValueObserver: <T = any>(initialValue: T, valueGetter: () => T, handler: (value: T) => void) => ValueObserverInstance<T>;
|
|
2
|
-
export
|
|
2
|
+
export type ValueObserverInstance<T> = {
|
|
3
3
|
readonly init: (value: T) => void;
|
|
4
4
|
readonly notify: () => void;
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const ERROR_PARAM_EMPTY = 0, ERROR_UNEXPECTED_CHAR = 1, ERROR_UNEXPECTED_END = 2;
|
|
2
|
-
export
|
|
2
|
+
export type ErrorCode = typeof ERROR_PARAM_EMPTY | typeof ERROR_UNEXPECTED_CHAR | typeof ERROR_UNEXPECTED_END;
|
|
3
3
|
export declare class FormatError extends Error {
|
|
4
4
|
readonly code: ErrorCode;
|
|
5
5
|
readonly index: number;
|
package/lib/TolgeeCore.d.ts
CHANGED
|
@@ -178,10 +178,10 @@ declare function createTolgee(options: TolgeeOptions): Readonly<{
|
|
|
178
178
|
*/
|
|
179
179
|
updateOptions(options?: TolgeeOptions): void;
|
|
180
180
|
}>;
|
|
181
|
-
export
|
|
181
|
+
export type TolgeeInstance = Omit<ReturnType<typeof createTolgee>, 't'> & {
|
|
182
182
|
t: TFnType<DefaultParamType, string, TranslationKey>;
|
|
183
183
|
};
|
|
184
|
-
export
|
|
184
|
+
export type TolgeeChainer = {
|
|
185
185
|
/**
|
|
186
186
|
* Add plugin, plugins are applied when `init` method is called.
|
|
187
187
|
*/
|
package/lib/types/cache.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export type TranslationValue = string | undefined | null;
|
|
2
|
+
export type TranslationsFlat = Map<string, TranslationValue>;
|
|
3
|
+
export type TreeTranslationsData = {
|
|
4
4
|
[key: string]: TranslationValue | TreeTranslationsData;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type CacheDescriptor = {
|
|
7
7
|
language: string;
|
|
8
8
|
namespace?: string;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type CacheDescriptorInternal = {
|
|
11
11
|
language: string;
|
|
12
12
|
namespace: string;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type CacheDescriptorWithKey = CacheDescriptorInternal & {
|
|
15
15
|
key?: string;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type TranslationChanger = {
|
|
18
18
|
revert: () => void;
|
|
19
19
|
};
|
|
20
|
-
export
|
|
21
|
-
export
|
|
20
|
+
export type ChangeTranslationInterface = (descriptor: CacheDescriptor, key: string, value: string) => TranslationChanger;
|
|
21
|
+
export type CachePublicRecord = {
|
|
22
22
|
data: TranslationsFlat;
|
|
23
23
|
language: string;
|
|
24
24
|
namespace: string;
|
package/lib/types/events.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { NsFallback } from './general';
|
|
2
2
|
import type { CacheDescriptorWithKey } from './cache';
|
|
3
|
-
export
|
|
3
|
+
export type Subscription = {
|
|
4
4
|
unsubscribe: () => void;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type SubscriptionSelective = {
|
|
7
7
|
unsubscribe: () => void;
|
|
8
8
|
/**
|
|
9
9
|
* Subscribes to namespace(s)
|
|
@@ -13,11 +13,11 @@ export declare type SubscriptionSelective = {
|
|
|
13
13
|
*/
|
|
14
14
|
subscribeNs(ns?: NsFallback): SubscriptionSelective;
|
|
15
15
|
};
|
|
16
|
-
export
|
|
16
|
+
export type ListenerEvent<T> = {
|
|
17
17
|
value: T;
|
|
18
18
|
};
|
|
19
|
-
export
|
|
20
|
-
export
|
|
19
|
+
export type Listener<T> = (e: ListenerEvent<T>) => void;
|
|
20
|
+
export type TolgeeEvent = 'language' | 'pendingLanguage' | 'loading' | 'fetching' | 'initialLoad' | 'running' | 'cache' | 'update' | 'permanentChange';
|
|
21
21
|
export interface EventType {
|
|
22
22
|
language: string;
|
|
23
23
|
pendingLanguage: string;
|
|
@@ -29,7 +29,7 @@ export interface EventType {
|
|
|
29
29
|
update: void;
|
|
30
30
|
permanentChange: CacheDescriptorWithKey;
|
|
31
31
|
}
|
|
32
|
-
export
|
|
32
|
+
export type TolgeeOn<E extends keyof EventType = keyof EventType> = {
|
|
33
33
|
/**
|
|
34
34
|
* Emitted when any key needs (or might need) to be re-rendered.
|
|
35
35
|
* Similar to tolgee.onNsUpdate, except for all namespaces.
|
|
@@ -69,7 +69,7 @@ export declare type TolgeeOn<E extends keyof EventType = keyof EventType> = {
|
|
|
69
69
|
(event: 'permanentChange', handler: Listener<CacheDescriptorWithKey>): Subscription;
|
|
70
70
|
(event: E, handler: unknown): Subscription;
|
|
71
71
|
};
|
|
72
|
-
export
|
|
72
|
+
export type TranslationDescriptor = {
|
|
73
73
|
key: string;
|
|
74
74
|
namespace: string | undefined;
|
|
75
75
|
};
|
package/lib/types/general.d.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
1
|
+
export type FallbackGeneral = undefined | false | string | string[];
|
|
2
|
+
export type NsType = string;
|
|
3
|
+
export type TranslationKey = string & Record<never, never>;
|
|
4
|
+
export type NsFallback = undefined | NsType | NsType[];
|
|
5
|
+
export type FallbackLanguageObject = Record<string, FallbackGeneral>;
|
|
6
|
+
export type FallbackLanguageOption = FallbackGeneral | FallbackLanguageObject;
|
|
7
|
+
export type DefaultParamType = string | number | bigint | Date;
|
|
8
|
+
export type TranslateParams<T = DefaultParamType> = {
|
|
9
9
|
[key: string]: T;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type TranslateOptions = {
|
|
12
12
|
ns?: NsType | null;
|
|
13
13
|
noWrap?: boolean;
|
|
14
14
|
orEmpty?: boolean;
|
|
15
15
|
language?: string;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type TranslateProps<T = DefaultParamType, K extends string = TranslationKey> = {
|
|
18
18
|
key: K;
|
|
19
19
|
defaultValue?: string;
|
|
20
20
|
params?: TranslateParams<T>;
|
|
21
21
|
} & TranslateOptions;
|
|
22
|
-
export
|
|
22
|
+
export type TranslatePropsInternal = TranslateProps & {
|
|
23
23
|
translation?: string;
|
|
24
24
|
};
|
|
25
|
-
|
|
26
|
-
export
|
|
25
|
+
type PropType<TObj> = TObj[keyof TObj];
|
|
26
|
+
export type CombinedOptions<T> = TranslateOptions & {
|
|
27
27
|
[key: string]: T | PropType<TranslateOptions>;
|
|
28
28
|
};
|
|
29
|
-
export
|
|
29
|
+
export type TFnType<T = DefaultParamType, R = string, K extends string = TranslationKey> = {
|
|
30
30
|
(key: K, defaultValue?: string, options?: CombinedOptions<T>): R;
|
|
31
31
|
(key: K, options?: CombinedOptions<T>): R;
|
|
32
32
|
(props: TranslateProps<T, K>): R;
|
|
33
33
|
};
|
|
34
|
-
export
|
|
35
|
-
export
|
|
34
|
+
export type KeyAndNamespacesInternal = Pick<TranslatePropsInternal, 'key' | 'ns' | 'language'>;
|
|
35
|
+
export type FetchFn = (input: string | URL, init?: RequestInit | undefined) => Promise<Response>;
|
|
36
36
|
export {};
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -3,53 +3,53 @@ import { FetchFn, NsFallback, NsType, TranslateParams, TranslatePropsInternal }
|
|
|
3
3
|
import type { ObserverOptionsInternal } from '../Controller/State/observerOptions';
|
|
4
4
|
import { TolgeeInstance } from '../TolgeeCore';
|
|
5
5
|
import { TranslationDescriptor } from './events';
|
|
6
|
-
export
|
|
6
|
+
export type BackendDevProps = {
|
|
7
7
|
apiUrl?: string;
|
|
8
8
|
apiKey?: string;
|
|
9
9
|
projectId?: number | string;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type CommonProps = {
|
|
12
12
|
fetch: FetchFn;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type BackendGetRecordProps = {
|
|
15
15
|
language: string;
|
|
16
16
|
namespace?: string;
|
|
17
17
|
};
|
|
18
|
-
export
|
|
18
|
+
export type BackendGetRecord = (data: BackendGetRecordProps & CommonProps) => Promise<TreeTranslationsData | undefined> | undefined;
|
|
19
19
|
export interface BackendMiddleware {
|
|
20
20
|
getRecord: BackendGetRecord;
|
|
21
21
|
}
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
22
|
+
export type BackendGetDevRecord = (data: BackendGetRecordProps & CommonProps & BackendDevProps) => Promise<TreeTranslationsData | undefined> | undefined;
|
|
23
|
+
export type BackendGetRecordInternal = (data: BackendGetRecordProps & BackendDevProps) => Promise<TreeTranslationsData | undefined> | undefined;
|
|
24
|
+
export type BackendDevMiddleware = {
|
|
25
25
|
getRecord: BackendGetDevRecord;
|
|
26
26
|
};
|
|
27
|
-
export
|
|
27
|
+
export type KeyAndParams = {
|
|
28
28
|
key: string;
|
|
29
29
|
params?: TranslateParams;
|
|
30
30
|
defaultValue?: string;
|
|
31
31
|
ns?: NsType;
|
|
32
32
|
};
|
|
33
|
-
export
|
|
33
|
+
export type Unwrapped = {
|
|
34
34
|
text: string;
|
|
35
35
|
keys: KeyAndParams[];
|
|
36
36
|
};
|
|
37
|
-
export
|
|
38
|
-
export
|
|
39
|
-
export
|
|
40
|
-
export
|
|
37
|
+
export type WrapperWrapProps = Pick<TranslatePropsInternal, 'key' | 'params' | 'defaultValue' | 'ns' | 'translation'>;
|
|
38
|
+
export type WrapperWrapFunction = (props: WrapperWrapProps) => string;
|
|
39
|
+
export type WrapperUnwrapFunction = (text: string) => Unwrapped;
|
|
40
|
+
export type WrapperAttributeXPathGetter = (props: {
|
|
41
41
|
tag: string;
|
|
42
42
|
attribute: string;
|
|
43
43
|
}) => string;
|
|
44
|
-
export
|
|
45
|
-
export
|
|
46
|
-
export
|
|
44
|
+
export type HighlightInterface = (key?: string, ns?: NsFallback) => Highlighter;
|
|
45
|
+
export type FindPositionsInterface = (key?: string, ns?: NsFallback) => KeyPosition[];
|
|
46
|
+
export type ObserverRunProps = {
|
|
47
47
|
mouseHighlight: boolean;
|
|
48
48
|
options: ObserverOptionsInternal;
|
|
49
49
|
translate: (params: TranslatePropsInternal) => string;
|
|
50
50
|
onClick: TranslationOnClick;
|
|
51
51
|
};
|
|
52
|
-
export
|
|
52
|
+
export type ObserverMiddleware = () => {
|
|
53
53
|
unwrap: (text: string) => Unwrapped;
|
|
54
54
|
wrap: WrapperWrapFunction;
|
|
55
55
|
retranslate: () => void;
|
|
@@ -59,47 +59,47 @@ export declare type ObserverMiddleware = () => {
|
|
|
59
59
|
outputNotFormattable: boolean;
|
|
60
60
|
findPositions: FindPositionsInterface;
|
|
61
61
|
};
|
|
62
|
-
export
|
|
62
|
+
export type LanguageDetectorProps = {
|
|
63
63
|
availableLanguages: string[];
|
|
64
64
|
fetch: FetchFn;
|
|
65
65
|
};
|
|
66
|
-
export
|
|
66
|
+
export type LanguageDetectorMiddleware = {
|
|
67
67
|
getLanguage: (props: LanguageDetectorProps) => string | undefined | Promise<string | undefined>;
|
|
68
68
|
};
|
|
69
|
-
export
|
|
69
|
+
export type LanguageStorageMiddleware = {
|
|
70
70
|
getLanguage: (props: CommonProps) => string | undefined | Promise<string | undefined>;
|
|
71
71
|
setLanguage: (language: string, props: CommonProps) => void | Promise<void>;
|
|
72
72
|
};
|
|
73
|
-
export
|
|
73
|
+
export type DevCredentials = undefined | {
|
|
74
74
|
apiUrl?: string;
|
|
75
75
|
apiKey?: string;
|
|
76
76
|
projectId?: string | number;
|
|
77
77
|
};
|
|
78
|
-
export
|
|
78
|
+
export type WrapperMiddleware = {
|
|
79
79
|
unwrap: WrapperUnwrapFunction;
|
|
80
80
|
wrap: WrapperWrapFunction;
|
|
81
81
|
getTextXPath: () => string;
|
|
82
82
|
getAttributeXPath: WrapperAttributeXPathGetter;
|
|
83
83
|
};
|
|
84
|
-
export
|
|
84
|
+
export type FormatterMiddlewareFormatParams = {
|
|
85
85
|
translation: string;
|
|
86
86
|
language: string;
|
|
87
87
|
params: Record<string, any> | undefined;
|
|
88
88
|
};
|
|
89
|
-
export
|
|
89
|
+
export type FormatterMiddleware = {
|
|
90
90
|
format: (props: FormatterMiddlewareFormatParams) => string;
|
|
91
91
|
};
|
|
92
|
-
export
|
|
92
|
+
export type TranslationOnClick = (data: {
|
|
93
93
|
keysAndDefaults: KeyAndParams[];
|
|
94
94
|
event: any;
|
|
95
95
|
}) => void;
|
|
96
|
-
export
|
|
96
|
+
export type Highlighter = {
|
|
97
97
|
unhighlight(): void;
|
|
98
98
|
};
|
|
99
|
-
export
|
|
99
|
+
export type FinalFormatterMiddleware = {
|
|
100
100
|
format: (props: FormatterMiddlewareFormatParams) => any;
|
|
101
101
|
};
|
|
102
|
-
export
|
|
102
|
+
export type KeyPosition = {
|
|
103
103
|
position: {
|
|
104
104
|
x: number;
|
|
105
105
|
y: number;
|
|
@@ -109,7 +109,7 @@ export declare type KeyPosition = {
|
|
|
109
109
|
keyName: string;
|
|
110
110
|
keyNamespace: string;
|
|
111
111
|
};
|
|
112
|
-
export
|
|
112
|
+
export type UiProps = {
|
|
113
113
|
apiUrl: string;
|
|
114
114
|
apiKey: string;
|
|
115
115
|
projectId: number | string | undefined;
|
|
@@ -118,18 +118,18 @@ export declare type UiProps = {
|
|
|
118
118
|
changeTranslation: ChangeTranslationInterface;
|
|
119
119
|
onPermanentChange: (props: TranslationDescriptor) => void;
|
|
120
120
|
};
|
|
121
|
-
export
|
|
121
|
+
export type UiKeyOption = {
|
|
122
122
|
key: string;
|
|
123
123
|
defaultValue?: string;
|
|
124
124
|
fallbackNamespaces: string[];
|
|
125
125
|
namespace: string;
|
|
126
126
|
translation: string | undefined;
|
|
127
127
|
};
|
|
128
|
-
export
|
|
128
|
+
export type UiMiddleware = (props: UiProps) => UiInterface;
|
|
129
129
|
export interface UiInterface {
|
|
130
130
|
handleElementClick(keysAndDefaults: UiKeyOption[], event: any): Promise<void>;
|
|
131
131
|
}
|
|
132
|
-
export
|
|
132
|
+
export type PluginTools = Readonly<{
|
|
133
133
|
setFinalFormatter: (formatter: FinalFormatterMiddleware | undefined) => void;
|
|
134
134
|
addFormatter: (formatter: FormatterMiddleware | undefined) => void;
|
|
135
135
|
setObserver: (observer: ObserverMiddleware | undefined) => void;
|
|
@@ -141,7 +141,7 @@ export declare type PluginTools = Readonly<{
|
|
|
141
141
|
setLanguageDetector: (languageDetector: LanguageDetectorMiddleware | undefined) => void;
|
|
142
142
|
setLanguageStorage: (languageStorage: LanguageStorageMiddleware | undefined) => void;
|
|
143
143
|
}>;
|
|
144
|
-
export
|
|
145
|
-
export
|
|
146
|
-
export
|
|
147
|
-
export
|
|
144
|
+
export type TolgeePlugin = (tolgee: TolgeeInstance, tools: PluginTools) => TolgeeInstance;
|
|
145
|
+
export type FormatErrorHandler = (error: string, info: TranslatePropsInternal) => string;
|
|
146
|
+
export type OnFormatError = string | FormatErrorHandler;
|
|
147
|
+
export type MissingTranslationHandler = (info: TranslatePropsInternal) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tolgee/core",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.17.0",
|
|
4
4
|
"description": "Library providing ability to translate messages directly in context of developed application.",
|
|
5
5
|
"main": "./dist/tolgee.cjs.js",
|
|
6
6
|
"module": "./dist/tolgee.esm.js",
|
|
@@ -63,11 +63,11 @@
|
|
|
63
63
|
"rollup-plugin-terser": "7.0.2",
|
|
64
64
|
"rollup-plugin-visualizer": "^5.8.0",
|
|
65
65
|
"ts-jest": "^27.1.5",
|
|
66
|
-
"typescript": "^4.
|
|
66
|
+
"typescript": "^4.9.5"
|
|
67
67
|
},
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
71
|
"sideEffects": false,
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "bda8d85d491915f12148988f4d105d1aea5efd28"
|
|
73
73
|
}
|