Dart Documentationchrome.eventsRule

Rule class

Description of a declarative rule for handling events.

class Rule extends ChromeObject {
 Rule({String id, List<String> tags, List<dynamic> conditions, List<dynamic> actions, int priority}) {
   if (id != null) this.id = id;
   if (tags != null) this.tags = tags;
   if (conditions != null) this.conditions = conditions;
   if (actions != null) this.actions = actions;
   if (priority != null) this.priority = priority;
 }
 Rule.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);

 /**
  * Optional identifier that allows referencing this rule.
  */
 String get id => jsProxy['id'];
 set id(String value) => jsProxy['id'] = value;

 /**
  * Tags can be used to annotate rules and perform operations on sets of rules.
  */
 List<String> get tags => listify(jsProxy['tags']);
 set tags(List<String> value) => jsProxy['tags'] = jsify(value);

 /**
  * List of conditions that can trigger the actions.
  */
 List<dynamic> get conditions => listify(jsProxy['conditions']);
 set conditions(List<dynamic> value) => jsProxy['conditions'] = jsify(value);

 /**
  * List of actions that are triggered if one of the condtions is fulfilled.
  */
 List<dynamic> get actions => listify(jsProxy['actions']);
 set actions(List<dynamic> value) => jsProxy['actions'] = jsify(value);

 /**
  * Optional priority of this rule. Defaults to 100.
  */
 int get priority => jsProxy['priority'];
 set priority(int value) => jsProxy['priority'] = value;
}

Extends

ChromeObject > Rule

Constructors

new Rule({String id, List<String> tags, List<dynamic> conditions, List<dynamic> actions, int priority}) #

Create a new instance of a ChromeObject, which creates and delegates to a JsObject proxy.

docs inherited from ChromeObject
Rule({String id, List<String> tags, List<dynamic> conditions, List<dynamic> actions, int priority}) {
 if (id != null) this.id = id;
 if (tags != null) this.tags = tags;
 if (conditions != null) this.conditions = conditions;
 if (actions != null) this.actions = actions;
 if (priority != null) this.priority = priority;
}

new Rule.fromProxy(JsObject jsProxy) #

Create a new instance of a ChromeObject, which delegates to the given JsObject proxy.

docs inherited from ChromeObject
Rule.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);

Properties

List<dynamic> actions #

List of actions that are triggered if one of the condtions is fulfilled.

List<dynamic> get actions => listify(jsProxy['actions']);
set actions(List<dynamic> value) => jsProxy['actions'] = jsify(value);

List<dynamic> conditions #

List of conditions that can trigger the actions.

List<dynamic> get conditions => listify(jsProxy['conditions']);
set conditions(List<dynamic> value) => jsProxy['conditions'] = jsify(value);

String id #

Optional identifier that allows referencing this rule.

String get id => jsProxy['id'];
set id(String value) => jsProxy['id'] = value;

final jsProxy #

inherited from ChromeObject
final dynamic jsProxy

int priority #

Optional priority of this rule. Defaults to 100.

int get priority => jsProxy['priority'];
set priority(int value) => jsProxy['priority'] = value;

List<String> tags #

Tags can be used to annotate rules and perform operations on sets of rules.

List<String> get tags => listify(jsProxy['tags']);
set tags(List<String> value) => jsProxy['tags'] = jsify(value);

Methods

JsObject toJs() #

inherited from ChromeObject
JsObject toJs() => jsProxy;

String toString() #

inherited from ChromeObject

Returns a string representation of this object.

docs inherited from Object
String toString() => jsProxy.toString();