-
Notifications
You must be signed in to change notification settings - Fork 34
/
index.d.ts
33 lines (29 loc) · 967 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { MutableRefObject, PureComponent } from 'react';
import { StyleProp, ViewStyle, ImageStyle } from 'react-native';
type AnimationConfig = {
[name: string]: number[];
};
export interface ISpriteSheetProps {
source: number | { uri: string; width: number; height: number };
columns: number;
rows: number;
ref: MutableRefObject<SpriteSheet | null>;
animations: AnimationConfig; // see example
viewStyle?: StyleProp<ViewStyle>; // styles for the sprite sheet container
imageStyle?: StyleProp<ImageStyle>; // styles for the sprite sheet
width?: number;
height?: number;
onLoad?: () => void;
}
export class SpriteSheet extends PureComponent<ISpriteSheetProps, {}> {
play: (config: {
type: string;
fps?: number;
loop?: boolean;
resetAfterFinish?: boolean;
onFinish?: () => void;
}) => void;
stop: (cb?: (value: number) => void) => void;
reset: (cb?: (value: number) => void) => void;
}
export default SpriteSheet;