astronotion
Version:
Library to make Astro sites with content from Notion
40 lines (39 loc) • 1.53 kB
TypeScript
import type { ExtendedRecordMap } from "notion-types";
import type { AnParentPage, AnEntryPage } from "./transform-page";
declare type AnAstroStaticPathBase = {
params: {
fullSlug: string;
};
};
export declare type AnTopLevelAstroStaticPath = AnAstroStaticPathBase & {
props: AnParentPage | AnEntryPage;
};
export declare type AnChildAstroStaticPath = AnAstroStaticPathBase & {
props: AnEntryPage;
};
export declare type AnConfigPage = {
notionId: string;
path: string;
};
/**
* Transform notion-client API data to Astro's getStaticPaths object
* for user-specified top-level pages. These pages can be either a
* "parent" (collection) page or a standalone entry page.
*
* ⚠️ Keep transform/customisation implementations in the transformBlah
* helper functions, not here.
*
* @link https://docs.astro.build/en/reference/api-reference/#getstaticpaths
*/
export declare const getTopLevelAstroStaticPathData: (data: ExtendedRecordMap, configs?: AnConfigPage[]) => AnTopLevelAstroStaticPath | undefined;
/**
* Transform notion-client API data to Astro's getStaticPaths object
* for "child" pages, ie. pages inside a top-level collection/DB page.
*
* ⚠️ Keep transform/customisation implementations in the transformBlah
* helper functions, not here.
*
* @link https://docs.astro.build/en/reference/api-reference/#getstaticpaths
*/
export declare const getChildAstroStaticPathData: (data: ExtendedRecordMap, configs?: AnConfigPage[]) => AnChildAstroStaticPath | undefined;
export {};