onedrive/utils/getPreviewType.ts
2021-10-06 05:28:40 +08:00

69 lines
1.2 KiB
TypeScript

const preview = {
markdown: 'markdown',
image: 'image',
text: 'text',
pdf: 'pdf',
code: 'code',
video: 'video',
audio: 'audio',
office: 'ms-office',
epub: 'epub',
}
const extensions = {
gif: preview.image,
jpeg: preview.image,
jpg: preview.image,
png: preview.image,
webp: preview.image,
md: preview.markdown,
markdown: preview.markdown,
mdown: preview.markdown,
pdf: preview.pdf,
doc: preview.office,
docx: preview.office,
ppt: preview.office,
pptx: preview.office,
xls: preview.office,
xlsx: preview.office,
c: preview.code,
cpp: preview.code,
js: preview.code,
java: preview.code,
sh: preview.code,
cs: preview.code,
py: preview.code,
css: preview.code,
html: preview.code,
ts: preview.code,
vue: preview.code,
json: preview.code,
yaml: preview.code,
toml: preview.code,
txt: preview.text,
mp4: preview.video,
flv: preview.video,
webm: preview.video,
m3u8: preview.video,
mkv: preview.video,
avi: preview.video, // won't work!
mp3: preview.audio,
m4a: preview.audio,
aac: preview.audio,
wav: preview.audio,
ogg: preview.audio,
oga: preview.audio,
opus: preview.audio,
flac: preview.audio,
epub: preview.epub,
}
export { extensions, preview }