chore(deps): update lint (#2233)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
This commit is contained in:
parent
603e10b6ca
commit
67d5d5c00a
18 changed files with 349 additions and 270 deletions
|
@ -52,6 +52,9 @@ export type ResolvedCommand = Exclude<CommandProvider, 'icon' | 'name' | 'descri
|
|||
bindings: string[] | undefined
|
||||
}
|
||||
|
||||
// TODO: define a type for command arg
|
||||
export type CommandHandler<T = void> = (arg: T) => void
|
||||
|
||||
export interface BaseQueryResultItem {
|
||||
index: number
|
||||
type: string
|
||||
|
@ -78,7 +81,7 @@ export interface QueryResult {
|
|||
grouped: Map<CommandScopeNames, QueryResultItem[]>
|
||||
}
|
||||
|
||||
function r<T extends Object | undefined>(i: T | (() => T)): T {
|
||||
function resolveFunction<T>(i: T): T extends () => infer R ? R : T {
|
||||
return typeof i === 'function' ? i() : i
|
||||
}
|
||||
|
||||
|
@ -90,10 +93,10 @@ export const useCommandRegistry = defineStore('command', () => {
|
|||
.filter(command => command.visible ? command.visible() : true)
|
||||
.map(provider => ({
|
||||
...provider,
|
||||
icon: r(provider.icon),
|
||||
name: r(provider.name),
|
||||
description: r(provider.description),
|
||||
bindings: r(provider.bindings),
|
||||
icon: resolveFunction(provider.icon),
|
||||
name: resolveFunction(provider.name),
|
||||
description: resolveFunction(provider.description),
|
||||
bindings: resolveFunction(provider.bindings),
|
||||
})))
|
||||
|
||||
let lastScope = ''
|
||||
|
|
|
@ -33,7 +33,7 @@ export function useIsMac() {
|
|||
?? navigator?.platform?.includes('Mac') ?? false)
|
||||
}
|
||||
|
||||
export function isEmptyObject(object: Object) {
|
||||
export function isEmptyObject(object: object) {
|
||||
return Object.keys(object).length === 0
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ export function useDeactivated() {
|
|||
*
|
||||
* for handling problems caused by the keepalive function
|
||||
*/
|
||||
export function onReactivated(hook: Function, target?: ComponentInternalInstance | null): void {
|
||||
export function onReactivated(hook: () => void, target?: ComponentInternalInstance | null): void {
|
||||
const initial = ref(true)
|
||||
onActivated(() => {
|
||||
if (initial.value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue