|
1 | | -declare module "react-device-detect" { |
2 | | - import * as React from "react"; |
3 | 1 |
|
4 | | - export class BrowserView extends React.Component<any, never> { |
5 | | - device: any; |
| 2 | +// Type definitions for react-device-detect 1.6.4 |
| 3 | +// Project: https://github.com/duskload/react-device-detect |
| 4 | +// Definitions by: Michael Laktionov <https://github.com/duskload> |
| 5 | +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped |
| 6 | +// TypeScript Version: 2.8 |
6 | 7 |
|
7 | | - render(): JSX.Element; |
8 | | - } |
| 8 | +declare module "react-device-detect" { |
| 9 | + export import BrowserView = ReactDeviceDetect.BrowserView; |
| 10 | + export import MobileView = ReactDeviceDetect.MobileView; |
| 11 | + export import AndroidView = ReactDeviceDetect.AndroidView; |
| 12 | + export import IEView = ReactDeviceDetect.IEView; |
| 13 | + export import IOSView = ReactDeviceDetect.IOSView; |
| 14 | + export import TabletView = ReactDeviceDetect.TabletView; |
| 15 | + export import WinPhoneView = ReactDeviceDetect.WinPhoneView; |
| 16 | + export import MobileOnlyView = ReactDeviceDetect.MobileOnlyView; |
| 17 | + export import SmartTVView = ReactDeviceDetect.SmartTVView; |
| 18 | + export import ConsoleView = ReactDeviceDetect.ConsoleView; |
| 19 | + export import WearableView = ReactDeviceDetect.WearableView; |
| 20 | + export import CustomView = ReactDeviceDetect.CustomView; |
| 21 | + export import CustomViewProps = ReactDeviceDetect.CustomViewProps; |
| 22 | + export import ViewProps = ReactDeviceDetect.ViewProps; |
| 23 | + export import isBrowser = ReactDeviceDetect.isBrowser; |
| 24 | + export import isMobile = ReactDeviceDetect.isMobile; |
| 25 | + export import isTablet = ReactDeviceDetect.isTablet; |
| 26 | + export import isSmartTV = ReactDeviceDetect.isSmartTV; |
| 27 | + export import isConsole = ReactDeviceDetect.isConsole; |
| 28 | + export import isWearable = ReactDeviceDetect.isWearable; |
| 29 | + export import isMobileSafari = ReactDeviceDetect.isMobileSafari; |
| 30 | + export import isChromium = ReactDeviceDetect.isChromium; |
| 31 | + export import isMobileOnly = ReactDeviceDetect.isMobileOnly; |
| 32 | + export import isAndroid = ReactDeviceDetect.isAndroid; |
| 33 | + export import isWinPhone = ReactDeviceDetect.isWinPhone; |
| 34 | + export import isIOS = ReactDeviceDetect.isIOS; |
| 35 | + export import isChrome = ReactDeviceDetect.isChrome; |
| 36 | + export import isFirefox = ReactDeviceDetect.isFirefox; |
| 37 | + export import isSafari = ReactDeviceDetect.isSafari; |
| 38 | + export import isOpera = ReactDeviceDetect.isOpera; |
| 39 | + export import isIE = ReactDeviceDetect.isIE; |
| 40 | + export import isEdge = ReactDeviceDetect.isEdge; |
| 41 | + export import isYandex = ReactDeviceDetect.isYandex; |
| 42 | + export import osVersion = ReactDeviceDetect.osVersion; |
| 43 | + export import osName = ReactDeviceDetect.osName; |
| 44 | + export import fullBrowserVersion = ReactDeviceDetect.fullBrowserVersion; |
| 45 | + export import browserVersion = ReactDeviceDetect.browserVersion; |
| 46 | + export import browserName = ReactDeviceDetect.browserName; |
| 47 | + export import mobileVendor = ReactDeviceDetect.mobileVendor; |
| 48 | + export import mobileModel = ReactDeviceDetect.mobileModel; |
| 49 | + export import engineName = ReactDeviceDetect.engineName; |
| 50 | + export import engineVersion = ReactDeviceDetect.engineVersion; |
| 51 | + export import getUA = ReactDeviceDetect.getUA; |
| 52 | +} |
9 | 53 |
|
10 | | - export class MobileView extends React.Component<any, never> { |
11 | | - device: any; |
| 54 | +declare namespace ReactDeviceDetect { |
12 | 55 |
|
13 | | - render(): JSX.Element; |
| 56 | + export interface ViewProps { |
| 57 | + renderWithFragment?: boolean; |
| 58 | + children?: React.ReactNode; |
| 59 | + viewClassName?: string; |
| 60 | + style?: React.CSSProperties; |
14 | 61 | } |
15 | 62 |
|
16 | | - export class AndroidView extends React.Component<any, never> { |
17 | | - device: any; |
18 | | - |
19 | | - render(): JSX.Element; |
| 63 | + export interface CustomViewProps { |
| 64 | + renderWithFragment?: boolean; |
| 65 | + children?: React.ReactNode; |
| 66 | + viewClassName?: string; |
| 67 | + style?: React.CSSProperties; |
| 68 | + condition?: boolean |
20 | 69 | } |
21 | 70 |
|
22 | | - export class IEView extends React.Component<any, never> { |
23 | | - device: any; |
24 | | - |
25 | | - render(): JSX.Element; |
| 71 | + export class BrowserView extends React.Component<ViewProps> { |
26 | 72 | } |
27 | 73 |
|
28 | | - export class IOSView extends React.Component<any, never> { |
29 | | - device: any; |
30 | | - |
31 | | - render(): JSX.Element; |
| 74 | + export class MobileView extends React.Component<ViewProps> { |
32 | 75 | } |
33 | 76 |
|
34 | | - export class TabletView extends React.Component<any, never> { |
35 | | - device: any; |
36 | | - |
37 | | - render(): JSX.Element; |
| 77 | + export class AndroidView extends React.Component<ViewProps> { |
38 | 78 | } |
39 | 79 |
|
40 | | - export class WinPhoneView extends React.Component<any, never> { |
41 | | - device: any; |
42 | | - |
43 | | - render(): JSX.Element; |
| 80 | + export class IEView extends React.Component<ViewProps> { |
44 | 81 | } |
45 | 82 |
|
46 | | - export class MobileOnlyView extends React.Component<any, never> { |
47 | | - device: any; |
48 | | - |
49 | | - render(): JSX.Element; |
| 83 | + export class IOSView extends React.Component<ViewProps> { |
50 | 84 | } |
51 | 85 |
|
52 | | - export class SmartTVView extends React.Component<any, never> { |
53 | | - device: any; |
54 | | - |
55 | | - render(): JSX.Element; |
| 86 | + export class TabletView extends React.Component<ViewProps> { |
56 | 87 | } |
57 | 88 |
|
58 | | - export class ConsoleView extends React.Component<any, never> { |
59 | | - device: any; |
| 89 | + export class WinPhoneView extends React.Component<ViewProps> { |
| 90 | + } |
60 | 91 |
|
61 | | - render(): JSX.Element; |
| 92 | + export class MobileOnlyView extends React.Component<ViewProps> { |
62 | 93 | } |
63 | 94 |
|
64 | | - export class WearableView extends React.Component<any, never> { |
65 | | - device: any; |
| 95 | + export class SmartTVView extends React.Component<ViewProps> { |
| 96 | + } |
66 | 97 |
|
67 | | - render(): JSX.Element; |
| 98 | + export class ConsoleView extends React.Component<ViewProps> { |
68 | 99 | } |
69 | 100 |
|
70 | | - export class CustomView extends React.Component<any, never> { |
71 | | - device: any; |
| 101 | + export class WearableView extends React.Component<ViewProps> { |
| 102 | + } |
72 | 103 |
|
73 | | - render(): JSX.Element; |
| 104 | + export class CustomView extends React.Component<CustomViewProps> { |
74 | 105 | } |
75 | 106 |
|
76 | 107 | export const isBrowser: boolean; |
|
0 commit comments