import { Debug } from '@jacobbubu/debug'; import * as pull from 'pull-stream'; import { AsyncModelStoreBase } from './async-model-store.interface'; export declare type SourceId = string; export declare type Timestamp = number; export declare type From = string; export declare type Singed = string; export interface ScuttlebuttOptions { id?: SourceId; createId?(): SourceId; sign?: boolean; verify?: boolean; accept?: any; logger?: Debug; } export interface AsyncModelOptions extends ScuttlebuttOptions { store?: AsyncModelStoreBase; } export interface StreamOptions { readable?: boolean; writable?: boolean; tail?: boolean; name?: string; clock?: Sources; sendClock?: boolean; wrapper?: string | Serializer; meta?: any; } export interface Sources { [sourceId: string]: Timestamp; } export declare enum UpdateItems { Data = 0, Timestamp = 1, SourceId = 2, From = 3, Singed = 4 } export interface Serializer { serialize: () => pull.Through; parse: () => pull.Through; } export declare type Update = [any, Timestamp, SourceId, From?, Singed?]; export declare type Verify = (update: Update) => boolean; export declare type Sign = (update: Update) => string;