mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(core): type collisions with namespace (#8809)
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { Color } from '../../color';
|
||||
import { Length, zeroLength } from './style-properties';
|
||||
import { Length, LengthType, zeroLength } from './style-properties';
|
||||
|
||||
export interface CSSShadow {
|
||||
inset: boolean;
|
||||
offsetX: Length;
|
||||
offsetY: Length;
|
||||
blurRadius?: Length;
|
||||
spreadRadius?: Length;
|
||||
offsetX: LengthType;
|
||||
offsetY: LengthType;
|
||||
blurRadius?: LengthType;
|
||||
spreadRadius?: LengthType;
|
||||
color: Color;
|
||||
}
|
||||
|
||||
@@ -66,3 +66,40 @@ export function parseCSSShadow(value: string): CSSShadow {
|
||||
color: new Color(colorRaw),
|
||||
};
|
||||
}
|
||||
|
||||
// if (value.indexOf('rgb') > -1) {
|
||||
// arr = value.split(' ');
|
||||
// colorRaw = arr.pop();
|
||||
// } else {
|
||||
// arr = value.split(/[ ,]+/);
|
||||
// colorRaw = arr.pop();
|
||||
// }
|
||||
|
||||
// let offsetX: number;
|
||||
// let offsetY: number;
|
||||
// let blurRadius: number; // not currently in use
|
||||
// let spreadRadius: number; // maybe rename this to just radius
|
||||
// let color: Color = new Color(colorRaw);
|
||||
|
||||
// if (arr.length === 2) {
|
||||
// offsetX = parseFloat(arr[0]);
|
||||
// offsetY = parseFloat(arr[1]);
|
||||
// } else if (arr.length === 3) {
|
||||
// offsetX = parseFloat(arr[0]);
|
||||
// offsetY = parseFloat(arr[1]);
|
||||
// blurRadius = parseFloat(arr[2]);
|
||||
// } else if (arr.length === 4) {
|
||||
// offsetX = parseFloat(arr[0]);
|
||||
// offsetY = parseFloat(arr[1]);
|
||||
// blurRadius = parseFloat(arr[2]);
|
||||
// spreadRadius = parseFloat(arr[3]);
|
||||
// } else {
|
||||
// throw new Error('Expected 3, 4 or 5 parameters. Actual: ' + value);
|
||||
// }
|
||||
// return {
|
||||
// offsetX: offsetX,
|
||||
// offsetY: offsetY,
|
||||
// blurRadius: blurRadius,
|
||||
// spreadRadius: spreadRadius,
|
||||
// color: color,
|
||||
// };
|
||||
|
||||
Reference in New Issue
Block a user