All files / src/classes CoreBundleModule.ts

100% Statements 2/2
100% Branches 0/0
100% Functions 1/1
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38                                                              1x 1x          
import type {
  ICoreCache,
  ICoreKernel,
  ICorePresenter,
  IDataBase,
} from '../lib';
import CoreClient from './CoreClient';
import CoreKernelModule from './CoreKernelModule';
 
/**
 * An abstract base class for modules that need to perform bundle‑level initialization
 * within the kernel.  It extends {@link CoreKernelModule} and supplies a standard
 * constructor that assigns the module name and kernel reference while also setting
 * the module’s `trigger` handler to the {@link initBundleModule} method.
 *
 * @template K - A concrete type that implements {@link ICoreKernel} with any argument.
 * @template T - Either a concrete {@link IDataBase} implementation or {@code null}.
 * @template P - Either a concrete {@link CoreClient} implementation or {@code null}.
 * @template C - Either a concrete {@link ICoreCache} implementation or {@code null}.
 * @template E - Either a concrete {@link ICorePresenter} implementation or {@code null}.
 *
 * @extends CoreKernelModule<K, T, P, C, E>
 */
export default abstract class CoreBundleModule<
  K extends ICoreKernel<any>,
  T extends IDataBase<any, any> | null,
  P extends CoreClient | null,
  C extends ICoreCache | null,
  E extends ICorePresenter<any> | null,
> extends CoreKernelModule<K, T, P, C, E> {
  protected constructor(name: string, kernel: K) {
    super(name, kernel);
    this.trigger = this.initBundleModule;
  }
 
  abstract initBundleModule(): Promise<void>;
}