diff --git a/types/franc/franc-tests.ts b/types/franc/franc-tests.ts index 475f636506..cad5c24817 100644 --- a/types/franc/franc-tests.ts +++ b/types/franc/franc-tests.ts @@ -1,4 +1,4 @@ -import franc = require('franc'); +import { detect } from 'franc'; const testText = 'This is an example sentence'; const testOptions = { @@ -7,8 +7,8 @@ const testOptions = { blacklist: [], }; -franc(testText); -franc(testText, testOptions); +detect(testText); +detect(testText, testOptions); -franc.all(testText); -franc.all(testText, testOptions)[0]; +detect.all(testText); +detect.all(testText, testOptions)[0]; diff --git a/types/franc/index.d.ts b/types/franc/index.d.ts index ac2dc1e90d..f99f237ead 100644 --- a/types/franc/index.d.ts +++ b/types/franc/index.d.ts @@ -11,8 +11,8 @@ export type Confidence = number; export interface Options { minLength?: number; - whitelist?: [ISO6393]; - blacklist?: [ISO6393]; + whitelist?: ISO6393[]; + blacklist?: ISO6393[]; } export function detect(text: string, options?: Options): ISO6393; @@ -20,3 +20,5 @@ export function detect(text: string, options?: Options): ISO6393; export namespace detect { function all(text: string, options?: Options): [ISO6393, number]; } + +export default detect;