Search Docs
Loading...
Skip to content

Type Alias: FeatureEntry

type FeatureEntry<S> = object & { [K in keyof S["settings"]]?: FeatureValue<S["settings"][K]> | ((context: FeatureSettingContext<S["settings"][K]>) => FeatureValue<S["settings"][K]>) };

One feature or option as configure takes it. Any other key sets the setting of that name.

Type Declaration#

Name Type Description
enabled? boolean Switches it on or off. The last write wins; off turns off everything inside it.
when? FeatureWhen Where it shows: a rule replaces the starting rule and the narrows and extends written before it, { narrow } adds a condition that must also hold, { extend } adds one that widens it, and 'inherit' makes an option follow its parent again.
options? { [K in keyof S["options"]]?: FeatureEntry<S["options"][K]> } The options inside it, by name, each written like a feature.

Type Parameters#

Type Parameter Default type
S extends FeatureShape FeatureShape