Skip to content

Commit 6bb30c0

Browse files
committed
0.45.2-beta.0
1 parent 33de899 commit 6bb30c0

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

packages/sdk-frontend/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@caido/sdk-frontend",
3-
"version": "v0.45.1",
3+
"version": "0.45.2-beta.0",
44
"description": "Typing for the Caido Frontend SDK",
55
"author": "Caido Labs Inc. <[email protected]>",
66
"license": "MIT",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Utilities to interact with the plugin's static assets.
3+
* @category Files
4+
*/
5+
export type AssetsSDK = {
6+
/**
7+
* Get a file from the assets folder.
8+
* @returns The asset file.
9+
*/
10+
get: (path: string) => Promise<Asset>;
11+
};
12+
/**
13+
* A static asset.
14+
* @category Files
15+
*/
16+
type Asset = {
17+
asReadableStream: () => ReadableStream;
18+
asArrayBuffer: () => Promise<ArrayBuffer>;
19+
asString: () => Promise<string>;
20+
asJson: <T = unknown>() => Promise<T>;
21+
};
22+
export {};

packages/sdk-frontend/src/types/index.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Sdk as GraphqlSDK } from "./__generated__/graphql-sdk";
2+
import type { AssetsSDK } from "./assets";
23
import type { BackendEndpoints, BackendEvents, BackendSDK } from "./backend";
34
import type { CommandPaletteSDK } from "./commandPalette";
45
import type { CommandsSDK } from "./commands";
@@ -74,6 +75,10 @@ export type API<T extends BackendEndpoints = Record<string, never>, E extends Ba
7475
* Utilities to interact with frontend-plugin storage.
7576
*/
7677
storage: StorageSDK;
78+
/**
79+
* Utilities to interact with the plugin's static assets.
80+
*/
81+
assets: AssetsSDK;
7782
/**
7883
* Utilities to interact with shortcuts.
7984
*/

0 commit comments

Comments
 (0)