Skip to content

Commit

Permalink
🍱 Add typings for ct.transiton
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmoMyzrailGorynych committed Mar 12, 2020
1 parent 57a88f2 commit 8d3f4a3
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions app/data/ct.libs/transition/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
type CtTransitionDirection = 'left' | 'right' | 'top' | 'bottom';

declare namespace ct {
/**
* Allows you to create transitions between rooms, or whenever you need them.
*/
namespace transition {
/**
* The beginning of a fading transition, which paints the whole screen through time.
* The arguments `duration` and `color` are optional,
* and default to `500` (0.5 seconds) and `0x000000` (black color).
*/
function fadeOut(duration: number, color: number): Promise<void>;
/**
* The end of a fading transition. The arguments `duration` and `color` are optional,
* and default to `500` (0.5 seconds) and `0x000000` (black color).
*/
function fadeIn(duration: number, color: number): Promise<void>;

/**
* Scales the camera by a given coefficient while also fading to a specified color
* (similar to `ct.transition.fadeOut`). The default `scaling` is `0.1`,
* which will zoom in 10 times. Setting values larger than `1` will zoom out instead.
* The arguments `duration` and `color` are optional, and default to `500` (0.5 seconds)
* and `0x000000` (black color).
*/
function scaleOut(duration: number, scaling: number, color: number): Promise<void>;
/**
* Scales the camera by a given coefficient and turns back to normal,
* while also fading in from a specified color (similar to `ct.transition.fadeIn`).
* The default `scaling` is `0.1`, which will zoom in 10 times. Setting values larger
* than `1` will zoom out instead. The arguments `duration` and `color` are optional,
* and default to `500` (0.5 seconds) and `0x000000` (black color).
*/
function scaleIn(duration: number, scaling: number, color: number): Promise<void>;

/**
* The beginning of a sliding transition. A rectangle will smoothly move
* from one edge of the screen to the opposite, in the given direction,
* covering the screen with an opaque color.
* The arguments `duration` and `color` are optional, and
* default to `500` (0.5 seconds) and `0x000000` (black color).
*/
function slideOut(duration: number, direction: CtTransitionDirection, color: number): Promise<void>;
/**
* The end of a sliding transition. A rectangle will smoothly move
* from one edge of the screen to the opposite, in the given direction,
* covering the screen with an opaque color.
* The arguments `duration` and `color` are optional,
* and default to `500` (0.5 seconds) and `0x000000` (black color).
*/
function slideIn(duration: number, direction: CtTransitionDirection, color: number): Promise<void>;

/**
* The beginning of a circle-shaped transition. This will create a circle
* that smoothly grows from a size of a point to cover the whole screen
* in a given opaque color. The arguments `duration` and `color` are optional,
* and default to `500` (0.5 seconds) and `0x000000` (black color).
*/
function circleOut(duration: number, color: number): Promise<void>;
/**
* The end of a circle-shaped transition. This will create a circle
* that covers the whole screen in a given opaque color but smoothly
* shrinks to a point. The arguments `duration` and `color` are optional,
* and default to `500` (0.5 seconds) and `0x000000` (black color).
*/
function circleIn(duration: number, color: number): Promise<void>;
}

}

0 comments on commit 8d3f4a3

Please sign in to comment.