chardet/lib/index.d.ts

19 lines
843 B
TypeScript
Raw Normal View History

2022-10-06 08:38:38 +00:00
import { Match } from './match';
interface FullOptions {
sampleSize: number;
position: number;
}
declare type Options = Partial<FullOptions>;
declare type DetectResult = Match[] | string | null;
export declare const detect: (buffer: Uint8Array) => string | null;
export declare const analyse: (buffer: Uint8Array) => Match[];
export declare const detectFile: (filepath: string, opts?: Options) => Promise<DetectResult>;
export declare const detectFileSync: (filepath: string, opts?: Options) => DetectResult;
declare const _default: {
analyse: (buffer: Uint8Array) => Match[];
detect: (buffer: Uint8Array) => string | null;
detectFileSync: (filepath: string, opts?: Partial<FullOptions>) => DetectResult;
detectFile: (filepath: string, opts?: Partial<FullOptions>) => Promise<DetectResult>;
};
export default _default;