mirror of
https://github.com/status-im/react-native-blur.git
synced 2025-02-27 15:30:27 +00:00
Flow definition (#308)
* Add flow definition * Minor chnage to the comments in the TypeScript definition to reflect 1a061eb45222506db8722ea371f68cbc99904549
This commit is contained in:
parent
2dca68fc99
commit
33d62f1f22
7
index.d.ts
vendored
7
index.d.ts
vendored
@ -6,10 +6,11 @@ export interface BlurViewProperties {
|
|||||||
| "xlight"
|
| "xlight"
|
||||||
| "light"
|
| "light"
|
||||||
| "dark"
|
| "dark"
|
||||||
// tvOS only
|
// tvOS and iOS 10+ only
|
||||||
| "extraDark"
|
|
||||||
| "regular"
|
| "regular"
|
||||||
| "prominent";
|
| "prominent"
|
||||||
|
// tvOS only
|
||||||
|
| "extraDark";
|
||||||
blurAmount?: number; // 0 - 100
|
blurAmount?: number; // 0 - 100
|
||||||
style?: StyleProp<ViewStyle>;
|
style?: StyleProp<ViewStyle>;
|
||||||
viewRef?: number | null;
|
viewRef?: number | null;
|
||||||
|
39
index.js.flow
Normal file
39
index.js.flow
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
// @flow
|
||||||
|
|
||||||
|
import * as React from 'react';
|
||||||
|
import {View} from 'react-native';
|
||||||
|
|
||||||
|
type ViewProps = React.ElementProps<typeof View>;
|
||||||
|
type ViewStyleProp = $PropertyType<ViewProps, 'style'>;
|
||||||
|
|
||||||
|
export type BlurType =
|
||||||
|
| 'xlight'
|
||||||
|
| 'light'
|
||||||
|
| 'dark'
|
||||||
|
// tvOS and iOS 10+ only
|
||||||
|
| 'regular'
|
||||||
|
| 'prominent'
|
||||||
|
// tvOS only
|
||||||
|
| 'extraDark';
|
||||||
|
|
||||||
|
export type BlurViewProps = {
|
||||||
|
blurType: BlurType,
|
||||||
|
blurAmount: number, // 0 - 100
|
||||||
|
style?: ?ViewStyleProp,
|
||||||
|
viewRef?: ?React.ElementRef<any>,
|
||||||
|
};
|
||||||
|
|
||||||
|
export class BlurView extends React.Component<BlurViewProps> {
|
||||||
|
static defaultProps = {
|
||||||
|
blurType: 'dark',
|
||||||
|
blurAmount: 10,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export type VibrancyViewProps = BlurViewProps;
|
||||||
|
|
||||||
|
export class VibrancyView extends React.Component<VibrancyViewProps> {
|
||||||
|
static defaultProps = {
|
||||||
|
blurAmount: 10,
|
||||||
|
};
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user