mirror of
https://github.com/chrononeko/chronocat.git
synced 2024-11-21 22:58:10 +00:00
feat(shell): mime: implement extend mime svc
This commit is contained in:
parent
c56844a5b4
commit
784966e4cc
@ -8,6 +8,7 @@ import { getConfig } from './services/config'
|
||||
import type { ChronocatLogCurrentConfig } from './services/config/configEntity'
|
||||
import { emitter } from './services/emitter'
|
||||
import { l } from './services/logger'
|
||||
import { mime } from './services/mime'
|
||||
import { getSelfProfile, setSelfProfile } from './services/selfProfile'
|
||||
import { uix } from './services/uix'
|
||||
import { validate } from './services/validate'
|
||||
@ -50,6 +51,7 @@ export const chronocat = () => {
|
||||
getSelfProfile,
|
||||
h,
|
||||
l,
|
||||
mime,
|
||||
platform: PLATFORM,
|
||||
sleep,
|
||||
timeout,
|
||||
|
7
packages/shell/src/services/mime.ts
Normal file
7
packages/shell/src/services/mime.ts
Normal file
@ -0,0 +1,7 @@
|
||||
// Should be 'mime/lite' but there's hoist pollution
|
||||
import { Mime } from 'mime/dist/src/index_lite'
|
||||
import mimeStandard from 'mime/types/standard.js'
|
||||
|
||||
export const mime = new Mime().define(mimeStandard).define({
|
||||
'audio/silk': ['slk', 'silk', 'ntsilk'],
|
||||
})
|
@ -47,6 +47,7 @@ import type {
|
||||
ChronocatSatoriServerConfig,
|
||||
} from './services/config/configEntity'
|
||||
import type { l } from './services/logger'
|
||||
import type { mime } from './services/mime'
|
||||
import type { getSelfProfile } from './services/selfProfile'
|
||||
import type { uix } from './services/uix'
|
||||
import type { validate } from './services/validate'
|
||||
@ -65,6 +66,7 @@ export interface ChronocatContext {
|
||||
getSelfProfile: typeof getSelfProfile
|
||||
h: typeof h
|
||||
l: typeof l
|
||||
mime: typeof mime
|
||||
platform: typeof PLATFORM
|
||||
sleep: typeof sleep
|
||||
timeout: typeof timeout
|
||||
|
Loading…
Reference in New Issue
Block a user