blogger-feeds
Version:
Read-only utilities and client for Blogger feeds
39 lines (38 loc) • 1.21 kB
TypeScript
export type SingleMeta = {
blog: string;
blogId: string;
postId: string;
updated: string;
etag: string;
total: null;
'start-index': null;
'max-results': null;
self: string;
href: string;
next: null;
};
export type PagedMeta = {
blog: string;
blogId: string;
postId: string;
updated: string;
etag: string;
total: number | null;
'start-index': number | null;
'max-results': number;
self: string;
href: string;
next: string | null;
};
export type SchemaParser = (raw: any, meta: PagedMeta | SingleMeta) => any;
export declare const extractLink: (raw: any, link: string) => string;
/**
* Maps each result data prop to its own schemaParser
* * must be fail-safe because blogger may change anytime
* * extracts the most important flags from feeds:
* - blog, holds the only reference to the custom domain
* - blogId, flag required by blog flows
* - postId, flag required by single / paged flows
* - next, flag and url to next paged posts group
*/
export declare const MetaSchema: Map<"blog" | "blogId" | "postId" | "updated" | "etag" | "total" | "start-index" | "max-results" | "self" | "href" | "next", SchemaParser>;