feat(shell): update ctx

This commit is contained in:
Il Harper 2024-03-05 21:22:13 +08:00
parent 07f282420d
commit 18ffcdbad1
No known key found for this signature in database
GPG Key ID: 4B71FCA698E7E8EC
2 changed files with 10 additions and 0 deletions

View File

@ -14,6 +14,8 @@ import { uix } from './services/uix'
import { validate } from './services/validate'
import type { ChronocatContext, Engine } from './types'
import { PLATFORM } from './utils/consts'
import { exists } from './utils/fs'
import { sleep, timeout } from './utils/time'
export * from './satori/types'
export * from './services/config/configEntity'
@ -34,11 +36,14 @@ export const chronocat = async () => {
api,
baseDir,
emit: emitter.emit,
exists,
getAuthData,
getConfig,
getSelfProfile,
l,
platform: PLATFORM,
sleep,
timeout,
uix,
validate,
whenReady: () => readyPromise,

View File

@ -14,17 +14,22 @@ import type { getSelfProfile } from './services/selfProfile'
import type { uix } from './services/uix'
import type { validate } from './services/validate'
import type { PLATFORM } from './utils/consts'
import type { exists } from './utils/fs'
import type { sleep, timeout } from './utils/time'
export interface ChronocatContext {
chronocat: {
api: typeof api
baseDir: typeof baseDir
emit: (message: DispatchMessage) => void
exists: typeof exists
getAuthData: typeof getAuthData
getConfig: typeof getConfig
getSelfProfile: typeof getSelfProfile
l: typeof l
platform: typeof PLATFORM
sleep: typeof sleep
timeout: typeof timeout
uix: typeof uix
validate: typeof validate
whenReady: () => Promise<void>