UNPKG

@subsocial/api

Version:
55 lines (54 loc) 1.73 kB
import { CID } from 'ipfs-http-client'; import { IpfsCid as RuntimeIpfsCid } from '@subsocial/definitions/interfaces'; import { TweetPostContent } from '@subsocial/utils'; export declare type IpfsCommonContent = IpfsCommentContent | IpfsPostContent | IpfsSpaceContent | IpfsSharedPostContent; export declare type NamedLink = { name: string; url?: string; }; export declare type IpfsSpaceContent = { name: string; about: string; image: string; email: string; tags: string[]; links: string[] | NamedLink[]; }; declare type CommonPostContent = { body: string; }; export declare type IpfsSharedPostContent = CommonPostContent; export declare type IpfsPostContent = CommonPostContent & { title: string; image: string; tags: string[]; canonical: string; tweet?: TweetPostContent; link?: string; }; export declare type IpfsCommentContent = CommonPostContent; export declare type IpfsCid = string | CID | RuntimeIpfsCid; export declare type Counts = { postsCount: number; commentsCount: number; reactionsCount: number; followsCount: number; spacesCount: number; activitiesCount: number; }; export declare type ImportCandidate = ToFile | ToDirectory | ToContent; export interface ToFile { path?: string; content: ToContent; } export interface ToDirectory { path: string; content?: undefined; } /** * File content in arbitrary (supported) representation. It is used in input * positions and is usually normalized to `Blob` in browser contexts and * `AsyncIterable<Uint8Array>` in node. */ export declare type ToContent = string | InstanceType<typeof String> | ArrayBufferView | ArrayBuffer | Blob | ReadableStream<Uint8Array>; export {};