feat(shell): inject h & styles

This commit is contained in:
Il Harper 2024-03-06 10:40:54 +08:00
parent c983cb77ba
commit e2c201c8c4
No known key found for this signature in database
GPG Key ID: 4B71FCA698E7E8EC
2 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,4 @@
import h from '@satorijs/element'
import styles from 'ansi-styles' import styles from 'ansi-styles'
import { mkdirSync, readdirSync } from 'node:fs' import { mkdirSync, readdirSync } from 'node:fs'
import { join } from 'node:path' import { join } from 'node:path'
@ -40,9 +41,11 @@ export const chronocat = async () => {
getAuthData, getAuthData,
getConfig, getConfig,
getSelfProfile, getSelfProfile,
h,
l, l,
platform: PLATFORM, platform: PLATFORM,
sleep, sleep,
styles,
timeout, timeout,
uix, uix,
validate, validate,

View File

@ -1,4 +1,6 @@
import type { QFace } from '@chronocat/red' import type { QFace } from '@chronocat/red'
import type h from '@satorijs/element'
import type styles from 'ansi-styles'
import type { O } from 'ts-toolbelt' import type { O } from 'ts-toolbelt'
import type { Event, Message, MessageCreatePayload } from './satori/types' import type { Event, Message, MessageCreatePayload } from './satori/types'
import type { api } from './services/api' import type { api } from './services/api'
@ -26,9 +28,11 @@ export interface ChronocatContext {
getAuthData: typeof getAuthData getAuthData: typeof getAuthData
getConfig: typeof getConfig getConfig: typeof getConfig
getSelfProfile: typeof getSelfProfile getSelfProfile: typeof getSelfProfile
h: typeof h
l: typeof l l: typeof l
platform: typeof PLATFORM platform: typeof PLATFORM
sleep: typeof sleep sleep: typeof sleep
styles: typeof styles
timeout: typeof timeout timeout: typeof timeout
uix: typeof uix uix: typeof uix
validate: typeof validate validate: typeof validate
@ -68,7 +72,13 @@ export interface Methods {
// Internal // Internal
'chronocat.internal.message.create.forward': [
[MessageCreatePayload],
Message[],
]
'chronocat.internal.assets.get': [[string], string] 'chronocat.internal.assets.get': [[string], string]
'chronocat.internal.qface.get': [[string], QFace | undefined] 'chronocat.internal.qface.get': [[string], QFace | undefined]
'chronocat.internal.qface.list': [[], QFace[] | undefined] 'chronocat.internal.qface.list': [[], QFace[] | undefined]
} }