@caido/sdk-frontend 0.58.3-beta.4 → 0.58.3

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.
@@ -1,69 +0,0 @@
1
- import type { KVEvents, KVValue } from "../types/kv";
2
- import type { ListenerHandle } from "../types/utils";
3
- /**
4
- * Options for defining a key-value pair.
5
- * @category KV
6
- */
7
- export type KVDefineOptions = {
8
- /**
9
- * Whether the key-value pair is exportable.
10
- *
11
- * Usually this should be true for keys that are settings that you would want to
12
- * transfer between Caido instances.
13
- *
14
- * @default false
15
- */
16
- exportable?: boolean | undefined;
17
- };
18
- /**
19
- * The SDK for the key-value store.
20
- *
21
- * Plugin package data shared across frontend and backend surfaces of the same
22
- * plugin package. Not per-user; separate from {@link StorageSDK}.
23
- *
24
- * @category KV
25
- */
26
- export type KVSDK = {
27
- /**
28
- * Defines a new key-value pair. Only call this once per key.
29
- * If the key is not defined, it will be created at first set with default options.
30
- * Defining a key alone does not notify listeners.
31
- *
32
- * @param key The key to define.
33
- * @param options The options for the key.
34
- */
35
- define: (key: string, options: KVDefineOptions) => Promise<void>;
36
- /**
37
- * Gets a value from the key-value store.
38
- *
39
- * @param key The key to get.
40
- * @returns The stored value (including null) or undefined if the key is not defined.
41
- */
42
- get: <T extends KVValue>(key: string) => Promise<T | undefined>;
43
- /**
44
- * Sets a value in the key-value store.
45
- *
46
- * @param key The key to set.
47
- * @param value The value to set.
48
- */
49
- set: <T extends KVValue>(key: string, value: T) => Promise<void>;
50
- /**
51
- * Deletes a key-value pair from the key-value store.
52
- *
53
- * No-op if the key is not defined.
54
- *
55
- * @param key The key to delete.
56
- */
57
- del: (key: string) => Promise<void>;
58
- /**
59
- * Registers a callback for when a key-value pair is set.
60
- *
61
- * Fires for writes from any surface of the plugin package, including the
62
- * local writer.
63
- *
64
- * @param event The event to register for.
65
- * @param callback The callback to register.
66
- * @returns A handle to stop listening.
67
- */
68
- on: <E extends keyof KVEvents>(event: E, callback: KVEvents[E]) => ListenerHandle;
69
- };
@@ -1,3 +0,0 @@
1
- export type HTTPQLEditorProps = {
2
- isReadOnly?: boolean;
3
- };
@@ -1,16 +0,0 @@
1
- /**
2
- * Represents any valid value for the key-value store.
3
- * It needs to be serializable to JSON.
4
- * @category KV
5
- */
6
- export type KVValue = string | number | boolean | KVValue[] | null | {
7
- [key: string]: KVValue;
8
- };
9
- /**
10
- * Represents the events that can be emitted by the key-value store.
11
- * @category KV
12
- */
13
- export type KVEvents = {
14
- set: <T extends KVValue>(key: string, value: T) => Promise<void> | void;
15
- delete: (key: string) => Promise<void> | void;
16
- };