/** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ import * as ts from 'typescript'; export interface LocaleTransformer { locale: string; localeTransformer: { type: 'program'; factory: (program: ts.Program) => ts.TransformerFactory; }; } /** * Return an array of locales with associated TypeScript transformer factories * suitable for passing to the `transformers.before` [0] option of * `@rollup/plugin-typescript`. * * Example: * * const locales = localeTransformers() * export default locales.map(({locale, localeTransformer}) => ({ * input: `src/index.ts`, * plugins: [ * typescript({ * transformers: { * before: [localeTransformer], * }, * }), * resolve(), * ], * output: { * file: `bundled/${locale}/index.js`, * format: 'es', * }, * })); * * [0] https://github.com/rollup/plugins/tree/master/packages/typescript/#transformers */ export declare const localeTransformers: (configPath?: string) => Array;