Skip to content

Commit 077e495

Browse files
authored
Remove "hoist-non-react-statics" from global type declaration (#1480)
* remove hoist-non-react-statics from global type declaration * remove explicit global module declaration for url-parse * Fix ts compile due to non-defined dependency typings * add generated types
1 parent 63d4fcf commit 077e495

File tree

12 files changed

+8
-19
lines changed

12 files changed

+8
-19
lines changed

generatedTypes/components/scrollBar/index.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,8 @@ declare const Item: {
8484
displayName: string;
8585
};
8686
declare const _default: React.ComponentClass<ScrollBarProps & {
87-
/**
87+
useCustomTheme?: boolean | undefined; /**
8888
* Whether to use a FlatList. NOTE: you must pass 'data' and 'renderItem' props as well
8989
*/
90-
useCustomTheme?: boolean | undefined;
9190
}, any> & typeof ScrollBar;
9291
export default _default;

generatedTypes/helpers/AvatarHelper.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ export declare function getAvatarColors(): string[];
33
export declare function getColorById(id: string, avatarColors?: string[]): string;
44
export declare function getInitials(name?: string, limit?: number): string;
55
export declare function getBackgroundColor(name?: string, avatarColors?: string[], hashFunction?: (name?: string) => number, defaultColor?: string): string | undefined;
6-
export declare function isGravatarUrl(url: string): any;
7-
export declare function isBlankGravatarUrl(url: string): any;
8-
export declare function patchGravatarUrl(gravatarUrl: string): any;
6+
export declare function isGravatarUrl(url: string): boolean;
7+
export declare function isBlankGravatarUrl(url: string): boolean;
8+
export declare function patchGravatarUrl(gravatarUrl: string): string;

generatedTypes/incubator/TextField/usePreset.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
126126
selectionState?: import("react-native").DocumentSelectionState | undefined;
127127
spellCheck?: boolean | undefined;
128128
textContentType?: "none" | "name" | "password" | "username" | "URL" | "addressCity" | "addressCityAndState" | "addressState" | "countryName" | "creditCardNumber" | "emailAddress" | "familyName" | "fullStreetAddress" | "givenName" | "jobTitle" | "location" | "middleName" | "namePrefix" | "nameSuffix" | "nickname" | "organizationName" | "postalCode" | "streetAddressLine1" | "streetAddressLine2" | "sublocality" | "telephoneNumber" | "newPassword" | "oneTimeCode" | undefined;
129-
autoCompleteType?: "email" | "name" | "off" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-number" | "password" | "postal-code" | "street-address" | "tel" | "username" | undefined;
129+
autoCompleteType?: "name" | "password" | "username" | "email" | "off" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-number" | "postal-code" | "street-address" | "tel" | undefined;
130130
importantForAutofill?: "auto" | "yes" | "no" | "noExcludeDescendants" | "yesExcludeDescendants" | undefined;
131131
disableFullscreenUI?: boolean | undefined;
132132
inlineImageLeft?: string | undefined;
@@ -458,7 +458,7 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
458458
selectionState?: import("react-native").DocumentSelectionState | undefined;
459459
spellCheck?: boolean | undefined;
460460
textContentType?: "none" | "name" | "password" | "username" | "URL" | "addressCity" | "addressCityAndState" | "addressState" | "countryName" | "creditCardNumber" | "emailAddress" | "familyName" | "fullStreetAddress" | "givenName" | "jobTitle" | "location" | "middleName" | "namePrefix" | "nameSuffix" | "nickname" | "organizationName" | "postalCode" | "streetAddressLine1" | "streetAddressLine2" | "sublocality" | "telephoneNumber" | "newPassword" | "oneTimeCode" | undefined;
461-
autoCompleteType?: "email" | "name" | "off" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-number" | "password" | "postal-code" | "street-address" | "tel" | "username" | undefined;
461+
autoCompleteType?: "name" | "password" | "username" | "email" | "off" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-number" | "postal-code" | "street-address" | "tel" | undefined;
462462
importantForAutofill?: "auto" | "yes" | "no" | "noExcludeDescendants" | "yesExcludeDescendants" | undefined;
463463
disableFullscreenUI?: boolean | undefined;
464464
inlineImageLeft?: string | undefined;
@@ -902,7 +902,7 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
902902
selectionState?: import("react-native").DocumentSelectionState | undefined;
903903
spellCheck?: boolean | undefined;
904904
textContentType?: "none" | "name" | "password" | "username" | "URL" | "addressCity" | "addressCityAndState" | "addressState" | "countryName" | "creditCardNumber" | "emailAddress" | "familyName" | "fullStreetAddress" | "givenName" | "jobTitle" | "location" | "middleName" | "namePrefix" | "nameSuffix" | "nickname" | "organizationName" | "postalCode" | "streetAddressLine1" | "streetAddressLine2" | "sublocality" | "telephoneNumber" | "newPassword" | "oneTimeCode" | undefined;
905-
autoCompleteType?: "email" | "name" | "off" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-number" | "password" | "postal-code" | "street-address" | "tel" | "username" | undefined;
905+
autoCompleteType?: "name" | "password" | "username" | "email" | "off" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-number" | "postal-code" | "street-address" | "tel" | undefined;
906906
importantForAutofill?: "auto" | "yes" | "no" | "noExcludeDescendants" | "yesExcludeDescendants" | undefined;
907907
disableFullscreenUI?: boolean | undefined;
908908
inlineImageLeft?: string | undefined;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"@react-native-community/netinfo": "^5.6.2",
7272
"@react-native-picker/picker": "^1.9.4",
7373
"@testing-library/react-hooks": "^3.4.2",
74+
"@types/hoist-non-react-statics": "^3.3.1",
7475
"@types/lodash": "^4.0.0",
7576
"@types/prop-types": "^15.5.3",
7677
"@types/react-native": "0.64.1",

src/commons/asBaseComponent.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import React from 'react';
22
import {Appearance} from 'react-native';
3-
//@ts-ignore
43
import hoistStatics from 'hoist-non-react-statics';
5-
//@ts-ignore
64
import * as Modifiers from './modifiers';
75
import forwardRef from './forwardRef';
86
import UIComponent from './UIComponent';

src/commons/forwardRef.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react';
2-
//@ts-ignore
32
import hoistStatics from 'hoist-non-react-statics';
43

54
export interface ForwardRefInjectedProps {

src/commons/withScrollEnabler.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, {useState, useCallback, useRef} from 'react';
22
import {FlatListProps, ScrollViewProps, LayoutChangeEvent} from 'react-native';
33
import forwardRef, {ForwardRefInjectedProps} from './forwardRef';
4-
//@ts-ignore
54
import hoistStatics from 'hoist-non-react-statics';
65

76
type ScrollEnablerProps = {

src/commons/withScrollReached.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, {useState, useCallback} from 'react';
22
import {FlatListProps, ScrollViewProps, NativeSyntheticEvent, NativeScrollEvent} from 'react-native';
33
import forwardRef, {ForwardRefInjectedProps} from './forwardRef';
4-
//@ts-ignore
54
import hoistStatics from 'hoist-non-react-statics';
65
import {Constants} from '../helpers';
76

src/components/image/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import _ from 'lodash';
22
import React, {PureComponent} from 'react';
3-
//@ts-ignore
43
import hoistNonReactStatic from 'hoist-non-react-statics';
54
import {
65
StyleSheet,

src/components/radioGroup/asRadioGroupChild.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, {Component} from 'react';
2-
// @ts-ignore
32
import hoistStatics from 'hoist-non-react-statics';
43
import RadioGroupContext from './RadioGroupContext';
54

src/incubator/TextField/withFieldState.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// TODO: remove this file (was replaced with useFieldState hook)
22
import React, {useCallback, useState, useEffect, useMemo} from 'react';
33
import _ from 'lodash';
4-
//@ts-ignore
54
import hoistStatics from 'hoist-non-react-statics';
65
import {TextInputProps} from 'react-native';
76
import validators from './validators';

typings/globalTypes.d.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ declare module 'react-native-color' {
99
declare const Gradient: any;
1010
}
1111

12-
declare module 'hoist-non-react-statics';
13-
declare module 'url-parse';
14-
1512
interface Extendable {
1613
[key: string]: any;
1714
}

0 commit comments

Comments
 (0)