Skip to content

Commit

Permalink
feat(VSCode): Define metadata API
Browse files Browse the repository at this point in the history
  • Loading branch information
lordrip committed Sep 16, 2024
1 parent c3cf5e0 commit bd46bba
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions packages/ui/src/multiplying-architecture/KaotoEditorChannelApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,32 @@ export interface KaotoEditorChannelApi extends KogitoEditorChannelApi {
* Returns the Kaoto VSCode settings defined.
*/
getVSCodeKaotoSettings(): Promise<ISettingsModel>;

/**
* Get metadata querying a Kaoto metadata file.
* @param path The path of the file being edited
* @param key The key to retrieve the preferences
*/
getMetadata<T>(path: string, key: string): Promise<T | undefined>;

/**
* Save preferences to a Kaoto metadata file.
* @param path The path of the file being edited
* @param key The key to set the preferences
* @param metadata The preferences to be saved
*/
setMetadata<T>(path: string, key: string, metadata: T): Promise<void>;

/**
* Retrieve resource content
* @param path The path of the resource, relative to the file being edited
*/
getResourceContent(path: string): Promise<string | undefined>;

/**
* Save resource content
* @param path The path of the resource, relative to the file being edited
* @param content The content to be saved
*/
saveResourceContent(path: string, content: string): Promise<void>;
}

0 comments on commit bd46bba

Please sign in to comment.