Diff
Not logged in

Differences From Artifact [ddad53664b]:

To Artifact [dc6f3ed590]:


     1      1   import { AccountInfo } from './accounts'
            2  +import Stats from '../services/stats'
     2      3   
     3      4   export interface MiddlewareDefinition {
     4      5     type: string,
     5      6     options?: object
     6      7   }
     7      8   
     8      9   /**
     9     10    * Services the connector exposes to middleware.
    10     11    */
    11     12   export interface MiddlewareServices {
           13  +  stats: Stats
    12     14     getInfo (accountId: string): AccountInfo
    13     15     getOwnAddress (): string
    14     16     sendData (data: Buffer, accountId: string): Promise<Buffer>
    15     17     sendMoney (amount: string, accountId: string): Promise<void>
    16     18   }
    17     19   
    18     20   export interface MiddlewareCallback<T,U> {
................................................................................
    39     41     insertBefore (middlewareName: string, entry: PipelineEntry<T,U>): void
    40     42     insertAfter (middlewareName: string, entry: PipelineEntry<T,U>): void
    41     43     getMethods (): MiddlewareMethod<T,U>[]
    42     44   }
    43     45   
    44     46   export interface Pipelines {
    45     47     readonly startup: Pipeline<void, void>,
           48  +  readonly teardown: Pipeline<void, void>,
    46     49     readonly incomingData: Pipeline<Buffer, Buffer>,
    47     50     readonly incomingMoney: Pipeline<string, void>,
    48     51     readonly outgoingData: Pipeline<Buffer, Buffer>
    49     52     readonly outgoingMoney: Pipeline<string, void>
    50     53   }
    51     54   
    52     55   export interface Middleware {
    53     56     applyToPipelines: (pipelines: Pipelines, accountId: string) => Promise<void>
    54     57   }
    55     58   
    56     59   export interface MiddlewareConstructor {
    57     60     new (options: object, api: MiddlewareServices): Middleware
    58     61   }