gl-react-dom
Version:
DOM implementation of gl-react, an universal React library to write and compose WebGL shaders
50 lines • 1.55 kB
TypeScript
import { Component } from "react";
type WebGLContextAttributes = {
alpha?: boolean;
depth?: boolean;
stencil?: boolean;
antialias?: boolean;
premultipliedAlpha?: boolean;
preserveDrawingBuffer?: boolean;
preferLowPowerToHighPerformance?: boolean;
failIfMajorPerformanceCaveat?: boolean;
};
export default class GLViewDOM extends Component<{
onContextCreate: (gl: WebGLRenderingContext) => void;
onContextFailure: (e: Error) => void;
onContextLost: () => void;
onContextRestored: (gl: WebGLRenderingContext | null) => void;
webglContextAttributes?: WebGLContextAttributes;
pixelRatio?: number;
width: number;
height: number;
style?: any;
debug?: number;
version?: string;
[key: string]: any;
}, {
error: Error | null;
}> {
state: {
error: Error | null;
};
static propTypes: {
[key: string]: any;
};
webglContextAttributes: WebGLContextAttributes;
canvas: HTMLCanvasElement | null;
gl: WebGLRenderingContext | null;
componentDidMount(): void;
componentWillUnmount(): void;
render(): import("react/jsx-runtime").JSX.Element;
_createContext(): WebGLRenderingContext;
_onContextLost: (e: Event) => void;
_onContextRestored: () => void;
onRef: (ref: HTMLCanvasElement | null) => void;
debugError: (error: Error) => void;
afterDraw: () => void;
captureAsDataURL(...args: any[]): string;
captureAsBlob(...args: any[]): Promise<Blob>;
}
export {};
//# sourceMappingURL=GLViewDOM.d.ts.map