From 25df9777a1aca7444009cb3662fecdcdc6a3fe7c Mon Sep 17 00:00:00 2001 From: Adrian Hall Date: Fri, 11 Aug 2017 12:55:06 -0700 Subject: [PATCH 1/4] Added event listener modifications to Dimensions per latest spec. --- types/react-native/index.d.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 629c8a8fd5..bea6b407c5 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -5645,7 +5645,23 @@ export interface Dimensions { * This should only be called from native code by sending the didUpdateDimensions event. * @param {object} dims Simple string-keyed object of dimensions to set */ - set( dims: {[key: string]: any} ): void + set( dims: {[key: string]: any} ): void; + + /** + * Add an event listener for dimension changes + * + * @param {string} type the type of event to listen to + * @param {function} handler the event handler + */ + addEventListener(type: "change", handler: () => void): void; + + /** + * Remove an event listener + * + * @param {string} type the type of event + * @param {function} handler the event handler + */ + removeEventListener(type: "change", handler: () => void): void; } export type SimpleTask = { From a0e14262fdec1ad4b76be1624ef18c28b62d71bc Mon Sep 17 00:00:00 2001 From: Adrian Hall Date: Fri, 11 Aug 2017 13:01:18 -0700 Subject: [PATCH 2/4] Fixed lint issues --- types/react-native/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index bea6b407c5..32b5b57f1b 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -5657,7 +5657,7 @@ export interface Dimensions { /** * Remove an event listener - * + * * @param {string} type the type of event * @param {function} handler the event handler */ From 6dd5be7f3eca8b905263506bbf44913931f368f5 Mon Sep 17 00:00:00 2001 From: Adrian Hall Date: Fri, 11 Aug 2017 13:34:04 -0700 Subject: [PATCH 3/4] Increment version # --- types/react-native/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 32b5b57f1b..e88a3036e4 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-native 0.47 +// Type definitions for react-native 0.48 // Project: https://github.com/facebook/react-native // Definitions by: Eloy Durán // Fedor Nezhivoi @@ -6,6 +6,7 @@ // Kyle Roach // Tim Wang // Kamal Mahyuddin +// Adrian Hall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 From 229ef45a966b502179dd8330b2924a3838d9d7e9 Mon Sep 17 00:00:00 2001 From: Adrian Hall Date: Fri, 11 Aug 2017 17:11:16 -0700 Subject: [PATCH 4/4] Addressed reviewer comments * Set the version # Back * Removed myself as a maintainer. --- types/react-native/index.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index e88a3036e4..32b5b57f1b 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-native 0.48 +// Type definitions for react-native 0.47 // Project: https://github.com/facebook/react-native // Definitions by: Eloy Durán // Fedor Nezhivoi @@ -6,7 +6,6 @@ // Kyle Roach // Tim Wang // Kamal Mahyuddin -// Adrian Hall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3