motionlink-cli
Version:
Making it easy to use Notion as a Content Management system for personal websites, portfolios, blogs, business homepages, and other kinds of static websites.
56 lines (55 loc) • 2.64 kB
TypeScript
import { NotionDatabaseAssociation, Token } from '../models/app_models';
import { Context, DatabaseRule, NotionBlock, NotionDatabase, NotionPage, TemplateRule } from '../models/config_models';
export interface BuildService {
build: (templateRules: TemplateRule[], databaseAssociations: NotionDatabaseAssociation[]) => Promise<void>;
}
export declare function newBuildService(): BuildService;
export declare class FileExtensionFinder {
findFileExtensionOf(path: string): string;
}
export declare class DatabaseAssociationFinder {
findDatabaseAssociationFor(rule: DatabaseRule, databaseAssociations: NotionDatabaseAssociation[]): NotionDatabaseAssociation;
}
export declare class CachingFileReader {
readAsString(path: string): string;
private fileChache;
}
export declare class TemplateRuleOutputWriter {
write(page: NotionPage, pageTemplateRule: TemplateRule): Promise<void>;
setFileExtensionFinder(fileExtensionFinder: FileExtensionFinder): this;
setCachingFileReader(reader: CachingFileReader): this;
private fileReader?;
private fileExtensionFinder?;
}
export declare class BlockChildrenFetcher {
fetchChildren(bId: string, notionToken: Token): Promise<NotionBlock[]>;
private _parseBlock;
}
export declare class DatabaseFetcher {
fetchDatabase(args: {
databaseRule: DatabaseRule;
association: NotionDatabaseAssociation;
context: Context;
onPostPageMapping: (notionPage: NotionPage) => Promise<NotionPage>;
}): Promise<NotionDatabase>;
setBlockChildrenFether(blockChildrenFetcher: BlockChildrenFetcher): this;
private blockChildrenFetcher;
}
export declare class SecondaryDatabasesFetcher {
fetchAll(databaseRules: DatabaseRule[], databaseAssociations: NotionDatabaseAssociation[], ctx: Context): Promise<Record<string, NotionDatabase>>;
setDatabaseFetcher(databaseFetcher: DatabaseFetcher): this;
setDatabaseAssociationFinder(finder: DatabaseAssociationFinder): this;
private databaseFetcher;
private databaseAssociationFinder;
}
export declare class TemplateRuleBuilder {
build(rule: TemplateRule, databaseAssociations: NotionDatabaseAssociation[]): Promise<void>;
setSecondaryDatabasesFetcher(secondaryDatabasesFetcher: SecondaryDatabasesFetcher): this;
setDatabaseFetcher(databaseFetcher: DatabaseFetcher): this;
setTemplateRuleOutputWriter(writer: TemplateRuleOutputWriter): this;
setDatabaseAssociationFinder(finder: DatabaseAssociationFinder): this;
private secondaryDatabasesFetcher;
private databaseFetcher;
private templateRuleOutputWriter;
private databaseAssociationFinder;
}