mwoffliner
Version:
MediaWiki ZIM scraper
27 lines (26 loc) • 1.08 kB
TypeScript
/**
* Check if a given article title or id is main page of the target ZIM
*/
export declare function isMainPage(articleTitleOrId: string): boolean;
/**
* Check if a given article title or id is a subpage or not
*
* A given is a subpage if subpages are activated on its namespace and it contains a / in its title/id
*/
export declare function isSubpage(articleTitleOrId: string): boolean;
/**
* For a given namespace number, get the namespace name
*/
export declare function getNamespaceName(namespace: number): string;
/**
* Extract the CSS class to apply on article <body> tag from its headHtml, typically returned by MW API call when fetching article content
*/
export declare function extractBodyCssClass(headHtml: string): string;
/**
* Extract the CSS class to apply on article <html> tag from its headHtml, typically returned by MW API call when fetching article content
*/
export declare function extractHtmlCssClass(headHtml: string): string;
/**
* Get the special display title for the main page
*/
export declare function getMainpageTitle(): Promise<string>;