import { VCSFileInfo } from '../../vcs/models/vcs-file-info.model.js';

import { DataPowerAssemblyDocument } from '../../common/models/datapower-assembly.interface.js';
import { APICFileInfo } from '../../apic-mode/models/apic-file-info.model.js';

export interface DataPowerAssemblyAction {
  /**
   * Updates active policy sequence for the form view
   * @param fileHandle Policy sequence file handle
   * @returns
   */
  setActiveDataPowerAssemblySeq: (
    fileHandle: FileSystemFileHandle | VCSFileInfo | APICFileInfo,
  ) => Promise<void>;

  /**
   * Accepts two params document and fileHandle, document is from assmebly-canvas component
   * fileHandle contains file name
   * @param document
   * @param fileHandle
   * @returns
   */

  updateDataPowerAssembly: (
    document: DataPowerAssemblyDocument,
    fileHandle: FileSystemFileHandle | VCSFileInfo | APICFileInfo,
  ) => Promise<void>;

  updateConfigurationField: <
    K extends keyof DataPowerAssemblyDocument['x-ibm-configuration'],
  >(
    fieldName: K,
    value: DataPowerAssemblyDocument['x-ibm-configuration'][K],
  ) => Promise<void>;

  removeConfigurationField: <
    K extends keyof DataPowerAssemblyDocument['x-ibm-configuration'],
  >(
    fieldName: K,
  ) => Promise<void>;
}
