2020-09-16 05:53:23 +02:00
|
|
|
export interface Mode {
|
2022-06-26 21:13:52 +02:00
|
|
|
name: string;
|
|
|
|
mime: string;
|
|
|
|
mimes?: string[];
|
|
|
|
mode: string;
|
|
|
|
ext?: string[];
|
|
|
|
alias?: string[];
|
|
|
|
file?: RegExp;
|
2020-09-16 05:53:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
const modes: Mode[] = [
|
2022-06-26 21:13:52 +02:00
|
|
|
{ name: 'C', mime: 'text/x-csrc', mode: 'clike', ext: ['c', 'h', 'ino'] },
|
|
|
|
{
|
|
|
|
name: 'C++',
|
|
|
|
mime: 'text/x-c++src',
|
|
|
|
mode: 'clike',
|
|
|
|
ext: ['cpp', 'c++', 'cc', 'cxx', 'hpp', 'h++', 'hh', 'hxx'],
|
|
|
|
alias: ['cpp'],
|
|
|
|
},
|
|
|
|
{ name: 'C#', mime: 'text/x-csharp', mode: 'clike', ext: ['cs'], alias: ['csharp', 'cs'] },
|
|
|
|
{ name: 'CSS', mime: 'text/css', mode: 'css', ext: ['css'] },
|
|
|
|
{ name: 'CQL', mime: 'text/x-cassandra', mode: 'sql', ext: ['cql'] },
|
|
|
|
{ name: 'Diff', mime: 'text/x-diff', mode: 'diff', ext: ['diff', 'patch'] },
|
2020-09-16 05:53:23 +02:00
|
|
|
{ name: 'Dockerfile', mime: 'text/x-dockerfile', mode: 'dockerfile', file: /^Dockerfile$/ },
|
|
|
|
{ name: 'Git Markdown', mime: 'text/x-gfm', mode: 'gfm', file: /^(readme|contributing|history|license).md$/i },
|
2022-06-26 21:13:52 +02:00
|
|
|
{ name: 'Golang', mime: 'text/x-go', mode: 'go', ext: ['go'] },
|
|
|
|
{ name: 'HTML', mime: 'text/html', mode: 'htmlmixed', ext: ['html', 'htm', 'handlebars', 'hbs'], alias: ['xhtml'] },
|
2020-09-16 05:53:23 +02:00
|
|
|
{ name: 'HTTP', mime: 'message/http', mode: 'http' },
|
2022-06-26 21:13:52 +02:00
|
|
|
{
|
|
|
|
name: 'JavaScript',
|
|
|
|
mime: 'text/javascript',
|
|
|
|
mimes: [
|
|
|
|
'text/javascript',
|
|
|
|
'text/ecmascript',
|
|
|
|
'application/javascript',
|
|
|
|
'application/x-javascript',
|
|
|
|
'application/ecmascript',
|
|
|
|
],
|
|
|
|
mode: 'javascript',
|
|
|
|
ext: ['js'],
|
|
|
|
alias: ['ecmascript', 'js', 'node'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'JSON',
|
|
|
|
mime: 'application/json',
|
|
|
|
mimes: ['application/json', 'application/x-json'],
|
|
|
|
mode: 'javascript',
|
|
|
|
ext: ['json', 'map'],
|
|
|
|
alias: ['json5'],
|
|
|
|
},
|
|
|
|
{ name: 'Lua', mime: 'text/x-lua', mode: 'lua', ext: ['lua'] },
|
|
|
|
{ name: 'Markdown', mime: 'text/x-markdown', mode: 'markdown', ext: ['markdown', 'md', 'mkd'] },
|
2020-09-16 05:53:23 +02:00
|
|
|
{ name: 'MariaDB', mime: 'text/x-mariadb', mode: 'sql' },
|
|
|
|
{ name: 'MS SQL', mime: 'text/x-mssql', mode: 'sql' },
|
|
|
|
{ name: 'MySQL', mime: 'text/x-mysql', mode: 'sql' },
|
|
|
|
{ name: 'Nginx', mime: 'text/x-nginx-conf', mode: 'nginx', file: /nginx.*\.conf$/i },
|
2022-06-26 21:13:52 +02:00
|
|
|
{
|
|
|
|
name: 'PHP',
|
|
|
|
mime: 'text/x-php',
|
|
|
|
mimes: ['text/x-php', 'application/x-httpd-php', 'application/x-httpd-php-open'],
|
|
|
|
mode: 'php',
|
|
|
|
ext: ['php', 'php3', 'php4', 'php5', 'php7', 'phtml'],
|
|
|
|
},
|
|
|
|
{ name: 'Plain Text', mime: 'text/plain', mode: 'null', ext: ['txt', 'text', 'conf', 'def', 'list', 'log'] },
|
2020-09-16 05:53:23 +02:00
|
|
|
{ name: 'PostgreSQL', mime: 'text/x-pgsql', mode: 'sql' },
|
2022-06-26 21:13:52 +02:00
|
|
|
{
|
|
|
|
name: 'Properties',
|
|
|
|
mime: 'text/x-properties',
|
|
|
|
mode: 'properties',
|
|
|
|
ext: ['properties', 'ini', 'in'],
|
|
|
|
alias: ['ini', 'properties'],
|
|
|
|
},
|
|
|
|
{ name: 'Pug', mime: 'text/x-pug', mimes: ['text/x-pug', 'text/x-jade'], mode: 'null', ext: ['pug'] },
|
|
|
|
{
|
|
|
|
name: 'Python',
|
|
|
|
mime: 'text/x-python',
|
|
|
|
mode: 'python',
|
|
|
|
ext: ['BUILD', 'bzl', 'py', 'pyw'],
|
|
|
|
file: /^(BUCK|BUILD)$/,
|
|
|
|
},
|
|
|
|
{ name: 'Ruby', mime: 'text/x-ruby', mode: 'ruby', ext: ['rb'], alias: ['jruby', 'macruby', 'rake', 'rb', 'rbx'] },
|
|
|
|
{ name: 'Rust', mime: 'text/x-rustsrc', mode: 'rust', ext: ['rs'] },
|
|
|
|
{ name: 'Sass', mime: 'text/x-sass', mode: 'sass', ext: ['sass'] },
|
|
|
|
{ name: 'SCSS', mime: 'text/x-scss', mode: 'css', ext: ['scss'] },
|
|
|
|
{
|
|
|
|
name: 'Shell',
|
|
|
|
mime: 'text/x-sh',
|
|
|
|
mimes: ['text/x-sh', 'application/x-sh'],
|
|
|
|
mode: 'shell',
|
|
|
|
ext: ['sh', 'ksh', 'bash'],
|
|
|
|
alias: ['bash', 'sh', 'zsh'],
|
|
|
|
file: /^PKGBUILD$/,
|
|
|
|
},
|
|
|
|
{ name: 'SQL', mime: 'text/x-sql', mode: 'sql', ext: ['sql'] },
|
2020-09-16 05:53:23 +02:00
|
|
|
{ name: 'SQLite', mime: 'text/x-sqlite', mode: 'sql' },
|
2022-06-26 21:13:52 +02:00
|
|
|
{ name: 'TOML', mime: 'text/x-toml', mode: 'toml', ext: ['toml'] },
|
|
|
|
{ name: 'TypeScript', mime: 'application/typescript', mode: 'javascript', ext: ['ts'], alias: ['ts'] },
|
|
|
|
{ name: 'Vue', mime: 'script/x-vue', mimes: ['script/x-vue', 'text/x-vue'], mode: 'vue', ext: ['vue'] },
|
|
|
|
{
|
|
|
|
name: 'XML',
|
|
|
|
mime: 'application/xml',
|
|
|
|
mimes: ['application/xml', 'text/xml'],
|
|
|
|
mode: 'xml',
|
|
|
|
ext: ['xml', 'xsl', 'xsd', 'svg'],
|
|
|
|
alias: ['rss', 'wsdl', 'xsd'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'YAML',
|
|
|
|
mime: 'text/x-yaml',
|
|
|
|
mimes: ['text/x-yaml', 'text/yaml'],
|
|
|
|
mode: 'yaml',
|
|
|
|
ext: ['yaml', 'yml'],
|
|
|
|
alias: ['yml'],
|
|
|
|
},
|
2020-09-16 05:53:23 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
export default modes;
|