@types/css-declaration-sorter
TypeScript definitions for css-declaration-sorter
Last updated 5 years ago by types .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @types/css-declaration-sorter 
SYNC missed versions from official npm registry.

Installation

npm install --save @types/css-declaration-sorter

Summary

This package contains type definitions for css-declaration-sorter (https://github.com/Siilwyn/css-declaration-sorter#readme).

Details

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

index.d.ts

// Type definitions for css-declaration-sorter 6.0
// Project: https://github.com/Siilwyn/css-declaration-sorter#readme
// Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 3.7

import { PluginCreator } from 'postcss';

/**
 * A Node.js module and PostCSS plugin to sort CSS, SCSS or Less declarations based on their property names.
 */
declare namespace cssDeclarationSorter {
    /**
     * Default, order in a simple alphabetical manner from a - z.
     */
    type Alphabetical = 'alphabetical';

    /**
     * Order from most important, flow affecting properties, to least important properties.
     * ```
     * 1. Box
     * 2. Border
     * 3. Background
     * 4. Text
     * 5. Other
     * ```
     */
    type SMACSS = 'smacss';

    /**
     * Order properties applying outside the box model, moving inward to intrinsic changes.
     * ```
     * 1. Positioning
     * 2. Visibility
     * 3. Box model
     * 4. Dimensions
     * 5. Text
     * ```
     */
    type ConcentricCSS = 'concentric-css';

    type SortOrder = Alphabetical | SMACSS | ConcentricCSS;

    /**
     * This function receives two declaration names and is expected
     * to return -1, 0 or 1 depending on the wanted order.
     */
    type SortFunction = (aProp: string, bProp: string) => -1 | 0 | 1;

    interface Options {
        /**
         * Provide the name of one of the built-in sort orders or a comparison function that is passed to `Array.sort`.
         * @default 'alphabetical'
         */
        order?: SortOrder | SortFunction | undefined;
        /**
         * To prevent breaking legacy CSS where shorthand declarations override longhand declarations
         * (also taking into account vendor prefixes) this option can enabled.
         * For example `animation-name: some; animation: greeting;` will be kept in this order when `keepOverrides` is `true`.
         */
        keepOverrides?: boolean | undefined;
    }

    type CssDeclarationSorter = PluginCreator<Options>;
}

declare const cssDeclarationSorter: cssDeclarationSorter.CssDeclarationSorter;
export = cssDeclarationSorter;

Additional Details

  • Last updated: Tue, 06 Jul 2021 20:32:33 GMT
  • Dependencies: @types/postcss
  • Global values: none

Credits

These definitions were written by Piotr Błażejewicz.

Current Tags

  • 6.0.1                                ...           latest (5 years ago)
  • 5.1.0                                ...           ts3.0 (6 years ago)
  • 5.1.0                                ...           ts3.1 (6 years ago)
  • 5.1.0                                ...           ts3.2 (6 years ago)
  • 5.1.0                                ...           ts3.3 (6 years ago)
  • 5.1.0                                ...           ts3.4 (6 years ago)
  • 5.1.0                                ...           ts3.5 (6 years ago)
  • 5.1.0                                ...           ts3.6 (6 years ago)
  • 6.0.1                                ...           ts3.7 (5 years ago)
  • 6.0.1                                ...           ts3.8 (5 years ago)
  • 6.0.1                                ...           ts3.9 (5 years ago)
  • 6.0.1                                ...           ts4.0 (5 years ago)
  • 6.0.1                                ...           ts4.1 (5 years ago)
  • 6.0.1                                ...           ts4.2 (5 years ago)
  • 6.0.1                                ...           ts4.3 (5 years ago)
  • 6.0.1                                ...           ts4.4 (5 years ago)
  • 6.0.1                                ...           ts4.5 (5 years ago)
  • 6.0.1                                ...           ts4.6 (5 years ago)
  • 6.0.1                                ...           ts4.7 (5 years ago)
  • 6.0.1                                ...           ts4.8 (5 years ago)
  • 6.0.1                                ...           ts4.9 (5 years ago)

3 Versions

  • 6.0.1                                ...           5 years ago
  • 6.0.0                                ...           5 years ago
  • 5.1.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org | Home |