@reactuses/core
Version:
<div align = "center"> <h1 align = "center"> reactuse </h1> </div>
37 lines (33 loc) • 717 B
text/typescript
import QRCode, { QRCodeToDataURLOptions } from 'qrcode';
/**
* @title UseQRCode
*/
type UseQRCode = (
/**
* @zh 文本
* @en Text
*/
text: string,
/**
* @zh 传递给 `QRCode.toDataURL` 的选项
* @en Options passed to `QRCode.toDataURL`
*/
options?: QRCodeToDataURLOptions) => UseQRCodeReturn;
/**
* @title UseQRCodeReturn
*/
interface UseQRCodeReturn {
/**
* @zh 生成的二维码
* @en Generated QR code
*/
qrCode: string;
/**
* @zh 错误
* @en Error
*/
error: unknown;
}
declare function generateQRCode(text: string, options?: QRCode.QRCodeToDataURLOptions): Promise<string>;
declare const useQRCode: UseQRCode;
export { generateQRCode, useQRCode };