import { Wizard } from "../wizard/wizard" ; export type ClusterProviderAction = 'create' | 'configure' ; export interface ClusterProvider { readonly id : string ; readonly displayName : string ; readonly supportedActions : ClusterProviderAction [ ] ; next ( w , action , m ) : void ; } export interface ClusterProviderRegistry { register ( clusterProvider ) : void ; list ( ) : ReadonlyArray < ClusterProvider > ; } class RegistryImpl implements ClusterProviderRegistry { private readonly providers = new Array < ClusterProvider > ( ) ; public register ( clusterProvider ) { console . log ( `You registered cluster type ${ clusterProvider . id }` ) ; this . providers . push ( clusterProvider ) ; } public list ( ) { let copy = new Array < ClusterProvider > ( ) ; copy = copy . concat ( this . providers ) ; return copy ; } } const registryImpl = new RegistryImpl ( ) ; export function get ( ) { return registryImpl ; }