mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
add 'sketch' and 'vr' as platforms to react-primitives (#28674)
* add 'sketch' and 'vr' as platforms to react-primitives * Update index.d.ts * fixed lint warnings * added test
This commit is contained in:
committed by
Ryan Cavanaugh
parent
b883a3573a
commit
bf29450ff9
Vendored
+11
-2
@@ -1,6 +1,7 @@
|
||||
// Type definitions for react-primitives 0.6
|
||||
// Project: https://github.com/lelandrichardson/react-primitives
|
||||
// Definitions by: Ahmed Ghoneim <https://github.com/aghoneim92>
|
||||
// David Pett <https://github.com/davidpett>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -11,7 +12,7 @@ import {
|
||||
Easing,
|
||||
Image,
|
||||
PixelRatio,
|
||||
Platform,
|
||||
PlatformOSType as RNPlatformOSType,
|
||||
StyleSheet,
|
||||
Text,
|
||||
TouchableOpacityProps,
|
||||
@@ -20,13 +21,21 @@ import {
|
||||
|
||||
export const Touchable: ComponentType<TouchableOpacityProps>;
|
||||
|
||||
// react-primitives also supports react-sketchapp and react-vr as platforms
|
||||
export type PlatformOSType = RNPlatformOSType | 'sketch' | 'vr';
|
||||
export interface PlatformStatic {
|
||||
OS: PlatformOSType;
|
||||
Version: number | string;
|
||||
select<T>(specifics: { [platform in PlatformOSType | 'default']?: T }): T;
|
||||
}
|
||||
export const Platform: PlatformStatic;
|
||||
|
||||
export {
|
||||
Animated,
|
||||
Dimensions,
|
||||
Easing,
|
||||
Image,
|
||||
PixelRatio,
|
||||
Platform,
|
||||
StyleSheet,
|
||||
Text,
|
||||
View
|
||||
|
||||
@@ -49,6 +49,9 @@ export default class Component extends React.Component<{}, State> {
|
||||
duration: 10000,
|
||||
easing: Easing.cubic
|
||||
}).start();
|
||||
if (Platform.OS === 'sketch') {
|
||||
console.log('The Platform is sketch');
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
Reference in New Issue
Block a user