3.0.4 • Published 6 months ago

@types/express-sitemap-xml v3.0.4

Weekly downloads
2,711
License
MIT
Repository
github
Last release
6 months ago

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

// Type definitions for express-sitemap-xml 3.0
// Project: https://github.com/feross/express-sitemap-xml
// Definitions by: Florian Imdahl <https://github.com/ffflorian>
//                 Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

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: Thu, 08 Jul 2021 12:01:22 GMT
  • Dependencies: @types/express
  • Global values: none

Credits

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

3.0.4

6 months ago

3.0.3

7 months ago

3.0.2

8 months ago

3.0.1

3 years ago

3.0.0

3 years ago

1.1.1

3 years ago

1.1.0

4 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago