mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Added type definitions for @chenfengyuan/vue-qrcode (#47016)
This commit is contained in:
parent
8809c61614
commit
869e188582
@ -0,0 +1,10 @@
|
||||
import Vue from 'vue';
|
||||
import VueQrCode from '@chenfengyuan/vue-qrcode';
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
components: {
|
||||
VueQrCode,
|
||||
},
|
||||
template: `<vue-qr-code :value="'http://example.com/'"></vue-qr-code>`
|
||||
});
|
||||
50
types/chenfengyuan__vue-qrcode/index.d.ts
vendored
Normal file
50
types/chenfengyuan__vue-qrcode/index.d.ts
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
// Type definitions for @chenfengyuan/vue-qrcode 1.0
|
||||
// Project: https://github.com/fengyuanchen/vue-qrcode
|
||||
// Definitions by: gaoming13 <https://github.com/gaoming13>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.9
|
||||
import { VueConstructor } from 'vue';
|
||||
|
||||
declare const VueQrCode: QrCodeConstructor;
|
||||
export = VueQrCode;
|
||||
|
||||
interface QrCodePorps {
|
||||
// The value of the QR code.
|
||||
value: string | null;
|
||||
// The options for the QR code generator.
|
||||
options: {
|
||||
// QR Code version.
|
||||
version?: number;
|
||||
// Error correction level.
|
||||
errorCorrectionLevel?: 'low' | 'medium' | 'quartile' | 'high' | 'L' | 'M' | 'Q' | 'H';
|
||||
// Mask pattern used to mask the symbol.
|
||||
maskPattern?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
||||
// Define how much wide the quiet zone should be.
|
||||
margin?: number;
|
||||
// Scale factor.
|
||||
scale?: number;
|
||||
// Forces a specific width for the output image.
|
||||
width?: number;
|
||||
color?: {
|
||||
dark?: string;
|
||||
light?: string;
|
||||
}
|
||||
};
|
||||
// The tag name of the component's root element.
|
||||
tag: string;
|
||||
}
|
||||
|
||||
interface QrCodeWatch {
|
||||
$props: (val: any) => void;
|
||||
}
|
||||
|
||||
interface QrCodeMethods {
|
||||
// Generate QR code.
|
||||
generate: () => void;
|
||||
}
|
||||
|
||||
interface QrCodeConstructor extends VueConstructor {
|
||||
props: QrCodePorps;
|
||||
watch: QrCodeWatch;
|
||||
methods: QrCodeMethods;
|
||||
}
|
||||
6
types/chenfengyuan__vue-qrcode/package.json
Normal file
6
types/chenfengyuan__vue-qrcode/package.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"vue": ">=2.0.0"
|
||||
}
|
||||
}
|
||||
23
types/chenfengyuan__vue-qrcode/tsconfig.json
Normal file
23
types/chenfengyuan__vue-qrcode/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6", "dom"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"esModuleInterop": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"paths": {
|
||||
"@chenfengyuan/vue-qrcode": ["chenfengyuan__vue-qrcode"]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"chenfengyuan__vue-qrcode-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/chenfengyuan__vue-qrcode/tslint.json
Normal file
1
types/chenfengyuan__vue-qrcode/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user