import { Document, MDX } from 'contentlayer2/core'; type MDXDocument = Document & { body: MDX; }; type MDXDocumentDate = MDXDocument & { date: string; }; type MDXBlog = MDXDocumentDate & { tags?: string[]; draft?: boolean; }; type MDXAuthor = MDXDocument & { name: string; }; declare function dateSortDesc(a: string, b: string): 1 | 0 | -1; /** * Sorts a list of MDX documents by date in descending order * * @param {MDXDocumentDate[]} allBlogs * @param {string} [dateKey='date'] * @return {*} */ declare function sortPosts(allBlogs: T[], dateKey?: string): T[]; /** * Kept for backwards compatibility * Please use `sortPosts` instead * @deprecated * @param {MDXBlog[]} allBlogs * @return {*} */ declare function sortedBlogPost(allBlogs: MDXDocumentDate[]): MDXDocumentDate[]; type ConvertUndefined = OrNull<{ [K in keyof T as undefined extends T[K] ? K : never]-?: T[K]; }>; type OrNull = { [K in keyof T]: Exclude | null; }; type PickRequired = { [K in keyof T as undefined extends T[K] ? never : K]: T[K]; }; type ConvertPick = ConvertUndefined & PickRequired; /** * A typesafe omit helper function * @example pick(content, ['title', 'description']) * * @param {Obj} obj * @param {Keys[]} keys * @return {*} {ConvertPick<{ [K in Keys]: Obj[K] }>} */ declare const pick: (obj: Obj, keys: Keys[]) => ConvertPick<{ [K in Keys]: Obj[K]; }>; /** * A typesafe omit helper function * @example omit(content, ['body', '_raw', '_id']) * * @param {Obj} obj * @param {Keys[]} keys * @return {*} {Omit} */ declare const omit: (obj: Obj, keys: Keys[]) => Omit; type CoreContent = Omit; /** * Omit body, _raw, _id from MDX document and return only the core content * * @param {T} content * @return {*} {CoreContent} */ declare function coreContent(content: T): CoreContent; /** * Omit body, _raw, _id from a list of MDX documents and returns only the core content * If `NODE_ENV` === "production", it will also filter out any documents with draft: true. * * @param {T[]} contents * @return {*} {CoreContent[]} */ declare function allCoreContent(contents: T[]): CoreContent[]; export { CoreContent, MDXAuthor, MDXBlog, MDXDocument, MDXDocumentDate, allCoreContent, coreContent, dateSortDesc, omit, pick, sortPosts, sortedBlogPost };