@linguanahq/compiler 0.1.0 → 0.1.1

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.
@@ -0,0 +1,40 @@
1
+ import generateImport from "@babel/generator";
2
+ import { type Diagnostic, type ManifestMessage } from "@linguanahq/catalog";
3
+ import { type Plugin } from "vite";
4
+ declare const generate: typeof generateImport;
5
+ export type StrictPolicy = boolean | {
6
+ ambiguous?: boolean;
7
+ unsafe?: boolean;
8
+ duplicate?: boolean;
9
+ };
10
+ export type LinguanaPluginOptions = {
11
+ projectId: string;
12
+ environment: string;
13
+ sourceLocale: string;
14
+ apiUrl?: string;
15
+ token?: string;
16
+ include?: string | string[];
17
+ exclude?: string | string[];
18
+ output?: string;
19
+ upload?: boolean;
20
+ strict?: StrictPolicy;
21
+ translation?: {
22
+ targetLocales: string[];
23
+ maxChargeMicros: number;
24
+ waitTimeoutMs?: number;
25
+ publish: "development";
26
+ };
27
+ };
28
+ export type TransformResult = {
29
+ code: string;
30
+ map: ReturnType<typeof generate>["map"];
31
+ messages: ManifestMessage[];
32
+ diagnostics: Diagnostic[];
33
+ };
34
+ export declare function transformSource(code: string, filename: string, options: Pick<LinguanaPluginOptions, "sourceLocale"> & {
35
+ root?: string;
36
+ runtimePackage?: string;
37
+ compilerRuntime?: string;
38
+ }): TransformResult;
39
+ export declare function linguana(options: LinguanaPluginOptions): Plugin;
40
+ export default linguana;