|
1
|
import { |
|
2
|
Effect, |
|
3
|
EffectBlur, |
|
4
|
EffectShadow, |
|
5
|
EffectType, |
|
6
|
Paint, |
|
7
|
PaintGradient, |
|
8
|
PaintImage, |
|
9
|
PaintSolid, |
|
10
|
PaintType, |
|
11
|
} from "./types" |
|
12
|
|
|
13
|
export function isEffectShadow(effect: Effect): effect is EffectShadow { |
|
14
|
return ( |
|
15
|
effect.type === EffectType.DROP_SHADOW || |
|
16
|
effect.type === EffectType.INNER_SHADOW |
|
17
|
) |
|
18
|
} |
|
19
|
|
|
20
|
export function isEffectBlur(effect: Effect): effect is EffectBlur { |
|
21
|
return ( |
|
22
|
effect.type === EffectType.BACKGROUND_BLUR || |
|
23
|
effect.type === EffectType.LAYER_BLUR |
|
24
|
) |
|
25
|
} |
|
26
|
|
|
27
|
export function isPaintSolid(paint: Paint): paint is PaintSolid { |
|
28
|
return paint.type === PaintType.SOLID |
|
29
|
} |
|
30
|
|
|
31
|
export function isPaintGradient(paint: Paint): paint is PaintGradient { |
|
32
|
return ( |
|
33
|
paint.type === PaintType.GRADIENT_ANGULAR || |
|
34
|
paint.type === PaintType.GRADIENT_DIAMOND || |
|
35
|
paint.type === PaintType.GRADIENT_LINEAR || |
|
36
|
paint.type === PaintType.GRADIENT_RADIAL |
|
37
|
) |
|
38
|
} |
|
39
|
|
|
40
|
export function isPaintImage(paint: Paint): paint is PaintImage { |
|
41
|
return paint.type === PaintType.IMAGE |
|
42
|
} |