mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 20:19:44 +08:00
f558a78d5c
* feat(qrcode): support click & iconSize configuration * fix fix use rest union React.HTMLAttributes<HTMLElement fix ImageSettings interface type fix add default 40 clear unused * empty commit --------- Co-authored-by: afc163 <afc163@gmail.com>
38 lines
919 B
TypeScript
38 lines
919 B
TypeScript
import type { CSSProperties } from 'react';
|
|
|
|
interface ImageSettings {
|
|
src: string;
|
|
height: number;
|
|
width: number;
|
|
excavate: boolean;
|
|
x?: number;
|
|
y?: number;
|
|
}
|
|
|
|
export interface QRProps {
|
|
value: string;
|
|
type?: 'canvas' | 'svg';
|
|
size?: number;
|
|
color?: string;
|
|
style?: CSSProperties;
|
|
includeMargin?: boolean;
|
|
imageSettings?: ImageSettings;
|
|
bgColor?: string;
|
|
}
|
|
|
|
export type QRPropsCanvas = QRProps & React.CanvasHTMLAttributes<HTMLCanvasElement>;
|
|
|
|
export type QRPropsSvg = QRProps & React.SVGAttributes<SVGSVGElement>;
|
|
|
|
export interface QRCodeProps extends QRProps, React.HTMLAttributes<HTMLDivElement> {
|
|
className?: string;
|
|
rootClassName?: string;
|
|
prefixCls?: string;
|
|
icon?: string;
|
|
iconSize?: number | { width: number; height: number };
|
|
bordered?: boolean;
|
|
errorLevel?: 'L' | 'M' | 'Q' | 'H';
|
|
status?: 'active' | 'expired' | 'loading' | 'scanned';
|
|
onRefresh?: () => void;
|
|
}
|