mirror of
https://github.com/sern-handler/handler
synced 2026-06-27 18:22:14 +00:00
refactor: move and update things
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { CommandModuleDefs } from '../../types/module';
|
||||
import type { CommandModule, CommandModuleDefs } from '../../types/module';
|
||||
import type { CommandType, ModuleStore } from '../structures';
|
||||
import type { Processed } from '../../types/handler';
|
||||
/**
|
||||
@@ -25,3 +25,16 @@ export class DefaultModuleManager implements ModuleManager {
|
||||
strat(this.moduleStore);
|
||||
}
|
||||
}
|
||||
|
||||
export type ModuleGetter = (accessStrat: (ms: ModuleStore) => Processed<CommandModule>|undefined) => Processed<CommandModule>|undefined
|
||||
export function createModuleGetter(moduleManager: ModuleManager) {
|
||||
return (accessStrat: (ms: ModuleStore) => Processed<CommandModule>|undefined) => {
|
||||
return moduleManager.get(accessStrat)
|
||||
}
|
||||
}
|
||||
|
||||
export function createModuleInserter(moduleManager: ModuleManager) {
|
||||
return (insertStrat: (ms: ModuleStore) => void) => {
|
||||
return moduleManager.set(insertStrat)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user