UNPKG

2.79 kBSource Map (JSON)View Raw
1{"version":3,"file":"GLView.types.js","sourceRoot":"","sources":["../src/GLView.types.ts"],"names":[],"mappings":"AA0DA,MAAM,CAAN,IAAY,eAgCX;AAhCD,WAAY,eAAe;IACzB;;OAEG;IACH,6DAAY,CAAA;IAEZ;;OAEG;IACH,qEAAgB,CAAA;IAEhB;;;OAGG;IACH,iEAAc,CAAA;IAEd;;OAEG;IACH,+EAAqB,CAAA;IAErB;;;OAGG;IACH,6EAAoB,CAAA;IAEpB;;OAEG;IACH,oDAAsE,CAAA;AACxE,CAAC,EAhCW,eAAe,KAAf,eAAe,QAgC1B","sourcesContent":["import { Component, ComponentClass } from 'react';\nimport { ViewProps } from 'react-native';\n\nimport WebGL2RenderingContext from './WebGL2RenderingContext';\n\nexport type SurfaceCreateEvent = {\n nativeEvent: {\n exglCtxId: number;\n };\n};\n\nexport type SnapshotOptions = {\n flip?: boolean;\n framebuffer?: WebGLFramebuffer;\n rect?: {\n x: number;\n y: number;\n width: number;\n height: number;\n };\n format?: 'jpeg' | 'png';\n compress?: number;\n};\n\nexport type GLSnapshot = {\n uri: string | Blob | null;\n localUri: string;\n width: number;\n height: number;\n};\n\nexport interface ExpoWebGLRenderingContext extends WebGL2RenderingContext {\n __exglCtxId: number;\n endFrameEXP(): void;\n __expoSetLogging(option: GLLoggingOption): void;\n}\n\nexport type ComponentOrHandle = null | number | Component<any, any> | ComponentClass<any>;\n\n/**\n *\n * A View that acts as an OpenGL ES render target. On mounting, an OpenGL ES\n * context is created. Its drawing buffer is presented as the contents of\n * the View every frame.\n */\nexport interface BaseGLViewProps extends ViewProps {\n /**\n * Called when the OpenGL context is created, with the context object as a parameter. The context\n * object has an API mirroring WebGL's WebGLRenderingContext.\n */\n onContextCreate(gl: ExpoWebGLRenderingContext): void;\n\n /**\n * [iOS only] Number of samples for Apple's built-in multisampling.\n */\n msaaSamples?: number;\n}\n\nexport enum GLLoggingOption {\n /**\n * Disables logging entirely.\n */\n DISABLED = 0,\n\n /**\n * Logs method calls, their parameters and results.\n */\n METHOD_CALLS = 1,\n\n /**\n * Calls `gl.getError()` after each other method call and prints an error if any is returned.\n * This option has a significant impact on the performance as this method is blocking.\n */\n GET_ERRORS = 2,\n\n /**\n * Resolves parameters of type `number` to their constant names.\n */\n RESOLVE_CONSTANTS = 4,\n\n /**\n * When this option is enabled, long strings will be truncated.\n * It's useful if your shaders are really big and logging them significantly reduces performance.\n */\n TRUNCATE_STRINGS = 8,\n\n /**\n * Enables all other options. It implies `GET_ERRORS` so be aware of the slowdown.\n */\n ALL = METHOD_CALLS | GET_ERRORS | RESOLVE_CONSTANTS | TRUNCATE_STRINGS,\n}\n"]}
\No newline at end of file