summaryrefslogtreecommitdiff
path: root/shared/src/commonMain/kotlin/dev/serrahima/lluerna/source/PostSource.kt
blob: fbf11bcfee5f6db72d89c6942e1ef7260c8882c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package dev.serrahima.lluerna.source

import dev.serrahima.lluerna.domain.Post

/**
 * the seam that keeps the ui protocol-agnostic.
 *
 * v1 implements exactly one source (`StandardSiteSource`). a future
 * `BlueskySource` / `WafrnSource` implements this same interface; the ui never
 * learns a second protocol.
 *
 * (shape is tentative — it will settle once the feed milestone lands.)
 */
interface PostSource {
    /** a follow-based feed for the given followed publication ids (at-uris). */
    suspend fun feed(followedPublications: List<String>): List<Post>

    /** the full chain ending at [uri], root-first. */
    suspend fun thread(uri: String): List<Post>
}