| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 879448e commit c58ec1f
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,8 @@ | |||
| 1 | + /** | ||
| 2 | + * @module "ui/styling/converters" | ||
| 3 | + */ /** */ | ||
| 4 | + | ||
| 5 | + import { AnimationCurve } from "../enums/enums"; | ||
| 6 | + | ||
| 7 | + export function timeConverter(value: string): number; | ||
| 8 | + export function animationTimingFunctionConverter(value: string): any; | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,21 @@ | |||
| 1 | + /** | ||
| 2 | + * @module "ui/styling/css-animations-parser" | ||
| 3 | + */ /** */ | ||
| 4 | + | ||
| 5 | + import { | ||
| 6 | + KeyframeAnimationInfo, | ||
| 7 | + KeyframeDeclaration, | ||
| 8 | + KeyframeInfo, | ||
| 9 | + UnparsedKeyframe, | ||
| 10 | + } from "../animation/keyframe-animation"; | ||
| 11 | + import { timeConverter, animationTimingFunctionConverter } from "./converters"; | ||
| 12 | + | ||
| 13 | + import { transformConverter } from "./style-properties"; | ||
| 14 | + | ||
| 15 | + export class CssAnimationParser { | ||
| 16 | + public static keyframeAnimationsFromCSSDeclarations(declarations: KeyframeDeclaration[]): KeyframeAnimationInfo[]; | ||
| 17 | + | ||
| 18 | + public static keyframesArrayFromCSS(keyframes: UnparsedKeyframe[]): KeyframeInfo[]; | ||
| 19 | + } | ||
| 20 | + | ||
| 21 | + export function parseKeyframeDeclarations(unparsedKeyframeDeclarations: KeyframeDeclaration[]) : KeyframeDeclaration[]; | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,9 +21,8 @@ const ANIMATION_PROPERTY_HANDLERS = Object.freeze({ | |||
| 21 | 21 | }); | |
| 22 | 22 | ||
| 23 | 23 | export class CssAnimationParser { | |
| 24 | - public static keyframeAnimationsFromCSSDeclarations( | ||
| 25 | - declarations: Array<KeyframeDeclaration>) | ||
| 26 | - : Array<KeyframeAnimationInfo> { | ||
| 24 | + public static keyframeAnimationsFromCSSDeclarations(declarations: KeyframeDeclaration[]) | ||
| 25 | + : KeyframeAnimationInfo[] { | ||
| 27 | 26 | ||
| 28 | 27 | if (declarations === null || declarations === undefined) { | |
| 29 | 28 | return undefined; | |
@@ -50,7 +49,7 @@ export class CssAnimationParser { | |||
| 50 | 49 | return animations.length === 0 ? undefined : animations; | |
| 51 | 50 | } | |
| 52 | 51 | ||
| 53 | - public static keyframesArrayFromCSS(keyframes: Array<UnparsedKeyframe>): Array<KeyframeInfo> { | ||
| 52 | + public static keyframesArrayFromCSS(keyframes: UnparsedKeyframe[]): KeyframeInfo[] { | ||
| 54 | 53 | let parsedKeyframes = new Array<KeyframeInfo>(); | |
| 55 | 54 | for (let keyframe of keyframes) { | |
| 56 | 55 | let declarations = parseKeyframeDeclarations(keyframe.declarations); | |
@@ -92,7 +91,7 @@ export class CssAnimationParser { | |||
| 92 | 91 | } | |
| 93 | 92 | } | |
| 94 | 93 | ||
| 95 | - function keyframeAnimationsFromCSSProperty(value: any, animations: Array<KeyframeAnimationInfo>) { | ||
| 94 | + function keyframeAnimationsFromCSSProperty(value: any, animations: KeyframeAnimationInfo[]) { | ||
| 96 | 95 | if (typeof value === "string") { | |
| 97 | 96 | let values = value.split(/[,]+/); | |
| 98 | 97 | for (let parsedValue of values) { | |
@@ -128,8 +127,7 @@ function keyframeAnimationsFromCSSProperty(value: any, animations: Array<Keyfram | |||
| 128 | 127 | } | |
| 129 | 128 | } | |
| 130 | 129 | ||
| 131 | - export function parseKeyframeDeclarations(unparsedKeyframeDeclarations: Array<KeyframeDeclaration>) | ||
| 132 | - : Array<KeyframeDeclaration> { | ||
| 130 | + export function parseKeyframeDeclarations(unparsedKeyframeDeclarations: KeyframeDeclaration[]): KeyframeDeclaration[] { | ||
| 133 | 131 | ||
| 134 | 132 | const declarations = unparsedKeyframeDeclarations | |
| 135 | 133 | .reduce((declarations, { property: unparsedProperty, value: unparsedValue }) => { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments