1 | import PropTypes from 'prop-types';
|
2 | import React from 'react';
|
3 | import { BaseGLViewProps, GLSnapshot, ExpoWebGLRenderingContext, SnapshotOptions } from './GLView.types';
|
4 | export { BaseGLViewProps, ExpoWebGLRenderingContext, SnapshotOptions, GLViewProps };
|
5 | interface GLViewProps extends BaseGLViewProps {
|
6 | onContextCreate: (gl: WebGLRenderingContext) => void;
|
7 | onContextRestored?: (gl?: WebGLRenderingContext) => void;
|
8 | onContextLost?: () => void;
|
9 | webglContextAttributes?: WebGLContextAttributes;
|
10 | }
|
11 | declare type State = {
|
12 | width: number;
|
13 | height: number;
|
14 | };
|
15 | export declare class GLView extends React.Component<GLViewProps, State> {
|
16 | state: {
|
17 | width: number;
|
18 | height: number;
|
19 | };
|
20 | static propTypes: {
|
21 | onContextCreate: PropTypes.Validator<(...args: any[]) => any>;
|
22 | onContextRestored: PropTypes.Requireable<(...args: any[]) => any>;
|
23 | onContextLost: PropTypes.Requireable<(...args: any[]) => any>;
|
24 | webglContextAttributes: PropTypes.Requireable<object>;
|
25 | };
|
26 | _hasContextBeenCreated: boolean;
|
27 | _webglContextAttributes: WebGLContextAttributes | undefined;
|
28 | canvas: HTMLCanvasElement | undefined;
|
29 | container?: HTMLElement;
|
30 | gl?: WebGLRenderingContext;
|
31 | static createContextAsync(): Promise<WebGLRenderingContext>;
|
32 | static destroyContextAsync(exgl?: WebGLRenderingContext | number): Promise<boolean>;
|
33 | static takeSnapshotAsync(exgl: WebGLRenderingContext, options?: SnapshotOptions): Promise<GLSnapshot>;
|
34 | componentDidMount(): void;
|
35 | _contextCreated: () => void;
|
36 | componentWillUnmount(): void;
|
37 | _updateLayout: () => void;
|
38 | render(): JSX.Element;
|
39 | componentDidUpdate(): void;
|
40 | _createContext(): WebGLRenderingContext;
|
41 | _getGlOrReject(): WebGLRenderingContext;
|
42 | _contextLost: (event: Event) => void;
|
43 | _contextRestored: () => void;
|
44 | _assignCanvasRef: (canvas: HTMLCanvasElement) => void;
|
45 | _assignContainerRef: (element: HTMLElement | null) => void;
|
46 | takeSnapshotAsync(options?: SnapshotOptions): Promise<GLSnapshot>;
|
47 | startARSessionAsync(): Promise<void>;
|
48 | createCameraTextureAsync(): Promise<void>;
|
49 | destroyObjectAsync(glObject: WebGLObject): Promise<void>;
|
50 | }
|