@caido/sdk-backend 0.42.1-beta.3 → 0.43.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 +2 -2
- package/src/typing.d.ts +24 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caido/sdk-backend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.0",
|
|
4
4
|
"description": "Typing for the Caido Backend SDK",
|
|
5
5
|
"author": "Caido Labs Inc. <dev@caido.io>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"src/*"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@caido/quickjs-types": "^0.
|
|
12
|
+
"@caido/quickjs-types": "^0.12.0",
|
|
13
13
|
"@caido/sdk-shared": "^0.1.0"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
package/src/typing.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ declare module "caido:plugin" {
|
|
|
8
8
|
Response,
|
|
9
9
|
ReplaySDK,
|
|
10
10
|
ProjectsSDK,
|
|
11
|
+
Project,
|
|
11
12
|
} from "caido:utils";
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -81,6 +82,29 @@ declare module "caido:plugin" {
|
|
|
81
82
|
response: Response,
|
|
82
83
|
) => MaybePromise<void>,
|
|
83
84
|
): void;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Registers an callback on project change.
|
|
88
|
+
*
|
|
89
|
+
* This callback is called asynchronously and cannot modify the project.
|
|
90
|
+
*
|
|
91
|
+
* It can happen that the project is null if the user deleted the currently selected one.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* sdk.events.onProjectChange((sdk, project) => {
|
|
96
|
+
* if (project !== null) {
|
|
97
|
+
* // Do something with the project
|
|
98
|
+
* }
|
|
99
|
+
* });
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
onProjectChange(
|
|
103
|
+
callback: (
|
|
104
|
+
sdk: SDK<API, Events>,
|
|
105
|
+
project: Project | null,
|
|
106
|
+
) => MaybePromise<void>,
|
|
107
|
+
): void;
|
|
84
108
|
};
|
|
85
109
|
|
|
86
110
|
/**
|