Skip to main content
class LetterboxLayer
import { LetterboxLayer } from "https://deno.land/x/earthstar_rich_threads@v2.3.0/mod.ts";

Constructors

new
LetterboxLayer(replica: Earthstar.Replica, user: Earthstar.AuthorKeypair | null)

Properties

_identity: Earthstar.AuthorKeypair | null
_replica: Earthstar.Replica

Methods

_createReplyDoc(
content: string,
threadRootTimestamp: number,
threadRootAuthor: string,
deleteAfter?: number,
): Promise<Earthstar.Doc | Earthstar.ValidationError>
_createRootDoc(content: string, deleteAfter?: number): Promise<Earthstar.Doc | Earthstar.ValidationError>
_docToPost(postDoc: Earthstar.Doc): Post
_docToThreadRoot(rootDoc: Earthstar.Doc): Post
clearReplyDraft(threadRootTimestamp: number, threadRootAuthor: string)
createReply(
threadRootTimestamp: number,
threadRootAuthorPubKey: string,
content: string,
deleteAfter?: number,
): Promise<Post | Earthstar.ValidationError>
createThread(content: string, deleteAfter?: number): Promise<Thread | Earthstar.ValidationError>
editPost(post: Post, content: string): Promise<Earthstar.Doc | Earthstar.ValidationError>
getDraftThreadParts(id: string): Promise<{ title: string; content: string; } | undefined>
getPostTimestamp(postDoc: Earthstar.Doc): number
getReplyDraft(threadRootTimestamp: number, threadRootAuthor: string): Promise<string | undefined>
getReplyTimestamp(postDoc: Earthstar.Doc): number
getThread(timestamp: number, authorPubKey: string): Promise<Thread | undefined>
getThreadRootDraftContent(id: string): Promise<string | undefined>
getThreadRootDraftIds(): Promise<string[]>
getThreadRoots(): Promise<Post[]>
getThreadRootTimestamp(rootDoc: Earthstar.Doc): number
getThreads(): Promise<Thread[]>
getThreadTitle(thread: Thread): string | undefined
isUnread(post: Post): Promise<boolean>
markReadUpTo(
threadRootTimestamp: number,
threadRootAuthorPubKey: string,
readUpToTimestamp: number,
)
setReplyDraft(
threadRootTimestamp: number,
threadRootAuthor: string,
content: string,
): Promise<Earthstar.Doc | Earthstar.ValidationError>
setThreadRootDraft(content: string, id?: string): Promise<string | Earthstar.ValidationError>
threadHasUnreadPosts(thread: Thread): Promise<boolean>