import { FILE_KNOWN_ATTRS, FILE_REQUIRED_ATTRS, FILE_TOKEN, FILE_TO_LINK_ATTRS_MAP, FileHtmlAttr, } from '@diplodoc/file-extension';
export const yfmFileNodeName = FILE_TOKEN;
export const YfmFileAttr = {
    Markup: 'data-markup',
    Name: FileHtmlAttr.Download,
    Link: FileHtmlAttr.Href,
    ReferrerPolicy: FileHtmlAttr.ReferrerPolicy,
    Rel: FileHtmlAttr.Rel,
    Target: FileHtmlAttr.Target,
    Type: FileHtmlAttr.Type,
    Lang: FileHtmlAttr.HrefLang,
};
export const YFM_FILE_DIRECTIVE_ATTRS = [
    YfmFileAttr.ReferrerPolicy,
    YfmFileAttr.Rel,
    YfmFileAttr.Target,
    YfmFileAttr.Type,
    YfmFileAttr.Lang,
];
export const KNOWN_ATTRS = FILE_KNOWN_ATTRS.map((attrName) => {
    if (attrName in FILE_TO_LINK_ATTRS_MAP)
        return FILE_TO_LINK_ATTRS_MAP[attrName];
    return attrName;
});
export const REQUIRED_ATTRS = FILE_REQUIRED_ATTRS.map((attrName) => {
    if (attrName in FILE_TO_LINK_ATTRS_MAP)
        return FILE_TO_LINK_ATTRS_MAP[attrName];
    return attrName;
});
export const fileNodeAttrsSpec = {
    [YfmFileAttr.Markup]: { default: null },
};
for (const attrName of KNOWN_ATTRS) {
    const attrSpec = (fileNodeAttrsSpec[attrName] = {});
    if (!REQUIRED_ATTRS.includes(attrName)) {
        attrSpec.default = null;
    }
}
export const LINK_TO_FILE_ATTRS_MAP = {};
for (const [key, value] of Object.entries(FILE_TO_LINK_ATTRS_MAP)) {
    LINK_TO_FILE_ATTRS_MAP[value] = key;
}
//# sourceMappingURL=const.js.map
