astronotion
Version:
Library to make Astro sites with content from Notion
22 lines (21 loc) • 773 B
TypeScript
import type { Collection, PageBlock } from "notion-types";
import type { MakeRequired } from "./type-utils";
export declare type FormatWithCover = Collection["format"] & {
collection_cover_position?: number;
};
export declare type ParentWithCover = Partial<Collection> & {
cover?: string;
format?: FormatWithCover;
};
export declare type EntryWithCover = MakeRequired<Partial<PageBlock>, "format">;
export declare type AnCoverImage = {
url: string;
position?: number;
};
/**
* Get a consistent cover image object between "parent" (collection) page and "child" page.
*
* @param {ParentWithCover | EntryWithCover} data
* @returns {AnCoverImage=}
*/
export declare const getCover: (data: ParentWithCover | EntryWithCover) => AnCoverImage | undefined;