DefinitelyTyped/types/qrcode.react/qrcode.react-tests.tsx
bjoluc ede0512c20 [qrcode.react] Support imageSettings and passed-through props (#40447)
* update and enhance qrcode.react types

* update qrcode.react version in header

* remove patch version
2019-11-18 12:17:33 -08:00

30 lines
1.6 KiB
TypeScript

import QRCode = require("qrcode.react");
import * as React from "react";
const qrcodes = [
<QRCode value="https://github.com/DefinitelyTyped/DefinitelyTyped"/>,
<QRCode value="https://github.com/DefinitelyTyped/DefinitelyTyped" size={64}/>,
<QRCode value="https://github.com/DefinitelyTyped/DefinitelyTyped" bgColor="#555555"/>,
<QRCode value="https://github.com/DefinitelyTyped/DefinitelyTyped" fgColor="#aaaaaa"/>,
<QRCode value="https://github.com/DefinitelyTyped/DefinitelyTyped" level="L"/>,
<QRCode value="https://github.com/DefinitelyTyped/DefinitelyTyped" level="H"/>,
<QRCode value="https://github.com/DefinitelyTyped/DefinitelyTyped" includeMargin={true}/>,
<QRCode value="https://github.com/DefinitelyTyped/DefinitelyTyped" size={256} bgColor="pink" fgColor="red" level="Q"/>,
// Test imageSettings property:
<QRCode value="https://github.com/DefinitelyTyped/DefinitelyTyped" imageSettings={{src: "./some-file.png"}}/>,
<QRCode value="https://github.com/DefinitelyTyped/DefinitelyTyped" imageSettings={{
src: "./some-file.png",
x: 1,
y: 1,
height: 1,
width: 1,
excavate: true
}}/>,
// Test some passed-through props for svg and canvas elements:
<QRCode value="https://github.com/DefinitelyTyped/DefinitelyTyped" renderAs="svg"/>,
<QRCode value="https://github.com/DefinitelyTyped/DefinitelyTyped" renderAs="svg" amplitude={1}/>,
<QRCode value="https://github.com/DefinitelyTyped/DefinitelyTyped" renderAs="canvas"/>,
<QRCode value="https://github.com/DefinitelyTyped/DefinitelyTyped" renderAs="canvas" height={1} width={1}/>,
<QRCode value="https://github.com/DefinitelyTyped/DefinitelyTyped" height={1} width={1}/>,
];