pixi-reactive
Version:
A library to help integrate PIXI into a React project
26 lines (25 loc) • 1.68 kB
TypeScript
import { SyntheticEvent } from 'react';
import { SpeedContextType, RenderingContextType, AnimationContextType, ParentContextType, LoadResourceType, TextureContextType, ShapeTextureType, ShapeStyleType, PointsContextType, ImpactContextType, PixiProps, PropsContextType } from '../types';
import * as PIXI from 'pixi.js';
import { PointerContextType } from '../types/PointerContextType';
export declare const useSpeedContext: () => SpeedContextType;
export declare const useAnimationContext: (speed: number) => AnimationContextType;
export declare const useRenderingContext: (canvasReference: string, frameId: number, background?: number | undefined) => RenderingContextType;
export declare const useParentContext: <T extends PIXI.Container>(parent: T) => ParentContextType<T>;
export declare const useTextureContext: (resources: LoadResourceType) => TextureContextType;
export declare const usePointerContext: (retina: boolean, width: number, height: number) => {
pointerContext: PointerContextType;
updatePosition: (event: SyntheticEvent) => {
x: number;
y: number;
} | null;
pointerStart: (event: SyntheticEvent) => void;
pointerOver: () => void;
pointerEnd: (event: SyntheticEvent) => void;
pointerCancel: () => void;
};
export declare const useShapeTextureContext: () => ShapeTextureType;
export declare const useShapeStyleContext: () => ShapeStyleType;
export declare const usePointsContext: () => PointsContextType;
export declare const useImpactContext: <T extends PIXI.Container>() => ImpactContextType<T>;
export declare const usePropsContext: <T extends PixiProps>(props: T) => PropsContextType<T>;