UNPKG

bigblocks

Version:

Complete Bitcoin UI component library - authentication, social, wallet, market, inscriptions, and blockchain interactions for React

179 lines 4.79 kB
export type MetaLensContextType = "url" | "tx" | "upc" | "geohash" | "ipfs" | "isbn" | "doi" | "custom"; export interface MetaLensTheme { background?: string; buttonBackground?: string; buttonColor?: string; color?: string; inputBackground?: string; inputColor?: string; inputBorder?: string; } export interface MetaLensComment { txid: string; author: string; authorPaymail?: string; authorBapId?: string; content: string; contentType?: "text/plain" | "text/markdown"; timestamp: Date; context: { type: MetaLensContextType; value: string; subcontext?: string; subcontextValue?: string; }; replies?: MetaLensComment[]; reactions?: Record<string, number>; metadata?: { app?: string; mentions?: string[]; tags?: string[]; thread?: string; }; } export interface MetaLensConfig { apiUrl?: string; faucetUrl?: string; appName?: string; theme?: MetaLensTheme; enableRealTime?: boolean; enableModeration?: boolean; moderationWords?: string[]; } export interface UseMetaLensReturn { postComment: (params: PostCommentParams) => Promise<string>; getComments: (context: MetaLensContextType, value: string) => Promise<MetaLensComment[]>; subscribeToComments: (context: MetaLensContextType, value: string, callback: (comment: MetaLensComment) => void) => () => void; getCommentCount: (context: MetaLensContextType, value: string) => Promise<number>; } export interface UseMetaLensStreamReturn { comments: MetaLensComment[]; loading: boolean; error: Error | null; refetch: () => void; } export interface UseMetaLensAuthReturn { isAuthenticated: boolean; authenticate: () => Promise<void>; user: MetaLensUser | null; signOut: () => void; signComment: (content: string) => Promise<SignedComment>; } export interface MetaLensUser { address: string; paymail?: string; bapId?: string; avatar?: string; name?: string; } export interface PostCommentParams { context: MetaLensContextType; value: string; subcontext?: string; subcontextValue?: string; content: string; contentType?: "text/plain" | "text/markdown"; parentId?: string; mentions?: string[]; tags?: string[]; } export interface SignedComment { content: string; signature: string; publicKey: string; mapData: Record<string, string>; } export interface MetaLensEvent { type: "comment" | "reaction" | "reply" | "delete"; data: MetaLensComment | MetaLensReaction; context: { type: MetaLensContextType; value: string; }; } export interface MetaLensReaction { txid: string; commentId: string; emoji: string; author: string; timestamp: Date; } export interface BmapTransactionData { tx?: { h: string; }; blk?: { i: number; t: number; }; timestamp?: number; MAP?: Array<Record<string, string>>; B?: Array<{ content: string; "content-type"?: string; }>; AIP?: Array<{ address: string; algorithm?: string; }>; } export interface MetaLensReactionData { commentId: string; emoji: string; removed?: boolean; } export interface MetaLensProviderProps { config?: MetaLensConfig; children: React.ReactNode; } export interface MetaLensCommentsProps { context: MetaLensContextType; value: string; subcontext?: string; subcontextValue?: string; showForm?: boolean; showCount?: boolean; maxHeight?: number | string; onCommentPosted?: (txid: string) => void; className?: string; theme?: MetaLensTheme; } export interface MetaLensBadgeProps { context: MetaLensContextType; value: string; position?: "top-right" | "top-left" | "bottom-right" | "bottom-left"; onClick?: () => void; theme?: "light" | "dark" | "auto"; className?: string; } export interface MetaLensEmbedProps { context: MetaLensContextType; value: string; height?: number | "auto"; scrolling?: boolean; theme?: MetaLensTheme; onHeightChange?: (height: number) => void; onSuccess?: (txid: string) => void; } export interface ModerationRule { type: "word" | "user" | "pattern"; value: string | RegExp; action: "hide" | "blur" | "replace"; replacement?: string; } export interface StreamOptions { autoConnect?: boolean; reconnectInterval?: number; maxReconnects?: number; } export interface MetaLensSearchParams { query?: string; author?: string; context?: MetaLensContextType; startDate?: Date; endDate?: Date; tags?: string[]; limit?: number; offset?: number; } //# sourceMappingURL=index.d.ts.map