mirror of
https://github.com/bs-community/blessing-skin-plugins.git
synced 2025-01-08 11:37:27 +08:00
fix types
This commit is contained in:
parent
f85b3cb294
commit
329af60d74
8
types.ts
8
types.ts
@ -26,7 +26,7 @@ export function t(key: string, params?: object) {
|
||||
}
|
||||
|
||||
export const fetch = {
|
||||
async get<T = any>(url: string, params?: Record<string, string>): Promise<T> {
|
||||
async get<T = any>(url: string, params?: Record<string, any>): Promise<T> {
|
||||
url
|
||||
params
|
||||
return {} as T
|
||||
@ -50,8 +50,12 @@ export const fetch = {
|
||||
|
||||
const emitter = new EventEmitter()
|
||||
export const event = {
|
||||
on(eventName: string | symbol, listener: (...args: any[]) => any): void {
|
||||
on(eventName: string | symbol, listener: (...args: any[]) => any): () => void {
|
||||
emitter.on(eventName, listener)
|
||||
|
||||
return () => {
|
||||
emitter.off(eventName, listener)
|
||||
}
|
||||
},
|
||||
emit(eventName: string | symbol, payload?: object): void {
|
||||
emitter.emit(eventName, payload)
|
||||
|
Loading…
Reference in New Issue
Block a user