@mdfriday/foundry
Version:
The core engine of MDFriday. Convert Markdown and shortcodes into fully themed static sites – Hugo-style, powered by TypeScript.
66 lines (65 loc) • 2.7 kB
TypeScript
import { Page, Pages, PageSource } from '../type';
import { PageTrees, PageTreesNode } from './pagetrees';
import { PageBuilder } from './pagebuilder';
import { FileInfo } from '../vo/fileinfo';
import { DynaCache } from '@pkg/cahce/cache';
export declare function addTrailingSlash(path: string): string;
export declare const pagePredicates: {
kindPage: (p: Page) => boolean;
kindSection: (p: Page) => boolean;
kindHome: (p: Page) => boolean;
kindTerm: (p: Page) => boolean;
shouldListLocal: (p: Page) => boolean;
shouldListGlobal: (p: Page) => boolean;
shouldListAny: (p: Page) => boolean;
shouldLink: (p: Page) => boolean;
};
export interface PageMapQueryPagesBelowPath {
path: string;
keyPart: string;
include: (p: Page) => boolean;
key(): string;
}
export interface PageMapQueryPagesInSection extends PageMapQueryPagesBelowPath {
recursive: boolean;
includeSelf: boolean;
index: number;
key(): string;
}
export declare class PageMapQueryPagesBelowPathImpl implements PageMapQueryPagesBelowPath {
path: string;
keyPart: string;
include: (p: Page) => boolean;
constructor(path: string, keyPart: string, include?: (p: Page) => boolean);
key(): string;
}
export declare class PageMapQueryPagesInSectionImpl extends PageMapQueryPagesBelowPathImpl implements PageMapQueryPagesInSection {
recursive: boolean;
includeSelf: boolean;
index: number;
constructor(path: string, keyPart: string, recursive: boolean, includeSelf: boolean, index: number, include?: (p: Page) => boolean);
key(): string;
}
export declare class PageMap extends PageTrees {
private pageReverseIndex;
pageBuilder: PageBuilder;
constructor(pageBuilder: PageBuilder);
setupReverseIndex(): void;
insertResourceNode(key: string, node: PageTreesNode): void;
addFi(f: FileInfo): Promise<void>;
assemble(): Promise<void>;
private assembleTerms;
private cleanPages;
private applyAggregates;
private assembleStructurePages;
private addMissingTaxonomies;
private addMissingStandalone;
getResourcesForPage(ps: Page): Promise<PageSource[]>;
private forEachResourceInPage;
getPagesInSection(langIndex: number, q: PageMapQueryPagesInSection): Promise<Pages>;
getOrCreatePagesFromCacheSync(cache: DynaCache<string, Pages> | null, key: string, create: (key: string) => Promise<Pages>): Promise<Pages>;
getPagesWithTerm(langIndex: number, q: PageMapQueryPagesBelowPath): Promise<Pages>;
getTermsForPageInTaxonomy(langIndex: number, base: string, taxonomy: string): Promise<Pages>;
getSections(langIndex: number, prefix: string): Promise<Pages>;
private pathDir;
}