import type { RemoteDesignerDefinitionsLoadContext, RemoteFeatureDefinition } from '@creatio-devkit/common';

import { RATING_TYPE } from './runtime-feature.ids';

/**
 * Root definition for the runtime feature.
 *
 * Describes the view elements this remote package contributes at runtime and provides the entry
 * points used to load designer metadata and activate the feature.
 */
export const runtimeFeatureDefinition = {
  id: 'sdk_custom_component_ai-runtime',
  discovery: {
    viewElements: [{ type: RATING_TYPE }],
    mobileViewElements: [],
  },
  loadDesignerDefinitions: (context: RemoteDesignerDefinitionsLoadContext) =>
    import('./runtime.designer-definitions').then((m) => m.loadRuntimeDesignerDefinitions(context)),
  activate: () =>
    import('./runtime.feature-activation').then((m) => m.activateRuntimeFeature()),
} satisfies RemoteFeatureDefinition;
