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

1.0.4 • Public • Published

Installation

npm install --save @types/filter-css

Summary

This package contains type definitions for filter-css (https://github.com/bezoerb/filter-css#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/filter-css.

index.d.ts

import { AtRule, Comment, Rule } from "css";

export = api;

declare function api(
    inputStylesheet: string,
    ignorePattern: api.Pattern | api.Pattern[],
    options?: api.Options,
): string;

declare namespace api {
    type Context = "type" | "media" | "selector" | "declarationProperty" | "declarationValue";

    /**
     * @param context The current matching context.
     * @param value The current value.
     * @param node The current AST node generated by [`css`]{@link https://github.com/reworkcss/css} being processed.
     * @returns Whether the element should be discarded.
     */
    type PatternFunction = (context: Context, value: string | undefined, node: Rule | Comment | AtRule) => boolean;

    type Pattern = string | RegExp | PatternFunction;

    interface Options {
        /**
         * Whether to match CSS selectors.
         * @default true
         */
        matchSelectors?: boolean | undefined;

        /**
         * Whether to match [AST Node types]{@link https://github.com/reworkcss/css#types} like `font-face`.
         * @default true
         */
        matchTypes?: boolean | undefined;

        /**
         * Whether to match CSS properties like `background-image`.
         * @default true
         */
        matchDeclarationProperties?: boolean | undefined;

        /**
         * Whether to match CSS values like `url(...)`.
         * @default true
         */
        matchDeclarationValues?: boolean | undefined;

        /**
         * Whether to match media queries like `min-device-pixel-ratio: 2`.
         * @default true
         */
        matchMedia?: boolean | undefined;
    }
}

Additional Details

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

Credits

These definitions were written by cherryblossom.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/filter-css

Weekly Downloads

16

Version

1.0.4

License

MIT

Unpacked Size

5.95 kB

Total Files

5

Last publish

Collaborators

  • types