Skip to content

Commit 30738b2

Browse files
committed
chore(declarations): update type declarations
1 parent 7d2750d commit 30738b2

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@
4848
},
4949
"devDependencies": {
5050
"@types/chalk": "0.4.30",
51+
"@types/chokidar": "^1.4.29",
5152
"@types/clean-css": "3.4.29",
5253
"@types/fs-extra": "0.0.33",
5354
"@types/jasmine": "2.2.33",
5455
"@types/node": "6.0.38",
56+
"@types/node-sass": "0.0.29",
5557
"@types/uglify-js": "2.0.27",
5658
"jasmine": "2.5.2",
5759
"tslint": "3.15.1",

src/declarations.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
declare module "*";
1+
declare module 'autoprefixer';
2+
declare module 'magic-string';
3+
declare module 'rollup-pluginutils';
4+
declare module 'rollup';

src/sass.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { ensureDirSync, readdirSync, writeFile } from 'fs-extra';
55
import { fillConfigDefaults, generateContext, getUserConfigFile, replacePathVars } from './util/config';
66
import { getModulePathsCache } from './rollup';
77
import { runWorker } from './worker-client';
8-
import * as nodeSass from 'node-sass';
8+
import { SassError, render as nodeSassRender, Result } from 'node-sass';
99
import * as postcss from 'postcss';
1010
import * as autoprefixer from 'autoprefixer';
1111

@@ -245,7 +245,7 @@ function render(context: BuildContext, sassConfig: SassConfig) {
245245
sassConfig.sourceMapContents = true;
246246
}
247247

248-
nodeSass.render(sassConfig, (renderErr: any, sassResult: SassResult) => {
248+
nodeSassRender(sassConfig, (renderErr: SassError, sassResult: Result) => {
249249
if (renderErr) {
250250
// sass render error!
251251
if (renderErr.file) {
@@ -282,7 +282,7 @@ function render(context: BuildContext, sassConfig: SassConfig) {
282282
}
283283

284284

285-
function renderSassSuccess(sassResult: SassResult, sassConfig: SassConfig): Promise<any> {
285+
function renderSassSuccess(sassResult: Result, sassConfig: SassConfig): Promise<any> {
286286
if (sassConfig.autoprefixer) {
287287
// with autoprefixer
288288

@@ -325,11 +325,11 @@ function renderSassSuccess(sassResult: SassResult, sassConfig: SassConfig): Prom
325325
sassMapResult = JSON.parse(sassResult.map.toString()).mappings;
326326
}
327327

328-
return writeOutput(sassConfig, sassResult.css, sassMapResult);
328+
return writeOutput(sassConfig, sassResult.css.toString(), sassMapResult);
329329
}
330330

331331

332-
function generateSourceMaps(sassResult: SassResult, sassConfig: SassConfig) {
332+
function generateSourceMaps(sassResult: Result, sassConfig: SassConfig) {
333333
// this can be async and nothing needs to wait on it
334334

335335
// build Source Maps!
@@ -493,12 +493,6 @@ export interface SassConfig {
493493
}
494494

495495

496-
export interface SassResult {
497-
css: string;
498-
map: SassMap;
499-
}
500-
501-
502496
export interface SassMap {
503497
file: string;
504498
sources: any[];

tsconfig.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
"outDir": "./dist",
88
"target": "es5",
99
"noImplicitAny": true,
10-
"typeRoots": [
11-
"./node_modules/@types"
12-
],
1310
"types": [
1411
"jasmine",
1512
"node"

0 commit comments

Comments
 (0)