-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(typegen): generate declaration files auto-magically
- Loading branch information
Showing
7 changed files
with
167 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import * as THREE from 'three'; | ||
import * as React from 'react'; | ||
export declare type CanvasContext = { | ||
canvas?: React.MutableRefObject<any>; | ||
subscribers: Array<Function>; | ||
frames: 0; | ||
aspect: 0; | ||
gl?: THREE.WebGLRenderer; | ||
camera?: THREE.Camera; | ||
scene?: THREE.Scene; | ||
canvasRect?: DOMRectReadOnly; | ||
viewport?: { | ||
width: number; | ||
height: number; | ||
}; | ||
size?: { | ||
left: number; | ||
top: number; | ||
width: number; | ||
height: number; | ||
}; | ||
ready: boolean; | ||
manual: boolean; | ||
active: boolean; | ||
captured: boolean; | ||
invalidateFrameloop: boolean; | ||
subscribe?: (callback: Function, main: any) => () => any; | ||
setManual: (takeOverRenderloop: boolean) => any; | ||
setDefaultCamera: (camera: THREE.Camera) => any; | ||
invalidate: () => any; | ||
}; | ||
export declare type CanvasProps = { | ||
children: React.ReactNode; | ||
gl: THREE.WebGLRenderer; | ||
camera?: THREE.Camera; | ||
style?: React.CSSProperties; | ||
pixelRatio?: number; | ||
invalidateFrameloop?: boolean; | ||
onCreated: Function; | ||
}; | ||
export declare type Measure = [{ | ||
ref: React.MutableRefObject<any>; | ||
}, { | ||
left: number; | ||
top: number; | ||
width: number; | ||
height: number; | ||
}]; | ||
export declare type IntersectObject = Event & THREE.Intersection & { | ||
ray: THREE.Raycaster; | ||
stopped: { | ||
current: boolean; | ||
}; | ||
uuid: string; | ||
transform: { | ||
x: Function; | ||
y: Function; | ||
}; | ||
}; | ||
export declare const stateContext: React.Context<{ | ||
ready: boolean; | ||
subscribers: any[]; | ||
manual: boolean; | ||
active: boolean; | ||
canvas: any; | ||
gl: any; | ||
camera: any; | ||
scene: any; | ||
size: any; | ||
canvasRect: any; | ||
frames: number; | ||
aspect: number; | ||
viewport: any; | ||
captured: any; | ||
invalidateFrameloop: boolean; | ||
subscribe: (fn: any, main: any) => () => void; | ||
setManual: (takeOverRenderloop: any) => void; | ||
setDefaultCamera: (cam: any) => void; | ||
invalidate: () => void; | ||
}>; | ||
export declare const Canvas: React.MemoExoticComponent<({ children, gl, camera, style, pixelRatio, invalidateFrameloop, onCreated, ...rest }: CanvasProps) => JSX.Element>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/// <reference types="react" /> | ||
export declare function useRender(fn: Function, takeOverRenderloop: boolean): any; | ||
export declare function useThree(): { | ||
ready: boolean; | ||
subscribers: any[]; | ||
manual: boolean; | ||
active: boolean; | ||
canvas: any; | ||
gl: any; | ||
camera: any; | ||
scene: any; | ||
size: any; | ||
canvasRect: any; | ||
frames: number; | ||
aspect: number; | ||
viewport: any; | ||
captured: any; | ||
invalidateFrameloop: boolean; | ||
setManual: (takeOverRenderloop: any) => void; | ||
setDefaultCamera: (cam: any) => void; | ||
invalidate: () => void; | ||
}; | ||
export declare function useUpdate(callback: Function, dependents: [], optionalRef: React.MutableRefObject<any>): React.MutableRefObject<any>; | ||
export declare function useResource(optionalRef: React.MutableRefObject<any>): React.MutableRefObject<any>; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export declare function addEffect(callback: any): void; | ||
export declare function invalidate(state: any, frames?: number): void; | ||
export declare const apply: (objects: any) => any; | ||
export declare function applyProps(instance: any, newProps: any, oldProps?: {}, interpolateArray?: boolean, container?: { | ||
__interaction: any; | ||
}): void; | ||
export declare function render(element: any, container: any, state: any): any; | ||
export declare function unmountComponentAtNode(container: any): void; |