mirror of
https://github.com/chrononeko/chronocat.git
synced 2024-11-21 22:58:10 +00:00
feat(shell): api: support api.has()
This commit is contained in:
parent
f62febad1e
commit
73164c4cdc
@ -21,6 +21,8 @@ export type Api = {
|
||||
method: M,
|
||||
impl: (...args: Methods[M][0]) => Promise<Methods[M][1]>,
|
||||
) => void
|
||||
|
||||
has: <M extends keyof Methods>(method: M) => boolean
|
||||
}
|
||||
|
||||
const buildNotimpl = (name: string) => {
|
||||
@ -74,3 +76,5 @@ api.register =
|
||||
api[method].engine = engine
|
||||
api[method].priority = newPriority
|
||||
}
|
||||
|
||||
api.has = <M extends keyof Methods>(method: M) => !api[method].notimpl
|
||||
|
Loading…
Reference in New Issue
Block a user