@k8slens/extensions 5.3.1-git.b7cb10521e.0 → 5.3.1-git.b7d29f8c49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/src/common/catalog/catalog-entity.d.ts +69 -3
  2. package/dist/src/common/routes/preferences.d.ts +2 -0
  3. package/dist/src/common/user-store/preferences-helpers.d.ts +7 -1
  4. package/dist/src/common/user-store/user-store.d.ts +2 -1
  5. package/dist/src/common/utils/__tests__/bind.test.d.ts +1 -0
  6. package/dist/src/common/utils/collection-functions.d.ts +12 -0
  7. package/dist/src/common/utils/index.d.ts +5 -0
  8. package/dist/src/common/vars.d.ts +3 -0
  9. package/dist/src/extensions/common-api/registrations.d.ts +1 -1
  10. package/dist/src/extensions/extension-api.js +33 -33
  11. package/dist/src/extensions/lens-renderer-extension.d.ts +4 -1
  12. package/dist/src/extensions/registries/index.d.ts +0 -1
  13. package/dist/src/extensions/renderer-api/components.d.ts +1 -0
  14. package/dist/src/main/routes/port-forward/port-forward.d.ts +0 -2
  15. package/dist/src/renderer/components/+catalog/__tests__/custom-columns.test.d.ts +5 -0
  16. package/dist/src/renderer/components/+catalog/custom-category-columns.d.ts +74 -0
  17. package/dist/src/renderer/components/+catalog/custom-category-columns.injectable.d.ts +5 -0
  18. package/dist/src/renderer/components/+catalog/get-category-columns.injectable.d.ts +9 -0
  19. package/dist/src/renderer/components/+catalog/internal-category-columns.d.ts +8 -0
  20. package/dist/src/renderer/components/+preferences/app-preferences/app-preferences.injectable.d.ts +7 -0
  21. package/dist/src/renderer/components/+preferences/app-preferences/get-app-preferences.d.ts +12 -0
  22. package/dist/src/renderer/components/+preferences/application.d.ts +4 -1
  23. package/dist/src/renderer/components/+preferences/extension-settings.d.ts +2 -2
  24. package/dist/src/renderer/components/+preferences/extensions.d.ts +4 -1
  25. package/dist/src/renderer/components/+preferences/preferences.d.ts +3 -6
  26. package/dist/src/renderer/components/+preferences/telemetry.d.ts +4 -1
  27. package/dist/src/renderer/components/+preferences/terminal.d.ts +5 -0
  28. package/dist/src/renderer/components/dock/terminal/terminal.d.ts +3 -0
  29. package/dist/src/renderer/components/input/input.d.ts +1 -0
  30. package/dist/src/renderer/components/table/table-cell.d.ts +37 -0
  31. package/dist/src/renderer/components/wizard/wizard.d.ts +3 -1
  32. package/package.json +1 -1
  33. package/dist/src/extensions/registries/app-preference-registry.d.ts +0 -22
@@ -5,6 +5,7 @@
5
5
  /// <reference types="react" />
6
6
  import type TypedEmitter from "typed-emitter";
7
7
  import { Disposer } from "../utils";
8
+ import type { CategoryColumnRegistration } from "../../renderer/components/+catalog/custom-category-columns";
8
9
  declare type ExtractEntityMetadataType<Entity> = Entity extends CatalogEntity<infer Metadata> ? Metadata : never;
9
10
  declare type ExtractEntityStatusType<Entity> = Entity extends CatalogEntity<any, infer Status> ? Status : never;
10
11
  declare type ExtractEntitySpecType<Entity> = Entity extends CatalogEntity<any, any, infer Spec> ? Spec : never;
@@ -40,6 +41,9 @@ export interface CatalogCategorySpec {
40
41
  * `name = "v1alpha1"` then the resulting `.apiVersion` MUST be `entity.k8slens.dev/v1alpha1`
41
42
  */
42
43
  versions: CatalogCategoryVersion<CatalogEntity>[];
44
+ /**
45
+ * This is the concerning the category
46
+ */
43
47
  names: {
44
48
  /**
45
49
  * The kind of entity that this category is for. This value MUST be a DNS
@@ -48,30 +52,92 @@ export interface CatalogCategorySpec {
48
52
  */
49
53
  kind: string;
50
54
  };
55
+ /**
56
+ * These are the columns used for displaying entities when in the catalog.
57
+ *
58
+ * If this is not provided then some default columns will be used, similar in
59
+ * scope to the columns in the "Browse" view.
60
+ *
61
+ * Even if you provide columns, a "Name" column will be provided as well with
62
+ * `priority: 0`.
63
+ *
64
+ * These columns will not be used in the "Browse" view.
65
+ */
66
+ displayColumns?: CategoryColumnRegistration[];
51
67
  }
