@shelchin/svelte-i18n
Version:
The last Svelte i18n library you'll ever need. Type-safe, AI-powered, zero-config.
27 lines (26 loc) • 891 B
TypeScript
/**
* Type discovery utilities for third-party packages
* Automatically finds and loads i18n types from packages
*/
/**
* Try to discover i18n types from a package
* @param packageName - Name of the package to check
* @returns The I18N_PATHS array if found, or null
*/
export declare function discoverPackageTypes(packageName: string): Promise<string[] | null>;
/**
* Get validation schema for a package
* First tries to get TypeScript types, then falls back to JSON schema
*/
export declare function getPackageSchema(packageName: string): Promise<{
paths?: string[];
schema?: Record<string, unknown>;
source: string;
} | null>;
/**
* Validate translations against package types or schema
*/
export declare function validateAgainstPackage(translations: Record<string, unknown>, packageInfo: {
paths?: string[];
schema?: Record<string, unknown>;
}): string[];