Wrapper around a list of rules that provides helpers to manage the rules

### Hierarchy

- Message<Rules>
  - Rules

## Index

### Constructors

- constructor

### Properties

- $type
- list
- $type

### Methods

- appendToRule
- clone
- getRule
- removeRule
- setRule
- setRuleExp
- toJSON
- toString
- create
- decode
- decodeDelimited
- encode
- encodeDelimited
- fromObject
- register
- toObject
- verify

## Constructors

### constructor

- new Rules(properties?: Properties<Rules>): Rules

- Overrides Message.__constructor

  - Defined in src/darc/rules.ts:131

  #### Parameters

  - ##### Optional properties: Properties<Rules>

  #### Returns Rules

## Properties

### $type

$type: Type

Inherited from Message.$type

- Defined in node_modules/protobufjs/index.d.ts:524

Reference to the reflected type.

### list

list: Rule[]

- Defined in src/darc/rules.ts:131

### Static $type

$type: Type

Inherited from Message.$type

- Defined in node_modules/protobufjs/index.d.ts:521

Reference to the reflected type.

## Methods

### appendToRule

- appendToRule(action: string, identity: IIdentity, op: string): void

- - Defined in src/darc/rules.ts:147

  Create or update a rule with the given identity

  #### Parameters

  - ##### action: string

    the name of the rule

  - ##### identity: IIdentity

    the identity to append

  - ##### op: string

    the operator to use if the rule exists

  #### Returns void

### clone

- clone(): Rules

- - Defined in src/darc/rules.ts:209

  Get a deep copy of the list of rules

  #### Returns Rules

  the clone

### getRule

- getRule(action: string): Rule

- - Defined in src/darc/rules.ts:201

  getRule returns the rule with the given action

  #### Parameters

  - ##### action: string

    to search in the rules for.

  #### Returns Rule

### removeRule

- removeRule(action: string): void

- - Defined in src/darc/rules.ts:189

  Removes a given rule from the list.

  #### Parameters

  - ##### action: string

    the action that will be removed.

  #### Returns void

### setRule

- setRule(action: string, identity: IIdentity): void

- - Defined in src/darc/rules.ts:163

  Sets a rule to correspond to the given identity. If the rule already exists, it will be replaced.

  #### Parameters

  - ##### action: string

    the name of the rule

  - ##### identity: IIdentity

    the identity to append

  #### Returns void

### setRuleExp

- setRuleExp(action: string, expression: Buffer): void

- - Defined in src/darc/rules.ts:173

  Sets the expression of a rule. If the rule already exists, it will be replaced. If the rule does not exist yet, it will be appended to the list of rules.

  #### Parameters

  - ##### action: string

    the name of the rule

  - ##### expression: Buffer

    the expression to put in the rule

  #### Returns void

### toJSON

- toJSON(): object

- Inherited from Message.toJSON

  - Defined in node_modules/protobufjs/index.d.ts:589

  Converts this message to JSON.

  #### Returns object

  JSON object

  - ##### [k: string]: any

### toString

- toString(): string

- - Defined in src/darc/rules.ts:217

  Get a string representation of the rules

  #### Returns string

  a string representation

### Static create

- create<T>(this: Constructor<T>, properties?: object): Message<T>

- Inherited from Message.create

  - Defined in node_modules/protobufjs/index.d.ts:531

  Creates a new message of this type using the specified properties.

  #### Type parameters

  - #### T: Message<Rules>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### Optional properties: object

    - ##### [k: string]: any

  #### Returns Message<T>

  Message instance

### Static decode

- decode<T>(this: Constructor<T>, reader: Reader | Uint8Array): T

- Inherited from Message.decode

  - Defined in node_modules/protobufjs/index.d.ts:554

  Decodes a message of this type.

  #### Type parameters

  - #### T: Message<Rules>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### reader: Reader | Uint8Array

    Reader or buffer to decode

  #### Returns T

  Decoded message

### Static decodeDelimited

- decodeDelimited<T>(this: Constructor<T>, reader: Reader | Uint8Array): T

- Inherited from Message.decodeDelimited

  - Defined in node_modules/protobufjs/index.d.ts:561

  Decodes a message of this type preceeded by its length as a varint.

  #### Type parameters

  - #### T: Message<Rules>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### reader: Reader | Uint8Array

    Reader or buffer to decode

  #### Returns T

  Decoded message

### Static encode

- encode<T>(this: Constructor<T>, message: T | object, writer?: Writer): Writer

- Inherited from Message.encode

  - Defined in node_modules/protobufjs/index.d.ts:539

  Encodes a message of this type.

  #### Type parameters

  - #### T: Message<Rules>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### message: T | object

    Message to encode

  - ##### Optional writer: Writer

  #### Returns Writer

  Writer

### Static encodeDelimited

- encodeDelimited<T>(this: Constructor<T>, message: T | object, writer?: Writer): Writer

- Inherited from Message.encodeDelimited

  - Defined in node_modules/protobufjs/index.d.ts:547

  Encodes a message of this type preceeded by its length as a varint.

  #### Type parameters

  - #### T: Message<Rules>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### message: T | object

    Message to encode

  - ##### Optional writer: Writer

  #### Returns Writer

  Writer

### Static fromObject

- fromObject<T>(this: Constructor<T>, object: object): T

- Inherited from Message.fromObject

  - Defined in node_modules/protobufjs/index.d.ts:575

  Creates a new message of this type from a plain object. Also converts values to their respective internal types.

  #### Type parameters

  - #### T: Message<Rules>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### object: object

    Plain object

    - ##### [k: string]: any

  #### Returns T

  Message instance

### Static register

- register(): void

- - Defined in src/darc/rules.ts:127
  see

    README#Message classes

  #### Returns void

### Static toObject

- toObject<T>(this: Constructor<T>, message: T, options?: IConversionOptions): object

- Inherited from Message.toObject

  - Defined in node_modules/protobufjs/index.d.ts:583

  Creates a plain object from a message of this type. Also converts values to other types if specified.

  #### Type parameters

  - #### T: Message<Rules>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### message: T

    Message instance

  - ##### Optional options: IConversionOptions

  #### Returns object

  Plain object

  - ##### [k: string]: any

### Static verify

- verify(message: object): string

- Inherited from Message.verify

  - Defined in node_modules/protobufjs/index.d.ts:568

  Verifies a message of this type.

  #### Parameters

  - ##### message: object

    Plain object to verify

    - ##### [k: string]: any

  #### Returns string

  `null` if valid, otherwise the reason why it is not

Generated using TypeDoc