@caido/sdk-frontend 0.48.2-beta.10 → 0.48.2-beta.11
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/types/footer.d.ts +43 -0
- package/src/types/index.d.ts +6 -0
package/package.json
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent, type DefineAddToSlotFn } from "./slots";
|
|
2
|
+
export declare const FooterSlot: {
|
|
3
|
+
readonly FooterSlotPrimary: "footer-primary";
|
|
4
|
+
readonly FooterSlotSecondary: "footer-secondary";
|
|
5
|
+
};
|
|
6
|
+
export type FooterSlot = (typeof FooterSlot)[keyof typeof FooterSlot];
|
|
7
|
+
/**
|
|
8
|
+
* Utilities to interact with the footer.
|
|
9
|
+
* @category Footer
|
|
10
|
+
*/
|
|
11
|
+
export type FooterSDK = {
|
|
12
|
+
/**
|
|
13
|
+
* Add a component to a slot.
|
|
14
|
+
* @param slot The slot to add the component to.
|
|
15
|
+
* @param content The content to add to the slot.
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* addToSlot(FooterSlot.FooterSlotPrimary, {
|
|
19
|
+
* kind: "Command",
|
|
20
|
+
* commandId: "my-command",
|
|
21
|
+
* icon: "my-icon",
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* addToSlot(FooterSlot.FooterSlotPrimary, {
|
|
25
|
+
* kind: "Button",
|
|
26
|
+
* label: "My button",
|
|
27
|
+
* icon: "fas fa-rocket",
|
|
28
|
+
* onClick: () => {
|
|
29
|
+
* console.log("Button clicked");
|
|
30
|
+
* },
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* addToSlot(FooterSlot.FooterSlotSecondary, {
|
|
34
|
+
* kind: "Custom",
|
|
35
|
+
* component: MyComponent,
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
addToSlot: DefineAddToSlotFn<{
|
|
40
|
+
[FooterSlot.FooterSlotPrimary]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
|
|
41
|
+
[FooterSlot.FooterSlotSecondary]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
|
|
42
|
+
}>;
|
|
43
|
+
};
|
package/src/types/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { EnvironmentSDK } from "./environment";
|
|
|
7
7
|
import type { FilesSDK } from "./files";
|
|
8
8
|
import type { FiltersSDK } from "./filters";
|
|
9
9
|
import type { FindingsSDK } from "./findings";
|
|
10
|
+
import type { FooterSDK } from "./footer";
|
|
10
11
|
import type { HTTPHistorySDK } from "./httpHistory";
|
|
11
12
|
import type { InterceptSDK } from "./intercept";
|
|
12
13
|
import type { MatchReplaceSDK } from "./matchReplace";
|
|
@@ -23,6 +24,7 @@ import type { StorageSDK } from "./storage";
|
|
|
23
24
|
import type { UISDK } from "./ui";
|
|
24
25
|
import type { WindowSDK } from "./window";
|
|
25
26
|
import type { WorkflowSDK } from "./workflows";
|
|
27
|
+
export { FooterSlot } from "./footer";
|
|
26
28
|
export type { DialogOptions } from "./window";
|
|
27
29
|
export type { CommandContext } from "./commands";
|
|
28
30
|
export type { MenuItem } from "./menu";
|
|
@@ -141,4 +143,8 @@ export type API<T extends BackendEndpoints = Record<string, never>, E extends Ba
|
|
|
141
143
|
* Utilities to interact with workflows.
|
|
142
144
|
*/
|
|
143
145
|
workflows: WorkflowSDK;
|
|
146
|
+
/**
|
|
147
|
+
* Utilities to interact with the footer.
|
|
148
|
+
*/
|
|
149
|
+
footer: FooterSDK;
|
|
144
150
|
};
|