A model that represents a base role.

Hierarchy (view full)

Implements

Constructors

Properties

onFound: OEvent<(() => void | Promise<void>)> = ...
onInitialised: OEvent<(() => void | Promise<void>)> = ...
onUpdated: OEvent<(() => void)> = ...
state: StateMachine<"Uninitialised" | "Initialised", "shutdown" | "init">

Methods

  • ************* Semi-abstracts **************

    Parameters

    • roleName: string

    Returns boolean | Promise<boolean>

  • Returns Promise<SHA256IdHash<Person>[]>

  • Checks if the data is affirmed by the role person ids.

    Parameters

    • data: SHA256Hash | SHA256IdHash

      The data to check.

    • OptionalbyPersonId: SHA256IdHash<Person>

      The personId that should be trusting the data.

    Returns Promise<boolean>

    True if the data is affirmed, false otherwise.

  • Checks if the data is signed by the role person ids.

    Parameters

    • data: SHA256Hash

      The data to check.

    • OptionalbyPersonId: SHA256IdHash<Person>

      The personId that should be signing the data.

    Returns Promise<boolean>

    True if the data is signed, false otherwise.

  • Initializes the role model.

    Returns Promise<void>

    A promise that resolves when the role model is initialised.

  • Returns true if the role is initialised.

    Returns boolean

    True if the role is initialised, false otherwise.

  • ************* Abstracts **************

    Parameters

    • OptionalpersonId: SHA256IdHash<Person>

    Returns Promise<boolean>

  • Parameters

    • personId: SHA256IdHash<Person>
    • OptionalcreatorId: SHA256IdHash<Person>

    Returns Promise<void>

  • Parameters

    • _rolePersonId: SHA256IdHash<Person>
    • _shareWithPersonIds: SHA256IdHash<Person>[]

    Returns Promise<void>

  • Parameters

    • personIds: SHA256IdHash<Person>[]
    • options: {
          rolePersonId?: SHA256IdHash<Person>;
      }
      • OptionalrolePersonId?: SHA256IdHash<Person>

    Returns Promise<void>

  • Shuts down the role model.

    Returns Promise<void>

    A promise that resolves when the role model is shut down.