@koishijs/core
Advanced tools
Comparing version 4.8.7 to 4.9.0
@@ -6,2 +6,3 @@ import * as utils from '@koishijs/utils'; | ||
import { Database, Driver, Result, Update } from '@minatojs/core'; | ||
import { segment } from '@satorijs/core'; | ||
import { Disposable, GetEvents, Parameters, ReturnType, ThisType } from 'cordis'; | ||
@@ -16,4 +17,4 @@ import { version } from '../package.json'; | ||
getSelfIds(type?: string, assignees?: string[]): Dict<string[]>; | ||
broadcast(content: string, forced?: boolean): Promise<string[]>; | ||
broadcast(channels: readonly string[], content: string, forced?: boolean): Promise<string[]>; | ||
broadcast(content: string | segment, forced?: boolean): Promise<string[]>; | ||
broadcast(channels: readonly string[], content: string | segment, forced?: boolean): Promise<string[]>; | ||
} | ||
@@ -70,3 +71,3 @@ export interface User { | ||
createChannel(platform: string, id: string, data: Partial<Channel>): Promise<Channel>; | ||
broadcast(...args: [string, boolean?] | [readonly string[], string, boolean?]): Promise<any[]>; | ||
broadcast(...args: [string | segment, boolean?] | [readonly string[], string | segment, boolean?]): Promise<any[]>; | ||
} | ||
@@ -87,9 +88,9 @@ export const defineDriver: <T>(constructor: Driver.Constructor<T>, schema?: utils.Schema, prepare?: Plugin.Function<T>) => Plugin.Object<T, any>; | ||
} | ||
export type Next = (next?: Next.Callback) => Promise<void | string>; | ||
export type Middleware = (session: Session, next: Next) => Awaitable<void | string>; | ||
export type Next = (next?: Next.Callback) => Promise<void | string | segment>; | ||
export type Middleware = (session: Session, next: Next) => Awaitable<void | string | segment>; | ||
export namespace Next { | ||
const MAX_DEPTH = 64; | ||
type Queue = ((next?: Next) => Awaitable<void | string>)[]; | ||
type Callback = void | string | ((next?: Next) => Awaitable<void | string>); | ||
function compose(callback: Callback, next?: Next): Promise<string | void>; | ||
type Queue = ((next?: Next) => Awaitable<void | string | segment>)[]; | ||
type Callback = void | string | ((next?: Next) => Awaitable<void | string | segment>); | ||
function compose(callback: Callback, next?: Next): Promise<string | void | segment>; | ||
} | ||
@@ -161,2 +162,6 @@ export namespace Internal { | ||
export function interpolate(initiator: string, terminator: string, parse?: (source: string) => Argv): void; | ||
export namespace whitespace { | ||
const unescape: (source: string) => string; | ||
const escape: (source: string) => string; | ||
} | ||
export class Tokenizer { | ||
@@ -258,3 +263,3 @@ private bracs; | ||
} | ||
type Action<U extends User.Field = never, G extends Channel.Field = never, A extends any[] = any[], O extends {} = {}> = (argv: Argv<U, G, A, O>, ...args: A) => Awaitable<void | string>; | ||
type Action<U extends User.Field = never, G extends Channel.Field = never, A extends any[] = any[], O extends {} = {}> = (argv: Argv<U, G, A, O>, ...args: A) => Awaitable<void | string | segment>; | ||
type Usage<U extends User.Field = never, G extends Channel.Field = never> = string | ((session: Session<U, G>) => Awaitable<string>); | ||
@@ -305,3 +310,3 @@ } | ||
use<T extends Command, R extends any[]>(callback: (command: this, ...args: R) => T, ...args: R): T; | ||
execute(argv: Argv<U, G, A, O>, fallback?: typeof Next.compose): Promise<string>; | ||
execute(argv: Argv<U, G, A, O>, fallback?: typeof Next.compose): Promise<string | segment>; | ||
dispose(): void; | ||
@@ -380,13 +385,10 @@ } | ||
scope?: string; | ||
private _promise; | ||
private _queuedTasks; | ||
private _queuedTimeout; | ||
constructor(bot: satori.Bot<Context>, payload: Partial<Session.Payload>); | ||
private _preprocess; | ||
preprocess(): Promise<string>; | ||
get username(): string; | ||
send(content: string): Promise<string[]>; | ||
send(content: string | satori.segment): Promise<string[]>; | ||
cancelQueued(delay?: number): void; | ||
private _next; | ||
sendQueued(content: string, delay?: number): Promise<string[]>; | ||
sendQueued(content: string | satori.segment, delay?: number): Promise<string[]>; | ||
resolveValue<T>(source: T | ((session: Session) => T)): T; | ||
@@ -424,2 +426,3 @@ getChannel<K extends Channel.Field = never>(id?: string, fields?: K[]): Promise<any>; | ||
}; | ||
export { resolveConfig } from 'cordis'; | ||
export type { Disposable } from 'cordis'; | ||
@@ -476,3 +479,3 @@ export interface Events<C extends Context = Context> extends satori.Events<C> { | ||
getGuildMemberMap(guildId: string): Promise<Dict<string>>; | ||
broadcast(channels: (string | [string, string])[], content: string, delay?: number): Promise<string[]>; | ||
broadcast(channels: (string | [string, string])[], content: string | satori.segment, delay?: number): Promise<string[]>; | ||
} | ||
@@ -479,0 +482,0 @@ } |
{ | ||
"name": "@koishijs/core", | ||
"description": "Core Features for Koishi", | ||
"version": "4.8.7", | ||
"version": "4.9.0", | ||
"main": "lib/index.cjs", | ||
@@ -33,8 +33,7 @@ "module": "lib/index.mjs", | ||
"dependencies": { | ||
"@koishijs/utils": "^6.1.1", | ||
"@koishijs/utils": "^6.1.2", | ||
"@minatojs/core": "^1.3.0", | ||
"@satorijs/core": "^1.0.11", | ||
"cordis": "^2.1.1", | ||
"fastest-levenshtein": "^1.0.14" | ||
"@satorijs/core": "^1.1.0", | ||
"cordis": "^2.1.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
441421
4
4509
- Removedfastest-levenshtein@^1.0.14
- Removedfastest-levenshtein@1.0.16(transitive)
Updated@koishijs/utils@^6.1.2
Updated@satorijs/core@^1.1.0