1 | import { Component, ComponentClass } from 'react';
|
2 | import { ViewProps } from 'react-native';
|
3 |
|
4 | import WebGL2RenderingContext from './WebGL2RenderingContext';
|
5 |
|
6 | export type SurfaceCreateEvent = {
|
7 | nativeEvent: {
|
8 | exglCtxId: number;
|
9 | };
|
10 | };
|
11 |
|
12 | export type SnapshotOptions = {
|
13 | flip?: boolean;
|
14 | framebuffer?: WebGLFramebuffer;
|
15 | rect?: {
|
16 | x: number;
|
17 | y: number;
|
18 | width: number;
|
19 | height: number;
|
20 | };
|
21 | format?: 'jpeg' | 'png';
|
22 | compress?: number;
|
23 | };
|
24 |
|
25 | export type GLSnapshot = {
|
26 | uri: string | Blob | null;
|
27 | localUri: string;
|
28 | width: number;
|
29 | height: number;
|
30 | };
|
31 |
|
32 | export interface ExpoWebGLRenderingContext extends WebGL2RenderingContext {
|
33 | __exglCtxId: number;
|
34 | endFrameEXP(): void;
|
35 | __expoSetLogging(option: GLLoggingOption): void;
|
36 | }
|
37 |
|
38 | export type ComponentOrHandle = null | number | Component<any, any> | ComponentClass<any>;
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 | export interface BaseGLViewProps extends ViewProps {
|
47 | |
48 |
|
49 |
|
50 |
|
51 | onContextCreate(gl: ExpoWebGLRenderingContext): void;
|
52 |
|
53 | |
54 |
|
55 |
|
56 | msaaSamples?: number;
|
57 | }
|
58 |
|
59 | export enum GLLoggingOption {
|
60 | |
61 |
|
62 |
|
63 | DISABLED = 0,
|
64 |
|
65 | |
66 |
|
67 |
|
68 | METHOD_CALLS = 1,
|
69 |
|
70 | |
71 |
|
72 |
|
73 |
|
74 | GET_ERRORS = 2,
|
75 |
|
76 | |
77 |
|
78 |
|
79 | RESOLVE_CONSTANTS = 4,
|
80 |
|
81 | |
82 |
|
83 |
|
84 |
|
85 | TRUNCATE_STRINGS = 8,
|
86 |
|
87 | |
88 |
|
89 |
|
90 | ALL = METHOD_CALLS | GET_ERRORS | RESOLVE_CONSTANTS | TRUNCATE_STRINGS,
|
91 | }
|