function registerTextMime(association, warnOnOverwrite) {
    if (warnOnOverwrite === void 0) { warnOnOverwrite = false; }
    // Register
    var associationItem = toTextMimeAssociationItem(association);
    registeredAssociations.push(associationItem);
    if (!associationItem.userConfigured) {
        nonUserRegisteredAssociations.push(associationItem);
    }
    else {
        userRegisteredAssociations.push(associationItem);
    }
    // Check for conflicts unless this is a user configured association
    if (warnOnOverwrite && !associationItem.userConfigured) {
        registeredAssociations.forEach(function (a) {
            if (a.mime === associationItem.mime || a.userConfigured) {
                return; // same mime or userConfigured is ok
            }
            if (associationItem.extension && a.extension === associationItem.extension) {
                console.warn("Overwriting extension <<" + associationItem.extension + ">> to now point to mime <<" + associationItem.mime + ">>");
            }
            if (associationItem.filename && a.filename === associationItem.filename) {
                console.warn("Overwriting filename <<" + associationItem.filename + ">> to now point to mime <<" + associationItem.mime + ">>");
            }
            if (associationItem.filepattern && a.filepattern === associationItem.filepattern) {
                console.warn("Overwriting filepattern <<" + associationItem.filepattern + ">> to now point to mime <<" + associationItem.mime + ">>");
            }
            if (associationItem.firstline && a.firstline === associationItem.firstline) {
                console.warn("Overwriting firstline <<" + associationItem.firstline + ">> to now point to mime <<" + associationItem.mime + ">>");
            }
        });
    }
}
/**
 * Associate a text mime to the registry.
 */
Associate a text mime to the registry.
Associate a text mime to the registry .
function registerTextMime(association, warnOnOverwrite) {
    if (warnOnOverwrite === void 0) { warnOnOverwrite = false; }
    var associationItem = toTextMimeAssociationItem(association);
    registeredAssociations.push(associationItem);
    if (!associationItem.userConfigured) {
        nonUserRegisteredAssociations.push(associationItem);
    }
    else {
        userRegisteredAssociations.push(associationItem);
    }
    if (warnOnOverwrite && !associationItem.userConfigured) {
        registeredAssociations.forEach(function (a) {
            if (a.mime === associationItem.mime || a.userConfigured) {
                return; 
            }
            if (associationItem.extension && a.extension === associationItem.extension) {
                console.warn("Overwriting extension <<" + associationItem.extension + ">> to now point to mime <<" + associationItem.mime + ">>");
            }
            if (associationItem.filename && a.filename === associationItem.filename) {
                console.warn("Overwriting filename <<" + associationItem.filename + ">> to now point to mime <<" + associationItem.mime + ">>");
            }
            if (associationItem.filepattern && a.filepattern === associationItem.filepattern) {
                console.warn("Overwriting filepattern <<" + associationItem.filepattern + ">> to now point to mime <<" + associationItem.mime + ">>");
            }
            if (associationItem.firstline && a.firstline === associationItem.firstline) {
                console.warn("Overwriting firstline <<" + associationItem.firstline + ">> to now point to mime <<" + associationItem.mime + ">>");
            }
        });
    }
}
function registerTextMime ( association , warnOnOverwrite ) { if ( warnOnOverwrite === void 0 ) { warnOnOverwrite = false ; } var associationItem = toTextMimeAssociationItem ( association ) ; registeredAssociations . push ( associationItem ) ; if ( ! associationItem . userConfigured ) { nonUserRegisteredAssociations . push ( associationItem ) ; } else { userRegisteredAssociations . push ( associationItem ) ; } if ( warnOnOverwrite && ! associationItem . userConfigured ) { registeredAssociations . forEach ( function ( a ) { if ( a . mime === associationItem . mime || a . userConfigured ) { return ; } if ( associationItem . extension && a . extension === associationItem . extension ) { console . warn ( "Overwriting extension <<" + associationItem . extension + ">> to now point to mime <<" + associationItem . mime + ">>" ) ; } if ( associationItem . filename && a . filename === associationItem . filename ) { console . warn ( "Overwriting filename <<" + associationItem . filename + ">> to now point to mime <<" + associationItem . mime + ">>" ) ; } if ( associationItem . filepattern && a . filepattern === associationItem . filepattern ) { console . warn ( "Overwriting filepattern <<" + associationItem . filepattern + ">> to now point to mime <<" + associationItem . mime + ">>" ) ; } if ( associationItem . firstline && a . firstline === associationItem . firstline ) { console . warn ( "Overwriting firstline <<" + associationItem . firstline + ">> to now point to mime <<" + associationItem . mime + ">>" ) ; } } ) ; } }
Associate a text mime to the registry.
Associate a text mime to the registry .
// Register // Check for conflicts unless this is a user configured association // same mime or userConfigured is ok