52
68
  /**
53
- * If the filter returns true, the menu item is displayed
69
+ * If the filter return a thruthy value, the menu item is displayed
54
70
  */
55
71
  export declare type AddMenuFilter = (menu: CatalogEntityAddMenu) => any;
56
72
  export interface CatalogCategoryEvents {
73
+ /**
74
+ * This event will be emitted when the category is loaded in the catalog
75
+ * view.
76
+ */
57
77
  load: () => void;
78
+ /**
79
+ * This event will be emitted when the catalog add menu is opened and is the
80
+ * way to added entries to that menu.
81
+ */
58
82
  catalogAddMenu: (context: CatalogEntityAddMenuContext) => void;
83
+ /**
84
+ * This event will be emitted when the context menu for an entity is declared
85
+ * by this category is opened.
86
+ */
59
87
  contextMenuOpen: (entity: CatalogEntity, context: CatalogEntityContextMenuContext) => void;
60
88
  }
61
89
  declare const CatalogCategory_base: new () => TypedEmitter<CatalogCategoryEvents>;
62
90
  export declare abstract class CatalogCategory extends CatalogCategory_base {
91
+ /**
92
+ * The version of category that you are wanting to declare.
93
+ *
94
+ * Currently supported values:
95
+ *
96
+ * - `"catalog.k8slens.dev/v1alpha1"`
97
+ */
63
98
  abstract readonly apiVersion: string;
99
+ /**
100
+ * The kind of item you wish to declare.
101
+ *
102
+ * Currently supported values:
103
+ *
104
+ * - `"CatalogCategory"`
105
+ */
64
106
  abstract readonly kind: string;
65
- abstract metadata: {
107
+ /**
108
+ * The data about the category itself
109
+ */
110
+ abstract readonly metadata: {
111
+ /**
112
+ * The name of your category. The category can be searched for by this
113
+ * value. This will also be used for the catalog menu.
114
+ */
66
115
  name: string;
116
+ /**
117
+ * Either an `<svg>` or the name of an icon from {@link IconProps}
118
+ */
67
119
  icon: string;
68
120
  };
121
+ /**
122
+ * The most important part of a category, as it is where entity versions are declared.
123
+ */
69
124
  abstract spec: CatalogCategorySpec;
125
+ /**
126
+ * @internal
127
+ */
70
128
  protected filters: import("mobx").ObservableSet<AddMenuFilter>;
71
- static parseId(id?: string): {
129
+ /**
130
+ * Parse a category ID into parts.
131
+ * @param id The id of a category is parse
132
+ * @returns The group and kind parts of the ID
133
+ */
134
+ static parseId(id: string): {
72
135
  group?: string;
73
136
  kind?: string;
74
137
  };
138
+ /**
139
+ * Get the ID of this category
140
+ */
75
141
  getId(): string;
76
142
  /**
77
143
  * Add a filter for menu items of catalogAddMenu
@@ -10,6 +10,7 @@ export declare const kubernetesRoute: RouteProps;
10
10
  export declare const editorRoute: RouteProps;
11
11
  export declare const telemetryRoute: RouteProps;
12
12
  export declare const extensionRoute: RouteProps;
13
+ export declare const terminalRoute: RouteProps;
13
14
  export declare const preferencesURL: ({ params, query, fragment }?: import("../utils/buildUrl").URLParams<{}, {}>) => string;
14
15
  export declare const appURL: ({ params, query, fragment }?: import("../utils/buildUrl").URLParams<{}, {}>) => string;
15
16
  export declare const proxyURL: ({ params, query, fragment }?: import("../utils/buildUrl").URLParams<{}, {}>) => string;
@@ -17,3 +18,4 @@ export declare const kubernetesURL: ({ params, query, fragment }?: import("../ut
17
18
  export declare const editorURL: ({ params, query, fragment }?: import("../utils/buildUrl").URLParams<{}, {}>) => string;
18
19
  export declare const telemetryURL: ({ params, query, fragment }?: import("../utils/buildUrl").URLParams<{}, {}>) => string;
19
20
  export declare const extensionURL: ({ params, query, fragment }?: import("../utils/buildUrl").URLParams<{}, {}>) => string;
21
+ export declare const terminalURL: ({ params, query, fragment }?: import("../utils/buildUrl").URLParams<{}, {}>) => string;
@@ -10,7 +10,12 @@ export interface KubeconfigSyncEntry extends KubeconfigSyncValue {
10
10
  }
11
11
  export interface KubeconfigSyncValue {
12
12
  }
13
- export declare type EditorConfiguration = Pick<editor.IStandaloneEditorConstructionOptions, "minimap" | "tabSize" | "lineNumbers">;
13
+ export interface TerminalConfig {
14
+ fontSize: number;
15
+ fontFamily: string;
16
+ }
17
+ export declare const defaultTerminalConfig: TerminalConfig;
18
+ export declare type EditorConfiguration = Pick<editor.IStandaloneEditorConstructionOptions, "minimap" | "tabSize" | "lineNumbers" | "fontSize" | "fontFamily">;
14
19
  export declare const defaultEditorConfig: EditorConfiguration;
15
20
  interface PreferenceDescription<T, R = T> {
16
21
  fromStore(val: T | undefined): R;
@@ -62,6 +67,7 @@ export declare const DESCRIPTORS: {
62
67
  syncKubeconfigEntries: PreferenceDescription<KubeconfigSyncEntry[], Map<string, KubeconfigSyncValue>>;
63
68
  editorConfiguration: PreferenceDescription<EditorConfiguration, EditorConfiguration>;
64
69
  terminalCopyOnSelect: PreferenceDescription<boolean, boolean>;
70
+ terminalConfig: PreferenceDescription<TerminalConfig, TerminalConfig>;
65
71
  updateChannel: PreferenceDescription<string, string>;
66
72
  extensionRegistryUrl: PreferenceDescription<ExtensionRegistry, ExtensionRegistry>;
67
73
  };
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { BaseStore } from "../base-store";
6
6
  import { ObservableToggleSet } from "../../renderer/utils";
7
- import { EditorConfiguration, ExtensionRegistry, KubeconfigSyncValue, UserPreferencesModel } from "./preferences-helpers";
7
+ import { EditorConfiguration, ExtensionRegistry, KubeconfigSyncValue, UserPreferencesModel, TerminalConfig } from "./preferences-helpers";
8
8
  export interface UserStoreModel {
9
9
  lastSeenAppVersion: string;
10
10
  preferences: UserPreferencesModel;
@@ -31,6 +31,7 @@ export declare class UserStore extends BaseStore<UserStoreModel> {
31
31
  downloadBinariesPath?: string;
32
32
  kubectlBinariesPath?: string;
33
33
  terminalCopyOnSelect: boolean;
34
+ terminalConfig: TerminalConfig;
34
35
  updateChannel?: string;
35
36
  extensionRegistryUrl: ExtensionRegistry;
36
37
  /**
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright (c) OpenLens Authors. All rights reserved.
3
+ * Licensed under MIT License. See LICENSE in root directory for more information.
4
+ */
5
+ /**
6
+ * Get the value behind `key`. If it was not present, first insert `value`
7
+ * @param map The map to interact with
8
+ * @param key The key to insert into the map with
9
+ * @param value The value to optional add to the map
10
+ * @returns The value in the map
11
+ */
12
+ export declare function getOrInsert<K, V>(map: Map<K, V>, key: K, value: V): V;
@@ -6,11 +6,16 @@
6
6
  * A function that does nothing
7
7
  */
8
8
  export declare function noop<T extends any[]>(...args: T): void;
9
+ /**
10
+ * A typecorrect version of <function>.bind()
11
+ */
12
+ export declare function bind<BoundArgs extends any[], NonBoundArgs extends any[], ReturnType>(fn: (...args: [...BoundArgs, ...NonBoundArgs]) => ReturnType, thisArg: any, ...boundArgs: BoundArgs): (...args: NonBoundArgs) => ReturnType;
9
13
  export * from "./app-version";
10
14
  export * from "./autobind";
11
15
  export * from "./camelCase";
12
16
  export * from "./cloneJson";
13
17
  export * from "./cluster-id-url-parsing";
18
+ export * from "./collection-functions";
14
19
  export * from "./convertCpu";
15
20
  export * from "./convertMemory";
16
21
  export * from "./debouncePromise";
@@ -18,6 +18,9 @@ export declare const productName: string;
18
18
  export declare const appName: string;
19
19
  export declare const publicPath: string;
20
20
  export declare const defaultTheme: string;
21
+ export declare const defaultFontSize = 12;
22
+ export declare const defaultTerminalFontFamily = "RobotoMono";
23
+ export declare const defaultEditorFontFamily = "RobotoMono";
21
24
  export declare const contextDir: string;
22
25
  export declare const buildDir: string;
23
26
  export declare const preloadEntrypoint: string;
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) OpenLens Authors. All rights reserved.
3
3
  * Licensed under MIT License. See LICENSE in root directory for more information.
4
4
  */
5
- export type { AppPreferenceRegistration, AppPreferenceComponents } from "../registries/app-preference-registry";
5
+ export type { AppPreferenceRegistration, AppPreferenceComponents } from "../../renderer/components/+preferences/app-preferences/app-preference-registration";
6
6
  export type { KubeObjectDetailRegistration, KubeObjectDetailComponents } from "../registries/kube-object-detail-registry";
7
7
  export type { KubeObjectMenuRegistration, KubeObjectMenuComponents } from "../registries/kube-object-menu-registry";
8
8
  export type { KubeObjectStatusRegistration } from "../registries/kube-object-status-registry";