Commit 1663c611 authored by nanahira's avatar nanahira

use selection from koishi package

parent 423388c6
import { import {
App,
Argv, Argv,
BeforeEventMap,
Channel,
Command, Command,
Context, Context,
EventMap, EventMap,
FieldCollector, FieldCollector,
MaybeArray,
Modules, Modules,
Plugin, Plugin,
Session, Session,
User, Selection,
} from 'koishi'; } from 'koishi';
import { KoishiPluginRegistrationOptions, PluginClass } from '../register'; import { KoishiPluginRegistrationOptions, PluginClass } from '../register';
import type { DefaultContext, DefaultState, ParameterizedContext } from 'koa'; import type { DefaultContext, DefaultState, ParameterizedContext } from 'koa';
...@@ -21,25 +17,6 @@ export interface Type<T = any> extends Function { ...@@ -21,25 +17,6 @@ export interface Type<T = any> extends Function {
new (...args: any[]): T; new (...args: any[]): T;
} }
const selectors = [
'user',
'guild',
'channel',
'self',
'private',
'platform',
] as const;
type SelectorType = typeof selectors[number];
type SelectorValue = boolean | MaybeArray<string | number>;
type BaseSelection = { [K in SelectorType as `$${K}`]?: SelectorValue };
export interface Selection extends BaseSelection {
$and?: Selection[];
$or?: Selection[];
$not?: Selection;
}
export interface ContextSelector { export interface ContextSelector {
select?: Selection; select?: Selection;
useSelector?: OnContextFunction; useSelector?: OnContextFunction;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment