From b6ba570873e321086df8cba82dc934f292ad70ef Mon Sep 17 00:00:00 2001 From: Michael Prokopchuk Date: Mon, 11 Jun 2018 16:22:41 -0400 Subject: [PATCH 1/2] Improve GLView interface and associated types --- types/expo/index.d.ts | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index e556e5255a..cb7a14381b 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -7,6 +7,7 @@ // Fernando Helwanger // Umidbek Karimov // Moshe Feuchtwanger +// Michael Prokopchuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -1390,12 +1391,24 @@ export namespace Font { } // #region GLView +export interface ExpoWebGLRenderingContext extends WebGLRenderingContext { + endFrameEXP(): any; +} + /** - * GLView + * A View that acts as an OpenGL ES render target. On mounting, an OpenGL ES + * context is created. Its drawing buffer is presented as the contents of + * the View every frame. */ export interface GLViewProps extends ViewProps { - onContextCreate(): void; - msaaSamples: number; + /** + * A function that will be called when the OpenGL ES context is created. + * Passes an object with a WebGLRenderingContext interface as an argument. + */ + onContextCreate(gl: ExpoWebGLRenderingContext): void; + + /** Number of MSAA samples to use on iOS. Defaults to 4. Ignored on Android. */ + msaaSamples?: number; } export class GLView extends Component { } From 2f6fd069334b1b69031979abb7416ca36dd01367 Mon Sep 17 00:00:00 2001 From: Michael Prokopchuk Date: Mon, 11 Jun 2018 16:26:28 -0400 Subject: [PATCH 2/2] Update endFrameEXP return type so it's more accurate --- types/expo/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index cb7a14381b..048d7b884d 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -1392,7 +1392,7 @@ export namespace Font { // #region GLView export interface ExpoWebGLRenderingContext extends WebGLRenderingContext { - endFrameEXP(): any; + endFrameEXP(): void; } /**