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

import {
  _LOGGER_CONFIG,
  LoggerConfig,
} from './core';

import {
  SERVICES, LoggerService,
} from './service';

export interface LoggerFeatureModuleConfig {
  url?: any;
}

export interface LoggerRootModuleConfig {
  config: LoggerConfig;
}

@NgModule({})
export class LoggerRootModule {
  constructor(
    private loggerService: LoggerService,
  ) {
  }
}

@NgModule({})
export class LoggerFeatureModule {
  constructor(
    private loggerService: LoggerService,
    private root: LoggerRootModule,
  ) {
  }
}

@NgModule({})
export class LoggerModule {
  static forRoot(config: LoggerRootModuleConfig): ModuleWithProviders {
    return {
      ngModule: LoggerRootModule,
      providers: [
        {
          provide: _LOGGER_CONFIG,
          useValue: config.config,
        },
        SERVICES,
      ],
    };
  }

  static forFeature(config: LoggerFeatureModuleConfig): ModuleWithProviders {
    return {
      ngModule: LoggerFeatureModule,
      providers: [
      ],
    };
  }
}
