Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/resources/scripts/modes.ts
7458 views
1
export interface Mode {
2
name: string;
3
mime: string;
4
mimes?: string[];
5
mode: string;
6
ext?: string[];
7
alias?: string[];
8
file?: RegExp;
9
}
10
11
const modes: Mode[] = [
12
{ name: 'C', mime: 'text/x-csrc', mode: 'clike', ext: ['c', 'h', 'ino'] },
13
{
14
name: 'C++',
15
mime: 'text/x-c++src',
16
mode: 'clike',
17
ext: ['cpp', 'c++', 'cc', 'cxx', 'hpp', 'h++', 'hh', 'hxx'],
18
alias: ['cpp'],
19
},
20
{ name: 'C#', mime: 'text/x-csharp', mode: 'clike', ext: ['cs'], alias: ['csharp', 'cs'] },
21
{ name: 'CSS', mime: 'text/css', mode: 'css', ext: ['css'] },
22
{ name: 'CQL', mime: 'text/x-cassandra', mode: 'sql', ext: ['cql'] },
23
{ name: 'Diff', mime: 'text/x-diff', mode: 'diff', ext: ['diff', 'patch'] },
24
{ name: 'Dockerfile', mime: 'text/x-dockerfile', mode: 'dockerfile', file: /^Dockerfile$/ },
25
{ name: 'Git Markdown', mime: 'text/x-gfm', mode: 'gfm', file: /^(readme|contributing|history|license).md$/i },
26
{ name: 'Golang', mime: 'text/x-go', mode: 'go', ext: ['go'] },
27
{ name: 'HTML', mime: 'text/html', mode: 'htmlmixed', ext: ['html', 'htm', 'handlebars', 'hbs'], alias: ['xhtml'] },
28
{ name: 'HTTP', mime: 'message/http', mode: 'http' },
29
{
30
name: 'JavaScript',
31
mime: 'text/javascript',
32
mimes: [
33
'text/javascript',
34
'text/ecmascript',
35
'application/javascript',
36
'application/x-javascript',
37
'application/ecmascript',
38
],
39
mode: 'javascript',
40
ext: ['js'],
41
alias: ['ecmascript', 'js', 'node'],
42
},
43
{
44
name: 'JSON',
45
mime: 'application/json',
46
mimes: ['application/json', 'application/x-json'],
47
mode: 'javascript',
48
ext: ['json', 'map'],
49
alias: ['json5'],
50
},
51
{ name: 'Lua', mime: 'text/x-lua', mode: 'lua', ext: ['lua'] },
52
{ name: 'Markdown', mime: 'text/x-markdown', mode: 'markdown', ext: ['markdown', 'md', 'mkd'] },
53
{ name: 'MariaDB', mime: 'text/x-mariadb', mode: 'sql' },
54
{ name: 'MS SQL', mime: 'text/x-mssql', mode: 'sql' },
55
{ name: 'MySQL', mime: 'text/x-mysql', mode: 'sql' },
56
{ name: 'Nginx', mime: 'text/x-nginx-conf', mode: 'nginx', file: /nginx.*\.conf$/i },
57
{
58
name: 'PHP',
59
mime: 'text/x-php',
60
mimes: ['text/x-php', 'application/x-httpd-php', 'application/x-httpd-php-open'],
61
mode: 'php',
62
ext: ['php', 'php3', 'php4', 'php5', 'php7', 'phtml'],
63
},
64
{ name: 'Plain Text', mime: 'text/plain', mode: 'null', ext: ['txt', 'text', 'conf', 'def', 'list', 'log'] },
65
{ name: 'PostgreSQL', mime: 'text/x-pgsql', mode: 'sql' },
66
{
67
name: 'Properties',
68
mime: 'text/x-properties',
69
mode: 'properties',
70
ext: ['properties', 'ini', 'in'],
71
alias: ['ini', 'properties'],
72
},
73
{ name: 'Pug', mime: 'text/x-pug', mimes: ['text/x-pug', 'text/x-jade'], mode: 'null', ext: ['pug'] },
74
{
75
name: 'Python',
76
mime: 'text/x-python',
77
mode: 'python',
78
ext: ['BUILD', 'bzl', 'py', 'pyw'],
79
file: /^(BUCK|BUILD)$/,
80
},
81
{ name: 'Ruby', mime: 'text/x-ruby', mode: 'ruby', ext: ['rb'], alias: ['jruby', 'macruby', 'rake', 'rb', 'rbx'] },
82
{ name: 'Rust', mime: 'text/x-rustsrc', mode: 'rust', ext: ['rs'] },
83
{ name: 'Sass', mime: 'text/x-sass', mode: 'sass', ext: ['sass'] },
84
{ name: 'SCSS', mime: 'text/x-scss', mode: 'css', ext: ['scss'] },
85
{
86
name: 'Shell',
87
mime: 'text/x-sh',
88
mimes: ['text/x-sh', 'application/x-sh'],
89
mode: 'shell',
90
ext: ['sh', 'ksh', 'bash'],
91
alias: ['bash', 'sh', 'zsh'],
92
file: /^PKGBUILD$/,
93
},
94
{ name: 'SQL', mime: 'text/x-sql', mode: 'sql', ext: ['sql'] },
95
{ name: 'SQLite', mime: 'text/x-sqlite', mode: 'sql' },
96
{ name: 'TOML', mime: 'text/x-toml', mode: 'toml', ext: ['toml'] },
97
{ name: 'TypeScript', mime: 'application/typescript', mode: 'javascript', ext: ['ts'], alias: ['ts'] },
98
{ name: 'Vue', mime: 'script/x-vue', mimes: ['script/x-vue', 'text/x-vue'], mode: 'vue', ext: ['vue'] },
99
{
100
name: 'XML',
101
mime: 'application/xml',
102
mimes: ['application/xml', 'text/xml'],
103
mode: 'xml',
104
ext: ['xml', 'xsl', 'xsd', 'svg'],
105
alias: ['rss', 'wsdl', 'xsd'],
106
},
107
{
108
name: 'YAML',
109
mime: 'text/x-yaml',
110
mimes: ['text/x-yaml', 'text/yaml'],
111
mode: 'yaml',
112
ext: ['yaml', 'yml'],
113
alias: ['yml'],
114
},
115
];
116
117
export default modes;
118
119