DefinitelyTyped/types/franc/index.d.ts
2018-09-17 16:24:52 -07:00

25 lines
634 B
TypeScript

// Type definitions for franc 4.0
// Project: https://github.com/wooorm/franc/
// Definitions by: William LeGate <https://github.com/wlegate>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// ISO 639-3 code (see: https://iso639-3.sil.org/code_tables/639/data)
type ISO6393 = string;
// Range [0, 1]
type Confidence = number;
interface Options {
minLength?: number;
whitelist?: ISO6393[];
blacklist?: ISO6393[];
}
declare function detect(text: string, options?: Options): ISO6393;
declare namespace detect {
function all(text: string, options?: Options): [ISO6393, number];
}
export = detect;