2.0.4 • Published 2 years ago

@types/gulp-sort v2.0.4

Weekly downloads
744
License
MIT
Repository
github
Last release
2 years ago

Installation

npm install --save @types/gulp-sort

Summary

This package contains type definitions for gulp-sort (https://github.com/pgilad/gulp-sort).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gulp-sort.

index.d.ts

// Type definitions for gulp-sort 2.0
// Project: https://github.com/pgilad/gulp-sort
// Definitions by: Joe Skeen <https://github.com/joeskeen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="node" />

/** Sort files in stream by path or any custom sort comparator */

import gulpUtil = require('gulp-util');

interface IOptions {
    /**
     * A function to compare two files.
     * Returns:
     * -1 if file1 should be before file2,
     * 0 if file1 is equivalent to file2, and
     * 1 if file1 should be after file2
     */
    comparator?: IComparatorFunction | undefined;
    /** Whether to sort in ascending order, default is true */
    asc?: boolean | undefined;
    /** Whether to use a custom sort function. */
    customSortFn?: (files: gulpUtil.File[], comparator?: IComparatorFunction) => gulpUtil.File[];
}

interface IComparatorFunction {
    /**
     * A function to compare two files.
     * Returns:
     * -1 if file1 should be before file2,
     * 0 if file1 is equivalent to file2, and
     * 1 if file1 should be after file2
     */
    (file1: gulpUtil.File, file2: gulpUtil.File): number;
}

/** Sort files in stream by path or any custom sort comparator */
declare function gulpSort(): NodeJS.ReadWriteStream;
declare function gulpSort(comparator: IComparatorFunction): NodeJS.ReadWriteStream;
declare function gulpSort(options: IOptions): NodeJS.ReadWriteStream;

declare namespace gulpSort {}

export = gulpSort;

Additional Details

Credits

These definitions were written by Joe Skeen.

2.0.3

2 years ago

2.0.2

2 years ago

2.0.4

2 years ago

2.0.1

2 years ago

2.0.0

4 years ago

0.0.33

4 years ago

0.0.32

8 years ago

0.0.31

8 years ago

0.0.30

8 years ago

0.0.29

9 years ago

0.0.28

9 years ago

0.0.27-alpha

9 years ago

0.0.26-alpha

9 years ago

0.0.25-alpha

9 years ago

0.0.24-alpha

9 years ago

0.0.23-alpha

9 years ago

0.0.22-alpha

9 years ago

0.0.21-alpha

9 years ago

0.0.16-alpha

9 years ago

0.0.15-alpha

9 years ago