44 * SPDX-License-Identifier: Apache-2.0
55 */
66
7- import {
8- Command ,
9- Message ,
10- MessageType ,
11- WebviewContext ,
12- ExecutionDetailsContext ,
13- ApiCallRequestMessage ,
14- UnsupportedMessage ,
15- } from './types'
7+ import { Command , Message , MessageType , BaseContext , ApiCallRequestMessage , UnsupportedMessage } from './types'
168import { StepFunctionApiHandler } from './stepFunctionApiHandler'
179import globals from '../../shared/extensionGlobals'
1810import { getLogger } from '../../shared/logger/logger'
@@ -21,7 +13,7 @@ import { getLogger } from '../../shared/logger/logger'
2113 * Handler for managing webview stage load, which updates load notifications.
2214 * @param context The context object containing the necessary information for the webview.
2315 */
24- export async function loadStageMessageHandler ( context : WebviewContext | ExecutionDetailsContext ) {
16+ export async function loadStageMessageHandler ( context : BaseContext ) {
2517 context . loaderNotification ?. progress . report ( { increment : 25 } )
2618 setTimeout ( ( ) => {
2719 context . loaderNotification ?. resolve ( )
@@ -33,10 +25,7 @@ export async function loadStageMessageHandler(context: WebviewContext | Executio
3325 * @param request The request message containing the API to call and the parameters
3426 * @param context The webview context used for returning the API response to the webview
3527 */
36- export function apiCallMessageHandler (
37- request : ApiCallRequestMessage ,
38- context : WebviewContext | ExecutionDetailsContext
39- ) {
28+ export function apiCallMessageHandler ( request : ApiCallRequestMessage , context : BaseContext ) {
4029 const logger = getLogger ( 'stepfunctions' )
4130 const apiHandler = new StepFunctionApiHandler ( globals . awsContext . getCredentialDefaultRegion ( ) , context )
4231 apiHandler . performApiCall ( request ) . catch ( ( error ) => logger . error ( '%s API call failed: %O' , request . apiName , error ) )
@@ -49,10 +38,7 @@ export function apiCallMessageHandler(
4938 * @param command The command received from the webview
5039 * @param messageType The type of the message received
5140 */
52- export async function handleUnsupportedMessage (
53- context : WebviewContext | ExecutionDetailsContext ,
54- originalMessage : Message
55- ) {
41+ export async function handleUnsupportedMessage ( context : BaseContext , originalMessage : Message ) {
5642 await context . panel . webview . postMessage ( {
5743 messageType : MessageType . RESPONSE ,
5844 command : Command . UNSUPPORTED_COMMAND ,
0 commit comments