import { NgModule, ModuleWithProviders } from '@angular/core';

import { _MODULE_CONFIG } from './config/token';
import { ModuleConfig } from './config/module-config';

import { CallService } from './services/call.service';

const SERVICES = [CallService];

@NgModule({
  declarations: [],
  imports: [],
  exports: []
})
export class UCapPromptApiModule {
  public static forRoot(
    config: ModuleConfig
  ): ModuleWithProviders<UCapPromptApiModule> {
    return {
      ngModule: UCapPromptApiModule,
      providers: [{ provide: _MODULE_CONFIG, useValue: config }, ...SERVICES]
    };
  }
}
