ember-intl
Version:
Internationalization for Ember projects
28 lines (22 loc) • 688 B
text/typescript
import Helper from '@ember/component/helper';
import service from '../-private/utils/service';
import type IntlService from '../services/intl';
type FormatParameters = Parameters<IntlService['formatList']>;
type Value = FormatParameters[0];
type Options = FormatParameters[1];
interface FormatListSignature {
Args: {
Named?: Options;
Positional: [Value];
};
Return: string;
}
export default class FormatListHelper extends Helper<FormatListSignature> {
declare intl: IntlService;
compute(
[value]: FormatListSignature['Args']['Positional'],
options: FormatListSignature['Args']['Named'],
) {
return this.intl.formatList(value, options);
}
}