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