css-value parse fix to match the new parse function export.

This commit is contained in:
Hristo Deshev
2015-10-15 10:36:15 +03:00
parent ea62b3d487
commit 5d59c4b3ef
2 changed files with 8 additions and 5 deletions

View File

@ -1,10 +1,13 @@
declare module "css-value" { declare module "css-value" {
export interface CSSValue { interface CSSValue {
type: string; type: string;
string: string; string: string;
unit: string; unit: string;
value: number; value: number;
} }
export function parse(cssValue: string): Array<CSSValue>; interface ParserFunction {
(cssValue: string): Array<CSSValue>;
}
export = ParserFunction;
} }

View File

@ -3,7 +3,7 @@ import colorModule = require("color");
import types = require("utils/types"); import types = require("utils/types");
import enums = require("ui/enums"); import enums = require("ui/enums");
import dts = require("ui/styling/background"); import dts = require("ui/styling/background");
import cssValue = require("css-value"); var cssValue = require("css-value");
export class Background implements dts.Background { export class Background implements dts.Background {
public static default = new Background(undefined, undefined, undefined, undefined, undefined); public static default = new Background(undefined, undefined, undefined, undefined, undefined);
@ -83,7 +83,7 @@ export class Background implements dts.Background {
// size // size
if (this.size) { if (this.size) {
let values = cssValue.parse(this.size); let values = cssValue(this.size);
if (values.length === 2) { if (values.length === 2) {
let vx = values[0]; let vx = values[0];
@ -126,7 +126,7 @@ export class Background implements dts.Background {
// position // position
if (this.position) { if (this.position) {
let values = cssValue.parse(this.position); let values = cssValue(this.position);
let spaceX = width - imageWidth; let spaceX = width - imageWidth;
let spaceY = height - imageHeight; let spaceY = height - imageHeight;