@satorijs/core
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -79,3 +79,3 @@ /// <reference types="ws" /> | ||
} | ||
export interface Session extends Session.Payload { | ||
export interface Session extends Session.Payload, Satori.Session { | ||
} | ||
@@ -104,3 +104,2 @@ export namespace Session { | ||
} | ||
type EventCallback<T = void> = (this: Session, session: Session) => T; | ||
} | ||
@@ -205,27 +204,36 @@ export class Session { | ||
export { Schema, Logger, segment, segment as Element, segment as h, Quester }; | ||
type Genres = 'friend' | 'channel' | 'guild' | 'guild-member' | 'guild-role' | 'guild-file' | 'guild-emoji'; | ||
type Actions = 'added' | 'deleted' | 'updated'; | ||
export interface Events<C extends Context = Context> extends cordis.Events<C>, Record<`${Genres}-${Actions}`, Session.EventCallback> { | ||
'message': Session.EventCallback; | ||
'message-deleted': Session.EventCallback; | ||
'message-updated': Session.EventCallback; | ||
'reaction-added': Session.EventCallback; | ||
'reaction-deleted': Session.EventCallback; | ||
'reaction-deleted/one': Session.EventCallback; | ||
'reaction-deleted/all': Session.EventCallback; | ||
'reaction-deleted/emoji': Session.EventCallback; | ||
'send': Session.EventCallback; | ||
'friend-request': Session.EventCallback; | ||
'guild-request': Session.EventCallback; | ||
'guild-member-request': Session.EventCallback; | ||
'guild-member/role': Session.EventCallback; | ||
'guild-member/ban': Session.EventCallback; | ||
'guild-member/nickname': Session.EventCallback; | ||
'notice/poke': Session.EventCallback; | ||
'notice/lucky-king': Session.EventCallback; | ||
'notice/honor': Session.EventCallback; | ||
'notice/honor/talkative': Session.EventCallback; | ||
'notice/honor/performer': Session.EventCallback; | ||
'notice/honor/emotion': Session.EventCallback; | ||
'before-send': Session.EventCallback<Awaitable<void | boolean>>; | ||
declare global { | ||
namespace Satori { | ||
type Genres = 'friend' | 'channel' | 'guild' | 'guild-member' | 'guild-role' | 'guild-file' | 'guild-emoji'; | ||
type Actions = 'added' | 'deleted' | 'updated'; | ||
interface Session { | ||
} | ||
interface Events extends Record<`${Genres}-${Actions}`, {}> { | ||
'message': {}; | ||
'message-deleted': {}; | ||
'message-updated': {}; | ||
'reaction-added': {}; | ||
'reaction-deleted': {}; | ||
'reaction-deleted/one': {}; | ||
'reaction-deleted/all': {}; | ||
'reaction-deleted/emoji': {}; | ||
'send': {}; | ||
'friend-request': {}; | ||
'guild-request': {}; | ||
'guild-member-request': {}; | ||
'guild-member/role': {}; | ||
'guild-member/ban': {}; | ||
'guild-member/nickname': {}; | ||
'notice/poke': {}; | ||
'notice/lucky-king': {}; | ||
'notice/honor': {}; | ||
'notice/honor/talkative': {}; | ||
'notice/honor/performer': {}; | ||
'notice/honor/emotion': {}; | ||
} | ||
} | ||
} | ||
type EventCallback<T = void> = (this: Session, session: Session) => T; | ||
export interface Events<C extends Context = Context> extends cordis.Events<C>, Record<keyof Satori.Events, EventCallback> { | ||
'before-send': EventCallback<Awaitable<void | boolean>>; | ||
'bot-added'(client: Bot): void; | ||
@@ -232,0 +240,0 @@ 'bot-removed'(client: Bot): void; |
{ | ||
"name": "@satorijs/core", | ||
"description": "Core components of Satorijs", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"main": "lib/index.cjs", | ||
@@ -42,5 +42,5 @@ "module": "lib/index.mjs", | ||
"ws": "^8.8.1", | ||
"reggol": "^1.3.1", | ||
"reggol": "^1.3.2", | ||
"schemastery": "^3.5.4" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1203
94464
Updatedreggol@^1.3.2