2.8.0 • Published 2 years ago

ssb-typescript v2.8.0

Weekly downloads
748
License
MIT
Repository
github
Last release
2 years ago

/**

  • ssb-typescript

  • Contains type definitions for common SSB concepts.
  • npm install ssb-typescript
  • Usage:
  • import {Msg} from 'ssb-typescript';
    */ /**
  • Starts with @ */ export declare type FeedId = string; /**
  • Starts with % */ export declare type MsgId = string; /**
  • Starts with & / export declare type BlobId = string; export interface Msg<C = Content> { key: MsgId; value: { previous: MsgId; author: FeedId; sequence: number; timestamp: number; hash: 'sha256'; content: C; signature: string; }; timestamp: number; } export declare type MsgInThread = Msg<{ root?: MsgId; fork?: MsgId; branch?: MsgId; }>; export interface UnboxedMsg<C = Content> extends Msg { value: Msg'value' & { cyphertext: string; private: true; unbox: string; }; meta?: { private: true; originalContent: string; }; } export declare type Privatable = T & { recps?: Array; }; export declare type Content = Privatable | Privatable | Privatable | Privatable | Privatable | Privatable | Privatable | Privatable | Privatable | null; export interface PostContent { type: 'post'; text: string; channel?: string; /** Links / mentions?: Array; root?: MsgId; branch?: MsgId | Array; fork?: MsgId; } export interface AboutContent { type: 'about'; about: FeedId; name?: string; description?: string; image?: string; } export interface ContactContent { type: 'contact'; contact?: FeedId; following?: boolean; blocking?: boolean; } export interface VoteContent { type: 'vote'; vote: { link: MsgId; value: number; expression: string; }; } export interface BlogContent { type: 'blog'; title: string; summary: string; channel?: string; thumbnail?: string; blog: string; /** Links / mentions?: Array; root?: MsgId; branch?: MsgId | Array; fork?: MsgId; } export interface AliasContent { type: 'room/alias'; action?: 'registered' | 'revoked'; alias?: string; aliasURL?: string; room?: FeedId; } export interface GatheringContent { type: 'gathering'; /** The message that spawned this gathering / progenitor?: MsgId; /** People to notify / mentions?: Array; } export interface GatheringUpdateContent { type: 'about'; /** SHOULD point to a type: 'gathering' message. / about: MsgId; title?: string; description?: string; location?: string; startDateTime?: { epoch?: number; tz?: string; bias?: number; silent?: boolean; }; image?: { link: BlobId; name?: string; size?: number; /** mimetype / type?: string; }; } export interface AttendeeContent { type: 'about'; /** SHOULD point to a type: 'gathering' message. / about: MsgId; attendee: { link: FeedId; remove?: true; }; } export interface About { name?: string; description?: string; color?: string; imageUrl?: string; id?: FeedId; /** true means following null means not-following false means blocked */ following?: true | null | false; } export interface PeerMetadata { host: string; port: number; key: string; name?: string; source: 'local' | 'pub' | 'manual'; announcers?: number; duration?: any; client: boolean; state: 'connecting' | 'connected' | 'disconnecting' | undefined; stateChange: number; ping?: { rtt: { mean: number; stdev: number; count: number; sum: number; sqsum: number; }; skew: { mean: number; stdev: number; count: number; sum: number; sqsum: number; }; }; }
2.7.0

2 years ago

2.8.0

2 years ago

2.7.1

2 years ago

2.6.0

2 years ago

2.3.0

3 years ago

2.5.0

3 years ago

2.4.0

3 years ago

2.2.0

3 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.7.0

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.0

5 years ago

1.3.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago