From 18ffcdbad1292ec5f0359439216b4f8ced043555 Mon Sep 17 00:00:00 2001 From: Il Harper Date: Tue, 5 Mar 2024 21:22:13 +0800 Subject: [PATCH] feat(shell): update ctx --- packages/shell/src/index.ts | 5 +++++ packages/shell/src/types.ts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/packages/shell/src/index.ts b/packages/shell/src/index.ts index 1a2d8b0..0fab35f 100644 --- a/packages/shell/src/index.ts +++ b/packages/shell/src/index.ts @@ -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, diff --git a/packages/shell/src/types.ts b/packages/shell/src/types.ts index c11c3ac..0179b8c 100644 --- a/packages/shell/src/types.ts +++ b/packages/shell/src/types.ts @@ -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