diff --git a/types/gulp-stylus/gulp-stylus-tests.ts b/types/gulp-stylus/gulp-stylus-tests.ts new file mode 100644 index 0000000000..e6cf4efad8 --- /dev/null +++ b/types/gulp-stylus/gulp-stylus-tests.ts @@ -0,0 +1,31 @@ +import * as gulp from 'gulp'; +import * as stylus from 'gulp-stylus'; + +gulp.task('styles1', () => { + return gulp.src('./css/one.styl') + .pipe(stylus()) + .pipe(gulp.dest('./css/build')); +}); + +gulp.task('styles2', () => { + return gulp.src('./css/compressed.styl') + .pipe(stylus({ + compress: true + })) + .pipe(gulp.dest('./css/build')); +}); + +gulp.task('styles3', () => { + return gulp.src('./css/*.styl') + .pipe(stylus({ + 'include css': true + })) + .pipe(gulp.dest('./')); +}); + +const data = {red: '#ff0000'}; +gulp.task('styles4', () => { + gulp.src('./sty/main.styl') + .pipe(stylus({ rawDefine: { data }})) + .pipe(gulp.dest('./css/build')); +}); diff --git a/types/gulp-stylus/index.d.ts b/types/gulp-stylus/index.d.ts new file mode 100644 index 0000000000..0466fec6b6 --- /dev/null +++ b/types/gulp-stylus/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for gulp-stylus 2.7 +// Project: http://github.com/stevelacy/gulp-stylus +// Definitions by: Takesi Tokugawa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +interface GulpStylus { + (options?: GulpStylus.Options): NodeJS.ReadWriteStream; +} + +declare namespace GulpStylus { + interface Options { + compress?: boolean; + linenos?: boolean; + 'include css'?: boolean; + rawDefine?: { + data: any + }; + } +} + +declare var gulpStylus: GulpStylus; +export = gulpStylus; diff --git a/types/gulp-stylus/tsconfig.json b/types/gulp-stylus/tsconfig.json new file mode 100644 index 0000000000..e02bd6fed0 --- /dev/null +++ b/types/gulp-stylus/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "gulp-stylus-tests.ts" + ] +} diff --git a/types/gulp-stylus/tslint.json b/types/gulp-stylus/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/gulp-stylus/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}