@types/postcss-url

  • Version 10.0.4
  • Published
  • 6.7 kB
  • 2 dependencies
  • MIT license

Install

npm i @types/postcss-url
yarn add @types/postcss-url
pnpm add @types/postcss-url

Overview

TypeScript definitions for postcss-url

Index

Variables

variable url

const url: PluginCreator<url.Options | url.Options[]>;

    Interfaces

    interface Options

    interface Options {}

      property assetsPath

      assetsPath?: boolean | string | undefined;
      • The assets files will be copied in that destination.

        false

      property basePath

      basePath?: string | string[] | undefined;
      • Specify the base path or list of base paths where to search images from.

      property fallback

      fallback?: CustomTransformFunction | undefined;
      • The fallback method to use if the maximum size is exceeded or the URL contains a hash.

      property filter

      filter?: RegExp | CustomFilterFunction | string | undefined;
      • Determine wether a file should be inlined.

      property hashOptions

      hashOptions?:
      | {
      /**
      * Hashing method or custom function.
      */
      method?: 'xxhash32' | 'xxhash64' | CustomHashFunction | undefined;
      /**
      * Shrink hast to certain length.
      */
      shrink?: number | undefined;
      /**
      * Append the original filename in resulting filename.
      */
      append?: boolean | undefined;
      }
      | undefined;
      • Hash options

      property ignoreFragmentWarning

      ignoreFragmentWarning?: boolean | undefined;
      • Do not warn when an SVG URL with a fragment is inlined. PostCSS-URL does not support partial inlining. The entire SVG file will be inlined. By default a warning will be issued when this occurs.

        false

      property includeUriFragment

      includeUriFragment?: boolean | undefined;
      • Specifies whether the URL's fragment identifer value, if present, will be added to the inlined data URI.

        false

      property maxSize

      maxSize?: number | undefined;
      • Specify the maximum file size to inline (in kilobytes).

      property optimizeSvgEncode

      optimizeSvgEncode?: boolean | undefined;
      • Reduce size of inlined svg (IE9+, Android 3+)

        false

      property url

      url?: 'copy' | 'inline' | 'rebase' | CustomTransformFunction | undefined;
      • URL rewriting mechanism.

        'rebase'

      property useHash

      useHash?: boolean | undefined;
      • Rename the path of the files by a hash name.

        false

      Type Aliases

      type CustomFilterFunction

      type CustomFilterFunction = (file: string) => boolean;

        type CustomHashFunction

        type CustomHashFunction = (file: Buffer) => string;

          type CustomTransformFunction

          type CustomTransformFunction = (
          asset: {
          /**
          * Original URL.
          */
          url: string;
          /**
          * URL pathname.
          */
          pathname?: string | undefined;
          /**
          * Absolute path to asset.
          */
          absolutePath?: string | undefined;
          /**
          * Current relative path to asset.
          */
          relativePath?: string | undefined;
          /**
          * Querystring from URL.
          */
          search?: string | undefined;
          /**
          * Hash from URL.
          */
          hash?: string | undefined;
          },
          dir: {
          /**
          * PostCSS from option.
          */
          from?: string | undefined;
          /**
          * PostCSS to option.
          */
          to?: string | undefined;
          /**
          * File path.
          */
          file?: string | undefined;
          }
          ) => string | Promise<string>;

            type Url

            type Url = PluginCreator<Options | Options[]>;

              Package Files (1)

              Dependencies (2)

              Dev Dependencies (0)

              No dev dependencies.

              Peer Dependencies (0)

              No peer dependencies.

              Badge

              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/postcss-url.

              • Markdown
                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/postcss-url)
              • HTML
                <a href="https://www.jsdocs.io/package/@types/postcss-url"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>