Skip to content

Commit

Permalink
0.45.2-beta.0
Browse files Browse the repository at this point in the history
  • Loading branch information
caidobot committed Jan 14, 2025
1 parent 33de899 commit 6bb30c0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/sdk-frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@caido/sdk-frontend",
"version": "v0.45.1",
"version": "0.45.2-beta.0",
"description": "Typing for the Caido Frontend SDK",
"author": "Caido Labs Inc. <[email protected]>",
"license": "MIT",
Expand Down
22 changes: 22 additions & 0 deletions packages/sdk-frontend/src/types/assets.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Utilities to interact with the plugin's static assets.
* @category Files
*/
export type AssetsSDK = {
/**
* Get a file from the assets folder.
* @returns The asset file.
*/
get: (path: string) => Promise<Asset>;
};
/**
* A static asset.
* @category Files
*/
type Asset = {
asReadableStream: () => ReadableStream;
asArrayBuffer: () => Promise<ArrayBuffer>;
asString: () => Promise<string>;
asJson: <T = unknown>() => Promise<T>;
};
export {};
5 changes: 5 additions & 0 deletions packages/sdk-frontend/src/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Sdk as GraphqlSDK } from "./__generated__/graphql-sdk";
import type { AssetsSDK } from "./assets";
import type { BackendEndpoints, BackendEvents, BackendSDK } from "./backend";
import type { CommandPaletteSDK } from "./commandPalette";
import type { CommandsSDK } from "./commands";
Expand Down Expand Up @@ -74,6 +75,10 @@ export type API<T extends BackendEndpoints = Record<string, never>, E extends Ba
* Utilities to interact with frontend-plugin storage.
*/
storage: StorageSDK;
/**
* Utilities to interact with the plugin's static assets.
*/
assets: AssetsSDK;
/**
* Utilities to interact with shortcuts.
*/
Expand Down

0 comments on commit 6bb30c0

Please sign in to comment.