@nativescript/rive
Version:
Rive for NativeScript
65 lines (64 loc) • 3.09 kB
TypeScript
import { RiveViewBase, TypeRiveDirection, TypeRiveFit, TypeRiveLoop } from './common';
export { TypeRiveAlignment, TypeRiveDirection, TypeRiveFit, TypeRiveLoop } from './common';
export declare class RiveView extends RiveViewBase {
riveFile: RiveFile;
ctrl: NSCRiveController;
nativeViewProtected: UIView;
fileName: string;
fit: TypeRiveFit;
autoPlay: boolean;
riveFileDelegate: RiveFileDelegateImpl;
riveStateMachineDelegate: RiveStateMachineDelegateImpl;
constructor();
createNativeView(): UIView;
disposeNativeView(): void;
riveFileHttpSrcDidLoad(riveFile: RiveFile): void;
triggerInput(name: string): void;
triggerInputValue(name: string, value: string | boolean | number | null): void;
setInputValue(value: string | boolean | number | null): void;
private _setInputValue;
setTextRunValue(name: string, value: any): void;
private _init;
isPlaying(): boolean;
play(loop?: TypeRiveLoop, direction?: TypeRiveDirection, settleInitialState?: boolean): void;
playWithAnimations(animationNames?: string | string[], loop?: TypeRiveLoop, direction?: TypeRiveDirection, areStateMachines?: boolean, settleInitialState?: boolean): void;
stop(): void;
stopWithAnimations(animationNames?: string[], areStateMachines?: boolean): void;
pause(): void;
pauseWithAnimations(animationNames?: string | string[], areStateMachines?: boolean): void;
reset(): void;
fireState(stateMachineName: string, inputName: string): void;
setBooleanState(stateMachineName: string, inputName: string, value: any): void;
setNumberState(stateMachineName: string, inputName: string, value: any): void;
getStateMachines(): void;
getPlayingStateMachines(): void;
getAnimations(): void;
getPlayingAnimations(): void;
private addListener;
private buildList;
private getLoop;
private getDirection;
private getFit;
private getAlignment;
}
declare class RiveFileDelegateImpl extends NSObject implements RiveFileDelegate {
static ObjCProtocols: {
prototype: RiveFileDelegate;
}[];
private _owner;
static initWithOwner(owner: WeakRef<RiveView>): RiveFileDelegateImpl;
riveFileDidLoadError(riveFile: RiveFile): boolean;
}
declare class RiveStateMachineDelegateImpl extends NSObject implements RiveStateMachineDelegate {
static ObjCProtocols: {
prototype: RiveStateMachineDelegate;
}[];
private _owner;
static initWithOwner(owner: WeakRef<RiveView>): RiveStateMachineDelegateImpl;
stateMachineDidChangeState?(stateMachine: RiveStateMachineInstance, stateName: string): void;
stateMachineReceivedInput?(stateMachine: RiveStateMachineInstance, input: StateMachineInput): void;
touchBeganOnArtboardAtLocation?(artboard: RiveArtboard, location: CGPoint): void;
touchCancelledOnArtboardAtLocation?(artboard: RiveArtboard, location: CGPoint): void;
touchEndedOnArtboardAtLocation?(artboard: RiveArtboard, location: CGPoint): void;
touchMovedOnArtboardAtLocation?(artboard: RiveArtboard, location: CGPoint): void;
}