hive-react-kit 0.10.6 → 0.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build.css +6 -3
- package/dist/components/community/CommunityDetail.d.ts +16 -1
- package/dist/components/community/CommunitySnapsTab.d.ts +56 -0
- package/dist/index.cjs.js +188 -188
- package/dist/index.esm.js +13940 -13690
- package/dist/services/communityService.d.ts +33 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CommunityItem, CommunityDetailsResponse, CommunitySubscriber, CommunityActivity } from '../types/community';
|
|
2
|
+
import { Post } from '../types/post';
|
|
2
3
|
declare class CommunityService {
|
|
3
4
|
/** Always read the latest endpoint — `setHiveApiEndpoint()` may have been
|
|
4
5
|
* called after construction, and a stale instance field would miss it. */
|
|
@@ -12,6 +13,38 @@ declare class CommunityService {
|
|
|
12
13
|
communityIcon(value: string): string;
|
|
13
14
|
userOwnerThumb(value: string): string;
|
|
14
15
|
getCommunityActivities(account: string, limit?: number, lastId?: number): Promise<CommunityActivity[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Snap references for a community, sourced from our `hreplier-api`
|
|
18
|
+
* `/snaps` endpoint with the `tag=<communityId>` filter. Mirrors
|
|
19
|
+
* peakd.com's public `/api/public/snaps/tags?container=…&tags=…`
|
|
20
|
+
* query but routes through our own backend. Returns the unsorted
|
|
21
|
+
* list of `{ id, author, permlink }` references; full post data is
|
|
22
|
+
* materialised by `getCommunitySnaps` via batched bridge.get_post.
|
|
23
|
+
*/
|
|
24
|
+
getCommunitySnapReferences(communityId: string, parent: string, signal?: AbortSignal): Promise<{
|
|
25
|
+
id: number;
|
|
26
|
+
author: string;
|
|
27
|
+
permlink: string;
|
|
28
|
+
}[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Community-scoped snaps for one container (`peak.snaps`,
|
|
31
|
+
* `ecency.waves`, `leothreads`, `liketu.moments`). The hreplier-api
|
|
32
|
+
* `/snaps?parent=&tag=` endpoint returns the full reference list in
|
|
33
|
+
* one shot and has no server-side pagination, so we cache it per
|
|
34
|
+
* (communityId, parent) and slice client-side. `startId` is the
|
|
35
|
+
* 20-item page offset:
|
|
36
|
+
* - undefined / 0 → first 20 refs
|
|
37
|
+
* - 20, 40, … → subsequent pages
|
|
38
|
+
* `nextStartId` is the next offset to request, or null when
|
|
39
|
+
* exhausted.
|
|
40
|
+
*
|
|
41
|
+
* Only the current slice is materialised via `bridge.get_post`, so
|
|
42
|
+
* switching pages stays snappy.
|
|
43
|
+
*/
|
|
44
|
+
getCommunitySnaps(communityId: string, parent: string, startId?: number, observer?: string, signal?: AbortSignal): Promise<{
|
|
45
|
+
snaps: Post[];
|
|
46
|
+
nextStartId: number | null;
|
|
47
|
+
}>;
|
|
15
48
|
}
|
|
16
49
|
export declare const communityService: CommunityService;
|
|
17
50
|
export {};
|