Skip to content

FeatureArg

FeatureArg<V> = readonly string[] | ContentMajor<V> | LanguageMajor<V>

Defined in: declare.ts:26

The per-feature declaration argument, shared by video.narration/text/ overlays/audio (and the screenshot subset). Every declaration is editable in the ScreenCI web app; the argument shape decides whether code supplies values and how they localize:

  • Names only (['intro', 'cta']): the names exist in code (so the test body can reference narration.intro), but their content is configured in the web app.
  • Content-major object ({ intro: 'Hi' }): a flat name -> value map of code values, shared across every language. The web app may override them.
  • Language-major object ({ fr: { intro: 'Salut' }, default: { intro: 'Hi' } }): top-level keys are language codes (plus an optional default). Each language maps name -> value; default supplies the shared fallback for any name a language omits.

Disambiguation (see isLanguageKey): an object is treated as language-major iff every top-level key is a supported language code or the literal default. There is deliberately no languages: wrapper. As a result a content name may not be a bare language code or default (rejected by normalizeFeature).

V