A rule will give who is allowed to use a given action

### Hierarchy

- Message<Rule>
  - Rule

## Index

### Constructors

- constructor

### Properties

- $type
- action
- expr
- $type
- AND
- OR

### Methods

- append
- clone
- getExpr
- getIdentities
- remove
- toJSON
- toString
- create
- decode
- decodeDelimited
- encode
- encodeDelimited
- fromActionExpr
- fromObject
- register
- toObject
- verify

## Constructors

### constructor

- new Rule(props?: Properties<Rule>): Rule

- Overrides Message.__constructor

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

  #### Parameters

  - ##### Optional props: Properties<Rule>

  #### Returns Rule

## Properties

### $type

$type: Type

Inherited from Message.$type

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

Reference to the reflected type.

### action

action: string

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

### Private expr

expr: Buffer

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

### Static $type

$type: Type

Inherited from Message.$type

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

Reference to the reflected type.

### Static AND

AND: "&" = "&"

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

### Static OR

OR: "|" = "|"

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

## Methods

### append

- append(identity: string, op: string): Buffer

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

  Appends an identity given as a string to the expression and returns a copy of the new expression.

  #### Parameters

  - ##### identity: string

    the identity to add, given as a string

  - ##### op: string

    the operator to apply to the expression

  #### Returns Buffer

### clone

- clone(): Rule

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

  Get a deep clone of the rule

  #### Returns Rule

  the new rule

### getExpr

- getExpr(): Buffer

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

  Returns a copy of the expression.

  #### Returns Buffer

### getIdentities

- getIdentities(): string[]

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

  Returns the identities in the expression, in the case it is a single identity, or if the identities are ORed together. If there are brakcets '()' or AND in the expression, it will throw an error.

  #### Returns string[]

### remove

- remove(identity: string): Buffer

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

  Searches for the given identity and removes it from the expression. Currently only expressions containing Rule.OR are supported. It returns a copy of the new expression.

  #### Parameters

  - ##### identity: string

    the string representation of the identity

  #### Returns Buffer

### 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:113

  Get a string representation of the rule

  #### Returns string

  the 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<Rule>

  #### 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<Rule>

  #### 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<Rule>

  #### 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<Rule>

  #### 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<Rule>

  #### Parameters

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

  - ##### message: T | object

    Message to encode

  - ##### Optional writer: Writer

  #### Returns Writer

  Writer

### Static fromActionExpr

- fromActionExpr(action: string, expr: Buffer): Rule

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

  Creates a rule given an action and an expression.

  #### Parameters

  - ##### action: string

  - ##### expr: Buffer

  #### Returns Rule

### 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<Rule>

  #### 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:18
  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<Rule>

  #### 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