Skip to content

Commit

Permalink
0.40.1-beta.3
Browse files Browse the repository at this point in the history
  • Loading branch information
caidobot committed Aug 30, 2024
1 parent 0291f0e commit 0603822
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/sdk-frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@caido/sdk-frontend",
"version": "0.40.1-beta.2",
"version": "0.40.1-beta.3",
"description": "Typing for the Caido Frontend SDK",
"author": "Caido Labs Inc. <[email protected]>",
"license": "MIT",
Expand All @@ -10,6 +10,8 @@
"files": [
"src/*"
],
"peerDependencies": {},
"peerDependencies": {
"@codemirror/view": "^6.0.0"
},
"peerDependenciesMeta": {}
}
9 changes: 9 additions & 0 deletions packages/sdk-frontend/src/types/editor.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { EditorView } from "@codemirror/view";
/**
* Generic editor interface.
*/
Expand All @@ -21,3 +22,11 @@ export type Editor = {
*/
focus: () => void;
};
export type HTTPRequestEditor = {
getElement: () => HTMLElement;
getEditorView: () => EditorView;
};
export type HTTPResponseEditor = {
getElement: () => HTMLElement;
getEditorView: () => EditorView;
};
12 changes: 11 additions & 1 deletion packages/sdk-frontend/src/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Sdk } from "./__generated__/graphql-sdk";
import type { BackendEndpoints, BackendEvents, ToBackendRPC } from "./backend";
import type { CommandContext } from "./commands";
import type { Editor } from "./editor";
import type { Editor, HTTPRequestEditor, HTTPResponseEditor } from "./editor";
import type { Finding } from "./findings";
import type { MenuItem } from "./menu";
import type { Scope } from "./scopes";
Expand Down Expand Up @@ -59,6 +59,16 @@ export type API<T extends BackendEndpoints = Record<string, never>, E extends Ba
body?: HTMLElement;
footer?: HTMLElement;
}) => HTMLElement;
/**
* Create an HTTP request editor
* @returns The HTTP request editor.
*/
httpRequestEditor: () => HTTPRequestEditor;
/**
* Create an HTTP response editor
* @returns The HTTP response editor.
*/
httpResponseEditor: () => HTTPResponseEditor;
};
/**
* Utilities to interact with scopes
Expand Down

0 comments on commit 0603822

Please sign in to comment.