@k8slens/extensions 5.4.0-git.9b9b8e0d05.0 → 5.4.0-git.9c604dcfa1.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.
@@ -2,12 +2,12 @@
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
- import { Disposer, ExtendedMap } from "../utils";
5
+ import type { Disposer } from "../utils";
6
6
  import { CatalogCategory, CatalogEntityData, CatalogEntityKindData } from "./catalog-entity";
7
7
  export declare type CategoryFilter = (category: CatalogCategory) => any;
8
8
  export declare class CatalogCategoryRegistry {
9
9
  protected categories: import("mobx").ObservableSet<CatalogCategory>;
10
- protected groupKinds: ExtendedMap<string, ExtendedMap<string, CatalogCategory>>;
10
+ protected groupKinds: Map<string, Map<string, CatalogCategory>>;
11
11
  protected filters: import("mobx").ObservableSet<CategoryFilter>;
12
12
  constructor();
13
13
  add(category: CatalogCategory): Disposer;
@@ -3,7 +3,7 @@
3
3
  * Licensed under MIT License. See LICENSE in root directory for more information.
4
4
  */
5
5
  import { BaseStore } from "../base-store";
6
- import { EditorConfiguration, ExtensionRegistry, KubeconfigSyncValue, UserPreferencesModel, TerminalConfig } from "./preferences-helpers";
6
+ import type { EditorConfiguration, ExtensionRegistry, KubeconfigSyncValue, UserPreferencesModel, TerminalConfig } from "./preferences-helpers";
7
7
  export interface UserStoreModel {
8
8
  lastSeenAppVersion: string;
9
9
  preferences: UserPreferencesModel;
@@ -11,8 +11,8 @@
11
11
  */
12
12
  export declare function getOrInsert<K, V>(map: Map<K, V>, key: K, value: V): V;
13
13
  /**
14
- * Like `getOrInsert` but specifically for when `V` is `Map<any, any>` so that
15
- * the typings are inferred.
14
+ * Like `getOrInsert` but specifically for when `V` is `Map<MK, MV>` so that
15
+ * the typings are inferred correctly.
16
16
  */
17
17
  export declare function getOrInsertMap<K, MK, MV>(map: Map<K, Map<MK, MV>>, key: K): Map<MK, MV>;
18
18
  /**
@@ -21,9 +21,23 @@ export declare function getOrInsertMap<K, MK, MV>(map: Map<K, Map<MK, MV>>, key:
21
21
  */
22
22
  export declare function getOrInsertSet<K, SK>(map: Map<K, Set<SK>>, key: K): Set<SK>;
23
23
  /**
24
- * Like `getOrInsert` but with delayed creation of the item
24
+ * Like `getOrInsert` but with delayed creation of the item. Which is useful
25
+ * if it is very expensive to create the initial value.
26
+ */
27
+ export declare function getOrInsertWith<K, V>(map: Map<K, V>, key: K, builder: () => V): V;
28
+ /**
29
+ * Set the value associated with `key` iff there was not a previous value
30
+ * @param map The map to interact with
31
+ * @throws if `key` already in map
32
+ * @returns `this` so that `strictSet` can be chained
33
+ */
34
+ export declare function strictSet<K, V>(map: Map<K, V>, key: K, val: V): typeof map;
35
+ /**
36
+ * Get the value associated with `key`
37
+ * @param map The map to interact with
38
+ * @throws if `key` did not a value associated with it
25
39
  */
26
- export declare function getOrInsertWith<K, V>(map: Map<K, V>, key: K, value: () => V): V;
40
+ export declare function strictGet<K, V>(map: Map<K, V>, key: K): V;
27
41
  /**
28
42
  * If `key` is in `set`, remove it otherwise add it.
29
43
  * @param set The set to manipulate
@@ -21,13 +21,12 @@ export * from "./delay";
21
21
  export * from "./disposer";
22
22
  export * from "./downloadFile";
23
23
  export * from "./escapeRegExp";
24
- export * from "./extended-map";
25
24
  export * from "./formatDuration";
26
25
  export * from "./getRandId";
27
26
  export * from "./hash-set";
28
27
  export * from "./n-fircate";
29
28
  export * from "./objects";
30
- export * from "./openExternal";
29
+ export * from "./openBrowser";
31
30
  export * from "./paths";
32
31
  export * from "./promise-exec";
33
32
  export * from "./reject-promise";
@@ -6,6 +6,5 @@
6
6
  * A better typed version of `Object.fromEntries` where the keys are known to
7
7
  * be a specific subset
8
8
  */
9
- export declare function fromEntries<T, Key extends string>(entries: Iterable<readonly [Key, T]>): {
10
- [k in Key]: T;
11
- };
9
+ export declare function fromEntries<T, Key extends string>(entries: Iterable<readonly [Key, T]>): Record<Key, T>;
10
+ export declare function entries<T extends Record<string, any>>(obj: T): [keyof T, T[keyof T]][];
@@ -0,0 +1,17 @@
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
+ * Opens a link using the program configured as the default browser
7
+ * on the target platform. Will reject URLs with a scheme other than
8
+ * http or https to prevent programs other than the default browser
9
+ * running.
10
+ *
11
+ * @param url The URL to open
12
+ */
13
+ export declare function openBrowser(url: string): Promise<void>;
14
+ /**
15
+ * @deprecated use openBrowser
16
+ */
17
+ export declare const openExternal: typeof openBrowser;
@@ -2,6 +2,6 @@
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 { Singleton, openExternal } from "../../common/utils";
5
+ export { Singleton, openExternal, openBrowser } from "../../common/utils";
6
6
  export { prevDefault, stopPropagation } from "../../renderer/utils/prevDefault";
7
7
  export { cssNames } from "../../renderer/utils/cssNames";