1 | // Type definitions for gulp-insert 0.5.0
|
2 | // Project: https://github.com/rschmukler/gulp-insert
|
3 | // Definitions by: Shant Marouti <https://github.com/shantmarouti>
|
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
5 |
|
6 | /// <reference types="node"/>
|
7 | /// <reference types="vinyl"/>
|
8 |
|
9 | declare module "gulp-insert" {
|
10 | import File = require("vinyl");
|
11 |
|
12 | interface Transformer {
|
13 | (contents: string, file: File): string;
|
14 | }
|
15 |
|
16 | namespace Insert {
|
17 | /**
|
18 | * Prepends a string onto the contents
|
19 | * @param {string} content
|
20 | * @returns {NodeJS.ReadWriteStream}
|
21 | */
|
22 | function prepend(content: string): NodeJS.ReadWriteStream;
|
23 |
|
24 | /**
|
25 | * Appends a string onto the contents
|
26 | * @param {string} content
|
27 | * @returns {NodeJS.ReadWriteStream}
|
28 | */
|
29 | function append(content: string): NodeJS.ReadWriteStream;
|
30 |
|
31 | /**
|
32 | * Wraps the contents with two strings
|
33 | * @param {string} prepend
|
34 | * @param {string} append
|
35 | * @returns {NodeJS.ReadWriteStream}
|
36 | */
|
37 | function wrap(prepend: string, append: string): NodeJS.ReadWriteStream;
|
38 |
|
39 | /**
|
40 | * Calls a function with the contents of the file
|
41 | * @param {Transformer} transformer
|
42 | * @returns {NodeJS.ReadWriteStream}
|
43 | */
|
44 | function transform(transformer: Transformer): NodeJS.ReadWriteStream;
|
45 | }
|
46 |
|
47 | namespace Insert {}
|
48 | export = Insert;
|
49 | }
|