hexo-post-parser
Version:
Parse Hexo Post To Object and pre-process all markdown posts for Automated SEO
1,120 lines (1,069 loc) • 35.9 kB
TypeScript
import * as sbg_utility from 'sbg-utility';
import * as hexo from 'hexo';
import momentInstance from 'moment-timezone';
import fs from 'fs-extra';
import events from 'events';
import { TypedEmitter } from 'tiny-typed-emitter';
import * as url from 'url';
import Bluebird from 'bluebird';
import * as glob from 'glob';
import upath from 'upath';
import * as front_matter from 'front-matter';
/**
* null | type
*/
type Nullable<T> = T | null | undefined;
/**
* Partializing properties
* @see {@link https://stackoverflow.com/a/40076355/6404439}
*/
type Partial$1<T> = {
[P in keyof T]?: T[P];
};
/**
* Partializing properties deeper
* @see {@link https://stackoverflow.com/a/40076355/6404439}
*/
type DeepPartial<T> = {
[P in keyof T]?: T[P] extends Record<string, unknown> ? DeepPartial<T[P]> : T[P];
};
declare function require<T>(name: string): T;
declare const nocache: any;
declare const verbose: any;
declare const defaultSiteOptions: DeepPartial<hexo['config']>;
type SiteConfig = typeof defaultSiteOptions & Record<string, any>;
/**
* find `_config.yml` and set to config
* @param file
*/
declare function findConfig(file?: string): void;
/**
* get site _config.yml
* @returns
*/
declare function getConfig(): SiteConfig;
/**
* assign new option
* @param obj
* @returns
*/
declare function setConfig(obj: Record<string, any>): SiteConfig;
type HC = sbg_utility.config.ProjConf;
interface ProjectConfig extends HC {
[key: string]: any;
/**
* Source posts
*/
post_dir: string;
/**
* Project CWD
*/
cwd: string;
}
/**
* Hexo Generated Dir
*/
declare const post_generated_dir: string;
/**
* SBG Source Post Dir
*/
declare const post_source_dir: string;
declare function moment$1(date?: momentInstance.MomentInput, format?: string): momentInstance.Moment;
/**
* custom moment
*/
declare const cmoment: typeof moment$1;
declare const customMoment: typeof moment$1;
declare const momentHpp: typeof moment$1;
declare const momentHexoPostParser: typeof moment$1;
/**
* Moment check date is today
* @param date
* @returns
*/
declare const isToday: (date: any) => boolean;
type DateMapperInput = momentInstance.MomentInput | parseDateMapper;
/**
* HexoJS date formatter
* * Playground Test {@link https://codepen.io/dimaslanjaka/pen/LYegjaV}
*/
declare class parseDateMapper {
data: momentInstance.Moment;
constructor(date: DateMapperInput);
format: (pattern: string) => string;
year: () => string;
toString: () => string;
}
interface ParseOptions {
/** process shortcodes? */
shortcodes?: {
/**
* Transform shortcode `<!-- css path/to/file.css -->`
*/
css: boolean;
/**
* Transform shortcode `<!-- script path/to/file.js -->`
*/
script: boolean;
/**
* Transform shortcode `<!-- include path/to/file -->`
*/
include: boolean;
/**
* Transform shortcode `{% youtube id 'type' %}` tag
*/
youtube: boolean;
/**
* Transform hyperlinks ends with `path/to/file.md` with `path/to/file.html`
*/
link: boolean;
/**
* Transform shortcode `<!-- extract-text path/to/file -->`
* @see {@link extractText}
*/
text: boolean;
/**
* Transform shortcode `<!-- now() -->`
* @see {@link shortcodeNow}
*/
now: boolean;
codeblock: boolean;
};
/** use cache? */
cache?: boolean;
/**
* Source File, keep empty when first parameter (text) is file
*/
sourceFile?: null | string;
/**
* Format dates?
*/
formatDate?: boolean | {
pattern: string;
};
/**
* Site Config
*/
config?: ReturnType<typeof getConfig> & Record<string, any>;
/**
* run auto fixer such as thumbnail, excerpt, etc
*/
fix?: boolean;
/** default thumbnail */
defaultThumb?: string;
}
/**
* Post author object type
*/
interface postAuthor {
[key: string]: any;
/**
* Author name
*/
name?: string;
/**
* Author email
*/
email?: string;
/**
* Author website url
*/
link?: string;
}
interface DynamicObject {
[keys: string]: any;
}
/**
* post metadata information (title, etc)
*/
interface postMeta {
[key: string]: any;
/**
* Article language code
*/
lang?: string;
/**
* Article title
*/
title: string;
/**
* published indicator
* * 1 / true = published
* * 0 / false = drafted
*/
published?: boolean | 1 | 0;
/**
* post description
*/
description?: string;
/**
* word count
*/
wordcount?: number;
/**
* Auto generated fixed id with uuid v4
*/
id?: string;
/**
* Post modified date
*/
updated?: string | parseDateMapper;
/**
* Author metadata
*/
author?: string | postAuthor;
/**
* Post published date
*/
date?: string | parseDateMapper;
/**
* Post tags
*/
tags?: string[];
/**
* Post categories
*/
categories?: string[];
/**
* All photos of post/page
*/
photos?: string[];
/**
* thumbnail
*/
cover?: string;
/**
* thumbnail (unused when `cover` property is settled)
*/
thumbnail?: string;
/**
* Post moved indicator
* * canonical should be replaced to this url
* * indicate this post was moved to another url
*/
redirect?: string;
/**
* full url
*/
url?: string;
/**
* just pathname
*/
permalink?: string;
/**
* archive (index, tags, categories)
*/
type?: 'post' | 'page' | 'archive';
/**
* Custom layout (hexo)
*/
layout?: string;
}
interface postMap {
[key: string]: any;
/**
* Article metadata as string
*/
metadataString?: string;
fileTree?: {
/**
* [post source] post file from `src-posts/`
*/
source?: string;
/**
* [public source] post file from source_dir _config.yml
*/
public?: string;
};
/**
* _config.yml
*/
config?: ReturnType<typeof getConfig> | null;
/**
* Article metadata
*/
metadata?: postMeta;
/**
* Article body
*/
body?: string;
/**
* raw body (no shortcodes parsed)
*/
rawbody: string;
/**
* Article body (unused when property `body` is settled)
*/
content?: string;
}
/**
* Rebuild {@link parsePost} result to markdown post back
* @param parsed parsed post return {@link parsePost}
* @returns
*/
declare function buildPost(parsed: Partial<postMap>): string;
/**
* generate post id using uuid v4
* @param meta
* @returns
*/
declare function generatePostId(meta: postMeta | string): string;
/**
* Loop dir recursive
* @param destDir
* @param debug
*/
declare function loopDir(destDir: fs.PathLike | string, debug?: boolean): string[];
declare function copyDir(source: string, dest: string, callback?: (err: any | null) => void): void;
/**
* slash alternative
* ```bash
* npm i slash #usually
* ```
* @url {@link https://github.com/sindresorhus/slash}
* @param path
*/
declare function slash(path: string): string;
/**
* check variable is empty, null, undefined, object/array length 0, number is 0
* @param data
* @returns
*/
declare const isEmpty: (data: any) => boolean;
/**
* Cacheable validate url is valid and http or https protocol
* @param str
* @returns
*/
declare function isValidHttpUrl(str: string): boolean;
declare const EOL = "\n";
declare const converterOpt: {
strikethrough: boolean;
tables: boolean;
tablesHeaderId: boolean;
};
/**
* Transform markdown string to html string
* @package showdown
* @param str
*/
declare function renderShowdown(str: string): string;
/**
* Render markdown to html using `markdown-it`, `markdown-it-attrs`, `markdown-it-anchors`, `markdown-it-sup`, `markdown-it-sub`, `markdown-it-mark`, `markdown-it-footnote`, `markdown-it-abbr`
* * {@link https://www.npmjs.com/package/markdown-it-attrs}
* * {@link https://www.npmjs.com/package/markdown-it-attrs}
* * {@link https://www.npmjs.com/package/markdown-it-anchors}
* * {@link https://www.npmjs.com/package/markdown-it-sup}
* * {@link https://www.npmjs.com/package/markdown-it-sub}
* * {@link https://www.npmjs.com/package/markdown-it-mark}
* * {@link https://www.npmjs.com/package/markdown-it-footnote}
* * {@link https://www.npmjs.com/package/markdown-it-abbr}
* @param str
* @returns
*/
declare function renderMarkdownIt(str: string): string;
/**
* Renders a markdown string using Marked.js, with optional caching.
*
* @param str - The markdown string to render.
* @param cache - If true, caches the result in a temporary file.
* @returns The rendered HTML content.
*/
declare function renderMarked(str: string, cache?: boolean): string;
/**
* mapped type
*/
type mergedPostMap = DeepPartial<postMap & postMap['metadata']>;
interface archiveMap extends mergedPostMap {
[key: string]: any;
/**
* previous page items
*/
prev?: mergedPostMap[] | null;
/**
* next page items
*/
next?: mergedPostMap[] | null;
/**
* current page number
*/
page_now?: number;
/**
* next page number
*/
page_next?: number;
/**
* next page url (only visible on archive generator)
*/
page_next_url?: string;
/**
* previous page url (only visible on archive generator)
*/
page_prev_url?: string;
/**
* previous page number
*/
page_prev?: number;
/**
* page total
*/
total?: number;
}
/**
* transform array into an mapped chunks
* @param chunks
* @returns
*/
declare function postChunksMapper<T extends any[][]>(chunks: T): T;
declare function array_wrap<T extends any[]>(arr: T): T;
interface DumperType extends Object {
[key: string]: any;
next: any;
prev: any;
posts: any[];
content: string;
}
declare function simplifyDump<T>(post: T, except?: string[] | string): T;
declare function simplifyDump<T extends any[]>(post: T, except?: string[] | string): T;
/**
* * group 0 = whole codeblock
* * group 1 = code language when exist otherwise inner codeblock
* * group 2 = inner codeblock
*/
declare const re_code_block: RegExp;
declare const re_inline_code_block: RegExp;
declare const re_script_tag: RegExp;
declare const re_style_tag: RegExp;
interface RenderBodyOptions extends Partial<postMap> {
/**
* enable dump
*/
verbose?: boolean;
/**
* the content
*/
body: string;
}
interface ClassEvents {
beforeRender: (body: string) => void;
afterRender: (body: string) => void;
}
interface RenderMarkdownBody {
on<U extends keyof ClassEvents>(event: U, listener: ClassEvents[U]): this;
emit<U extends keyof ClassEvents>(event: U, ...args: Parameters<ClassEvents[U]>): boolean;
}
declare class RenderMarkdownBody extends events.EventEmitter {
private options;
private codeBlocks;
private styleScriptBlocks;
constructor(options: RenderBodyOptions);
/**
* extract markdown codeblock
*/
extractCodeBlock(): this;
getExtractedCodeblock(): string[];
private re;
extractStyleScript(): this;
getExtractedStyleScript(): {
script: string[];
style: string[];
};
restoreCodeBlock(): this;
restoreStyleScript(): this;
renderMarkdown(): this;
/**
* get the content
* @returns
*/
getContent(): string;
/**
* update the content
* @param content
*/
setContent(content: string): this;
}
/**
* Fixable render markdown mixed with html
* * render {@link postMap.body}
* @todo render markdown to html
* @param options
* @returns
*/
declare function renderBodyMarkdown(options: RenderBodyOptions): string;
/**
* Save Parsed Hexo markdown post
* @param parsed return {@link parsePost}
* @param file file path to save
*/
declare function saveParsedPost(parsed: postMap, file: string): void;
/**
* validate {@link parsePost}
* @param parse
* @returns
*/
declare const validateParsed: (parse: postMap) => boolean;
declare function nodeListOf2Html(nodes: NodeListOf<Element>): any;
declare class array_iterator {
data: any[];
constructor(arr: any[]);
/**
* @see {@link https://stackoverflow.com/a/62889031/6404439}
* @returns
*/
values(): {
[Symbol.iterator](): any;
next(): {
value: any;
done: boolean;
} | {
done: boolean;
value?: undefined;
};
previous(): {
value: any;
done: boolean;
} | {
done: boolean;
value?: undefined;
};
};
}
declare function uniqueArray<T extends any[]>(array: T): T;
/**
* Unique Array Of Strings
* @description Lowercase all string and filter duplicated from them
* @param arr
* @returns
*/
declare function uniqueStringArray(arr: Array<string>): string[];
type Func = (...args: any[]) => any;
declare class memoizer {
cache: {};
memoize: <F extends Func>(fn: F) => F;
/**
* @see {@link memoizer.memoize}
*/
fn: <F extends Func>(fn: F) => F;
/**
* cache directory
*/
cacheDir: string;
verbose: boolean;
/**
* determine function return type
* @param arg
* @returns
*/
determineType(arg: any): "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | "array";
/**
* clear cache function
* @param fn
*/
clear(fn: Func, ...args: any[]): void;
/**
* get function cache file
* @param fn
* @param args
* @returns
*/
getCacheFilePath(fn: Func, ...args: any[]): string;
/**
* determine function
* @param fn
* @param _args
* @returns
*/
private determinefn;
}
declare const memoizeFs: <F extends Func>(fn: F) => F;
/**
* default folder to save databases
*/
declare const dbFolder: string;
interface CacheOpt {
/**
* immediately save cache value
* * default false
*/
sync?: boolean;
/**
* root/folder to save entire databases
* * default node_modules/.cache/dimaslanjaka
*/
folder?: string;
}
/**
* @default
*/
type ResovableValue = {
/**
* resolve all `cache value` instead `value location file`, default `true`
*/
resolveValue?: boolean;
/**
* max result, default null
*/
max?: number;
/**
* randomize entries, default false
*/
randomize?: boolean;
};
declare const defaultResovableValue: ResovableValue;
interface CacheFileEvent {
update: () => void;
}
/**
* @summary IN FILE CACHE.
* @description Save cache to file (not in-memory), cache will be restored on next process restart.
*/
declare class CacheFile extends TypedEmitter<CacheFileEvent> {
getInstance(): this;
private total;
getTotal(): number;
/**
* memoizer persistent file
* * cached function result for reusable
* @see {@link memoizer}
*/
static memoizer: memoizer;
md5Cache: DynamicObject;
dbFile: string;
static options: CacheOpt;
private currentHash;
constructor(hash?: string, opt?: CacheOpt);
/**
* clear cache
* @returns
*/
clear(): Promise<Error[]>;
/**
* @see {@link CacheFile.set}
* @param key
* @param value
* @returns
*/
setCache: (key: string, value: any) => CacheFile;
/**
* resolve long text on key
*/
resolveKey(key: string): string;
/**
* locate ${CacheFile.options.folder}/${currentHash}/${unique key hash}
* @param key
* @returns
*/
locateKey: (key: string) => string;
dump(key?: string): {
resolveKey: string;
locateKey: string;
db: string;
};
set(key: string, value: any): CacheFile;
/**
* check cache key exist
* @param key key cache
* @returns boolean
*/
has(key: string): boolean;
/**
* Get cache by key
* @param key
* @param fallback
* @returns
*/
get(key: string, fallback?: any): any;
getCache: (key: string, fallback?: any) => any;
/**
* get all databases
* @param opt Options
* @returns object keys and values
*/
getAll(opt?: ResovableValue): DynamicObject;
/**
* get all database values
* @param opt Options
* @returns array values
*/
getValues<T = any>(opt?: ResovableValue): T[];
/**
* Check file is changed with md5 algorithm
* @param path0
* @returns
*/
isFileChanged(path0: string): boolean;
}
type postResult = mergedPostMap;
declare class CachePost extends CacheFile {
constructor();
}
declare const Post: typeof CachePost;
/**
* Get information date of files
*/
/**
* get modified date of file
* @param path
* @returns
*/
declare function getModifiedDateOfFile(path: fs.PathLike): Promise<{
mtime: Date;
ctime: Date;
'Status Last Modified': Date;
'Data Last Modified': Date;
}>;
type ErrnoException = NodeJS.ErrnoException;
/**
* node_modules/.cache/${name}
*/
declare const cacheDir: string;
type Mutable<T> = {
-readonly [k in keyof T]: T[k];
};
type readDirectoryRecursivePromise = (files: string[] | ErrnoException) => any;
type readDirectoryRecursiveCb = (err: ErrnoException, results?: string[]) => any;
declare function readDirectoryRecursive(dirPath: string): Bluebird<Parameters<readDirectoryRecursivePromise>[0]>;
declare function removeMultiSlashes(str: string): string;
declare const globSrc: (pattern: string, opts?: glob.GlobOptionsWithFileTypesUnset) => Bluebird<string[]>;
interface ResolveOpt {
[key: string]: any;
/**
* validate path exists, otherwise null
*/
validate?: boolean;
}
/**
* @see {@link upath.resolve}
* @param str
* @param opt
* @returns
*/
declare const resolve: (str: string, opt?: ResolveOpt | any) => string;
/**
* nullable read file synchronous
* @param path
* @param opt
* @returns
*/
declare function read(path: string, opt?: Parameters<typeof fs.readFileSync>[1]): string | Buffer;
/**
* smart join to unix path
* * removes empty/null/undefined
* @param str
* @returns
*/
declare const join: typeof upath.join;
declare const write: (path: fs.PathLike, content: any) => Bluebird<string | Buffer | url.URL>;
declare const rmdirSync: (path: fs.PathLike, options?: fs.RmOptions) => void;
declare const rm: (path: fs.PathLike, options?: fs.RmOptions | fs.NoParamCallback, callback?: fs.NoParamCallback) => void;
declare const mkdirSync: (path: fs.PathLike, options?: fs.MakeDirectoryOptions) => string;
declare const fsreadDirSync: typeof fs.readdirSync;
declare const existsSync: typeof fs.existsSync;
declare const readFileSync: typeof fs.readFileSync;
declare const appendFileSync: typeof fs.appendFileSync;
declare const statSync: fs.StatSyncFn;
declare const basename: typeof upath.basename;
declare const relative: typeof upath.relative;
declare const extname: typeof upath.extname;
declare const PATH_SEPARATOR: "/" | "\\";
/**
* MD5 file synchronously
* @param path
* @returns
*/
declare function md5FileSync(path: string): string;
/**
* PHP MD5 Equivalent
* @param data
* @returns
*/
declare function md5(data: string): string;
/**
* transform path to slugify version
* @param str
* @returns
*/
declare function slugifySanitizeFilename(str: string): string;
declare const defOpt: {
separator: string;
lowercase: boolean;
decamelize: boolean;
customReplacements: string[];
preserveLeadingUnderscore: boolean;
preserveTrailingDash: boolean;
};
type SlugifyOpt = typeof defOpt | {
[key: string]: any;
};
declare function slugifyWithCounter(): {
(str: string, options: SlugifyOpt): string;
reset(): void;
};
/**
* clean white spaces
* @param s
* @returns
*/
declare function cleanWhiteSpace(text: string): string;
/**
* clean string with exception char
* @param text
* @returns
*/
declare function cleanString(text: string, exception?: string): string;
/**
* Replace string by array pattern
* @param array
* @param replacement
* @example
* replaceArr('str', ['s','r'], ''); // t
* replaceArr('str', ['s','r'], ['a s', 'ring']); // a string
*/
declare function replaceArr(str: string, array: (string | RegExp)[], replacement: string | string[]): string;
/**
* generate random id
* @param n
* @param prefix
* @returns
*/
declare const makeid: (n?: number, prefix?: string) => string;
/**
* transform permalink format in `_config.yml`
* @param post post path
*/
declare function parsePermalink(post: string, config: {
[key: string]: any;
/**
* permalink pattern
*/
permalink: string;
url: string;
/**
* post created date
*/
date: moment.MomentInput;
/**
* post title
*/
title: string;
}): string;
/**
* Parse Hexo markdown post (structured with yaml and universal markdown blocks)
* * return {@link postMap} metadata {string & object} and body
* * return {@link null} == failed
* @param target file path or string markdown contents (used for cache key)
* @param options options parser
* * {@link ParseOptions.sourceFile} used for cache key when `target` is file contents
*/
declare function parsePost(target: string, options?: ParseOptions): Promise<postMap>;
/**
* parse post using front-matter
* @param source markdown post string or path
* @returns
*/
declare function parsePostFM(source: string): front_matter.FrontMatterResult<postMeta>;
declare function shortcodeCodeblock(str: string): Promise<string>;
/**
* Parse shortcode css
* ```html
* <!-- css /path/file.css -->
* ```
* @param file file path
* @param str body content
* @returns
*/
declare function shortcodeCss(file: string, str: string): string;
declare function datatables(file: string, str: string): string;
declare function extractText(file: string, str: string): string;
/**
* Replace hyperlinks endswith .md with .html
* @param content body string
* @returns
*/
declare function replaceMD2HTML(content: string): string;
declare function shortcodeImportPost(file: string, str: string): void;
/**
* Process `shortcode include` to included in file, shortcode below:
* ```html
* <!-- include file.ext -->
* ```
* @param sourceFile
* @param bodyString
* @returns
*/
declare function parseShortCodeInclude(sourceFile: string, bodyString: string): string;
/**
* Parse shortcode script
* ```html
* <!-- script /path/file.js -->
* ```
* @param file markdown file
* @param str content to replace
* @returns
*/
declare function shortcodeScript(file: string, str: string): string;
/**
* Current date time
* @return string ex> '2012-11-04 14:55:45'
*/
declare function now(): string;
/**
* Transform `now shortcode` to current formatted time
* ```html
* <!-- now() -->
* ```
* @param file
* @see {@link now}
*/
declare function shortcodeNow(file: string | fs.PathLike, read: string): string;
/**
* Parse shortcode youtube
* * `{% youtube video_id [type] [cookie] %}` will compiled to `<div class="video-container"><iframe src="youtube url"></iframe></div>`
*/
declare function shortcodeYoutube(content: string): string;
/**
* sort object keys alphabetically or reversed
* @param obj
* @param param1
* @see {@link https://stackoverflow.com/a/72773057/6404439}
* @returns
*/
declare const sortObjectByKeys: <T extends Record<string, any>>(obj: T, { desc }?: {
desc?: boolean;
}) => T;
declare function removeDoubleSlashes(str: string): string;
/**
* count words boundary
* @param str
* @returns
*/
declare function countWordsBoundary(str: string): number;
/**
* Counts the number of words in a given string.
* Non-alphanumeric characters (except spaces) are removed before counting.
*
* @param str - The input string to process.
* @returns The number of words in the string.
*/
declare function countWords(str: string): number;
type lib_CacheOpt = CacheOpt;
type lib_ClassEvents = ClassEvents;
type lib_DateMapperInput = DateMapperInput;
type lib_DeepPartial<T> = DeepPartial<T>;
type lib_DumperType = DumperType;
type lib_DynamicObject = DynamicObject;
declare const lib_EOL: typeof EOL;
type lib_Mutable<T> = Mutable<T>;
type lib_Nullable<T> = Nullable<T>;
declare const lib_PATH_SEPARATOR: typeof PATH_SEPARATOR;
type lib_ParseOptions = ParseOptions;
declare const lib_Post: typeof Post;
type lib_ProjectConfig = ProjectConfig;
type lib_RenderBodyOptions = RenderBodyOptions;
type lib_RenderMarkdownBody = RenderMarkdownBody;
declare const lib_RenderMarkdownBody: typeof RenderMarkdownBody;
type lib_ResovableValue = ResovableValue;
type lib_SiteConfig = SiteConfig;
type lib_SlugifyOpt = SlugifyOpt;
declare const lib_appendFileSync: typeof appendFileSync;
type lib_archiveMap = archiveMap;
type lib_array_iterator = array_iterator;
declare const lib_array_iterator: typeof array_iterator;
declare const lib_array_wrap: typeof array_wrap;
declare const lib_basename: typeof basename;
declare const lib_buildPost: typeof buildPost;
declare const lib_cacheDir: typeof cacheDir;
declare const lib_cleanString: typeof cleanString;
declare const lib_cleanWhiteSpace: typeof cleanWhiteSpace;
declare const lib_cmoment: typeof cmoment;
declare const lib_converterOpt: typeof converterOpt;
declare const lib_copyDir: typeof copyDir;
declare const lib_countWords: typeof countWords;
declare const lib_countWordsBoundary: typeof countWordsBoundary;
declare const lib_customMoment: typeof customMoment;
declare const lib_datatables: typeof datatables;
declare const lib_dbFolder: typeof dbFolder;
declare const lib_defaultResovableValue: typeof defaultResovableValue;
declare const lib_existsSync: typeof existsSync;
declare const lib_extname: typeof extname;
declare const lib_extractText: typeof extractText;
declare const lib_findConfig: typeof findConfig;
declare const lib_fsreadDirSync: typeof fsreadDirSync;
declare const lib_generatePostId: typeof generatePostId;
declare const lib_getConfig: typeof getConfig;
declare const lib_getModifiedDateOfFile: typeof getModifiedDateOfFile;
declare const lib_globSrc: typeof globSrc;
declare const lib_isEmpty: typeof isEmpty;
declare const lib_isToday: typeof isToday;
declare const lib_isValidHttpUrl: typeof isValidHttpUrl;
declare const lib_join: typeof join;
declare const lib_loopDir: typeof loopDir;
declare const lib_makeid: typeof makeid;
declare const lib_md5: typeof md5;
declare const lib_md5FileSync: typeof md5FileSync;
declare const lib_memoizeFs: typeof memoizeFs;
type lib_mergedPostMap = mergedPostMap;
declare const lib_mkdirSync: typeof mkdirSync;
declare const lib_momentHexoPostParser: typeof momentHexoPostParser;
declare const lib_momentHpp: typeof momentHpp;
declare const lib_nocache: typeof nocache;
declare const lib_nodeListOf2Html: typeof nodeListOf2Html;
declare const lib_now: typeof now;
type lib_parseDateMapper = parseDateMapper;
declare const lib_parseDateMapper: typeof parseDateMapper;
declare const lib_parsePermalink: typeof parsePermalink;
declare const lib_parsePost: typeof parsePost;
declare const lib_parsePostFM: typeof parsePostFM;
declare const lib_parseShortCodeInclude: typeof parseShortCodeInclude;
type lib_postAuthor = postAuthor;
declare const lib_postChunksMapper: typeof postChunksMapper;
type lib_postMap = postMap;
type lib_postMeta = postMeta;
type lib_postResult = postResult;
declare const lib_post_generated_dir: typeof post_generated_dir;
declare const lib_post_source_dir: typeof post_source_dir;
declare const lib_re_code_block: typeof re_code_block;
declare const lib_re_inline_code_block: typeof re_inline_code_block;
declare const lib_re_script_tag: typeof re_script_tag;
declare const lib_re_style_tag: typeof re_style_tag;
declare const lib_read: typeof read;
declare const lib_readDirectoryRecursive: typeof readDirectoryRecursive;
type lib_readDirectoryRecursiveCb = readDirectoryRecursiveCb;
type lib_readDirectoryRecursivePromise = readDirectoryRecursivePromise;
declare const lib_readFileSync: typeof readFileSync;
declare const lib_relative: typeof relative;
declare const lib_removeDoubleSlashes: typeof removeDoubleSlashes;
declare const lib_removeMultiSlashes: typeof removeMultiSlashes;
declare const lib_renderBodyMarkdown: typeof renderBodyMarkdown;
declare const lib_renderMarkdownIt: typeof renderMarkdownIt;
declare const lib_renderMarked: typeof renderMarked;
declare const lib_renderShowdown: typeof renderShowdown;
declare const lib_replaceArr: typeof replaceArr;
declare const lib_replaceMD2HTML: typeof replaceMD2HTML;
declare const lib_require: typeof require;
declare const lib_resolve: typeof resolve;
declare const lib_rm: typeof rm;
declare const lib_rmdirSync: typeof rmdirSync;
declare const lib_saveParsedPost: typeof saveParsedPost;
declare const lib_setConfig: typeof setConfig;
declare const lib_shortcodeCodeblock: typeof shortcodeCodeblock;
declare const lib_shortcodeCss: typeof shortcodeCss;
declare const lib_shortcodeImportPost: typeof shortcodeImportPost;
declare const lib_shortcodeNow: typeof shortcodeNow;
declare const lib_shortcodeScript: typeof shortcodeScript;
declare const lib_shortcodeYoutube: typeof shortcodeYoutube;
declare const lib_simplifyDump: typeof simplifyDump;
declare const lib_slash: typeof slash;
declare const lib_slugifySanitizeFilename: typeof slugifySanitizeFilename;
declare const lib_slugifyWithCounter: typeof slugifyWithCounter;
declare const lib_sortObjectByKeys: typeof sortObjectByKeys;
declare const lib_statSync: typeof statSync;
declare const lib_uniqueArray: typeof uniqueArray;
declare const lib_uniqueStringArray: typeof uniqueStringArray;
declare const lib_validateParsed: typeof validateParsed;
declare const lib_verbose: typeof verbose;
declare const lib_write: typeof write;
declare namespace lib {
export { type lib_CacheOpt as CacheOpt, type lib_ClassEvents as ClassEvents, type lib_DateMapperInput as DateMapperInput, type lib_DeepPartial as DeepPartial, type lib_DumperType as DumperType, type lib_DynamicObject as DynamicObject, lib_EOL as EOL, type lib_Mutable as Mutable, type lib_Nullable as Nullable, lib_PATH_SEPARATOR as PATH_SEPARATOR, type lib_ParseOptions as ParseOptions, type Partial$1 as Partial, lib_Post as Post, type lib_ProjectConfig as ProjectConfig, type lib_RenderBodyOptions as RenderBodyOptions, lib_RenderMarkdownBody as RenderMarkdownBody, type lib_ResovableValue as ResovableValue, type lib_SiteConfig as SiteConfig, type lib_SlugifyOpt as SlugifyOpt, lib_appendFileSync as appendFileSync, type lib_archiveMap as archiveMap, lib_array_iterator as array_iterator, lib_array_wrap as array_wrap, lib_basename as basename, lib_buildPost as buildPost, lib_cacheDir as cacheDir, lib_cleanString as cleanString, lib_cleanWhiteSpace as cleanWhiteSpace, lib_cmoment as cmoment, lib_converterOpt as converterOpt, lib_copyDir as copyDir, lib_countWords as countWords, lib_countWordsBoundary as countWordsBoundary, lib_customMoment as customMoment, lib_datatables as datatables, lib_dbFolder as dbFolder, lib_defaultResovableValue as defaultResovableValue, lib_existsSync as existsSync, lib_extname as extname, lib_extractText as extractText, lib_findConfig as findConfig, lib_fsreadDirSync as fsreadDirSync, lib_generatePostId as generatePostId, lib_getConfig as getConfig, lib_getModifiedDateOfFile as getModifiedDateOfFile, lib_globSrc as globSrc, lib_isEmpty as isEmpty, lib_isToday as isToday, lib_isValidHttpUrl as isValidHttpUrl, lib_join as join, lib_loopDir as loopDir, lib_makeid as makeid, lib_md5 as md5, lib_md5FileSync as md5FileSync, lib_memoizeFs as memoizeFs, type lib_mergedPostMap as mergedPostMap, lib_mkdirSync as mkdirSync, moment$1 as moment, lib_momentHexoPostParser as momentHexoPostParser, lib_momentHpp as momentHpp, lib_nocache as nocache, lib_nodeListOf2Html as nodeListOf2Html, lib_now as now, lib_parseDateMapper as parseDateMapper, lib_parsePermalink as parsePermalink, lib_parsePost as parsePost, lib_parsePostFM as parsePostFM, lib_parseShortCodeInclude as parseShortCodeInclude, type lib_postAuthor as postAuthor, lib_postChunksMapper as postChunksMapper, type lib_postMap as postMap, type lib_postMeta as postMeta, type lib_postResult as postResult, lib_post_generated_dir as post_generated_dir, lib_post_source_dir as post_source_dir, lib_re_code_block as re_code_block, lib_re_inline_code_block as re_inline_code_block, lib_re_script_tag as re_script_tag, lib_re_style_tag as re_style_tag, lib_read as read, lib_readDirectoryRecursive as readDirectoryRecursive, type lib_readDirectoryRecursiveCb as readDirectoryRecursiveCb, type lib_readDirectoryRecursivePromise as readDirectoryRecursivePromise, lib_readFileSync as readFileSync, lib_relative as relative, lib_removeDoubleSlashes as removeDoubleSlashes, lib_removeMultiSlashes as removeMultiSlashes, lib_renderBodyMarkdown as renderBodyMarkdown, lib_renderMarkdownIt as renderMarkdownIt, lib_renderMarked as renderMarked, lib_renderShowdown as renderShowdown, lib_replaceArr as replaceArr, lib_replaceMD2HTML as replaceMD2HTML, lib_require as require, lib_resolve as resolve, lib_rm as rm, lib_rmdirSync as rmdirSync, lib_saveParsedPost as saveParsedPost, lib_setConfig as setConfig, lib_shortcodeCodeblock as shortcodeCodeblock, lib_shortcodeCss as shortcodeCss, lib_shortcodeImportPost as shortcodeImportPost, lib_shortcodeNow as shortcodeNow, lib_shortcodeScript as shortcodeScript, lib_shortcodeYoutube as shortcodeYoutube, lib_simplifyDump as simplifyDump, lib_slash as slash, lib_slugifySanitizeFilename as slugifySanitizeFilename, lib_slugifyWithCounter as slugifyWithCounter, lib_sortObjectByKeys as sortObjectByKeys, lib_statSync as statSync, lib_uniqueArray as uniqueArray, lib_uniqueStringArray as uniqueStringArray, lib_validateParsed as validateParsed, lib_verbose as verbose, lib_write as write };
}
export { type CacheOpt, type ClassEvents, type DateMapperInput, type DeepPartial, type DumperType, type DynamicObject, EOL, type Mutable, type Nullable, PATH_SEPARATOR, type ParseOptions, type Partial$1 as Partial, Post, type ProjectConfig, type RenderBodyOptions, RenderMarkdownBody, type ResovableValue, type SiteConfig, type SlugifyOpt, appendFileSync, type archiveMap, array_iterator, array_wrap, basename, buildPost, cacheDir, cleanString, cleanWhiteSpace, cmoment, converterOpt, copyDir, countWords, countWordsBoundary, customMoment, datatables, dbFolder, lib as default, defaultResovableValue, existsSync, extname, extractText, findConfig, fsreadDirSync, generatePostId, getConfig, getModifiedDateOfFile, globSrc, isEmpty, isToday, isValidHttpUrl, join, loopDir, makeid, md5, md5FileSync, memoizeFs, type mergedPostMap, mkdirSync, moment$1 as moment, momentHexoPostParser, momentHpp, nocache, nodeListOf2Html, now, parseDateMapper, parsePermalink, parsePost, parsePostFM, parseShortCodeInclude, type postAuthor, postChunksMapper, type postMap, type postMeta, type postResult, post_generated_dir, post_source_dir, re_code_block, re_inline_code_block, re_script_tag, re_style_tag, read, readDirectoryRecursive, type readDirectoryRecursiveCb, type readDirectoryRecursivePromise, readFileSync, relative, removeDoubleSlashes, removeMultiSlashes, renderBodyMarkdown, renderMarkdownIt, renderMarked, renderShowdown, replaceArr, replaceMD2HTML, require, resolve, rm, rmdirSync, saveParsedPost, setConfig, shortcodeCodeblock, shortcodeCss, shortcodeImportPost, shortcodeNow, shortcodeScript, shortcodeYoutube, simplifyDump, slash, slugifySanitizeFilename, slugifyWithCounter, sortObjectByKeys, statSync, uniqueArray, uniqueStringArray, validateParsed, verbose, write };