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

5.0.8 • Public • Published

Installation

npm install --save @types/slug

Summary

This package contains type definitions for slug (https://github.com/trott/node-slug).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/slug.

export = slug;
export as namespace slug;

declare function slug(string: string, replacement: string): string;
declare function slug(string: string, opts?: slug.Options): string;

declare namespace slug {
    const charmap: CharMap;
    const defaults: {
        charmap: CharMap;
        mode: string;
        modes: {
            pretty: Mode;
            rfc3986: Mode;
        };
        multicharmap: CharMap;
        fallback: boolean;
    };
    const multicharmap: CharMap;

    function extend(entry: CharMap): void;
    function reset(): void;

    interface Mode {
        charmap?: CharMap | null | undefined;
        lower?: boolean | null | undefined;
        multicharmap?: CharMap | null | undefined;
        remove?: RegExp | null | undefined;
        replacement?: string | null | undefined;
        symbols?: boolean | null | undefined;
        trim?: boolean | null | undefined;
        fallback?: boolean | null | undefined;
    }

    type Options = {
        locale?: string | undefined;
        mode?: "pretty" | "rfc3986" | null | undefined;
    } & Partial<Mode>;

    type CharMap = Record<string, string>;
}

Additional Details

  • Last updated: Tue, 05 Mar 2024 17:08:19 GMT
  • Dependencies: none

Credits

These definitions were written by Daniel Clausmeyer.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @types/slug

      Weekly Downloads

      97,607

      Version

      5.0.8

      License

      MIT

      Unpacked Size

      4.79 kB

      Total Files

      5

      Last publish

      Collaborators

      • types