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

Constructors

new
LetterboxLayerCache(replica: Earthstar.ReplicaCache, user: Earthstar.AuthorKeypair | null)

Properties

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

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): { title: string; content: string; } | undefined
getPostTimestamp(postDoc: Earthstar.Doc): number
getReplyDraft(threadRootTimestamp: number, threadRootAuthor: string): string | undefined
getReplyTimestamp(postDoc: Earthstar.Doc): number
getThread(timestamp: number, authorPubKey: string): Thread | undefined
getThreadRootDraftContent(id: string): string | undefined
getThreadRootTimestamp(rootDoc: Earthstar.Doc): number
getThreadTitle(thread: Thread): string | undefined
isUnread(post: Post): 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): boolean