@types/express-sitemap-xml
TypeScript icon, indicating that this package has built-in type declarations

3.0.4 • Public • Published

Installation

npm install --save @types/express-sitemap-xml

Summary

This package contains type definitions for express-sitemap-xml (https://github.com/feross/express-sitemap-xml).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-sitemap-xml.

index.d.ts

import express = require("express");

/**
 * Create a sitemap.xml middleware.
 * @param getUrls Is called at most once per 24 hours. The resulting sitemap(s)
 *   are cached to make repeated HTTP requests faster.
 * @param base Specifies the base URL to be used in case any URLs are specified
 *   as relative URLs. The argument is also used if a sitemap index needs to be
 *   generated and sitemap locations need to be specified, e.g.
 *   `${base}/sitemap-0.xml` becomes `https://bitmidi.com/sitemap-0.xml`.
 */
declare function expressSitemapXml(
    getUrls: () => expressSitemapXml.SitemapLeaf[] | Promise<expressSitemapXml.SitemapLeaf[]>,
    base: string,
): express.RequestHandler;

declare namespace expressSitemapXml {
    interface LeafObject {
        changeFreq?: string | undefined;
        /** specify `true` for today's date */
        lastMod?: string | Date | true | undefined;
        url: string;
    }

    type SitemapLeaf = string | LeafObject;

    interface Sitemap {
        [leaf: string]: string;
    }

    /**
     * @async
     * Create an object where the keys are sitemap URLs to be served by the
     * server and the values are strings of sitemap XML content
     */
    function buildSitemaps(urls: SitemapLeaf[], base: string): Promise<Sitemap>;
}

export = expressSitemapXml;

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: @types/express

Credits

These definitions were written by Florian Imdahl, and Piotr Błażejewicz.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/express-sitemap-xml

Weekly Downloads

1,527

Version

3.0.4

License

MIT

Unpacked Size

5.58 kB

Total Files

5

Last publish

Collaborators

  • types