yingye / weapp-qrcode

weapp.qrcode.js 在 微信小程序 中,快速生成二维码
MIT License
1.63k stars 982 forks source link

没有声明文件,导致在ts文件中使用报错 #72

Open lovelytong opened 3 years ago

lovelytong commented 3 years ago

Description

没有声明文件,导致在ts文件中使用报错

Environment

Reproduce

问题复现步骤:

  1. [第一步]
  2. [第二步]
  3. [其他步骤...]

期望的表现:

[在这里描述期望的表现]

观察到的表现:

[在这里描述观察到的表现]

屏幕截图和动态 GIF 图 image

// TODO(you): code or logs here to reproduce the problem
abearxiong commented 3 years ago

自己定义一个呗

abearxiong commented 3 years ago

qrcode.d.ts

// declare var drawQrcode: Function;
export interface DrawQrcodeOption {
  ctx?: any;
  canvasId?: string;
  text: string;
  width?: number;
  height?: number;
  x?: number;
  y?: number;
  typeNumber?: number;
  correctLevel?: number;
  background?: string;
  foreground?: string;
}
export function drawQrcode(option: DrawQrcodeOption): any;