From 8ecbf03638ae2bbb907b20f03260baf1b888441b Mon Sep 17 00:00:00 2001 From: Agnislav Onufrijchuk Date: Mon, 3 Aug 2015 13:37:08 +0300 Subject: [PATCH] Added definition for gulp-ruby-sass node package --- gulp-ruby-sass/gulp-ruby-sass-tests.ts | 14 ++++++ gulp-ruby-sass/gulp-ruby-sass.d.ts | 68 ++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 gulp-ruby-sass/gulp-ruby-sass-tests.ts create mode 100644 gulp-ruby-sass/gulp-ruby-sass.d.ts diff --git a/gulp-ruby-sass/gulp-ruby-sass-tests.ts b/gulp-ruby-sass/gulp-ruby-sass-tests.ts new file mode 100644 index 0000000000..cba0c4c60d --- /dev/null +++ b/gulp-ruby-sass/gulp-ruby-sass-tests.ts @@ -0,0 +1,14 @@ +/// +/// +import gulp = require("gulp"); +import sass = require("gulp-ruby-sass"); + +gulp.task('sass', function () { + sass('./scss/*.scss') + .pipe(gulp.dest('./css')); +}); + +gulp.task('sass', function () { + sass('./scss/', {verbose: true, style: 'compact'}) + .pipe(gulp.dest('./css')); +}); diff --git a/gulp-ruby-sass/gulp-ruby-sass.d.ts b/gulp-ruby-sass/gulp-ruby-sass.d.ts new file mode 100644 index 0000000000..bb0c56328d --- /dev/null +++ b/gulp-ruby-sass/gulp-ruby-sass.d.ts @@ -0,0 +1,68 @@ +// Type definitions for gulp-ruby-sass v1.0.5 +// Project: https://github.com/sindresorhus/gulp-ruby-sass +// Definitions by: Agnislav Onufrijchuk +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "gulp-ruby-sass" { + /** + * The interface includes all options that available for sass executable. + * Options are converted from dashed to camelCase + * @interface SassOptions + */ + interface SassOptions { + loadPath?: string | string[]; + require?: string; + compass?: boolean; + style?: string; + force?: boolean; + stopOnError?: boolean; + scss?: boolean; + defaultEncoding?: string; + unixNewlines?: boolean; + debugInfo?: boolean; + lineNumbers?: boolean; + lineComments?: boolean; + check?: boolean; + precision?: number; + cacheLocation?: string; + noCache?: boolean; + trace?: boolean; + quiet?: boolean; + + // Actually, there should be a string. However due to ts spec, overriding member should be the same type or a subtype. + // http://stackoverflow.com/questions/19605557/incompatible-static-properties-in-three-d-ts-with-latest-typescript + // We need Options.soucemap to be boolean, so here 'any' is used instead of string. + sourcemap?: any; + + // All listed below options are acceptable by the sass executable and potentially may be used from js. + // However I doubt are there cases when it's meaningful + watch?: string; + update?: string; + stdin?: boolean; + interactive?: boolean; + } + + /** + * The interface includes the node-ruby-sass only options. + * Attention: sourcemap option type differs from the same SassOption's type. + * @interface Options + * @extends SassOptions + */ + interface Options extends SassOptions { + verbose?: boolean; + bundleExec?: boolean; + sourcemap?: boolean; + container?: string; + } + + /** + * Object to be exported + * @param {string} source - Filename or directory + * @param {Options} options - Additional processing rules/options + */ + function sass(source: string, options?: Options): NodeJS.ReadableStream; + + export = sass; +}