Commit 98b45550 authored by nanahira's avatar nanahira

revert if things

parent 80847bda
...@@ -127,12 +127,12 @@ export const PluginName = (name: string) => ...@@ -127,12 +127,12 @@ export const PluginName = (name: string) =>
export const If = <T>( export const If = <T>(
func: Condition<boolean, T, [Record<string, any>]>, func: Condition<boolean, T, [Record<string, any>]>,
): TypedMethodDecorator<T> => ): MethodDecorator =>
Metadata.append('KoishiControl', { type: 'if', condition: func }); Metadata.append('KoishiControl', { type: 'if', condition: func });
export const For = <T>( export const For = <T>(
func: Condition<Iterable<Record<string, any>>, T, [Record<string, any>]>, func: Condition<Iterable<Record<string, any>>, T, [Record<string, any>]>,
): TypedMethodDecorator<T> => ): MethodDecorator =>
Metadata.append('KoishiControl', { type: 'for', condition: func }); Metadata.append('KoishiControl', { type: 'for', condition: func });
export const UseModel = (...models: ModelClassType[]): ClassDecorator => export const UseModel = (...models: ModelClassType[]): ClassDecorator =>
......
...@@ -48,12 +48,6 @@ export type MapPluginToConfigWithSelection<M extends Dict<PluginClass>> = { ...@@ -48,12 +48,6 @@ export type MapPluginToConfigWithSelection<M extends Dict<PluginClass>> = {
[K in keyof M]: ClassPluginConfig<M[K]> & Selection; [K in keyof M]: ClassPluginConfig<M[K]> & Selection;
}; };
export type TypedMethodDecorator<T> = <P>(
target: T,
propertyKey: string | symbol,
descriptor: TypedPropertyDescriptor<P>,
) => void;
export interface ControlTypeMap { export interface ControlTypeMap {
if: boolean; if: boolean;
for: Iterable<Record<string, any>>; for: Iterable<Record<string, any>>;
......
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