aboutsummaryrefslogtreecommitdiff
path: root/src/formats.ts
blob: b5a24bf7046f6f87587614095f9c8eee17c869b2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
interface Format {
    parse_coverage: (file: Document) => number;
}

interface FormatList {
    [key: string]: Format
}

interface FormatObj {
    formats: FormatList,
    list_formats: () => string[],
    get_format: (format: string) => Format,
}

const FormatsObj: FormatObj = {
    formats: {
        tarpaulin: {
            parse_coverage: (file: Document) => {
                return 0.0;
            }
        },
    },

    list_formats: function () {
        return Object.keys(this.formats);
    },

    get_format: function (format: string) {
        return this.formats[format];
    }
}

export default FormatsObj;