1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export interface Confidence {
|
10 | name: string;
|
11 | confidence: number;
|
12 | lang?: string | undefined;
|
13 | }
|
14 |
|
15 | export interface Options {
|
16 | returnAllMatches?: boolean | undefined;
|
17 | sampleSize?: number | undefined;
|
18 | }
|
19 |
|
20 |
|
21 | export function detect(buf: Buffer, opts?: Options): string | null;
|
22 |
|
23 | export function detectFile(path: string, cb: (err: any, result: string | null) => void): void;
|
24 | export function detectFile(path: string, opts: Options, cb: (err: any, result: string | null) => void): void;
|
25 |
|
26 | export function detectFileSync(path: string, opts?: Options): string | null;
|
27 |
|
28 |
|
29 | export function detectAll(buf: Buffer, opts?: Options): Confidence[] | null;
|
30 |
|
31 | export function detectFileAll(path: string, cb: (err: any, result: Confidence[] | null) => void): void;
|
32 | export function detectFileAll(path: string, opts: Options, cb: (err: any, result: Confidence[] | null) => void): void;
|
33 |
|
34 | export function detectFileAllSync(path: string, opts?: Options): Confidence[] | null;
|