diff --git a/react-responsive/react-responsive-tests.tsx b/react-responsive/react-responsive-tests.tsx new file mode 100644 index 0000000000..643fc93658 --- /dev/null +++ b/react-responsive/react-responsive-tests.tsx @@ -0,0 +1,45 @@ +/// +/// + +import * as React from "react"; +import * as MediaQuery from "react-responsive"; + +class Test extends React.Component<{}, {}> { + render() { + return ( +
+
Device Test!
+ +
You are a desktop or laptop
+ +
You also have a huge screen
+
+ +
You are sized like a tablet or mobile phone though
+
+
+ +
You are a tablet or mobile phone
+
+ +
You are portrait
+
+ +
You are landscape
+
+ +
You are retina
+
+ +
You are a desktop or laptop
+ +
You also have a huge screen
+
+ +
You are sized like a tablet or mobile phone though
+
+
+
+ ) + } +} diff --git a/react-responsive/react-responsive.d.ts b/react-responsive/react-responsive.d.ts new file mode 100644 index 0000000000..dbd272ee72 --- /dev/null +++ b/react-responsive/react-responsive.d.ts @@ -0,0 +1,66 @@ +// Type definitions for react-responsive 1.1.3 +// Project: https://github.com/contra/react-responsive +// Definitions by: Alexey Svetliakov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "react-responsive" { + import * as React from 'react'; + + namespace MediaQuery { + export interface MediaQueryProps { + query?: string; + // matchers + orientation?: "portrait" | "landscape"; + scan?: "progressive" | "interlace"; + aspectRatio?: string; + deviceAspectRatio?: string; + height?: number | string; + deviceHeight?: number | string; + width?: number | string; + deviceWidth?: number | string; + color?: boolean; + colorIndex?: boolean; + monochrome?: boolean; + resolution?: number | string; + // types + minAspectRatio?: string; + maxAspectRatio?: string; + minDeviceAspectRatio?: string; + maxDeviceAspectRatio?: string; + minHeight?: number | string; + maxHeight?: number | string; + minDeviceHeight?: number | string; + maxDeviceHeight?: number | string; + minDeviceWidth?: number | string; + maxDeviceWidth?: number | string; + minWidth?: number | string; + maxWidth?: number | string; + minColor?: number; + maxColor?: number; + minColorIndex?: number; + maxColorIndex?: number; + minMonochrome?: number; + maxMonochrome?: number; + minResolution?: number | string; + maxResolution?: number | string; + // types + all?: boolean; + grid?: boolean; + aural?: boolean; + braille?: boolean; + handheld?: boolean; + print?: boolean; + projection?: boolean; + screen?: boolean; + tty?: boolean; + tv?: boolean; + embossed?: boolean; + } + } + + class MediaQuery extends React.Component { } + export = MediaQuery; + +}