UNPKG

@oap75/types

Version:

JavaScript type definitions for Subsocial blockchain.

70 lines (69 loc) 2.11 kB
import CID from 'cids'; import { IpfsCid as RuntimeIpfsCid } from '@subsocial/definitions/interfaces'; export { CID }; export declare type CommonContent = CommentContent | PostContent | SpaceContent | ProfileContent | SharedPostContent; export declare type Activity = { account: string; block_number: string; event_index: number; event: EventsName; /** Account id. */ following_id?: string; space_id?: string; post_id?: string; comment_id?: string; amount?: string; /** Date of this activity. Example: "2020-12-03T19:22:36.000Z" */ date: string; aggregated: boolean; agg_count: number; }; export declare type NamedLink = { name: string; url?: string; }; declare type ContentFormat = { format?: 'md' | 'html'; }; export declare type SpaceContent = ContentFormat & { name: string; about: string; image: string; email: string; tags: string[]; links: string[] | NamedLink[]; }; declare type CommonPostContent = ContentFormat & { body: string; }; export declare type SharedPostContent = CommonPostContent; export declare type SubstrareProposal = { kind: 'SubstrateProposal'; network: 'Kusama' | 'Polkadot'; proposalIndex: number; }; export declare type MetaItem = SubstrareProposal; export declare type PostContent = CommonPostContent & { title: string; image: string; tags: string[]; canonical: string; link?: string; meta?: MetaItem[]; }; export declare type CommentContent = CommonPostContent; export declare type ProfileContent = { name: string; avatar: string; about: string; }; export declare type IpfsCid = string | CID | RuntimeIpfsCid; export declare type EventsName = 'AccountFollowed' | 'SpaceFollowed' | 'SpaceCreated' | 'CommentCreated' | 'CommentReplyCreated' | 'PostCreated' | 'PostShared' | 'CommentShared' | 'PostReactionCreated' | 'CommentReactionCreated'; export declare type Counts = { postsCount: number; commentsCount: number; reactionsCount: number; followsCount: number; spacesCount: number; activitiesCount: number; };