@caido/sdk-frontend 0.48.2-beta.2 → 0.48.2-beta.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caido/sdk-frontend",
3
- "version": "0.48.2-beta.2",
3
+ "version": "0.48.2-beta.4",
4
4
  "description": "Typing for the Caido Frontend SDK",
5
5
  "author": "Caido Labs Inc. <dev@caido.io>",
6
6
  "license": "MIT",
@@ -1,7 +1,10 @@
1
+ import { type Extension } from "@codemirror/state";
1
2
  import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent, type DefineAddToSlotFn } from "./slots";
2
3
  import type { ID } from "./utils";
3
4
  export declare const ReplaySlot: {
4
- readonly SessionToolbar: "session-toolbar";
5
+ readonly SessionToolbarPrimary: "session-toolbar-primary";
6
+ readonly SessionToolbarSecondary: "session-toolbar-secondary";
7
+ readonly Topbar: "topbar";
5
8
  };
6
9
  export type ReplaySlot = (typeof ReplaySlot)[keyof typeof ReplaySlot];
7
10
  /**
@@ -121,8 +124,37 @@ export type ReplaySDK = {
121
124
  * Add a component to a slot.
122
125
  * @param slot The slot to add the component to.
123
126
  * @param content The content to add to the slot.
127
+ * @example
128
+ * ```ts
129
+ * addToSlot(ReplaySlot.SessionToolbar, {
130
+ * kind: "Command",
131
+ * commandId: "my-command",
132
+ * icon: "my-icon",
133
+ * });
134
+ *
135
+ * addToSlot(ReplaySlot.SessionToolbar, {
136
+ * kind: "Custom",
137
+ * component: MyComponent,
138
+ * });
139
+ *
140
+ * addToSlot(ReplaySlot.SessionToolbar, {
141
+ * kind: "Button",
142
+ * label: "My Button",
143
+ * icon: "my-icon",
144
+ * onClick: () => {
145
+ * console.log("Button clicked");
146
+ * },
147
+ * });
148
+ * ```
124
149
  */
125
150
  addToSlot: DefineAddToSlotFn<{
126
- [ReplaySlot.SessionToolbar]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
151
+ [ReplaySlot.SessionToolbarPrimary]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
152
+ [ReplaySlot.SessionToolbarSecondary]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
153
+ [ReplaySlot.Topbar]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
127
154
  }>;
155
+ /**
156
+ * Add an extension to the request editor.
157
+ * @param extension The extension to add.
158
+ */
159
+ addRequestEditorExtension: (extension: Extension) => void;
128
160
  };