Skip to content

Commit

Permalink
Fixes Functions not in TS definition files bberak#60
Browse files Browse the repository at this point in the history
  • Loading branch information
SimpleProgrammingAU authored Dec 25, 2020
1 parent 9f4ea58 commit ba9cd2d
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions react-native-game-engine.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ declare module "react-native-game-engine" {
import * as React from "react";
import { StyleProp, ViewStyle, ScaledSize } from "react-native";

interface DefaultRendererOptions {
state: any;
screen: ScaledSize;
}

export function DefaultRenderer(defaultRendererOptions: DefaultRendererOptions): any;
export function DefaultRenderer(entities: any[], screen: ScaledSize, layout:LayoutRectangle): Component;

export class DefaultTimer {}
export class DefaultTimer {
loop: (time:number) => void;
start: () => void;
stop: () => void;
subscribe: (callback: () => void) => void;
unsubscribe: (callback: () => void) => void;
}

interface TouchProcessorOptions {
triggerPressEventBefore: number;
Expand Down Expand Up @@ -44,14 +45,19 @@ declare module "react-native-game-engine" {
entities?: {} | Promise<any>;
renderer?: any;
touchProcessor?: any;
timer?: any;
timer?: DefaultTimer | any;
running?: boolean;
onEvent?: any;
style?: StyleProp<ViewStyle>;
children?: React.ReactNode;
}

export class GameEngine extends React.Component<GameEngineProperties> {}
export class GameEngine extends React.Component<GameEngineProperties> {
dispatch: (event:any) => void;
start: () => void;
stop: () => void;
swap: ({}:any | Promise) => void | Promise<void>
}

export type TouchEventType = 'start' | 'end' | 'move' | 'press' | 'long-press';

Expand Down Expand Up @@ -86,13 +92,16 @@ declare module "react-native-game-engine" {

export interface GameLoopProperties {
touchProcessor?: any;
timer?: any;
timer?: DefaultTimer | any;
running?: boolean;
onUpdate?: (args: GameLoopUpdateEventOptionType) => void;
style?: StyleProp<ViewStyle>;
children?: React.ReactNode;
}

export class GameLoop extends React.Component<GameLoopProperties> {}
export class GameLoop extends React.Component<GameLoopProperties> {
start: () => void;
stop: () => void;
}
}

0 comments on commit ba9cd2d

Please sign in to comment.