import{_ as e,c as t,o as a,N as o}from"./chunks/framework.0799945b.js";const m=JSON.parse('{"title":"Module: features/decorators/common","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/features/common.md","lastUpdated":null}'),r={name:"api/modules/features/common.md"},c=o(`

Module: features/decorators/common

Interfaces

EffectFeatureOptions

EffectFeatureOptions: Object

NameType
effectany

Defined in

profectus/src/features/decorators/common.ts:14

Type Aliases

Decorator

Ƭ Decorator<FeatureOptions, BaseFeature, GenericFeature, S>: Object

Type parameters

NameType
FeatureOptionsFeatureOptions
BaseFeatureobject
GenericFeatureBaseFeature
Sextends State = State

Type declaration

NameType
getGatheredProps?(feature: OptionsObject<FeatureOptions, BaseFeature & { id: string }, GenericFeature>) => Partial<OptionsObject<FeatureOptions, BaseFeature & { id: string }, GenericFeature>>
getPersistentData?() => Record<string, Persistent<S>>
postConstruct?(feature: OptionsObject<FeatureOptions, BaseFeature & { id: string }, GenericFeature>) => void
preConstruct?(feature: OptionsObject<FeatureOptions, BaseFeature & { id: string }, GenericFeature>) => void

Defined in

profectus/src/features/decorators/common.ts:5


EffectFeature

Ƭ EffectFeature<T>: Replace<T, { effect: GetComputableType<T["effect"]> }>

Type parameters

NameType
Textends EffectFeatureOptions

Defined in

profectus/src/features/decorators/common.ts:18


GenericDecorator

Ƭ GenericDecorator: Decorator<unknown>

Defined in

profectus/src/features/decorators/common.ts:12


GenericEffectFeature

Ƭ GenericEffectFeature: Replace<EffectFeature<EffectFeatureOptions>, { effect: ProcessedComputable<any> }>

Defined in

profectus/src/features/decorators/common.ts:22

Variables

effectDecorator

Const effectDecorator: Decorator<EffectFeatureOptions, unknown, GenericEffectFeature>

Allows the usage of an effect field in the decorated feature.
To function properly, the createFeature() function must have its generic type extended by EffectFeatureOptions.
To allow access to the decorated values outside the createFeature() function, the output type must be extended by GenericEffectFeature.

Example

ts
createRepeatable<RepeatableOptions & EffectFeatureOptions>(() => ({
  effect() { return Decimal.pow(2, this.amount); },
  ...
}), effectDecorator) as GenericUpgrade & GenericEffectFeature;

Defined in

profectus/src/features/decorators/common.ts:38

`,41),s=[c];function n(d,l,i,p,f,u){return a(),t("div",null,s)}const y=e(r,[["render",n]]);export{m as __pageData,y as default};