@canalplus/readme.doc
Version:
Readme's an Extremely Accessible Documentation MakEr
32 lines (31 loc) • 1.11 kB
TypeScript
/**
* Class responsible for creating and managing a sitemap.
* It allows adding URLs to the sitemap and generating an XML file of the sitemap.
* This is used by search engines to crawl and index files.
*/
export declare class SiteMapCreator {
/**
* @private
* @type {Array<{ loc: string, lastmod: string }>}
* @description Stores the list of URLs and their corresponding last modified dates.
*/
private siteMapEntry;
constructor();
/**
* Adds a new URL to the sitemap.
* The `lastmod` (last modification date) is automatically set to the current date in the format `YYYY-MM-DD`.
*
* @param {string} loc - The URL to be added to the sitemap.
* @example
* const sitemap = new SiteMapCreator();
* sitemap.addToSiteMap('https://mydoc.com');
*/
addToSiteMap(loc: string): void;
/**
* Generates the XML for the sitemap.
* This method converts the list of entries into a properly formatted XML string.
*
* @returns {string} The XML string representing the sitemap.
*/
generateSiteMapXML(): string;
}