@mintlify/common
Version:
Commonly shared code within Mintlify
61 lines (60 loc) • 3.3 kB
TypeScript
import type { FrontmatterContent, Heading, Parent, Root, RootContent } from 'mdast';
import { MdxJsxFlowElement } from 'mdast-util-mdx-jsx';
import { RSSItemV2, SavedRssFileV4, SavedRssFileWithContent } from '../types/rss.js';
export type UpdateMDXComponent = MdxJsxFlowElement;
export declare const isFrontmatter: (node: RootContent | undefined) => node is FrontmatterContent;
export declare const isUpdate: (node: RootContent | undefined) => node is UpdateMDXComponent;
export declare const isHeading: (node: RootContent | undefined) => node is Heading;
export declare const isNormalMarkdown: (node: RootContent | undefined) => node is RootContent;
export declare const containsUpdates: (tree: Root) => boolean;
export declare const getTags: (node: UpdateMDXComponent) => string[] | undefined;
export declare const getRssPropsData: (updateComponent: UpdateMDXComponent) => {
rssTitle: string | undefined;
rssDescription: string | undefined;
};
export declare const getUpdateTitle: (updateComponent: UpdateMDXComponent) => string | undefined;
export declare const getUpdateDescription: (updateComponent: UpdateMDXComponent) => string | undefined;
export declare const compareUpdates: ({ newTree, previousTree, }: {
newTree: Root;
previousTree: Root;
}) => UpdateMDXComponent[];
export declare const matchRSSTitle: (node: MdxJsxFlowElement, title: string) => boolean;
export declare const splitChildrenAtHeadings: (children: RootContent[]) => RootContent[][];
export declare const getMarkdownHeadingProps: (heading: Parent) => {
title: string | undefined;
anchor: string | undefined;
};
export declare const updateGroupToRSSItemV2: ({ group, date, }: {
group: RootContent[];
date?: string;
}) => RSSItemV2 | undefined;
export declare const getNewContent: (newUpdateComponents: UpdateMDXComponent[]) => RSSItemV2[];
export declare const getNewMarkdownUpdates: ({ newTree, previousTree, previousUpdates, }: {
newTree: Root;
previousTree: Root;
previousUpdates: RSSItemV2[];
}) => RSSItemV2[];
export declare const containsRssProps: (updateNode: UpdateMDXComponent) => boolean;
export declare const containsMarkdownGroups: (updateNode: UpdateMDXComponent) => boolean;
export declare const containsMarkdownHeading: (updateNode: UpdateMDXComponent, title: string) => boolean;
export declare const processUpdateNode: ({ updateNode, date, }: {
updateNode: UpdateMDXComponent;
date?: string;
}) => RSSItemV2[];
export declare const processUpdatePerNode: ({ updateNode, date, title, description, }: {
updateNode: UpdateMDXComponent;
date: string;
title?: string;
description?: string;
}) => RSSItemV2[];
export declare const processUpdatePerMarkdownGroup: ({ updateNode, date, updatesByMarkdown, }: {
updateNode: UpdateMDXComponent;
date: string;
updatesByMarkdown: RootContent[][];
}) => RSSItemV2[];
export declare const isRSSFileV4: (rssFile: SavedRssFileWithContent | SavedRssFileV4) => rssFile is SavedRssFileV4;
export { enhanceSnippetsWithImportNames } from './enhanceSnippetsWithImportNames.js';
export { getV4FeedUpdates } from './getV4FeedUpdates.js';
export { resolveSnippets } from './resolveSnippets.js';
export { encodeContentAsHtml } from './encodeContentAsHtml.js';
export { UPDATE_MAX } from './constants.js';