UNPKG

@subsocial/api

Version:
31 lines (30 loc) 1.63 kB
import { AccountId } from '@polkadot/types/interfaces'; import BN from 'bn.js'; import { SpaceId, PostId, Space, Post, ReactionId } from '@subsocial/definitions/interfaces'; import { ApiPromise as SubstrateApi } from '@polkadot/api'; import { SubsocialIpfsProps } from '../ipfs'; export declare type HttpRequestMethod = 'post' | 'get'; export declare type UseServerProps = { httpRequestMethod: HttpRequestMethod; }; export declare type SubsocialContext = { /** @deprecated */ useServer?: UseServerProps; }; export declare type SubsocialApiProps = SubsocialContext & SubsocialIpfsProps & { substrateApi: SubstrateApi; }; export declare type CreateSubsocialApiProps = Omit<SubsocialApiProps, 'substrateApi'> & { substrateNodeUrl: string; }; export declare type SubstrateId = SpaceId | PostId | BN | string; export declare type CommonStruct = Space | Post; export declare type AnyAccountId = AccountId | string; export declare type AnySpaceId = SpaceId | BN | string; export declare type AnyPostId = PostId | BN | string; export declare type AnyReactionId = ReactionId | BN | string; declare type CidAsStr = string; export declare type ContentResult<T> = Record<CidAsStr, T>; export declare type PalletName = 'domains' | 'permissions' | 'posts' | 'accountFollows' | 'profiles' | 'reactions' | 'roles' | 'scores' | 'spaceFollows' | 'spaceOwnership' | 'spaces' | 'utils'; export declare type EventsName = 'AccountFollowed' | 'SpaceFollowed' | 'SpaceCreated' | 'CommentCreated' | 'CommentReplyCreated' | 'PostCreated' | 'PostShared' | 'CommentShared' | 'PostReactionCreated' | 'CommentReactionCreated'; export {};