-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes Functions not in TS definition files #60 #61
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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(entities: any[], screen: ScaledSize, layout:LayoutRectangle): Component; | ||
|
||
export function DefaultRenderer(defaultRendererOptions: DefaultRendererOptions): any; | ||
|
||
export class DefaultTimer {} | ||
export class DefaultTimer { | ||
loop: (time:number) => void; | ||
start: () => void; | ||
stop: () => void; | ||
subscribe: (callback: () => void) => void; | ||
unsubscribe: (callback: () => void) => void; | ||
} | ||
|
||
interface TouchProcessorOptions { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it seems like arguments for this interface may be optional because there are default values provided:
|
||
triggerPressEventBefore: number; | ||
|
@@ -38,20 +39,32 @@ declare module "react-native-game-engine" { | |
} | ||
|
||
export type GameEngineSystem = (entities: any, update: GameEngineUpdateEventOptionType) => any; | ||
|
||
interface GameEngineEntity { | ||
[key:string]: any; | ||
renderer?: JSX.Element | React.ComponentClass<any. any>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
|
||
type GameEngineEntities = Record<string | number, GameEngineEntity>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is this for? Doesn't look like it's used anywhere |
||
|
||
export interface GameEngineProperties { | ||
systems?: any[]; | ||
entities?: {} | Promise<any>; | ||
renderer?: any; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey @SimpleProgrammingAU - this all looks really good. Quick question, should this line be: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should probably be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see.. I ask because of this change that you made: What exactly did you mean by:
Are you saying that the Lastly, since I'm not 100% across TS, would changing the name break anything from a backwards compatibility, tooling and intellisense (VS Code?) perspective? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let me have a play around with somethings myself because I'm not 100%, either! I'll get back to you tomorrow (I'm UTC+11) with either a new commit or more commentary =) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @SimpleProgrammingAU I'm curious where this ended up. Any updates on your findings? |
||
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> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add |
||
dispatch: (event:any) => void; | ||
start: () => void; | ||
stop: () => void; | ||
swap: ({}:any | Promise) => void | Promise<void> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
as Promise shall have 1 argument |
||
} | ||
|
||
export type TouchEventType = 'start' | 'end' | 'move' | 'press' | 'long-press'; | ||
|
||
|
@@ -86,13 +99,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> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
start: () => void; | ||
stop: () => void; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no such type
LayoutRectangle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also no
Component