1// Type definitions for codemirror
2// Project: https://github.com/marijnh/CodeMirror
3// Definitions by: koddsson <https://github.com/koddsson>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5// TypeScript Version: 3.2
6
7import * as CodeMirror from 'codemirror';
8
9interface MimeType {
10    name: string;
11    mime?: string;
12    mimes?: string;
13    mode: string;
14    file?: RegExp;
15    ext?: string[];
16    alias?: string[];
17}
18
19declare module 'codemirror' {
20    const modeInfo: MimeType[];
21    function findModeByMIME(mime: string): MimeType;
22    function findModeByExtension(ext: string): MimeType;
23    function findModeByFileName(filename: string): MimeType;
24    function findModeByName(name: string): MimeType;
25}
26