@caido/sdk-frontend 0.36.1 → 0.37.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.
- package/package.json +1 -1
- package/src/index.d.ts +1 -11
- package/src/index.js +0 -1
- package/src/types/__generated__/graphql-sdk.d.ts +1123 -582
- package/src/types/index.d.ts +2 -0
- package/src/types/storage.d.ts +14 -0
package/src/types/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { Commands } from "./commands";
|
|
|
3
3
|
import type { Menu } from "./menu";
|
|
4
4
|
import type { Navigation } from "./navigation";
|
|
5
5
|
import type { Scopes } from "./scopes";
|
|
6
|
+
import type { Storage } from "./storage";
|
|
6
7
|
import type { UI } from "./ui";
|
|
7
8
|
import type { Window } from "./window";
|
|
8
9
|
export type { CommandContext } from "./commands";
|
|
@@ -13,6 +14,7 @@ export type API = {
|
|
|
13
14
|
menu: Menu;
|
|
14
15
|
navigation: Navigation;
|
|
15
16
|
window: Window;
|
|
17
|
+
storage: Storage;
|
|
16
18
|
shortcuts: {
|
|
17
19
|
register: (commandId: string, keys: string[]) => void;
|
|
18
20
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type JSONPrimitive = string | number | boolean | null | undefined;
|
|
2
|
+
type JSONValue = JSONPrimitive | JSONValue[] | {
|
|
3
|
+
[key: string]: JSONValue;
|
|
4
|
+
};
|
|
5
|
+
type NotAssignableToJson = bigint | symbol | Function;
|
|
6
|
+
type JSONCompatible<T> = unknown extends T ? never : {
|
|
7
|
+
[P in keyof T]: T[P] extends JSONValue ? T[P] : T[P] extends NotAssignableToJson ? never : JSONCompatible<T[P]>;
|
|
8
|
+
};
|
|
9
|
+
export type Storage = {
|
|
10
|
+
get: () => JSONValue;
|
|
11
|
+
set: <T>(value: JSONCompatible<T>) => Promise<void>;
|
|
12
|
+
onChange: (callback: (value: JSONValue) => void) => void;
|
|
13
|
+
};
|
|
14
|
+
export {};
|