diff --git a/types/franc/franc-tests.ts b/types/franc/franc-tests.ts index cad5c24817..99cd097844 100644 --- a/types/franc/franc-tests.ts +++ b/types/franc/franc-tests.ts @@ -1,4 +1,4 @@ -import { detect } from 'franc'; +import * as detect from 'franc'; const testText = 'This is an example sentence'; const testOptions = { diff --git a/types/franc/index.d.ts b/types/franc/index.d.ts index 3447f25cc8..613c46946f 100644 --- a/types/franc/index.d.ts +++ b/types/franc/index.d.ts @@ -4,19 +4,21 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // ISO 639-3 code (see: https://iso639-3.sil.org/code_tables/639/data) -export type ISO6393 = string; +type ISO6393 = string; // Range [0, 1] -export type Confidence = number; +type Confidence = number; -export interface Options { +interface Options { minLength?: number; whitelist?: ISO6393[]; blacklist?: ISO6393[]; } -export function detect(text: string, options?: Options): ISO6393; +declare function detect(text: string, options?: Options): ISO6393; -export namespace detect { +declare namespace detect { function all(text: string, options?: Options): [ISO6393, number]; } + +export = detect;