1 |
|
2 |
|
3 | import type { TestContext as BaseTestContext } from 'ember-test-helpers';
|
4 | import type IntlService from 'ember-intl/services/intl';
|
5 | import type { TOptions } from 'ember-intl/services/intl';
|
6 | import type { Translations } from 'ember-intl/-private/store/translation';
|
7 | export interface IntlTestContext {
|
8 | intl: IntlService;
|
9 | }
|
10 | export interface TestContext extends IntlTestContext, BaseTestContext {
|
11 | }
|
12 | export interface SetupIntlOptions {
|
13 | |
14 |
|
15 |
|
16 |
|
17 |
|
18 | missingMessage?: boolean | ((key: string, locales: string[], options: TOptions) => string);
|
19 | formats?: IntlService['formats'];
|
20 | }
|
21 | /**
|
22 | * Calling this helper will install a special `missing-message` util that will
|
23 | * serialize all missing translations in a deterministic manner, including
|
24 | * variables you've passed for interpolation. This means that you do not have
|
25 | * to explicitly add any translations and can just rely on the implicit
|
26 | * serialization. See the docs for detailed examples.
|
27 | *
|
28 | * Besides the `hooks` object you can also pass a `locale` string or array to
|
29 | * set the locale, as well as an object of `translations`, if you do want to
|
30 | * bootstrap translations. Both arguments are optional.
|
31 | *
|
32 | * @param {object} hooks
|
33 | * @param {string} [localeOrTranslations]
|
34 | * @param {object} [translations]
|
35 | * @param {object} [options]
|
36 | */
|
37 | export default function setupIntl(hooks: NestedHooks, locale: string | string[], translations?: Translations, options?: SetupIntlOptions): void;
|
38 | export default function setupIntl(hooks: NestedHooks, translations?: Translations, options?: SetupIntlOptions): void;
|
39 |
|
\ | No newline at end of file |