[]previous and next page

DuskFeature

A feature object.

A feature object. Built by the factory functions of @shadow-js/dusk/features/*.

Import#

ts
import type { DuskFeature } from "@shadow-js/dusk/server";

Signature#

ts
interface DuskFeature {
  /** Which feature this is; the core installs at most one of each. */
  readonly name: FeatureName;
  /**
   * Fills this feature's capability. Runs once per handler, in {@link FEATURE_ORDER}. A feature that needs
   * another one reads `host.capabilities` and calls `host.need` when that one is missing.
   * @internal
   */
  install(host: FeatureHost): void;
}

Members#

Name Type Description
name readonly name: FeatureName Which feature this is; the core installs at most one of each.
install install(host: FeatureHost): void Fills this feature's capability. Runs once per handler, in FEATURE_ORDER. A feature that needs another one reads host.capabilities and calls host.need when that one is missing.