ptn-helpers 0.0.16 → 0.0.17

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.
Files changed (2) hide show
  1. package/lib/index.d.ts +21 -1
  2. package/package.json +1 -1
package/lib/index.d.ts CHANGED
@@ -1,4 +1,24 @@
1
- import { FeedItem, PtnNode } from "./types";
2
1
  export declare const FEED_LINK_KEYS: string[];
2
+ export declare type FeedLinkKey = typeof FEED_LINK_KEYS[number];
3
+ export declare type FeedAttachment = {
4
+ [feedLinkKey in FeedLinkKey]?: string | undefined;
5
+ } & {
6
+ _ptr_media_type: string;
7
+ _ptr_open_graph_image_url?: string;
8
+ url?: string;
9
+ };
10
+ export declare type FeedItem = {
11
+ id: string;
12
+ date_published: string;
13
+ url: string;
14
+ content_text: string;
15
+ attachments?: FeedAttachment[];
16
+ _ptr_sender_type: string;
17
+ };
18
+ export declare type PtnNode = {
19
+ text: string;
20
+ children: PtnNode[];
21
+ uid?: string;
22
+ };
3
23
  export declare const itemToNode: (feedItem: FeedItem, hashtag: string) => PtnNode;
4
24
  export declare const organizeFeedItems: (feedItems: FeedItem[], dateFormat?: string) => Record<string, Record<string, FeedItem[]>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ptn-helpers",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "description": "helper functions to fetch and display ptn data",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",