Permalink
Browse files

perf(animations): reduce size of animations bundle

before:
animations.umd.js = 33k
animations.umd.min.js = 9.0k

after:
animations.umd.js = 31k
animations.umd.min.js = 7.9k
  • Loading branch information...
matsko committed May 17, 2017
1 parent 6416e79 commit 712630ca65b8b083249bc7ab786046dc45622207
Showing with 30 additions and 31 deletions.
  1. +16 −17 packages/animations/src/players/animation_player.ts
  2. +14 −14 tools/public_api_guard/animations/animations.d.ts
@@ -10,23 +10,22 @@ import {scheduleMicroTask} from '../util';
/**
* @experimental Animation support is experimental.
*/
export abstract class AnimationPlayer {
abstract onDone(fn: () => void): void;
abstract onStart(fn: () => void): void;
abstract onDestroy(fn: () => void): void;
abstract init(): void;
abstract hasStarted(): boolean;
abstract play(): void;
abstract pause(): void;
abstract restart(): void;
abstract finish(): void;
abstract destroy(): void;
abstract reset(): void;
abstract setPosition(p: any /** TODO #9100 */): void;
abstract getPosition(): number;
get parentPlayer(): AnimationPlayer|null { throw new Error('NOT IMPLEMENTED: Base Class'); }
set parentPlayer(player: AnimationPlayer|null) { throw new Error('NOT IMPLEMENTED: Base Class'); }
get totalTime(): number { throw new Error('NOT IMPLEMENTED: Base Class'); }
export interface AnimationPlayer {
onDone(fn: () => void): void;
onStart(fn: () => void): void;
onDestroy(fn: () => void): void;
init(): void;
hasStarted(): boolean;
play(): void;
pause(): void;
restart(): void;
finish(): void;
destroy(): void;
reset(): void;
setPosition(p: any /** TODO #9100 */): void;
getPosition(): number;
parentPlayer: AnimationPlayer|null;
readonly totalTime: number;
beforeDestroy?: () => any;
}
@@ -98,23 +98,23 @@ export interface AnimationOptions {
}
/** @experimental */
export declare abstract class AnimationPlayer {
export interface AnimationPlayer {
beforeDestroy?: () => any;
parentPlayer: AnimationPlayer | null;
readonly totalTime: number;
abstract destroy(): void;
abstract finish(): void;
abstract getPosition(): number;
abstract hasStarted(): boolean;
abstract init(): void;
abstract onDestroy(fn: () => void): void;
abstract onDone(fn: () => void): void;
abstract onStart(fn: () => void): void;
abstract pause(): void;
abstract play(): void;
abstract reset(): void;
abstract restart(): void;
abstract setPosition(p: any): void;
destroy(): void;
finish(): void;
getPosition(): number;
hasStarted(): boolean;
init(): void;
onDestroy(fn: () => void): void;
onDone(fn: () => void): void;
onStart(fn: () => void): void;
pause(): void;
play(): void;
reset(): void;
restart(): void;
setPosition(p: any): void;
}
/** @experimental */

0 comments on commit 712630c

Please sign in to comment.