Skip to content
This repository was archived by the owner on Jun 5, 2019. It is now read-only.

Commit 46107ae

Browse files
committed
Merge remote-tracking branch 'upstream/master' into storybook-ify
2 parents b9c1038 + 966cd22 commit 46107ae

File tree

5 files changed

+156
-0
lines changed

5 files changed

+156
-0
lines changed

typings/electron-is-dev.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare module 'electron-is-dev' {
2+
export const isDev: boolean
3+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
declare module 'electron-window-state-manager' {
2+
interface ElectronStateManagerOptions {
3+
/** The default width for this window. */
4+
defaultWidth?: number
5+
/** The default height for this window. */
6+
defaultHeight?: number
7+
}
8+
9+
/**
10+
* Manages an Electron.BrowserWindow's dimensions and stores it to disk.
11+
*/
12+
class ElectronStateManager {
13+
/**
14+
* Creates a manager that loads/saves a window's coordinates & dimensions.
15+
*
16+
* @param name The name of the window.
17+
* @param options Some default options.
18+
*/
19+
constructor(name: string, options?: ElectronStateManagerOptions)
20+
/** Save this window's dimensions */
21+
saveState(browserWindow: Electron.BrowserWindow): void
22+
/** The window width. */
23+
width: number
24+
/** The window height. */
25+
height: number
26+
/** the window left position. */
27+
x: number
28+
/** The window right position. */
29+
y: number
30+
/** Is this maximized? */
31+
maximized: boolean
32+
}
33+
34+
export = ElectronStateManager
35+
}

typings/images.d.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Tell the TS compiler that it's ok to load these
2+
// types of extensions. FuseBox will do the right thing.
3+
declare module '*.jpeg' {
4+
export default ''
5+
}
6+
7+
declare module '*.jpg' {
8+
export default ''
9+
}
10+
11+
declare module '*.gif' {
12+
export default ''
13+
}
14+
15+
declare module '*.png' {
16+
export default ''
17+
}
18+
19+
declare module '*.svg' {
20+
export default ''
21+
}

typings/popmotion-react.d.ts

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
declare module 'popmotion-react' {
2+
import { Component } from 'react'
3+
4+
export interface StateChangeValue {
5+
[name: string]: any
6+
}
7+
8+
export interface SetStateFunctions {
9+
[name: string]: () => void
10+
}
11+
12+
export interface MotionStateProps {
13+
/** The current numerical value, or object of named values. */
14+
v: number | StateChangeValue
15+
16+
/** Current velocity, or object of named velocities. */
17+
velocity: number
18+
19+
/** Current state name. */
20+
state: string
21+
22+
/** Object of setter functions, generated from the states defined in onStateChange (each optionally accepts an Event). */
23+
setStateTo: SetStateFunctions
24+
25+
/** Provides onStateChange setters a ref attribute for an escape hatch to the DOM (for instance attaching/removing events). */
26+
setRef(ref: React.ReactNode): void
27+
}
28+
29+
export interface StateChangeEvent {
30+
/** The popmotion value object. */
31+
value: any
32+
/** State before current state change. */
33+
previousState: string
34+
/** Object of state setters (each optionally accepts an Event). */
35+
setStateTo: any
36+
/** : A reference to the mounted React component, if a component was provided setRef. */
37+
ref: React.ReactNode
38+
/** The triggering event, if a state setter was called with one. */
39+
e: Event
40+
/** When hooking into TransitionGroup lifecycle events componentWillEnter, componentWillAppear and componentWillLeave, this callback is provided and required. */
41+
onComplete?: () => void
42+
}
43+
44+
export interface MotionStates {
45+
[stateName: string]: (onStateChange: StateChangeEvent) => void
46+
}
47+
48+
export interface MotionValueProps {
49+
/**
50+
* The initial state to start in.
51+
*/
52+
initialState?: string
53+
54+
/**
55+
* A state machine mapping state names to action states.
56+
*/
57+
onStateChange?: MotionStates
58+
}
59+
60+
export class MotionValue extends Component<MotionValueProps, {}> {
61+
constructor()
62+
}
63+
}

typings/popmotion.d.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
declare module 'popmotion' {
2+
export interface ActionProps {
3+
/** Fires every frame the value is updated. */
4+
onUpdate?(): void
5+
/** Fires when an action starts. */
6+
onStart?(): void
7+
/** Fires when an action is stopped. */
8+
onStop?(): void
9+
/** Fires when an action is completed. */
10+
onComplete?(): void
11+
/** If defined, get and onUpdate will pass the current value through this function before returning. */
12+
transform?(): void
13+
}
14+
15+
export interface TweenProps {
16+
/** The amount of time for the tween to take, in milliseconds. (default: 300) */
17+
duration?: number
18+
/** Easing function */
19+
ease?: () => void
20+
/** The number to tween from. (default 0) */
21+
from?: number
22+
/** The number to tween to. (default: 1) */
23+
to?: number
24+
/** Number of times to flip tween on tween complete. (default: 0) */
25+
flip?: number
26+
/** Number of times to restart tween from beginning on tween complete. (default: 0) */
27+
loop?: number
28+
/** yoyo <Number>: Number of times to reverse tween on tween complete. (default: 0) */
29+
yoyo?: number
30+
}
31+
32+
export function tween(options: TweenProps & ActionProps): any
33+
export const transform: any
34+
}

0 commit comments

Comments
 (0)