mirror of
https://github.com/zhigang1992/react-native-paper.git
synced 2026-06-10 07:19:40 +08:00
fix: add $Omit for lower Typescript versions (#1180)
This commit is contained in:
committed by
Dawid Urbaniak
parent
ae6258cf87
commit
12ed01e04c
@@ -8,10 +8,10 @@ import {
|
||||
StyleProp,
|
||||
ViewStyle,
|
||||
} from 'react-native';
|
||||
|
||||
import { $Omit } from './../../types';
|
||||
import AppbarAction from './AppbarAction';
|
||||
|
||||
type Props = Omit<
|
||||
type Props = $Omit<
|
||||
React.ComponentProps<typeof AppbarAction> & {
|
||||
/**
|
||||
* Custom color for back icon.
|
||||
|
||||
@@ -9,10 +9,10 @@ import {
|
||||
} from 'react-native';
|
||||
import AnimatedText from './Typography/AnimatedText';
|
||||
import { withTheme } from '../core/theming';
|
||||
import { Theme } from '../types';
|
||||
import { Theme, $Omit } from '../types';
|
||||
|
||||
type Props = Omit<
|
||||
Omit<React.ComponentProps<typeof Animated.Text>, 'padding'>,
|
||||
type Props = $Omit<
|
||||
$Omit<React.ComponentProps<typeof Animated.Text>, 'padding'>,
|
||||
'type'
|
||||
> & {
|
||||
/**
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
} from 'react-native';
|
||||
|
||||
import { withTheme } from '../../core/theming';
|
||||
import { Theme } from '../../types';
|
||||
import { Theme, $Omit } from '../../types';
|
||||
import Portal from '../Portal/Portal';
|
||||
import Surface from '../Surface';
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
@@ -54,7 +54,7 @@ type Props = {
|
||||
theme: Theme;
|
||||
};
|
||||
|
||||
type Layout = Omit<Omit<LayoutRectangle, 'x'>, 'y'>;
|
||||
type Layout = $Omit<$Omit<LayoutRectangle, 'x'>, 'y'>;
|
||||
|
||||
type State = {
|
||||
rendered: boolean;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { TextInput as NativeTextInput, Animated } from 'react-native';
|
||||
import { TextInputProps } from './TextInput';
|
||||
import { $Omit } from './../../types';
|
||||
|
||||
export type RenderProps = {
|
||||
ref: (a: NativeTextInput | null | undefined) => void;
|
||||
@@ -17,7 +18,7 @@ export type RenderProps = {
|
||||
value?: string;
|
||||
adjustsFontSizeToFit?: boolean;
|
||||
};
|
||||
type TextInputTypesWithoutMode = Omit<TextInputProps, 'mode'>;
|
||||
type TextInputTypesWithoutMode = $Omit<TextInputProps, 'mode'>;
|
||||
export type State = {
|
||||
labeled: Animated.Value;
|
||||
error: Animated.Value;
|
||||
|
||||
@@ -44,7 +44,8 @@ export type Theme = {
|
||||
};
|
||||
};
|
||||
|
||||
export type $RemoveChildren<T extends React.ComponentType<any>> = Omit<
|
||||
export type $Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
|
||||
export type $RemoveChildren<T extends React.ComponentType<any>> = $Omit<
|
||||
React.ComponentProps<T>,
|
||||
'children'
|
||||
>;
|
||||
|
||||
Reference in New Issue
Block a user