UNPKG

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.

53 lines (52 loc) 1.93 kB
import { GetBlockResponse } from '@notionhq/client/build/src/api-endpoints'; import { NotionBlock, TemplateRule } from '../models/config_models'; import { EquationObject, FileObject, MentionObject, TextObject } from '../models/notion_objects'; export declare function applyAnnotations(text: string, annotations: { bold: boolean; italic: boolean; strikethrough: boolean; code: boolean; }): string; /** * @visibleForTesting */ export declare function getMedia(object: FileObject, rule: TemplateRule): { src: string; captionMarkdown: string; }; /** * The object transformers. * * The keys are the object types and the value is the object type to * Markdown transformer. * * These can be overwritten to provide custom implementations. * * See all object types here: src/models/notion_objects.ts */ export declare const ObjectTransformers: { text: (object: TextObject) => string; mention: (object: MentionObject) => string; equation: (object: EquationObject) => string; transform_all: (objects: Array<TextObject | MentionObject | EquationObject>) => string; }; declare type BlockTransformerType = (block: GetBlockResponse, rule: TemplateRule) => string; /** * The block transformers. * * The keys are the block types and the value is the NotionBlock to * Markdown controller for the block. * * These can be overwritten to provide custom implementations. */ export declare const BlockTransformers: Record<string, BlockTransformerType>; export default class MarkdownService { genMarkdownForBlocks(blocks: NotionBlock[], rule: TemplateRule): string; genMarkdownForBlocksWithIndent(blocks: NotionBlock[], rule: TemplateRule, indent: string): string; private getTransformerForBlock; private getMarkdownForBlock; private static _instance; static get instance(): MarkdownService; static setMockedInstance(instance: MarkdownService): void; } export {};