@simplymobile/capacitor-bixolon-printer 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Package.swift +28 -0
- package/README.md +257 -0
- package/SimplymobileCapacitorBixolonPrinter.podspec +17 -0
- package/android/build.gradle +58 -0
- package/android/src/main/AndroidManifest.xml +11 -0
- package/android/src/main/java/pl/simplymobile/plugins/bixolonprinter/BixolonPrinterPlugin.java +725 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/docs.json +315 -0
- package/dist/esm/definitions.d.ts +117 -0
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +37 -0
- package/dist/esm/web.js +46 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +60 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +63 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Sources/BixolonPrinterPlugin/BixolonPrinter.swift +8 -0
- package/ios/Sources/BixolonPrinterPlugin/BixolonPrinterPlugin.swift +73 -0
- package/ios/Tests/BixolonPrinterPluginTests/BixolonPrinterTests.swift +25 -0
- package/package.json +83 -0
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var capacitorBixolonPrinter = (function (exports, core) {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const BixolonPrinter = core.registerPlugin('BixolonPrinter', {
|
|
5
|
+
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.BixolonPrinterWeb()),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
class BixolonPrinterWeb extends core.WebPlugin {
|
|
9
|
+
async checkPermissions() {
|
|
10
|
+
return { bluetooth: 'denied' };
|
|
11
|
+
}
|
|
12
|
+
async requestPermissions() {
|
|
13
|
+
return { bluetooth: 'denied' };
|
|
14
|
+
}
|
|
15
|
+
async list() {
|
|
16
|
+
console.log('NOT IMPLEMENTED');
|
|
17
|
+
return { devices: [] };
|
|
18
|
+
}
|
|
19
|
+
async getStatus() {
|
|
20
|
+
console.log('NOT IMPLEMENTED');
|
|
21
|
+
return { enabled: false, connected: false };
|
|
22
|
+
}
|
|
23
|
+
async connect(options) {
|
|
24
|
+
console.log('NOT IMPLEMENTED', options.name);
|
|
25
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
26
|
+
}
|
|
27
|
+
async disconnect() {
|
|
28
|
+
console.log('NOT IMPLEMENTED');
|
|
29
|
+
}
|
|
30
|
+
async printText(options) {
|
|
31
|
+
console.log('NOT IMPLEMENTED', options.text);
|
|
32
|
+
}
|
|
33
|
+
async printBase64(options) {
|
|
34
|
+
console.log('NOT IMPLEMENTED', options.align);
|
|
35
|
+
}
|
|
36
|
+
async printImageUrl(options) {
|
|
37
|
+
console.log('NOT IMPLEMENTED', options.url, options.align);
|
|
38
|
+
}
|
|
39
|
+
async printPOSCommand(options) {
|
|
40
|
+
console.log('NOT IMPLEMENTED', options.command);
|
|
41
|
+
}
|
|
42
|
+
async printQRCode(options) {
|
|
43
|
+
console.log('NOT IMPLEMENTED', options.text);
|
|
44
|
+
}
|
|
45
|
+
async cutPaper() {
|
|
46
|
+
console.log('NOT IMPLEMENTED');
|
|
47
|
+
}
|
|
48
|
+
async setBrand(options) {
|
|
49
|
+
console.log('NOT IMPLEMENTED', options.brand);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
var web = /*#__PURE__*/Object.freeze({
|
|
54
|
+
__proto__: null,
|
|
55
|
+
BixolonPrinterWeb: BixolonPrinterWeb
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
exports.BixolonPrinter = BixolonPrinter;
|
|
59
|
+
|
|
60
|
+
return exports;
|
|
61
|
+
|
|
62
|
+
})({}, capacitorExports);
|
|
63
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst BixolonPrinter = registerPlugin('BixolonPrinter', {\n web: () => import('./web').then(m => new m.BixolonPrinterWeb()),\n});\nexport * from './definitions';\nexport { BixolonPrinter };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class BixolonPrinterWeb extends WebPlugin {\n async checkPermissions() {\n return { bluetooth: 'denied' };\n }\n async requestPermissions() {\n return { bluetooth: 'denied' };\n }\n async list() {\n console.log('NOT IMPLEMENTED');\n return { devices: [] };\n }\n async getStatus() {\n console.log('NOT IMPLEMENTED');\n return { enabled: false, connected: false };\n }\n async connect(options) {\n console.log('NOT IMPLEMENTED', options.name);\n return { message: 'NOT IMPLEMENTED' };\n }\n async disconnect() {\n console.log('NOT IMPLEMENTED');\n }\n async printText(options) {\n console.log('NOT IMPLEMENTED', options.text);\n }\n async printBase64(options) {\n console.log('NOT IMPLEMENTED', options.align);\n }\n async printImageUrl(options) {\n console.log('NOT IMPLEMENTED', options.url, options.align);\n }\n async printPOSCommand(options) {\n console.log('NOT IMPLEMENTED', options.command);\n }\n async printQRCode(options) {\n console.log('NOT IMPLEMENTED', options.text);\n }\n async cutPaper() {\n console.log('NOT IMPLEMENTED');\n }\n async setBrand(options) {\n console.log('NOT IMPLEMENTED', options.brand);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,cAAc,GAAGA,mBAAc,CAAC,gBAAgB,EAAE;IACxD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,iBAAiB,EAAE,CAAC;IACnE,CAAC;;ICFM,MAAM,iBAAiB,SAASC,cAAS,CAAC;IACjD,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,SAAS,EAAE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C,OAAO,CAAC;IACvD,IAAI;IACJ,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;IAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,IAAI,CAAC;IACpD,IAAI;IACJ,IAAI,MAAM,QAAQ,GAAG;IACrB,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACtC,IAAI;IACJ,IAAI,MAAM,QAAQ,CAAC,OAAO,EAAE;IAC5B,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,KAAK,CAAC;IACrD,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import Capacitor
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Bixolon Bluetooth printer plugin.
|
|
6
|
+
*
|
|
7
|
+
* This is an Android-only plugin. On iOS every method rejects with `unimplemented`.
|
|
8
|
+
* Please read the Capacitor iOS Plugin Development Guide
|
|
9
|
+
* here: https://capacitorjs.com/docs/plugins/ios
|
|
10
|
+
*/
|
|
11
|
+
@objc(BixolonPrinterPlugin)
|
|
12
|
+
public class BixolonPrinterPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
13
|
+
public let identifier = "BixolonPrinterPlugin"
|
|
14
|
+
public let jsName = "BixolonPrinter"
|
|
15
|
+
public let pluginMethods: [CAPPluginMethod] = [
|
|
16
|
+
CAPPluginMethod(name: "list", returnType: CAPPluginReturnPromise),
|
|
17
|
+
CAPPluginMethod(name: "getStatus", returnType: CAPPluginReturnPromise),
|
|
18
|
+
CAPPluginMethod(name: "connect", returnType: CAPPluginReturnPromise),
|
|
19
|
+
CAPPluginMethod(name: "disconnect", returnType: CAPPluginReturnPromise),
|
|
20
|
+
CAPPluginMethod(name: "printText", returnType: CAPPluginReturnPromise),
|
|
21
|
+
CAPPluginMethod(name: "printBase64", returnType: CAPPluginReturnPromise),
|
|
22
|
+
CAPPluginMethod(name: "printImageUrl", returnType: CAPPluginReturnPromise),
|
|
23
|
+
CAPPluginMethod(name: "printPOSCommand", returnType: CAPPluginReturnPromise),
|
|
24
|
+
CAPPluginMethod(name: "printQRCode", returnType: CAPPluginReturnPromise),
|
|
25
|
+
CAPPluginMethod(name: "cutPaper", returnType: CAPPluginReturnPromise),
|
|
26
|
+
CAPPluginMethod(name: "setBrand", returnType: CAPPluginReturnPromise)
|
|
27
|
+
]
|
|
28
|
+
private let implementation = BixolonPrinter()
|
|
29
|
+
|
|
30
|
+
@objc func list(_ call: CAPPluginCall) {
|
|
31
|
+
call.unimplemented("BixolonPrinter is Android-only.")
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@objc func getStatus(_ call: CAPPluginCall) {
|
|
35
|
+
call.unimplemented("BixolonPrinter is Android-only.")
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@objc func connect(_ call: CAPPluginCall) {
|
|
39
|
+
call.unimplemented("BixolonPrinter is Android-only.")
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@objc func disconnect(_ call: CAPPluginCall) {
|
|
43
|
+
call.unimplemented("BixolonPrinter is Android-only.")
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@objc func printText(_ call: CAPPluginCall) {
|
|
47
|
+
call.unimplemented("BixolonPrinter is Android-only.")
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@objc func printBase64(_ call: CAPPluginCall) {
|
|
51
|
+
call.unimplemented("BixolonPrinter is Android-only.")
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@objc func printImageUrl(_ call: CAPPluginCall) {
|
|
55
|
+
call.unimplemented("BixolonPrinter is Android-only.")
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@objc func printPOSCommand(_ call: CAPPluginCall) {
|
|
59
|
+
call.unimplemented("BixolonPrinter is Android-only.")
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@objc func printQRCode(_ call: CAPPluginCall) {
|
|
63
|
+
call.unimplemented("BixolonPrinter is Android-only.")
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@objc func cutPaper(_ call: CAPPluginCall) {
|
|
67
|
+
call.unimplemented("BixolonPrinter is Android-only.")
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@objc func setBrand(_ call: CAPPluginCall) {
|
|
71
|
+
call.unimplemented("BixolonPrinter is Android-only.")
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import XCTest
|
|
2
|
+
@testable import BixolonPrinterPlugin
|
|
3
|
+
|
|
4
|
+
class BixolonPrinterTests: XCTestCase {
|
|
5
|
+
override func setUp() {
|
|
6
|
+
super.setUp()
|
|
7
|
+
// Put setup code here. This method is called before the invocation of each test method in the class.
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
override func tearDown() {
|
|
11
|
+
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
|
12
|
+
super.tearDown()
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
func testEcho() {
|
|
16
|
+
// This is an example of a functional test case for a plugin.
|
|
17
|
+
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
|
18
|
+
|
|
19
|
+
let implementation = BixolonPrinter()
|
|
20
|
+
let value = "Hello, World!"
|
|
21
|
+
let result = implementation.echo(value)
|
|
22
|
+
|
|
23
|
+
XCTAssertEqual(value, result)
|
|
24
|
+
}
|
|
25
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@simplymobile/capacitor-bixolon-printer",
|
|
3
|
+
"version": "8.0.0",
|
|
4
|
+
"description": "Capacitor Bixolon Bluetooth printer plugin",
|
|
5
|
+
"author": "SimplyMobile",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"main": "dist/plugin.cjs.js",
|
|
8
|
+
"module": "dist/esm/index.js",
|
|
9
|
+
"types": "dist/esm/index.d.ts",
|
|
10
|
+
"unpkg": "dist/plugin.js",
|
|
11
|
+
"files": [
|
|
12
|
+
"android/src/main/",
|
|
13
|
+
"android/build.gradle",
|
|
14
|
+
"dist/",
|
|
15
|
+
"ios/Sources",
|
|
16
|
+
"ios/Tests",
|
|
17
|
+
"Package.swift",
|
|
18
|
+
"SimplymobileCapacitorBixolonPrinter.podspec"
|
|
19
|
+
],
|
|
20
|
+
"keywords": [
|
|
21
|
+
"capacitor",
|
|
22
|
+
"plugin",
|
|
23
|
+
"native",
|
|
24
|
+
"bixolon",
|
|
25
|
+
"bluetooth",
|
|
26
|
+
"printer"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
30
|
+
"verify:ios": "xcodebuild -scheme SimplymobileCapacitorBixolonPrinter -destination generic/platform=iOS",
|
|
31
|
+
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
32
|
+
"verify:web": "npm run build",
|
|
33
|
+
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
34
|
+
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
|
|
35
|
+
"eslint": "eslint . --ext ts",
|
|
36
|
+
"prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
|
|
37
|
+
"swiftlint": "node-swiftlint",
|
|
38
|
+
"docgen": "docgen --api BixolonPrinterPlugin --output-readme README.md --output-json dist/docs.json",
|
|
39
|
+
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
40
|
+
"clean": "rimraf ./dist",
|
|
41
|
+
"watch": "tsc --watch",
|
|
42
|
+
"prepublishOnly": "npm run build"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@capacitor/android": "^8.0.0",
|
|
46
|
+
"@capacitor/core": "^8.0.0",
|
|
47
|
+
"@capacitor/docgen": "^0.3.1",
|
|
48
|
+
"@capacitor/ios": "^8.0.0",
|
|
49
|
+
"@ionic/eslint-config": "^0.4.0",
|
|
50
|
+
"@ionic/prettier-config": "^4.0.0",
|
|
51
|
+
"@ionic/swiftlint-config": "^2.0.0",
|
|
52
|
+
"eslint": "^8.57.1",
|
|
53
|
+
"prettier": "^3.6.2",
|
|
54
|
+
"prettier-plugin-java": "^2.7.7",
|
|
55
|
+
"rimraf": "^6.1.0",
|
|
56
|
+
"rollup": "^4.53.2",
|
|
57
|
+
"swiftlint": "^2.0.0",
|
|
58
|
+
"typescript": "^5.9.3"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"@capacitor/core": ">=8.0.0"
|
|
62
|
+
},
|
|
63
|
+
"eslintConfig": {
|
|
64
|
+
"extends": "@ionic/eslint-config/recommended"
|
|
65
|
+
},
|
|
66
|
+
"prettier": "@ionic/prettier-config",
|
|
67
|
+
"swiftlint": "@ionic/swiftlint-config",
|
|
68
|
+
"repository": {
|
|
69
|
+
"type": "git",
|
|
70
|
+
"url": "git+https://github.com/.git"
|
|
71
|
+
},
|
|
72
|
+
"bugs": {
|
|
73
|
+
"url": "https://github.com/issues"
|
|
74
|
+
},
|
|
75
|
+
"capacitor": {
|
|
76
|
+
"ios": {
|
|
77
|
+
"src": "ios"
|
|
78
|
+
},
|
|
79
|
+
"android": {
|
|
80
|
+
"src": "android"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|