Home Manual Reference Source
public class | source

TargetFileRule

Helper service used by TargetsFileRules in order to create dynamic file rules for multiple purposes.

Constructor Summary

Public Constructor
public

constructor(events: Events, targets: Targets, ruleType: string, getSettingsForTargetRule: TargetFileRuleHandler)

Member Summary

Public Members
public

A local reference for the events service.

public

A local reference for the targets service.

Method Summary

Public Methods
public

addTarget(target: Target)

Add a target to the rule.

public

Get the rule settings.

Public Constructors

public constructor(events: Events, targets: Targets, ruleType: string, getSettingsForTargetRule: TargetFileRuleHandler) source

Params:

NameTypeAttributeDescription
events Events

To reduce the rule settings updated.

targets Targets

To get the information of other targets from the includeTargets setting.

ruleType string

A reference identifier that tells for which kind file type the rule is being used for.

getSettingsForTargetRule TargetFileRuleHandler

To define the rule settings whenever a new target is added.

Throw:

Error

If getSettingsForTargetRule is not a function.

Public Members

public events: Events source

A local reference for the events service.

public targets: Targets source

A local reference for the targets service.

Public Methods

public addTarget(target: Target) source

Add a target to the rule. This means the instance will process it and eventually add its paths to the settings. This method uses the reducer event target-file-rule, and if a target was already added, target-file-rule-update too. Both events receive the next state of the settings as well as the current, and expect the final state on return.

Params:

NameTypeAttributeDescription
target Target

The target information.

public getRule(): TargetFileRuleSettings source

Get the rule settings.