mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Upgrade to latest for all linting deps (#4755)
* Upgrade to eslint latest Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix OOM error Signed-off-by: Sebastian Malton <sebastian@malton.name> * resolve PR comments Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
2ad78c2a86
commit
38790eb886
35 files changed
+284
-470
No files matched your search
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type { CatalogEntity } from "../../../../common/catalog";
|
||||
|
||||
/**
|
||||
* The context given to commands when executed
|
||||
*/
|
||||
export interface CommandContext {
|
||||
entity?: CatalogEntity;
|
||||
}
|
||||
|
||||
export interface CommandActionNavigateOptions {
|
||||
/**
|
||||
* If `true` then the navigate will only navigate on the root frame and not
|
||||
* within a cluster
|
||||
* @default false
|
||||
*/
|
||||
forceRootFrame?: boolean;
|
||||
}
|
||||
|
||||
export interface CommandActionContext extends CommandContext {
|
||||
navigate: (url: string, opts?: CommandActionNavigateOptions) => void;
|
||||
}
|
||||
|
||||
export interface CommandRegistration {
|
||||
/**
|
||||
* The ID of the command, must be globally unique
|
||||
*/
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* The display name of the command in the command pallet
|
||||
*/
|
||||
title: string | ((context: CommandContext) => string);
|
||||
|
||||
/**
|
||||
* @deprecated use `isActive` instead since there is always an entity active
|
||||
*/
|
||||
scope?: "global" | "entity";
|
||||
|
||||
/**
|
||||
* The function to run when this command is selected
|
||||
*/
|
||||
action: (context: CommandActionContext) => void;
|
||||
|
||||
/**
|
||||
* A function that determines if the command is active.
|
||||
*
|
||||
* @default () => true
|
||||
*/
|
||||
isActive?: (context: CommandContext) => boolean;
|
||||
}
|
||||
|
||||
export type RegisteredCommand = Required<Omit<CommandRegistration, "scope">>;
|
||||
Reference in new issue
Block a user