From 37ade59fcac847e0d1dba08cdb9d65f7172f072b Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Tue, 10 Aug 2021 11:12:36 +0100 Subject: [PATCH 1/6] Releasing sub-packages --- packages/fork-htmlparser2/package-lock.json | 2 +- packages/fork-htmlparser2/package.json | 2 +- packages/fork-sax/package-lock.json | 2 +- packages/fork-sax/package.json | 2 +- packages/lib/package-lock.json | 2 +- packages/lib/package.json | 14 +++++++------- packages/plugin-repo-cli/package-lock.json | 2 +- packages/plugin-repo-cli/package.json | 2 +- packages/renderer/package-lock.json | 2 +- packages/renderer/package.json | 4 ++-- packages/tools/package-lock.json | 2 +- packages/tools/package.json | 4 ++-- packages/turndown-plugin-gfm/package-lock.json | 2 +- packages/turndown-plugin-gfm/package.json | 2 +- packages/turndown/package-lock.json | 2 +- packages/turndown/package.json | 2 +- 16 files changed, 24 insertions(+), 24 deletions(-) diff --git a/packages/fork-htmlparser2/package-lock.json b/packages/fork-htmlparser2/package-lock.json index 4589aad88..71f60eaed 100644 --- a/packages/fork-htmlparser2/package-lock.json +++ b/packages/fork-htmlparser2/package-lock.json @@ -1,6 +1,6 @@ { "name": "@joplin/fork-htmlparser2", - "version": "4.1.28", + "version": "4.1.29", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/fork-htmlparser2/package.json b/packages/fork-htmlparser2/package.json index 7774b9583..523766f6c 100644 --- a/packages/fork-htmlparser2/package.json +++ b/packages/fork-htmlparser2/package.json @@ -1,7 +1,7 @@ { "name": "@joplin/fork-htmlparser2", "description": "Fast & forgiving HTML/XML/RSS parser", - "version": "4.1.28", + "version": "4.1.29", "author": "Felix Boehm ", "publishConfig": { "access": "public" diff --git a/packages/fork-sax/package-lock.json b/packages/fork-sax/package-lock.json index 24d80746c..c8c159c34 100644 --- a/packages/fork-sax/package-lock.json +++ b/packages/fork-sax/package-lock.json @@ -1,6 +1,6 @@ { "name": "@joplin/fork-sax", - "version": "1.2.32", + "version": "1.2.33", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/fork-sax/package.json b/packages/fork-sax/package.json index fe15824da..ce55e1909 100644 --- a/packages/fork-sax/package.json +++ b/packages/fork-sax/package.json @@ -2,7 +2,7 @@ "name": "@joplin/fork-sax", "description": "An evented streaming XML parser in JavaScript", "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "version": "1.2.32", + "version": "1.2.33", "main": "lib/sax.js", "publishConfig": { "access": "public" diff --git a/packages/lib/package-lock.json b/packages/lib/package-lock.json index 731e4cb17..854c7714b 100644 --- a/packages/lib/package-lock.json +++ b/packages/lib/package-lock.json @@ -1,6 +1,6 @@ { "name": "@joplin/lib", - "version": "2.2.0", + "version": "2.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/lib/package.json b/packages/lib/package.json index 1b39994da..5003870e2 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -1,6 +1,6 @@ { "name": "@joplin/lib", - "version": "2.2.0", + "version": "2.2.1", "description": "Joplin Core library", "author": "Laurent Cozic", "homepage": "", @@ -25,14 +25,14 @@ "typescript": "^4.0.5" }, "dependencies": { - "@joplin/fork-htmlparser2": "^4.1.28", - "@joplin/fork-sax": "^1.2.32", - "@joplin/renderer": "^1.8.2", - "@joplin/turndown": "^4.0.50", - "@joplin/turndown-plugin-gfm": "^1.0.32", - "async-mutex": "^0.1.3", "@aws-sdk/client-s3": "^3.22.0", "@aws-sdk/s3-request-presigner": "^3.23.0", + "@joplin/fork-htmlparser2": "^4.1.29", + "@joplin/fork-sax": "^1.2.33", + "@joplin/renderer": "^1.8.2", + "@joplin/turndown": "^4.0.51", + "@joplin/turndown-plugin-gfm": "^1.0.33", + "async-mutex": "^0.1.3", "base-64": "^0.1.0", "base64-stream": "^1.0.0", "builtin-modules": "^3.1.0", diff --git a/packages/plugin-repo-cli/package-lock.json b/packages/plugin-repo-cli/package-lock.json index 4cd5ccad7..b848e1bd7 100644 --- a/packages/plugin-repo-cli/package-lock.json +++ b/packages/plugin-repo-cli/package-lock.json @@ -1,6 +1,6 @@ { "name": "@joplin/plugin-repo-cli", - "version": "2.1.1", + "version": "2.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/plugin-repo-cli/package.json b/packages/plugin-repo-cli/package.json index a3c5c6d45..3f5554e90 100644 --- a/packages/plugin-repo-cli/package.json +++ b/packages/plugin-repo-cli/package.json @@ -1,6 +1,6 @@ { "name": "@joplin/plugin-repo-cli", - "version": "2.2.0", + "version": "2.2.1", "description": "", "main": "index.js", "bin": { diff --git a/packages/renderer/package-lock.json b/packages/renderer/package-lock.json index 016d26f02..2220159f4 100644 --- a/packages/renderer/package-lock.json +++ b/packages/renderer/package-lock.json @@ -1,6 +1,6 @@ { "name": "@joplin/renderer", - "version": "2.2.0", + "version": "2.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/renderer/package.json b/packages/renderer/package.json index db99314c3..5b9df8b28 100644 --- a/packages/renderer/package.json +++ b/packages/renderer/package.json @@ -1,6 +1,6 @@ { "name": "@joplin/renderer", - "version": "2.2.0", + "version": "2.2.1", "description": "The Joplin note renderer, used the mobile and desktop application", "repository": "https://github.com/laurent22/joplin/tree/dev/packages/renderer", "main": "index.js", @@ -24,7 +24,7 @@ "typescript": "^4.0.5" }, "dependencies": { - "@joplin/fork-htmlparser2": "^4.1.28", + "@joplin/fork-htmlparser2": "^4.1.29", "font-awesome-filetypes": "^2.1.0", "fs-extra": "^8.1.0", "highlight.js": "^10.2.1", diff --git a/packages/tools/package-lock.json b/packages/tools/package-lock.json index 0579eb3bb..952e3efef 100644 --- a/packages/tools/package-lock.json +++ b/packages/tools/package-lock.json @@ -1,6 +1,6 @@ { "name": "@joplin/tools", - "version": "2.2.0", + "version": "2.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/tools/package.json b/packages/tools/package.json index e40cd7e15..d89a112c6 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -1,6 +1,6 @@ { "name": "@joplin/tools", - "version": "2.2.0", + "version": "2.2.1", "description": "Various tools for Joplin", "main": "index.js", "author": "Laurent Cozic", @@ -38,8 +38,8 @@ "devDependencies": { "@rmp135/sql-ts": "^1.6.0", "@types/fs-extra": "^9.0.6", - "@types/node": "^14.14.6", "@types/mustache": "^0.8.32", + "@types/node": "^14.14.6", "gulp": "^4.0.2", "sqlite3": "^5.0.0", "typescript": "^4.1.3" diff --git a/packages/turndown-plugin-gfm/package-lock.json b/packages/turndown-plugin-gfm/package-lock.json index ec1d3b397..6ada355dd 100644 --- a/packages/turndown-plugin-gfm/package-lock.json +++ b/packages/turndown-plugin-gfm/package-lock.json @@ -1,6 +1,6 @@ { "name": "@joplin/turndown-plugin-gfm", - "version": "1.0.32", + "version": "1.0.33", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/turndown-plugin-gfm/package.json b/packages/turndown-plugin-gfm/package.json index c9d7a3fab..c1c819a6b 100644 --- a/packages/turndown-plugin-gfm/package.json +++ b/packages/turndown-plugin-gfm/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "1.0.32", + "version": "1.0.33", "author": "Dom Christie", "main": "lib/turndown-plugin-gfm.cjs.js", "devDependencies": { diff --git a/packages/turndown/package-lock.json b/packages/turndown/package-lock.json index 7e9c78f49..5a3e9e082 100644 --- a/packages/turndown/package-lock.json +++ b/packages/turndown/package-lock.json @@ -1,6 +1,6 @@ { "name": "@joplin/turndown", - "version": "4.0.50", + "version": "4.0.51", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/turndown/package.json b/packages/turndown/package.json index 1fb2f0127..1bd059262 100644 --- a/packages/turndown/package.json +++ b/packages/turndown/package.json @@ -1,7 +1,7 @@ { "name": "@joplin/turndown", "description": "A library that converts HTML to Markdown", - "version": "4.0.50", + "version": "4.0.51", "author": "Dom Christie", "main": "lib/turndown.cjs.js", "publishConfig": { From f2351cbf32e423e51c7df62ae83bc880e2de598c Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Tue, 10 Aug 2021 11:17:53 +0100 Subject: [PATCH 2/6] Releasing sub-packages --- packages/fork-htmlparser2/package-lock.json | 2 +- packages/fork-htmlparser2/package.json | 2 +- packages/fork-sax/package-lock.json | 2 +- packages/fork-sax/package.json | 2 +- packages/lib/package-lock.json | 2 +- packages/lib/package.json | 10 +++++----- packages/plugin-repo-cli/package-lock.json | 2 +- packages/plugin-repo-cli/package.json | 2 +- packages/renderer/package-lock.json | 2 +- packages/renderer/package.json | 4 ++-- packages/tools/package-lock.json | 2 +- packages/tools/package.json | 2 +- packages/turndown-plugin-gfm/package-lock.json | 2 +- packages/turndown-plugin-gfm/package.json | 2 +- packages/turndown/package-lock.json | 2 +- packages/turndown/package.json | 2 +- 16 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/fork-htmlparser2/package-lock.json b/packages/fork-htmlparser2/package-lock.json index 71f60eaed..8ac5f22aa 100644 --- a/packages/fork-htmlparser2/package-lock.json +++ b/packages/fork-htmlparser2/package-lock.json @@ -1,6 +1,6 @@ { "name": "@joplin/fork-htmlparser2", - "version": "4.1.29", + "version": "4.1.30", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/fork-htmlparser2/package.json b/packages/fork-htmlparser2/package.json index 523766f6c..be7200279 100644 --- a/packages/fork-htmlparser2/package.json +++ b/packages/fork-htmlparser2/package.json @@ -1,7 +1,7 @@ { "name": "@joplin/fork-htmlparser2", "description": "Fast & forgiving HTML/XML/RSS parser", - "version": "4.1.29", + "version": "4.1.30", "author": "Felix Boehm ", "publishConfig": { "access": "public" diff --git a/packages/fork-sax/package-lock.json b/packages/fork-sax/package-lock.json index c8c159c34..4fca5e784 100644 --- a/packages/fork-sax/package-lock.json +++ b/packages/fork-sax/package-lock.json @@ -1,6 +1,6 @@ { "name": "@joplin/fork-sax", - "version": "1.2.33", + "version": "1.2.34", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/fork-sax/package.json b/packages/fork-sax/package.json index ce55e1909..2a5b7cb9d 100644 --- a/packages/fork-sax/package.json +++ b/packages/fork-sax/package.json @@ -2,7 +2,7 @@ "name": "@joplin/fork-sax", "description": "An evented streaming XML parser in JavaScript", "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "version": "1.2.33", + "version": "1.2.34", "main": "lib/sax.js", "publishConfig": { "access": "public" diff --git a/packages/lib/package-lock.json b/packages/lib/package-lock.json index 854c7714b..d32f02318 100644 --- a/packages/lib/package-lock.json +++ b/packages/lib/package-lock.json @@ -1,6 +1,6 @@ { "name": "@joplin/lib", - "version": "2.2.1", + "version": "2.2.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/lib/package.json b/packages/lib/package.json index 5003870e2..605139e05 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -1,6 +1,6 @@ { "name": "@joplin/lib", - "version": "2.2.1", + "version": "2.2.2", "description": "Joplin Core library", "author": "Laurent Cozic", "homepage": "", @@ -27,11 +27,11 @@ "dependencies": { "@aws-sdk/client-s3": "^3.22.0", "@aws-sdk/s3-request-presigner": "^3.23.0", - "@joplin/fork-htmlparser2": "^4.1.29", - "@joplin/fork-sax": "^1.2.33", + "@joplin/fork-htmlparser2": "^4.1.30", + "@joplin/fork-sax": "^1.2.34", "@joplin/renderer": "^1.8.2", - "@joplin/turndown": "^4.0.51", - "@joplin/turndown-plugin-gfm": "^1.0.33", + "@joplin/turndown": "^4.0.52", + "@joplin/turndown-plugin-gfm": "^1.0.34", "async-mutex": "^0.1.3", "base-64": "^0.1.0", "base64-stream": "^1.0.0", diff --git a/packages/plugin-repo-cli/package-lock.json b/packages/plugin-repo-cli/package-lock.json index b848e1bd7..917fa456f 100644 --- a/packages/plugin-repo-cli/package-lock.json +++ b/packages/plugin-repo-cli/package-lock.json @@ -1,6 +1,6 @@ { "name": "@joplin/plugin-repo-cli", - "version": "2.2.1", + "version": "2.2.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/plugin-repo-cli/package.json b/packages/plugin-repo-cli/package.json index 3f5554e90..638ca0300 100644 --- a/packages/plugin-repo-cli/package.json +++ b/packages/plugin-repo-cli/package.json @@ -1,6 +1,6 @@ { "name": "@joplin/plugin-repo-cli", - "version": "2.2.1", + "version": "2.2.2", "description": "", "main": "index.js", "bin": { diff --git a/packages/renderer/package-lock.json b/packages/renderer/package-lock.json index 2220159f4..0cf56c5e9 100644 --- a/packages/renderer/package-lock.json +++ b/packages/renderer/package-lock.json @@ -1,6 +1,6 @@ { "name": "@joplin/renderer", - "version": "2.2.1", + "version": "2.2.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/renderer/package.json b/packages/renderer/package.json index 5b9df8b28..2faafc178 100644 --- a/packages/renderer/package.json +++ b/packages/renderer/package.json @@ -1,6 +1,6 @@ { "name": "@joplin/renderer", - "version": "2.2.1", + "version": "2.2.2", "description": "The Joplin note renderer, used the mobile and desktop application", "repository": "https://github.com/laurent22/joplin/tree/dev/packages/renderer", "main": "index.js", @@ -24,7 +24,7 @@ "typescript": "^4.0.5" }, "dependencies": { - "@joplin/fork-htmlparser2": "^4.1.29", + "@joplin/fork-htmlparser2": "^4.1.30", "font-awesome-filetypes": "^2.1.0", "fs-extra": "^8.1.0", "highlight.js": "^10.2.1", diff --git a/packages/tools/package-lock.json b/packages/tools/package-lock.json index 952e3efef..016daafc5 100644 --- a/packages/tools/package-lock.json +++ b/packages/tools/package-lock.json @@ -1,6 +1,6 @@ { "name": "@joplin/tools", - "version": "2.2.1", + "version": "2.2.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/tools/package.json b/packages/tools/package.json index d89a112c6..37c018e9b 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -1,6 +1,6 @@ { "name": "@joplin/tools", - "version": "2.2.1", + "version": "2.2.2", "description": "Various tools for Joplin", "main": "index.js", "author": "Laurent Cozic", diff --git a/packages/turndown-plugin-gfm/package-lock.json b/packages/turndown-plugin-gfm/package-lock.json index 6ada355dd..fc291157f 100644 --- a/packages/turndown-plugin-gfm/package-lock.json +++ b/packages/turndown-plugin-gfm/package-lock.json @@ -1,6 +1,6 @@ { "name": "@joplin/turndown-plugin-gfm", - "version": "1.0.33", + "version": "1.0.34", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/turndown-plugin-gfm/package.json b/packages/turndown-plugin-gfm/package.json index c1c819a6b..1c9a1b5a0 100644 --- a/packages/turndown-plugin-gfm/package.json +++ b/packages/turndown-plugin-gfm/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "1.0.33", + "version": "1.0.34", "author": "Dom Christie", "main": "lib/turndown-plugin-gfm.cjs.js", "devDependencies": { diff --git a/packages/turndown/package-lock.json b/packages/turndown/package-lock.json index 5a3e9e082..c21a4051b 100644 --- a/packages/turndown/package-lock.json +++ b/packages/turndown/package-lock.json @@ -1,6 +1,6 @@ { "name": "@joplin/turndown", - "version": "4.0.51", + "version": "4.0.52", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/turndown/package.json b/packages/turndown/package.json index 1bd059262..7416eb6a3 100644 --- a/packages/turndown/package.json +++ b/packages/turndown/package.json @@ -1,7 +1,7 @@ { "name": "@joplin/turndown", "description": "A library that converts HTML to Markdown", - "version": "4.0.51", + "version": "4.0.52", "author": "Dom Christie", "main": "lib/turndown.cjs.js", "publishConfig": { From 97349ceb6a8ed2295cb80a953ee66ab6287e8ae9 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Tue, 10 Aug 2021 11:21:37 +0100 Subject: [PATCH 3/6] CLI v2.2.1 --- packages/app-cli/package-lock.json | 2 +- packages/app-cli/package.json | 2 +- readme/changelog_cli.md | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/app-cli/package-lock.json b/packages/app-cli/package-lock.json index 76c46f35d..72133e5b1 100644 --- a/packages/app-cli/package-lock.json +++ b/packages/app-cli/package-lock.json @@ -1,6 +1,6 @@ { "name": "joplin", - "version": "2.2.0", + "version": "2.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/app-cli/package.json b/packages/app-cli/package.json index 441205761..f78b7c773 100644 --- a/packages/app-cli/package.json +++ b/packages/app-cli/package.json @@ -32,7 +32,7 @@ ], "owner": "Laurent Cozic" }, - "version": "2.2.0", + "version": "2.2.1", "bin": { "joplin": "./main.js" }, diff --git a/readme/changelog_cli.md b/readme/changelog_cli.md index ccf4f6c98..037b93454 100644 --- a/readme/changelog_cli.md +++ b/readme/changelog_cli.md @@ -1,5 +1,15 @@ # Joplin terminal app changelog +## [cli-v2.2.1](https://github.com/laurent22/joplin/releases/tag/cli-v2.2.1) - 2021-08-10T10:21:09Z + +- Improved: Ensure that timestamps are not changed when sharing or unsharing a note (cafaa9c) +- Improved: Fix AWS S3 sync error and upgrade framework to v3 (#5212) (#4810 by Lee Matos) +- Improved: Handles OneDrive throttling responses and sets User-Agent based on Microsoft best practices (#5246) (#5244 by [@alec](https://github.com/alec)) +- Improved: Interpret only valid search filters (#5103) (#3871 by [@JackGruber](https://github.com/JackGruber)) +- Fixed: Do not export share properties (#5232) +- Fixed: Fixed issue with orphaned resource being created in case of a resource conflict (#5223) +- Fixed: Import highlighted text from ENEX files (#5213) + ## [cli-v2.1.2](https://github.com/laurent22/joplin/releases/tag/cli-v2.1.2) - 2021-06-27T15:51:36Z - New: Add support for X-API-MIN-VERSION header (51f3c00) From bac0d681564fca005edfe844f13a088d7e404e5e Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Tue, 10 Aug 2021 11:34:49 +0100 Subject: [PATCH 4/6] Plugins: Updated types --- .../codemirror_content_script/api/Joplin.d.ts | 6 +++++ .../api/JoplinClipboard.d.ts | 23 ++++++++++++++++++ .../api/JoplinViewsDialogs.d.ts | 9 ++++++- .../api/JoplinWindow.d.ts | 24 +++++++++++++++++++ .../codemirror_content_script/api/types.ts | 20 ++++++++++++++-- .../plugins/content_script/api/Joplin.d.ts | 6 +++++ .../content_script/api/JoplinClipboard.d.ts | 23 ++++++++++++++++++ .../api/JoplinViewsDialogs.d.ts | 9 ++++++- .../content_script/api/JoplinWindow.d.ts | 24 +++++++++++++++++++ .../plugins/content_script/api/types.ts | 20 ++++++++++++++-- .../support/plugins/dialog/api/Joplin.d.ts | 6 +++++ .../plugins/dialog/api/JoplinClipboard.d.ts | 23 ++++++++++++++++++ .../dialog/api/JoplinViewsDialogs.d.ts | 9 ++++++- .../plugins/dialog/api/JoplinWindow.d.ts | 24 +++++++++++++++++++ .../tests/support/plugins/dialog/api/types.ts | 20 ++++++++++++++-- .../editor_context_menu/api/Joplin.d.ts | 6 +++++ .../api/JoplinClipboard.d.ts | 23 ++++++++++++++++++ .../api/JoplinViewsDialogs.d.ts | 9 ++++++- .../editor_context_menu/api/JoplinWindow.d.ts | 24 +++++++++++++++++++ .../plugins/editor_context_menu/api/types.ts | 20 ++++++++++++++-- .../support/plugins/events/api/Joplin.d.ts | 6 +++++ .../plugins/events/api/JoplinClipboard.d.ts | 23 ++++++++++++++++++ .../events/api/JoplinViewsDialogs.d.ts | 9 ++++++- .../plugins/events/api/JoplinWindow.d.ts | 24 +++++++++++++++++++ .../tests/support/plugins/events/api/types.ts | 20 ++++++++++++++-- .../plugins/external_assets/api/Joplin.d.ts | 6 +++++ .../external_assets/api/JoplinClipboard.d.ts | 23 ++++++++++++++++++ .../api/JoplinViewsDialogs.d.ts | 9 ++++++- .../external_assets/api/JoplinWindow.d.ts | 24 +++++++++++++++++++ .../plugins/external_assets/api/types.ts | 20 ++++++++++++++-- .../support/plugins/jpl_test/api/Joplin.d.ts | 6 +++++ .../plugins/jpl_test/api/JoplinClipboard.d.ts | 23 ++++++++++++++++++ .../jpl_test/api/JoplinViewsDialogs.d.ts | 9 ++++++- .../plugins/jpl_test/api/JoplinWindow.d.ts | 24 +++++++++++++++++++ .../support/plugins/jpl_test/api/types.ts | 20 ++++++++++++++-- .../plugins/json_export/api/Joplin.d.ts | 6 +++++ .../json_export/api/JoplinClipboard.d.ts | 23 ++++++++++++++++++ .../json_export/api/JoplinViewsDialogs.d.ts | 9 ++++++- .../plugins/json_export/api/JoplinWindow.d.ts | 24 +++++++++++++++++++ .../support/plugins/json_export/api/types.ts | 20 ++++++++++++++-- .../support/plugins/menu/api/Joplin.d.ts | 6 +++++ .../plugins/menu/api/JoplinClipboard.d.ts | 23 ++++++++++++++++++ .../plugins/menu/api/JoplinViewsDialogs.d.ts | 9 ++++++- .../plugins/menu/api/JoplinWindow.d.ts | 24 +++++++++++++++++++ .../tests/support/plugins/menu/api/types.ts | 20 ++++++++++++++-- .../plugins/multi_selection/api/Joplin.d.ts | 6 +++++ .../multi_selection/api/JoplinClipboard.d.ts | 23 ++++++++++++++++++ .../api/JoplinViewsDialogs.d.ts | 9 ++++++- .../multi_selection/api/JoplinWindow.d.ts | 24 +++++++++++++++++++ .../plugins/multi_selection/api/types.ts | 20 ++++++++++++++-- .../plugins/nativeModule/api/Joplin.d.ts | 6 +++++ .../nativeModule/api/JoplinClipboard.d.ts | 23 ++++++++++++++++++ .../nativeModule/api/JoplinViewsDialogs.d.ts | 9 ++++++- .../nativeModule/api/JoplinWindow.d.ts | 24 +++++++++++++++++++ .../support/plugins/nativeModule/api/types.ts | 20 ++++++++++++++-- .../plugins/post_messages/api/Joplin.d.ts | 6 +++++ .../post_messages/api/JoplinClipboard.d.ts | 23 ++++++++++++++++++ .../post_messages/api/JoplinViewsDialogs.d.ts | 9 ++++++- .../post_messages/api/JoplinWindow.d.ts | 24 +++++++++++++++++++ .../plugins/post_messages/api/types.ts | 20 ++++++++++++++-- .../plugins/register_command/api/Joplin.d.ts | 6 +++++ .../register_command/api/JoplinClipboard.d.ts | 23 ++++++++++++++++++ .../api/JoplinViewsDialogs.d.ts | 9 ++++++- .../register_command/api/JoplinWindow.d.ts | 24 +++++++++++++++++++ .../plugins/register_command/api/types.ts | 20 ++++++++++++++-- .../plugins/selected_text/api/Joplin.d.ts | 6 +++++ .../selected_text/api/JoplinClipboard.d.ts | 23 ++++++++++++++++++ .../selected_text/api/JoplinViewsDialogs.d.ts | 9 ++++++- .../selected_text/api/JoplinWindow.d.ts | 24 +++++++++++++++++++ .../plugins/selected_text/api/types.ts | 20 ++++++++++++++-- .../support/plugins/settings/api/Joplin.d.ts | 6 +++++ .../plugins/settings/api/JoplinClipboard.d.ts | 23 ++++++++++++++++++ .../settings/api/JoplinViewsDialogs.d.ts | 9 ++++++- .../plugins/settings/api/JoplinWindow.d.ts | 24 +++++++++++++++++++ .../support/plugins/settings/api/types.ts | 20 ++++++++++++++-- .../tests/support/plugins/toc/api/Joplin.d.ts | 6 +++++ .../plugins/toc/api/JoplinClipboard.d.ts | 23 ++++++++++++++++++ .../plugins/toc/api/JoplinViewsDialogs.d.ts | 9 ++++++- .../support/plugins/toc/api/JoplinWindow.d.ts | 24 +++++++++++++++++++ .../tests/support/plugins/toc/api/types.ts | 20 ++++++++++++++-- .../withExternalModules/api/Joplin.d.ts | 6 +++++ .../api/JoplinClipboard.d.ts | 23 ++++++++++++++++++ .../api/JoplinViewsDialogs.d.ts | 9 ++++++- .../withExternalModules/api/JoplinWindow.d.ts | 24 +++++++++++++++++++ .../plugins/withExternalModules/api/types.ts | 20 ++++++++++++++-- .../generators/app/templates/api/Joplin.d.ts | 6 +++++ .../app/templates/api/JoplinClipboard.d.ts | 23 ++++++++++++++++++ .../app/templates/api/JoplinViewsDialogs.d.ts | 9 ++++++- .../app/templates/api/JoplinWindow.d.ts | 24 +++++++++++++++++++ .../generators/app/templates/api/types.ts | 20 ++++++++++++++-- packages/generator-joplin/package-lock.json | 2 +- 91 files changed, 1423 insertions(+), 55 deletions(-) create mode 100644 packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinClipboard.d.ts create mode 100644 packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinWindow.d.ts create mode 100644 packages/app-cli/tests/support/plugins/content_script/api/JoplinClipboard.d.ts create mode 100644 packages/app-cli/tests/support/plugins/content_script/api/JoplinWindow.d.ts create mode 100644 packages/app-cli/tests/support/plugins/dialog/api/JoplinClipboard.d.ts create mode 100644 packages/app-cli/tests/support/plugins/dialog/api/JoplinWindow.d.ts create mode 100644 packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinClipboard.d.ts create mode 100644 packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinWindow.d.ts create mode 100644 packages/app-cli/tests/support/plugins/events/api/JoplinClipboard.d.ts create mode 100644 packages/app-cli/tests/support/plugins/events/api/JoplinWindow.d.ts create mode 100644 packages/app-cli/tests/support/plugins/external_assets/api/JoplinClipboard.d.ts create mode 100644 packages/app-cli/tests/support/plugins/external_assets/api/JoplinWindow.d.ts create mode 100644 packages/app-cli/tests/support/plugins/jpl_test/api/JoplinClipboard.d.ts create mode 100644 packages/app-cli/tests/support/plugins/jpl_test/api/JoplinWindow.d.ts create mode 100644 packages/app-cli/tests/support/plugins/json_export/api/JoplinClipboard.d.ts create mode 100644 packages/app-cli/tests/support/plugins/json_export/api/JoplinWindow.d.ts create mode 100644 packages/app-cli/tests/support/plugins/menu/api/JoplinClipboard.d.ts create mode 100644 packages/app-cli/tests/support/plugins/menu/api/JoplinWindow.d.ts create mode 100644 packages/app-cli/tests/support/plugins/multi_selection/api/JoplinClipboard.d.ts create mode 100644 packages/app-cli/tests/support/plugins/multi_selection/api/JoplinWindow.d.ts create mode 100644 packages/app-cli/tests/support/plugins/nativeModule/api/JoplinClipboard.d.ts create mode 100644 packages/app-cli/tests/support/plugins/nativeModule/api/JoplinWindow.d.ts create mode 100644 packages/app-cli/tests/support/plugins/post_messages/api/JoplinClipboard.d.ts create mode 100644 packages/app-cli/tests/support/plugins/post_messages/api/JoplinWindow.d.ts create mode 100644 packages/app-cli/tests/support/plugins/register_command/api/JoplinClipboard.d.ts create mode 100644 packages/app-cli/tests/support/plugins/register_command/api/JoplinWindow.d.ts create mode 100644 packages/app-cli/tests/support/plugins/selected_text/api/JoplinClipboard.d.ts create mode 100644 packages/app-cli/tests/support/plugins/selected_text/api/JoplinWindow.d.ts create mode 100644 packages/app-cli/tests/support/plugins/settings/api/JoplinClipboard.d.ts create mode 100644 packages/app-cli/tests/support/plugins/settings/api/JoplinWindow.d.ts create mode 100644 packages/app-cli/tests/support/plugins/toc/api/JoplinClipboard.d.ts create mode 100644 packages/app-cli/tests/support/plugins/toc/api/JoplinWindow.d.ts create mode 100644 packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinClipboard.d.ts create mode 100644 packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinWindow.d.ts create mode 100644 packages/generator-joplin/generators/app/templates/api/JoplinClipboard.d.ts create mode 100644 packages/generator-joplin/generators/app/templates/api/JoplinWindow.d.ts diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/Joplin.d.ts index e30586e68..09d856e37 100644 --- a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/Joplin.d.ts @@ -8,6 +8,8 @@ import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; import JoplinContentScripts from './JoplinContentScripts'; +import JoplinClipboard from './JoplinClipboard'; +import JoplinWindow from './JoplinWindow'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -33,8 +35,12 @@ export default class Joplin { private interop_; private settings_; private contentScripts_; + private clipboard_; + private window_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; + get clipboard(): JoplinClipboard; + get window(): JoplinWindow; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; get contentScripts(): JoplinContentScripts; diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinClipboard.d.ts b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinClipboard.d.ts new file mode 100644 index 000000000..3abc4e9df --- /dev/null +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinClipboard.d.ts @@ -0,0 +1,23 @@ +export default class JoplinClipboard { + private electronClipboard_; + private electronNativeImage_; + constructor(electronClipboard: any, electronNativeImage: any); + readText(): Promise; + writeText(text: string): Promise; + readHtml(): Promise; + writeHtml(html: string): Promise; + /** + * Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + readImage(): Promise; + /** + * Takes an image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + writeImage(dataUrl: string): Promise; + /** + * Returns the list available formats (mime types). + * + * For example [ 'text/plain', 'text/html' ] + */ + availableFormats(): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinViewsDialogs.d.ts b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinViewsDialogs.d.ts index 043d488ea..f1643a01d 100644 --- a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinViewsDialogs.d.ts +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinViewsDialogs.d.ts @@ -2,7 +2,7 @@ import Plugin from '../Plugin'; import { ButtonSpec, ViewHandle, DialogResult } from './types'; /** * Allows creating and managing dialogs. A dialog is modal window that - * contains a webview and a row of buttons. You can update the update the + * contains a webview and a row of buttons. You can update the * webview using the `setHtml` method. Dialogs are hidden by default and * you need to call `open()` to open them. Once the user clicks on a * button, the `open` call will return an object indicating what button was @@ -59,4 +59,11 @@ export default class JoplinViewsDialogs { * Opens the dialog */ open(handle: ViewHandle): Promise; + /** + * Toggle on whether to fit the dialog size to the content or not. + * When set to false, the dialog stretches to fill the application + * window. + * @default true + */ + setFitToContent(handle: ViewHandle, status: boolean): Promise; } diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinWindow.d.ts b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinWindow.d.ts new file mode 100644 index 000000000..231c55c3d --- /dev/null +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinWindow.d.ts @@ -0,0 +1,24 @@ +import Plugin from '../Plugin'; +export interface Implementation { + injectCustomStyles(elementId: string, cssFilePath: string): Promise; +} +export default class JoplinWindow { + private plugin_; + private store_; + private implementation_; + constructor(implementation: Implementation, plugin: Plugin, store: any); + /** + * Loads a chrome CSS file. It will apply to the window UI elements, except + * for the note viewer. It is the same as the "Custom stylesheet for + * Joplin-wide app styles" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadChromeCssFile(filePath: string): Promise; + /** + * Loads a note CSS file. It will apply to the note viewer, as well as any + * exported or printed note. It is the same as the "Custom stylesheet for + * rendered Markdown" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadNoteCssFile(filePath: string): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/types.ts b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/types.ts index 9c4aa7332..e0b2d96c0 100644 --- a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/types.ts +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/types.ts @@ -334,6 +334,17 @@ export enum SettingItemType { Button = 6, } +export enum AppType { + Desktop = 'desktop', + Mobile = 'mobile', + Cli = 'cli', +} + +export enum SettingStorage { + Database = 1, + File = 2, +} + // Redefine a simplified interface to mask internal details // and to remove function calls as they would have to be async. export interface SettingItem { @@ -372,7 +383,7 @@ export interface SettingItem { /** * Reserved property. Not used at the moment. */ - appTypes?: string[]; + appTypes?: AppType[]; /** * Set this to `true` to store secure data, such as passwords. Any such @@ -393,6 +404,11 @@ export interface SettingItem { minimum?: number; maximum?: number; step?: number; + + /** + * Either store the setting in the database or in settings.json. Defaults to database. + */ + storage?: SettingStorage; } export interface SettingSection { @@ -419,7 +435,7 @@ export type Path = string[]; // Content Script types // ================================================================= -export type PostMessageHandler = (id: string, message: any)=> Promise; +export type PostMessageHandler = (message: any)=> Promise; /** * When a content script is initialised, it receives a `context` object. diff --git a/packages/app-cli/tests/support/plugins/content_script/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/content_script/api/Joplin.d.ts index e30586e68..09d856e37 100644 --- a/packages/app-cli/tests/support/plugins/content_script/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/content_script/api/Joplin.d.ts @@ -8,6 +8,8 @@ import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; import JoplinContentScripts from './JoplinContentScripts'; +import JoplinClipboard from './JoplinClipboard'; +import JoplinWindow from './JoplinWindow'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -33,8 +35,12 @@ export default class Joplin { private interop_; private settings_; private contentScripts_; + private clipboard_; + private window_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; + get clipboard(): JoplinClipboard; + get window(): JoplinWindow; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; get contentScripts(): JoplinContentScripts; diff --git a/packages/app-cli/tests/support/plugins/content_script/api/JoplinClipboard.d.ts b/packages/app-cli/tests/support/plugins/content_script/api/JoplinClipboard.d.ts new file mode 100644 index 000000000..3abc4e9df --- /dev/null +++ b/packages/app-cli/tests/support/plugins/content_script/api/JoplinClipboard.d.ts @@ -0,0 +1,23 @@ +export default class JoplinClipboard { + private electronClipboard_; + private electronNativeImage_; + constructor(electronClipboard: any, electronNativeImage: any); + readText(): Promise; + writeText(text: string): Promise; + readHtml(): Promise; + writeHtml(html: string): Promise; + /** + * Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + readImage(): Promise; + /** + * Takes an image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + writeImage(dataUrl: string): Promise; + /** + * Returns the list available formats (mime types). + * + * For example [ 'text/plain', 'text/html' ] + */ + availableFormats(): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/content_script/api/JoplinViewsDialogs.d.ts b/packages/app-cli/tests/support/plugins/content_script/api/JoplinViewsDialogs.d.ts index 043d488ea..f1643a01d 100644 --- a/packages/app-cli/tests/support/plugins/content_script/api/JoplinViewsDialogs.d.ts +++ b/packages/app-cli/tests/support/plugins/content_script/api/JoplinViewsDialogs.d.ts @@ -2,7 +2,7 @@ import Plugin from '../Plugin'; import { ButtonSpec, ViewHandle, DialogResult } from './types'; /** * Allows creating and managing dialogs. A dialog is modal window that - * contains a webview and a row of buttons. You can update the update the + * contains a webview and a row of buttons. You can update the * webview using the `setHtml` method. Dialogs are hidden by default and * you need to call `open()` to open them. Once the user clicks on a * button, the `open` call will return an object indicating what button was @@ -59,4 +59,11 @@ export default class JoplinViewsDialogs { * Opens the dialog */ open(handle: ViewHandle): Promise; + /** + * Toggle on whether to fit the dialog size to the content or not. + * When set to false, the dialog stretches to fill the application + * window. + * @default true + */ + setFitToContent(handle: ViewHandle, status: boolean): Promise; } diff --git a/packages/app-cli/tests/support/plugins/content_script/api/JoplinWindow.d.ts b/packages/app-cli/tests/support/plugins/content_script/api/JoplinWindow.d.ts new file mode 100644 index 000000000..231c55c3d --- /dev/null +++ b/packages/app-cli/tests/support/plugins/content_script/api/JoplinWindow.d.ts @@ -0,0 +1,24 @@ +import Plugin from '../Plugin'; +export interface Implementation { + injectCustomStyles(elementId: string, cssFilePath: string): Promise; +} +export default class JoplinWindow { + private plugin_; + private store_; + private implementation_; + constructor(implementation: Implementation, plugin: Plugin, store: any); + /** + * Loads a chrome CSS file. It will apply to the window UI elements, except + * for the note viewer. It is the same as the "Custom stylesheet for + * Joplin-wide app styles" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadChromeCssFile(filePath: string): Promise; + /** + * Loads a note CSS file. It will apply to the note viewer, as well as any + * exported or printed note. It is the same as the "Custom stylesheet for + * rendered Markdown" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadNoteCssFile(filePath: string): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/content_script/api/types.ts b/packages/app-cli/tests/support/plugins/content_script/api/types.ts index 9c4aa7332..e0b2d96c0 100644 --- a/packages/app-cli/tests/support/plugins/content_script/api/types.ts +++ b/packages/app-cli/tests/support/plugins/content_script/api/types.ts @@ -334,6 +334,17 @@ export enum SettingItemType { Button = 6, } +export enum AppType { + Desktop = 'desktop', + Mobile = 'mobile', + Cli = 'cli', +} + +export enum SettingStorage { + Database = 1, + File = 2, +} + // Redefine a simplified interface to mask internal details // and to remove function calls as they would have to be async. export interface SettingItem { @@ -372,7 +383,7 @@ export interface SettingItem { /** * Reserved property. Not used at the moment. */ - appTypes?: string[]; + appTypes?: AppType[]; /** * Set this to `true` to store secure data, such as passwords. Any such @@ -393,6 +404,11 @@ export interface SettingItem { minimum?: number; maximum?: number; step?: number; + + /** + * Either store the setting in the database or in settings.json. Defaults to database. + */ + storage?: SettingStorage; } export interface SettingSection { @@ -419,7 +435,7 @@ export type Path = string[]; // Content Script types // ================================================================= -export type PostMessageHandler = (id: string, message: any)=> Promise; +export type PostMessageHandler = (message: any)=> Promise; /** * When a content script is initialised, it receives a `context` object. diff --git a/packages/app-cli/tests/support/plugins/dialog/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/dialog/api/Joplin.d.ts index e30586e68..09d856e37 100644 --- a/packages/app-cli/tests/support/plugins/dialog/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/dialog/api/Joplin.d.ts @@ -8,6 +8,8 @@ import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; import JoplinContentScripts from './JoplinContentScripts'; +import JoplinClipboard from './JoplinClipboard'; +import JoplinWindow from './JoplinWindow'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -33,8 +35,12 @@ export default class Joplin { private interop_; private settings_; private contentScripts_; + private clipboard_; + private window_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; + get clipboard(): JoplinClipboard; + get window(): JoplinWindow; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; get contentScripts(): JoplinContentScripts; diff --git a/packages/app-cli/tests/support/plugins/dialog/api/JoplinClipboard.d.ts b/packages/app-cli/tests/support/plugins/dialog/api/JoplinClipboard.d.ts new file mode 100644 index 000000000..3abc4e9df --- /dev/null +++ b/packages/app-cli/tests/support/plugins/dialog/api/JoplinClipboard.d.ts @@ -0,0 +1,23 @@ +export default class JoplinClipboard { + private electronClipboard_; + private electronNativeImage_; + constructor(electronClipboard: any, electronNativeImage: any); + readText(): Promise; + writeText(text: string): Promise; + readHtml(): Promise; + writeHtml(html: string): Promise; + /** + * Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + readImage(): Promise; + /** + * Takes an image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + writeImage(dataUrl: string): Promise; + /** + * Returns the list available formats (mime types). + * + * For example [ 'text/plain', 'text/html' ] + */ + availableFormats(): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/dialog/api/JoplinViewsDialogs.d.ts b/packages/app-cli/tests/support/plugins/dialog/api/JoplinViewsDialogs.d.ts index 043d488ea..f1643a01d 100644 --- a/packages/app-cli/tests/support/plugins/dialog/api/JoplinViewsDialogs.d.ts +++ b/packages/app-cli/tests/support/plugins/dialog/api/JoplinViewsDialogs.d.ts @@ -2,7 +2,7 @@ import Plugin from '../Plugin'; import { ButtonSpec, ViewHandle, DialogResult } from './types'; /** * Allows creating and managing dialogs. A dialog is modal window that - * contains a webview and a row of buttons. You can update the update the + * contains a webview and a row of buttons. You can update the * webview using the `setHtml` method. Dialogs are hidden by default and * you need to call `open()` to open them. Once the user clicks on a * button, the `open` call will return an object indicating what button was @@ -59,4 +59,11 @@ export default class JoplinViewsDialogs { * Opens the dialog */ open(handle: ViewHandle): Promise; + /** + * Toggle on whether to fit the dialog size to the content or not. + * When set to false, the dialog stretches to fill the application + * window. + * @default true + */ + setFitToContent(handle: ViewHandle, status: boolean): Promise; } diff --git a/packages/app-cli/tests/support/plugins/dialog/api/JoplinWindow.d.ts b/packages/app-cli/tests/support/plugins/dialog/api/JoplinWindow.d.ts new file mode 100644 index 000000000..231c55c3d --- /dev/null +++ b/packages/app-cli/tests/support/plugins/dialog/api/JoplinWindow.d.ts @@ -0,0 +1,24 @@ +import Plugin from '../Plugin'; +export interface Implementation { + injectCustomStyles(elementId: string, cssFilePath: string): Promise; +} +export default class JoplinWindow { + private plugin_; + private store_; + private implementation_; + constructor(implementation: Implementation, plugin: Plugin, store: any); + /** + * Loads a chrome CSS file. It will apply to the window UI elements, except + * for the note viewer. It is the same as the "Custom stylesheet for + * Joplin-wide app styles" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadChromeCssFile(filePath: string): Promise; + /** + * Loads a note CSS file. It will apply to the note viewer, as well as any + * exported or printed note. It is the same as the "Custom stylesheet for + * rendered Markdown" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadNoteCssFile(filePath: string): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/dialog/api/types.ts b/packages/app-cli/tests/support/plugins/dialog/api/types.ts index 9c4aa7332..e0b2d96c0 100644 --- a/packages/app-cli/tests/support/plugins/dialog/api/types.ts +++ b/packages/app-cli/tests/support/plugins/dialog/api/types.ts @@ -334,6 +334,17 @@ export enum SettingItemType { Button = 6, } +export enum AppType { + Desktop = 'desktop', + Mobile = 'mobile', + Cli = 'cli', +} + +export enum SettingStorage { + Database = 1, + File = 2, +} + // Redefine a simplified interface to mask internal details // and to remove function calls as they would have to be async. export interface SettingItem { @@ -372,7 +383,7 @@ export interface SettingItem { /** * Reserved property. Not used at the moment. */ - appTypes?: string[]; + appTypes?: AppType[]; /** * Set this to `true` to store secure data, such as passwords. Any such @@ -393,6 +404,11 @@ export interface SettingItem { minimum?: number; maximum?: number; step?: number; + + /** + * Either store the setting in the database or in settings.json. Defaults to database. + */ + storage?: SettingStorage; } export interface SettingSection { @@ -419,7 +435,7 @@ export type Path = string[]; // Content Script types // ================================================================= -export type PostMessageHandler = (id: string, message: any)=> Promise; +export type PostMessageHandler = (message: any)=> Promise; /** * When a content script is initialised, it receives a `context` object. diff --git a/packages/app-cli/tests/support/plugins/editor_context_menu/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/editor_context_menu/api/Joplin.d.ts index e30586e68..09d856e37 100644 --- a/packages/app-cli/tests/support/plugins/editor_context_menu/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/editor_context_menu/api/Joplin.d.ts @@ -8,6 +8,8 @@ import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; import JoplinContentScripts from './JoplinContentScripts'; +import JoplinClipboard from './JoplinClipboard'; +import JoplinWindow from './JoplinWindow'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -33,8 +35,12 @@ export default class Joplin { private interop_; private settings_; private contentScripts_; + private clipboard_; + private window_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; + get clipboard(): JoplinClipboard; + get window(): JoplinWindow; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; get contentScripts(): JoplinContentScripts; diff --git a/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinClipboard.d.ts b/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinClipboard.d.ts new file mode 100644 index 000000000..3abc4e9df --- /dev/null +++ b/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinClipboard.d.ts @@ -0,0 +1,23 @@ +export default class JoplinClipboard { + private electronClipboard_; + private electronNativeImage_; + constructor(electronClipboard: any, electronNativeImage: any); + readText(): Promise; + writeText(text: string): Promise; + readHtml(): Promise; + writeHtml(html: string): Promise; + /** + * Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + readImage(): Promise; + /** + * Takes an image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + writeImage(dataUrl: string): Promise; + /** + * Returns the list available formats (mime types). + * + * For example [ 'text/plain', 'text/html' ] + */ + availableFormats(): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinViewsDialogs.d.ts b/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinViewsDialogs.d.ts index 043d488ea..f1643a01d 100644 --- a/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinViewsDialogs.d.ts +++ b/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinViewsDialogs.d.ts @@ -2,7 +2,7 @@ import Plugin from '../Plugin'; import { ButtonSpec, ViewHandle, DialogResult } from './types'; /** * Allows creating and managing dialogs. A dialog is modal window that - * contains a webview and a row of buttons. You can update the update the + * contains a webview and a row of buttons. You can update the * webview using the `setHtml` method. Dialogs are hidden by default and * you need to call `open()` to open them. Once the user clicks on a * button, the `open` call will return an object indicating what button was @@ -59,4 +59,11 @@ export default class JoplinViewsDialogs { * Opens the dialog */ open(handle: ViewHandle): Promise; + /** + * Toggle on whether to fit the dialog size to the content or not. + * When set to false, the dialog stretches to fill the application + * window. + * @default true + */ + setFitToContent(handle: ViewHandle, status: boolean): Promise; } diff --git a/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinWindow.d.ts b/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinWindow.d.ts new file mode 100644 index 000000000..231c55c3d --- /dev/null +++ b/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinWindow.d.ts @@ -0,0 +1,24 @@ +import Plugin from '../Plugin'; +export interface Implementation { + injectCustomStyles(elementId: string, cssFilePath: string): Promise; +} +export default class JoplinWindow { + private plugin_; + private store_; + private implementation_; + constructor(implementation: Implementation, plugin: Plugin, store: any); + /** + * Loads a chrome CSS file. It will apply to the window UI elements, except + * for the note viewer. It is the same as the "Custom stylesheet for + * Joplin-wide app styles" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadChromeCssFile(filePath: string): Promise; + /** + * Loads a note CSS file. It will apply to the note viewer, as well as any + * exported or printed note. It is the same as the "Custom stylesheet for + * rendered Markdown" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadNoteCssFile(filePath: string): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/editor_context_menu/api/types.ts b/packages/app-cli/tests/support/plugins/editor_context_menu/api/types.ts index 9c4aa7332..e0b2d96c0 100644 --- a/packages/app-cli/tests/support/plugins/editor_context_menu/api/types.ts +++ b/packages/app-cli/tests/support/plugins/editor_context_menu/api/types.ts @@ -334,6 +334,17 @@ export enum SettingItemType { Button = 6, } +export enum AppType { + Desktop = 'desktop', + Mobile = 'mobile', + Cli = 'cli', +} + +export enum SettingStorage { + Database = 1, + File = 2, +} + // Redefine a simplified interface to mask internal details // and to remove function calls as they would have to be async. export interface SettingItem { @@ -372,7 +383,7 @@ export interface SettingItem { /** * Reserved property. Not used at the moment. */ - appTypes?: string[]; + appTypes?: AppType[]; /** * Set this to `true` to store secure data, such as passwords. Any such @@ -393,6 +404,11 @@ export interface SettingItem { minimum?: number; maximum?: number; step?: number; + + /** + * Either store the setting in the database or in settings.json. Defaults to database. + */ + storage?: SettingStorage; } export interface SettingSection { @@ -419,7 +435,7 @@ export type Path = string[]; // Content Script types // ================================================================= -export type PostMessageHandler = (id: string, message: any)=> Promise; +export type PostMessageHandler = (message: any)=> Promise; /** * When a content script is initialised, it receives a `context` object. diff --git a/packages/app-cli/tests/support/plugins/events/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/events/api/Joplin.d.ts index e30586e68..09d856e37 100644 --- a/packages/app-cli/tests/support/plugins/events/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/events/api/Joplin.d.ts @@ -8,6 +8,8 @@ import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; import JoplinContentScripts from './JoplinContentScripts'; +import JoplinClipboard from './JoplinClipboard'; +import JoplinWindow from './JoplinWindow'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -33,8 +35,12 @@ export default class Joplin { private interop_; private settings_; private contentScripts_; + private clipboard_; + private window_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; + get clipboard(): JoplinClipboard; + get window(): JoplinWindow; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; get contentScripts(): JoplinContentScripts; diff --git a/packages/app-cli/tests/support/plugins/events/api/JoplinClipboard.d.ts b/packages/app-cli/tests/support/plugins/events/api/JoplinClipboard.d.ts new file mode 100644 index 000000000..3abc4e9df --- /dev/null +++ b/packages/app-cli/tests/support/plugins/events/api/JoplinClipboard.d.ts @@ -0,0 +1,23 @@ +export default class JoplinClipboard { + private electronClipboard_; + private electronNativeImage_; + constructor(electronClipboard: any, electronNativeImage: any); + readText(): Promise; + writeText(text: string): Promise; + readHtml(): Promise; + writeHtml(html: string): Promise; + /** + * Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + readImage(): Promise; + /** + * Takes an image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + writeImage(dataUrl: string): Promise; + /** + * Returns the list available formats (mime types). + * + * For example [ 'text/plain', 'text/html' ] + */ + availableFormats(): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/events/api/JoplinViewsDialogs.d.ts b/packages/app-cli/tests/support/plugins/events/api/JoplinViewsDialogs.d.ts index 043d488ea..f1643a01d 100644 --- a/packages/app-cli/tests/support/plugins/events/api/JoplinViewsDialogs.d.ts +++ b/packages/app-cli/tests/support/plugins/events/api/JoplinViewsDialogs.d.ts @@ -2,7 +2,7 @@ import Plugin from '../Plugin'; import { ButtonSpec, ViewHandle, DialogResult } from './types'; /** * Allows creating and managing dialogs. A dialog is modal window that - * contains a webview and a row of buttons. You can update the update the + * contains a webview and a row of buttons. You can update the * webview using the `setHtml` method. Dialogs are hidden by default and * you need to call `open()` to open them. Once the user clicks on a * button, the `open` call will return an object indicating what button was @@ -59,4 +59,11 @@ export default class JoplinViewsDialogs { * Opens the dialog */ open(handle: ViewHandle): Promise; + /** + * Toggle on whether to fit the dialog size to the content or not. + * When set to false, the dialog stretches to fill the application + * window. + * @default true + */ + setFitToContent(handle: ViewHandle, status: boolean): Promise; } diff --git a/packages/app-cli/tests/support/plugins/events/api/JoplinWindow.d.ts b/packages/app-cli/tests/support/plugins/events/api/JoplinWindow.d.ts new file mode 100644 index 000000000..231c55c3d --- /dev/null +++ b/packages/app-cli/tests/support/plugins/events/api/JoplinWindow.d.ts @@ -0,0 +1,24 @@ +import Plugin from '../Plugin'; +export interface Implementation { + injectCustomStyles(elementId: string, cssFilePath: string): Promise; +} +export default class JoplinWindow { + private plugin_; + private store_; + private implementation_; + constructor(implementation: Implementation, plugin: Plugin, store: any); + /** + * Loads a chrome CSS file. It will apply to the window UI elements, except + * for the note viewer. It is the same as the "Custom stylesheet for + * Joplin-wide app styles" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadChromeCssFile(filePath: string): Promise; + /** + * Loads a note CSS file. It will apply to the note viewer, as well as any + * exported or printed note. It is the same as the "Custom stylesheet for + * rendered Markdown" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadNoteCssFile(filePath: string): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/events/api/types.ts b/packages/app-cli/tests/support/plugins/events/api/types.ts index 9c4aa7332..e0b2d96c0 100644 --- a/packages/app-cli/tests/support/plugins/events/api/types.ts +++ b/packages/app-cli/tests/support/plugins/events/api/types.ts @@ -334,6 +334,17 @@ export enum SettingItemType { Button = 6, } +export enum AppType { + Desktop = 'desktop', + Mobile = 'mobile', + Cli = 'cli', +} + +export enum SettingStorage { + Database = 1, + File = 2, +} + // Redefine a simplified interface to mask internal details // and to remove function calls as they would have to be async. export interface SettingItem { @@ -372,7 +383,7 @@ export interface SettingItem { /** * Reserved property. Not used at the moment. */ - appTypes?: string[]; + appTypes?: AppType[]; /** * Set this to `true` to store secure data, such as passwords. Any such @@ -393,6 +404,11 @@ export interface SettingItem { minimum?: number; maximum?: number; step?: number; + + /** + * Either store the setting in the database or in settings.json. Defaults to database. + */ + storage?: SettingStorage; } export interface SettingSection { @@ -419,7 +435,7 @@ export type Path = string[]; // Content Script types // ================================================================= -export type PostMessageHandler = (id: string, message: any)=> Promise; +export type PostMessageHandler = (message: any)=> Promise; /** * When a content script is initialised, it receives a `context` object. diff --git a/packages/app-cli/tests/support/plugins/external_assets/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/external_assets/api/Joplin.d.ts index e30586e68..09d856e37 100644 --- a/packages/app-cli/tests/support/plugins/external_assets/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/external_assets/api/Joplin.d.ts @@ -8,6 +8,8 @@ import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; import JoplinContentScripts from './JoplinContentScripts'; +import JoplinClipboard from './JoplinClipboard'; +import JoplinWindow from './JoplinWindow'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -33,8 +35,12 @@ export default class Joplin { private interop_; private settings_; private contentScripts_; + private clipboard_; + private window_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; + get clipboard(): JoplinClipboard; + get window(): JoplinWindow; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; get contentScripts(): JoplinContentScripts; diff --git a/packages/app-cli/tests/support/plugins/external_assets/api/JoplinClipboard.d.ts b/packages/app-cli/tests/support/plugins/external_assets/api/JoplinClipboard.d.ts new file mode 100644 index 000000000..3abc4e9df --- /dev/null +++ b/packages/app-cli/tests/support/plugins/external_assets/api/JoplinClipboard.d.ts @@ -0,0 +1,23 @@ +export default class JoplinClipboard { + private electronClipboard_; + private electronNativeImage_; + constructor(electronClipboard: any, electronNativeImage: any); + readText(): Promise; + writeText(text: string): Promise; + readHtml(): Promise; + writeHtml(html: string): Promise; + /** + * Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + readImage(): Promise; + /** + * Takes an image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + writeImage(dataUrl: string): Promise; + /** + * Returns the list available formats (mime types). + * + * For example [ 'text/plain', 'text/html' ] + */ + availableFormats(): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/external_assets/api/JoplinViewsDialogs.d.ts b/packages/app-cli/tests/support/plugins/external_assets/api/JoplinViewsDialogs.d.ts index 043d488ea..f1643a01d 100644 --- a/packages/app-cli/tests/support/plugins/external_assets/api/JoplinViewsDialogs.d.ts +++ b/packages/app-cli/tests/support/plugins/external_assets/api/JoplinViewsDialogs.d.ts @@ -2,7 +2,7 @@ import Plugin from '../Plugin'; import { ButtonSpec, ViewHandle, DialogResult } from './types'; /** * Allows creating and managing dialogs. A dialog is modal window that - * contains a webview and a row of buttons. You can update the update the + * contains a webview and a row of buttons. You can update the * webview using the `setHtml` method. Dialogs are hidden by default and * you need to call `open()` to open them. Once the user clicks on a * button, the `open` call will return an object indicating what button was @@ -59,4 +59,11 @@ export default class JoplinViewsDialogs { * Opens the dialog */ open(handle: ViewHandle): Promise; + /** + * Toggle on whether to fit the dialog size to the content or not. + * When set to false, the dialog stretches to fill the application + * window. + * @default true + */ + setFitToContent(handle: ViewHandle, status: boolean): Promise; } diff --git a/packages/app-cli/tests/support/plugins/external_assets/api/JoplinWindow.d.ts b/packages/app-cli/tests/support/plugins/external_assets/api/JoplinWindow.d.ts new file mode 100644 index 000000000..231c55c3d --- /dev/null +++ b/packages/app-cli/tests/support/plugins/external_assets/api/JoplinWindow.d.ts @@ -0,0 +1,24 @@ +import Plugin from '../Plugin'; +export interface Implementation { + injectCustomStyles(elementId: string, cssFilePath: string): Promise; +} +export default class JoplinWindow { + private plugin_; + private store_; + private implementation_; + constructor(implementation: Implementation, plugin: Plugin, store: any); + /** + * Loads a chrome CSS file. It will apply to the window UI elements, except + * for the note viewer. It is the same as the "Custom stylesheet for + * Joplin-wide app styles" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadChromeCssFile(filePath: string): Promise; + /** + * Loads a note CSS file. It will apply to the note viewer, as well as any + * exported or printed note. It is the same as the "Custom stylesheet for + * rendered Markdown" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadNoteCssFile(filePath: string): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/external_assets/api/types.ts b/packages/app-cli/tests/support/plugins/external_assets/api/types.ts index 9c4aa7332..e0b2d96c0 100644 --- a/packages/app-cli/tests/support/plugins/external_assets/api/types.ts +++ b/packages/app-cli/tests/support/plugins/external_assets/api/types.ts @@ -334,6 +334,17 @@ export enum SettingItemType { Button = 6, } +export enum AppType { + Desktop = 'desktop', + Mobile = 'mobile', + Cli = 'cli', +} + +export enum SettingStorage { + Database = 1, + File = 2, +} + // Redefine a simplified interface to mask internal details // and to remove function calls as they would have to be async. export interface SettingItem { @@ -372,7 +383,7 @@ export interface SettingItem { /** * Reserved property. Not used at the moment. */ - appTypes?: string[]; + appTypes?: AppType[]; /** * Set this to `true` to store secure data, such as passwords. Any such @@ -393,6 +404,11 @@ export interface SettingItem { minimum?: number; maximum?: number; step?: number; + + /** + * Either store the setting in the database or in settings.json. Defaults to database. + */ + storage?: SettingStorage; } export interface SettingSection { @@ -419,7 +435,7 @@ export type Path = string[]; // Content Script types // ================================================================= -export type PostMessageHandler = (id: string, message: any)=> Promise; +export type PostMessageHandler = (message: any)=> Promise; /** * When a content script is initialised, it receives a `context` object. diff --git a/packages/app-cli/tests/support/plugins/jpl_test/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/jpl_test/api/Joplin.d.ts index e30586e68..09d856e37 100644 --- a/packages/app-cli/tests/support/plugins/jpl_test/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/jpl_test/api/Joplin.d.ts @@ -8,6 +8,8 @@ import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; import JoplinContentScripts from './JoplinContentScripts'; +import JoplinClipboard from './JoplinClipboard'; +import JoplinWindow from './JoplinWindow'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -33,8 +35,12 @@ export default class Joplin { private interop_; private settings_; private contentScripts_; + private clipboard_; + private window_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; + get clipboard(): JoplinClipboard; + get window(): JoplinWindow; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; get contentScripts(): JoplinContentScripts; diff --git a/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinClipboard.d.ts b/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinClipboard.d.ts new file mode 100644 index 000000000..3abc4e9df --- /dev/null +++ b/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinClipboard.d.ts @@ -0,0 +1,23 @@ +export default class JoplinClipboard { + private electronClipboard_; + private electronNativeImage_; + constructor(electronClipboard: any, electronNativeImage: any); + readText(): Promise; + writeText(text: string): Promise; + readHtml(): Promise; + writeHtml(html: string): Promise; + /** + * Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + readImage(): Promise; + /** + * Takes an image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + writeImage(dataUrl: string): Promise; + /** + * Returns the list available formats (mime types). + * + * For example [ 'text/plain', 'text/html' ] + */ + availableFormats(): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinViewsDialogs.d.ts b/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinViewsDialogs.d.ts index 043d488ea..f1643a01d 100644 --- a/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinViewsDialogs.d.ts +++ b/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinViewsDialogs.d.ts @@ -2,7 +2,7 @@ import Plugin from '../Plugin'; import { ButtonSpec, ViewHandle, DialogResult } from './types'; /** * Allows creating and managing dialogs. A dialog is modal window that - * contains a webview and a row of buttons. You can update the update the + * contains a webview and a row of buttons. You can update the * webview using the `setHtml` method. Dialogs are hidden by default and * you need to call `open()` to open them. Once the user clicks on a * button, the `open` call will return an object indicating what button was @@ -59,4 +59,11 @@ export default class JoplinViewsDialogs { * Opens the dialog */ open(handle: ViewHandle): Promise; + /** + * Toggle on whether to fit the dialog size to the content or not. + * When set to false, the dialog stretches to fill the application + * window. + * @default true + */ + setFitToContent(handle: ViewHandle, status: boolean): Promise; } diff --git a/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinWindow.d.ts b/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinWindow.d.ts new file mode 100644 index 000000000..231c55c3d --- /dev/null +++ b/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinWindow.d.ts @@ -0,0 +1,24 @@ +import Plugin from '../Plugin'; +export interface Implementation { + injectCustomStyles(elementId: string, cssFilePath: string): Promise; +} +export default class JoplinWindow { + private plugin_; + private store_; + private implementation_; + constructor(implementation: Implementation, plugin: Plugin, store: any); + /** + * Loads a chrome CSS file. It will apply to the window UI elements, except + * for the note viewer. It is the same as the "Custom stylesheet for + * Joplin-wide app styles" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadChromeCssFile(filePath: string): Promise; + /** + * Loads a note CSS file. It will apply to the note viewer, as well as any + * exported or printed note. It is the same as the "Custom stylesheet for + * rendered Markdown" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadNoteCssFile(filePath: string): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/jpl_test/api/types.ts b/packages/app-cli/tests/support/plugins/jpl_test/api/types.ts index 9c4aa7332..e0b2d96c0 100644 --- a/packages/app-cli/tests/support/plugins/jpl_test/api/types.ts +++ b/packages/app-cli/tests/support/plugins/jpl_test/api/types.ts @@ -334,6 +334,17 @@ export enum SettingItemType { Button = 6, } +export enum AppType { + Desktop = 'desktop', + Mobile = 'mobile', + Cli = 'cli', +} + +export enum SettingStorage { + Database = 1, + File = 2, +} + // Redefine a simplified interface to mask internal details // and to remove function calls as they would have to be async. export interface SettingItem { @@ -372,7 +383,7 @@ export interface SettingItem { /** * Reserved property. Not used at the moment. */ - appTypes?: string[]; + appTypes?: AppType[]; /** * Set this to `true` to store secure data, such as passwords. Any such @@ -393,6 +404,11 @@ export interface SettingItem { minimum?: number; maximum?: number; step?: number; + + /** + * Either store the setting in the database or in settings.json. Defaults to database. + */ + storage?: SettingStorage; } export interface SettingSection { @@ -419,7 +435,7 @@ export type Path = string[]; // Content Script types // ================================================================= -export type PostMessageHandler = (id: string, message: any)=> Promise; +export type PostMessageHandler = (message: any)=> Promise; /** * When a content script is initialised, it receives a `context` object. diff --git a/packages/app-cli/tests/support/plugins/json_export/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/json_export/api/Joplin.d.ts index e30586e68..09d856e37 100644 --- a/packages/app-cli/tests/support/plugins/json_export/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/json_export/api/Joplin.d.ts @@ -8,6 +8,8 @@ import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; import JoplinContentScripts from './JoplinContentScripts'; +import JoplinClipboard from './JoplinClipboard'; +import JoplinWindow from './JoplinWindow'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -33,8 +35,12 @@ export default class Joplin { private interop_; private settings_; private contentScripts_; + private clipboard_; + private window_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; + get clipboard(): JoplinClipboard; + get window(): JoplinWindow; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; get contentScripts(): JoplinContentScripts; diff --git a/packages/app-cli/tests/support/plugins/json_export/api/JoplinClipboard.d.ts b/packages/app-cli/tests/support/plugins/json_export/api/JoplinClipboard.d.ts new file mode 100644 index 000000000..3abc4e9df --- /dev/null +++ b/packages/app-cli/tests/support/plugins/json_export/api/JoplinClipboard.d.ts @@ -0,0 +1,23 @@ +export default class JoplinClipboard { + private electronClipboard_; + private electronNativeImage_; + constructor(electronClipboard: any, electronNativeImage: any); + readText(): Promise; + writeText(text: string): Promise; + readHtml(): Promise; + writeHtml(html: string): Promise; + /** + * Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + readImage(): Promise; + /** + * Takes an image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + writeImage(dataUrl: string): Promise; + /** + * Returns the list available formats (mime types). + * + * For example [ 'text/plain', 'text/html' ] + */ + availableFormats(): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/json_export/api/JoplinViewsDialogs.d.ts b/packages/app-cli/tests/support/plugins/json_export/api/JoplinViewsDialogs.d.ts index 043d488ea..f1643a01d 100644 --- a/packages/app-cli/tests/support/plugins/json_export/api/JoplinViewsDialogs.d.ts +++ b/packages/app-cli/tests/support/plugins/json_export/api/JoplinViewsDialogs.d.ts @@ -2,7 +2,7 @@ import Plugin from '../Plugin'; import { ButtonSpec, ViewHandle, DialogResult } from './types'; /** * Allows creating and managing dialogs. A dialog is modal window that - * contains a webview and a row of buttons. You can update the update the + * contains a webview and a row of buttons. You can update the * webview using the `setHtml` method. Dialogs are hidden by default and * you need to call `open()` to open them. Once the user clicks on a * button, the `open` call will return an object indicating what button was @@ -59,4 +59,11 @@ export default class JoplinViewsDialogs { * Opens the dialog */ open(handle: ViewHandle): Promise; + /** + * Toggle on whether to fit the dialog size to the content or not. + * When set to false, the dialog stretches to fill the application + * window. + * @default true + */ + setFitToContent(handle: ViewHandle, status: boolean): Promise; } diff --git a/packages/app-cli/tests/support/plugins/json_export/api/JoplinWindow.d.ts b/packages/app-cli/tests/support/plugins/json_export/api/JoplinWindow.d.ts new file mode 100644 index 000000000..231c55c3d --- /dev/null +++ b/packages/app-cli/tests/support/plugins/json_export/api/JoplinWindow.d.ts @@ -0,0 +1,24 @@ +import Plugin from '../Plugin'; +export interface Implementation { + injectCustomStyles(elementId: string, cssFilePath: string): Promise; +} +export default class JoplinWindow { + private plugin_; + private store_; + private implementation_; + constructor(implementation: Implementation, plugin: Plugin, store: any); + /** + * Loads a chrome CSS file. It will apply to the window UI elements, except + * for the note viewer. It is the same as the "Custom stylesheet for + * Joplin-wide app styles" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadChromeCssFile(filePath: string): Promise; + /** + * Loads a note CSS file. It will apply to the note viewer, as well as any + * exported or printed note. It is the same as the "Custom stylesheet for + * rendered Markdown" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadNoteCssFile(filePath: string): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/json_export/api/types.ts b/packages/app-cli/tests/support/plugins/json_export/api/types.ts index 9c4aa7332..e0b2d96c0 100644 --- a/packages/app-cli/tests/support/plugins/json_export/api/types.ts +++ b/packages/app-cli/tests/support/plugins/json_export/api/types.ts @@ -334,6 +334,17 @@ export enum SettingItemType { Button = 6, } +export enum AppType { + Desktop = 'desktop', + Mobile = 'mobile', + Cli = 'cli', +} + +export enum SettingStorage { + Database = 1, + File = 2, +} + // Redefine a simplified interface to mask internal details // and to remove function calls as they would have to be async. export interface SettingItem { @@ -372,7 +383,7 @@ export interface SettingItem { /** * Reserved property. Not used at the moment. */ - appTypes?: string[]; + appTypes?: AppType[]; /** * Set this to `true` to store secure data, such as passwords. Any such @@ -393,6 +404,11 @@ export interface SettingItem { minimum?: number; maximum?: number; step?: number; + + /** + * Either store the setting in the database or in settings.json. Defaults to database. + */ + storage?: SettingStorage; } export interface SettingSection { @@ -419,7 +435,7 @@ export type Path = string[]; // Content Script types // ================================================================= -export type PostMessageHandler = (id: string, message: any)=> Promise; +export type PostMessageHandler = (message: any)=> Promise; /** * When a content script is initialised, it receives a `context` object. diff --git a/packages/app-cli/tests/support/plugins/menu/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/menu/api/Joplin.d.ts index e30586e68..09d856e37 100644 --- a/packages/app-cli/tests/support/plugins/menu/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/menu/api/Joplin.d.ts @@ -8,6 +8,8 @@ import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; import JoplinContentScripts from './JoplinContentScripts'; +import JoplinClipboard from './JoplinClipboard'; +import JoplinWindow from './JoplinWindow'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -33,8 +35,12 @@ export default class Joplin { private interop_; private settings_; private contentScripts_; + private clipboard_; + private window_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; + get clipboard(): JoplinClipboard; + get window(): JoplinWindow; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; get contentScripts(): JoplinContentScripts; diff --git a/packages/app-cli/tests/support/plugins/menu/api/JoplinClipboard.d.ts b/packages/app-cli/tests/support/plugins/menu/api/JoplinClipboard.d.ts new file mode 100644 index 000000000..3abc4e9df --- /dev/null +++ b/packages/app-cli/tests/support/plugins/menu/api/JoplinClipboard.d.ts @@ -0,0 +1,23 @@ +export default class JoplinClipboard { + private electronClipboard_; + private electronNativeImage_; + constructor(electronClipboard: any, electronNativeImage: any); + readText(): Promise; + writeText(text: string): Promise; + readHtml(): Promise; + writeHtml(html: string): Promise; + /** + * Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + readImage(): Promise; + /** + * Takes an image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + writeImage(dataUrl: string): Promise; + /** + * Returns the list available formats (mime types). + * + * For example [ 'text/plain', 'text/html' ] + */ + availableFormats(): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/menu/api/JoplinViewsDialogs.d.ts b/packages/app-cli/tests/support/plugins/menu/api/JoplinViewsDialogs.d.ts index 043d488ea..f1643a01d 100644 --- a/packages/app-cli/tests/support/plugins/menu/api/JoplinViewsDialogs.d.ts +++ b/packages/app-cli/tests/support/plugins/menu/api/JoplinViewsDialogs.d.ts @@ -2,7 +2,7 @@ import Plugin from '../Plugin'; import { ButtonSpec, ViewHandle, DialogResult } from './types'; /** * Allows creating and managing dialogs. A dialog is modal window that - * contains a webview and a row of buttons. You can update the update the + * contains a webview and a row of buttons. You can update the * webview using the `setHtml` method. Dialogs are hidden by default and * you need to call `open()` to open them. Once the user clicks on a * button, the `open` call will return an object indicating what button was @@ -59,4 +59,11 @@ export default class JoplinViewsDialogs { * Opens the dialog */ open(handle: ViewHandle): Promise; + /** + * Toggle on whether to fit the dialog size to the content or not. + * When set to false, the dialog stretches to fill the application + * window. + * @default true + */ + setFitToContent(handle: ViewHandle, status: boolean): Promise; } diff --git a/packages/app-cli/tests/support/plugins/menu/api/JoplinWindow.d.ts b/packages/app-cli/tests/support/plugins/menu/api/JoplinWindow.d.ts new file mode 100644 index 000000000..231c55c3d --- /dev/null +++ b/packages/app-cli/tests/support/plugins/menu/api/JoplinWindow.d.ts @@ -0,0 +1,24 @@ +import Plugin from '../Plugin'; +export interface Implementation { + injectCustomStyles(elementId: string, cssFilePath: string): Promise; +} +export default class JoplinWindow { + private plugin_; + private store_; + private implementation_; + constructor(implementation: Implementation, plugin: Plugin, store: any); + /** + * Loads a chrome CSS file. It will apply to the window UI elements, except + * for the note viewer. It is the same as the "Custom stylesheet for + * Joplin-wide app styles" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadChromeCssFile(filePath: string): Promise; + /** + * Loads a note CSS file. It will apply to the note viewer, as well as any + * exported or printed note. It is the same as the "Custom stylesheet for + * rendered Markdown" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadNoteCssFile(filePath: string): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/menu/api/types.ts b/packages/app-cli/tests/support/plugins/menu/api/types.ts index 9c4aa7332..e0b2d96c0 100644 --- a/packages/app-cli/tests/support/plugins/menu/api/types.ts +++ b/packages/app-cli/tests/support/plugins/menu/api/types.ts @@ -334,6 +334,17 @@ export enum SettingItemType { Button = 6, } +export enum AppType { + Desktop = 'desktop', + Mobile = 'mobile', + Cli = 'cli', +} + +export enum SettingStorage { + Database = 1, + File = 2, +} + // Redefine a simplified interface to mask internal details // and to remove function calls as they would have to be async. export interface SettingItem { @@ -372,7 +383,7 @@ export interface SettingItem { /** * Reserved property. Not used at the moment. */ - appTypes?: string[]; + appTypes?: AppType[]; /** * Set this to `true` to store secure data, such as passwords. Any such @@ -393,6 +404,11 @@ export interface SettingItem { minimum?: number; maximum?: number; step?: number; + + /** + * Either store the setting in the database or in settings.json. Defaults to database. + */ + storage?: SettingStorage; } export interface SettingSection { @@ -419,7 +435,7 @@ export type Path = string[]; // Content Script types // ================================================================= -export type PostMessageHandler = (id: string, message: any)=> Promise; +export type PostMessageHandler = (message: any)=> Promise; /** * When a content script is initialised, it receives a `context` object. diff --git a/packages/app-cli/tests/support/plugins/multi_selection/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/multi_selection/api/Joplin.d.ts index e30586e68..09d856e37 100644 --- a/packages/app-cli/tests/support/plugins/multi_selection/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/multi_selection/api/Joplin.d.ts @@ -8,6 +8,8 @@ import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; import JoplinContentScripts from './JoplinContentScripts'; +import JoplinClipboard from './JoplinClipboard'; +import JoplinWindow from './JoplinWindow'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -33,8 +35,12 @@ export default class Joplin { private interop_; private settings_; private contentScripts_; + private clipboard_; + private window_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; + get clipboard(): JoplinClipboard; + get window(): JoplinWindow; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; get contentScripts(): JoplinContentScripts; diff --git a/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinClipboard.d.ts b/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinClipboard.d.ts new file mode 100644 index 000000000..3abc4e9df --- /dev/null +++ b/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinClipboard.d.ts @@ -0,0 +1,23 @@ +export default class JoplinClipboard { + private electronClipboard_; + private electronNativeImage_; + constructor(electronClipboard: any, electronNativeImage: any); + readText(): Promise; + writeText(text: string): Promise; + readHtml(): Promise; + writeHtml(html: string): Promise; + /** + * Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + readImage(): Promise; + /** + * Takes an image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + writeImage(dataUrl: string): Promise; + /** + * Returns the list available formats (mime types). + * + * For example [ 'text/plain', 'text/html' ] + */ + availableFormats(): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinViewsDialogs.d.ts b/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinViewsDialogs.d.ts index 043d488ea..f1643a01d 100644 --- a/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinViewsDialogs.d.ts +++ b/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinViewsDialogs.d.ts @@ -2,7 +2,7 @@ import Plugin from '../Plugin'; import { ButtonSpec, ViewHandle, DialogResult } from './types'; /** * Allows creating and managing dialogs. A dialog is modal window that - * contains a webview and a row of buttons. You can update the update the + * contains a webview and a row of buttons. You can update the * webview using the `setHtml` method. Dialogs are hidden by default and * you need to call `open()` to open them. Once the user clicks on a * button, the `open` call will return an object indicating what button was @@ -59,4 +59,11 @@ export default class JoplinViewsDialogs { * Opens the dialog */ open(handle: ViewHandle): Promise; + /** + * Toggle on whether to fit the dialog size to the content or not. + * When set to false, the dialog stretches to fill the application + * window. + * @default true + */ + setFitToContent(handle: ViewHandle, status: boolean): Promise; } diff --git a/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinWindow.d.ts b/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinWindow.d.ts new file mode 100644 index 000000000..231c55c3d --- /dev/null +++ b/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinWindow.d.ts @@ -0,0 +1,24 @@ +import Plugin from '../Plugin'; +export interface Implementation { + injectCustomStyles(elementId: string, cssFilePath: string): Promise; +} +export default class JoplinWindow { + private plugin_; + private store_; + private implementation_; + constructor(implementation: Implementation, plugin: Plugin, store: any); + /** + * Loads a chrome CSS file. It will apply to the window UI elements, except + * for the note viewer. It is the same as the "Custom stylesheet for + * Joplin-wide app styles" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadChromeCssFile(filePath: string): Promise; + /** + * Loads a note CSS file. It will apply to the note viewer, as well as any + * exported or printed note. It is the same as the "Custom stylesheet for + * rendered Markdown" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadNoteCssFile(filePath: string): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/multi_selection/api/types.ts b/packages/app-cli/tests/support/plugins/multi_selection/api/types.ts index 9c4aa7332..e0b2d96c0 100644 --- a/packages/app-cli/tests/support/plugins/multi_selection/api/types.ts +++ b/packages/app-cli/tests/support/plugins/multi_selection/api/types.ts @@ -334,6 +334,17 @@ export enum SettingItemType { Button = 6, } +export enum AppType { + Desktop = 'desktop', + Mobile = 'mobile', + Cli = 'cli', +} + +export enum SettingStorage { + Database = 1, + File = 2, +} + // Redefine a simplified interface to mask internal details // and to remove function calls as they would have to be async. export interface SettingItem { @@ -372,7 +383,7 @@ export interface SettingItem { /** * Reserved property. Not used at the moment. */ - appTypes?: string[]; + appTypes?: AppType[]; /** * Set this to `true` to store secure data, such as passwords. Any such @@ -393,6 +404,11 @@ export interface SettingItem { minimum?: number; maximum?: number; step?: number; + + /** + * Either store the setting in the database or in settings.json. Defaults to database. + */ + storage?: SettingStorage; } export interface SettingSection { @@ -419,7 +435,7 @@ export type Path = string[]; // Content Script types // ================================================================= -export type PostMessageHandler = (id: string, message: any)=> Promise; +export type PostMessageHandler = (message: any)=> Promise; /** * When a content script is initialised, it receives a `context` object. diff --git a/packages/app-cli/tests/support/plugins/nativeModule/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/nativeModule/api/Joplin.d.ts index e30586e68..09d856e37 100644 --- a/packages/app-cli/tests/support/plugins/nativeModule/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/nativeModule/api/Joplin.d.ts @@ -8,6 +8,8 @@ import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; import JoplinContentScripts from './JoplinContentScripts'; +import JoplinClipboard from './JoplinClipboard'; +import JoplinWindow from './JoplinWindow'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -33,8 +35,12 @@ export default class Joplin { private interop_; private settings_; private contentScripts_; + private clipboard_; + private window_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; + get clipboard(): JoplinClipboard; + get window(): JoplinWindow; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; get contentScripts(): JoplinContentScripts; diff --git a/packages/app-cli/tests/support/plugins/nativeModule/api/JoplinClipboard.d.ts b/packages/app-cli/tests/support/plugins/nativeModule/api/JoplinClipboard.d.ts new file mode 100644 index 000000000..3abc4e9df --- /dev/null +++ b/packages/app-cli/tests/support/plugins/nativeModule/api/JoplinClipboard.d.ts @@ -0,0 +1,23 @@ +export default class JoplinClipboard { + private electronClipboard_; + private electronNativeImage_; + constructor(electronClipboard: any, electronNativeImage: any); + readText(): Promise; + writeText(text: string): Promise; + readHtml(): Promise; + writeHtml(html: string): Promise; + /** + * Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + readImage(): Promise; + /** + * Takes an image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + writeImage(dataUrl: string): Promise; + /** + * Returns the list available formats (mime types). + * + * For example [ 'text/plain', 'text/html' ] + */ + availableFormats(): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/nativeModule/api/JoplinViewsDialogs.d.ts b/packages/app-cli/tests/support/plugins/nativeModule/api/JoplinViewsDialogs.d.ts index 043d488ea..f1643a01d 100644 --- a/packages/app-cli/tests/support/plugins/nativeModule/api/JoplinViewsDialogs.d.ts +++ b/packages/app-cli/tests/support/plugins/nativeModule/api/JoplinViewsDialogs.d.ts @@ -2,7 +2,7 @@ import Plugin from '../Plugin'; import { ButtonSpec, ViewHandle, DialogResult } from './types'; /** * Allows creating and managing dialogs. A dialog is modal window that - * contains a webview and a row of buttons. You can update the update the + * contains a webview and a row of buttons. You can update the * webview using the `setHtml` method. Dialogs are hidden by default and * you need to call `open()` to open them. Once the user clicks on a * button, the `open` call will return an object indicating what button was @@ -59,4 +59,11 @@ export default class JoplinViewsDialogs { * Opens the dialog */ open(handle: ViewHandle): Promise; + /** + * Toggle on whether to fit the dialog size to the content or not. + * When set to false, the dialog stretches to fill the application + * window. + * @default true + */ + setFitToContent(handle: ViewHandle, status: boolean): Promise; } diff --git a/packages/app-cli/tests/support/plugins/nativeModule/api/JoplinWindow.d.ts b/packages/app-cli/tests/support/plugins/nativeModule/api/JoplinWindow.d.ts new file mode 100644 index 000000000..231c55c3d --- /dev/null +++ b/packages/app-cli/tests/support/plugins/nativeModule/api/JoplinWindow.d.ts @@ -0,0 +1,24 @@ +import Plugin from '../Plugin'; +export interface Implementation { + injectCustomStyles(elementId: string, cssFilePath: string): Promise; +} +export default class JoplinWindow { + private plugin_; + private store_; + private implementation_; + constructor(implementation: Implementation, plugin: Plugin, store: any); + /** + * Loads a chrome CSS file. It will apply to the window UI elements, except + * for the note viewer. It is the same as the "Custom stylesheet for + * Joplin-wide app styles" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadChromeCssFile(filePath: string): Promise; + /** + * Loads a note CSS file. It will apply to the note viewer, as well as any + * exported or printed note. It is the same as the "Custom stylesheet for + * rendered Markdown" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadNoteCssFile(filePath: string): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/nativeModule/api/types.ts b/packages/app-cli/tests/support/plugins/nativeModule/api/types.ts index 9c4aa7332..e0b2d96c0 100644 --- a/packages/app-cli/tests/support/plugins/nativeModule/api/types.ts +++ b/packages/app-cli/tests/support/plugins/nativeModule/api/types.ts @@ -334,6 +334,17 @@ export enum SettingItemType { Button = 6, } +export enum AppType { + Desktop = 'desktop', + Mobile = 'mobile', + Cli = 'cli', +} + +export enum SettingStorage { + Database = 1, + File = 2, +} + // Redefine a simplified interface to mask internal details // and to remove function calls as they would have to be async. export interface SettingItem { @@ -372,7 +383,7 @@ export interface SettingItem { /** * Reserved property. Not used at the moment. */ - appTypes?: string[]; + appTypes?: AppType[]; /** * Set this to `true` to store secure data, such as passwords. Any such @@ -393,6 +404,11 @@ export interface SettingItem { minimum?: number; maximum?: number; step?: number; + + /** + * Either store the setting in the database or in settings.json. Defaults to database. + */ + storage?: SettingStorage; } export interface SettingSection { @@ -419,7 +435,7 @@ export type Path = string[]; // Content Script types // ================================================================= -export type PostMessageHandler = (id: string, message: any)=> Promise; +export type PostMessageHandler = (message: any)=> Promise; /** * When a content script is initialised, it receives a `context` object. diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/post_messages/api/Joplin.d.ts index e30586e68..09d856e37 100644 --- a/packages/app-cli/tests/support/plugins/post_messages/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/post_messages/api/Joplin.d.ts @@ -8,6 +8,8 @@ import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; import JoplinContentScripts from './JoplinContentScripts'; +import JoplinClipboard from './JoplinClipboard'; +import JoplinWindow from './JoplinWindow'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -33,8 +35,12 @@ export default class Joplin { private interop_; private settings_; private contentScripts_; + private clipboard_; + private window_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; + get clipboard(): JoplinClipboard; + get window(): JoplinWindow; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; get contentScripts(): JoplinContentScripts; diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/JoplinClipboard.d.ts b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinClipboard.d.ts new file mode 100644 index 000000000..3abc4e9df --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinClipboard.d.ts @@ -0,0 +1,23 @@ +export default class JoplinClipboard { + private electronClipboard_; + private electronNativeImage_; + constructor(electronClipboard: any, electronNativeImage: any); + readText(): Promise; + writeText(text: string): Promise; + readHtml(): Promise; + writeHtml(html: string): Promise; + /** + * Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + readImage(): Promise; + /** + * Takes an image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + writeImage(dataUrl: string): Promise; + /** + * Returns the list available formats (mime types). + * + * For example [ 'text/plain', 'text/html' ] + */ + availableFormats(): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViewsDialogs.d.ts b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViewsDialogs.d.ts index 043d488ea..f1643a01d 100644 --- a/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViewsDialogs.d.ts +++ b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViewsDialogs.d.ts @@ -2,7 +2,7 @@ import Plugin from '../Plugin'; import { ButtonSpec, ViewHandle, DialogResult } from './types'; /** * Allows creating and managing dialogs. A dialog is modal window that - * contains a webview and a row of buttons. You can update the update the + * contains a webview and a row of buttons. You can update the * webview using the `setHtml` method. Dialogs are hidden by default and * you need to call `open()` to open them. Once the user clicks on a * button, the `open` call will return an object indicating what button was @@ -59,4 +59,11 @@ export default class JoplinViewsDialogs { * Opens the dialog */ open(handle: ViewHandle): Promise; + /** + * Toggle on whether to fit the dialog size to the content or not. + * When set to false, the dialog stretches to fill the application + * window. + * @default true + */ + setFitToContent(handle: ViewHandle, status: boolean): Promise; } diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/JoplinWindow.d.ts b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinWindow.d.ts new file mode 100644 index 000000000..231c55c3d --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinWindow.d.ts @@ -0,0 +1,24 @@ +import Plugin from '../Plugin'; +export interface Implementation { + injectCustomStyles(elementId: string, cssFilePath: string): Promise; +} +export default class JoplinWindow { + private plugin_; + private store_; + private implementation_; + constructor(implementation: Implementation, plugin: Plugin, store: any); + /** + * Loads a chrome CSS file. It will apply to the window UI elements, except + * for the note viewer. It is the same as the "Custom stylesheet for + * Joplin-wide app styles" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadChromeCssFile(filePath: string): Promise; + /** + * Loads a note CSS file. It will apply to the note viewer, as well as any + * exported or printed note. It is the same as the "Custom stylesheet for + * rendered Markdown" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadNoteCssFile(filePath: string): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/types.ts b/packages/app-cli/tests/support/plugins/post_messages/api/types.ts index 9c4aa7332..e0b2d96c0 100644 --- a/packages/app-cli/tests/support/plugins/post_messages/api/types.ts +++ b/packages/app-cli/tests/support/plugins/post_messages/api/types.ts @@ -334,6 +334,17 @@ export enum SettingItemType { Button = 6, } +export enum AppType { + Desktop = 'desktop', + Mobile = 'mobile', + Cli = 'cli', +} + +export enum SettingStorage { + Database = 1, + File = 2, +} + // Redefine a simplified interface to mask internal details // and to remove function calls as they would have to be async. export interface SettingItem { @@ -372,7 +383,7 @@ export interface SettingItem { /** * Reserved property. Not used at the moment. */ - appTypes?: string[]; + appTypes?: AppType[]; /** * Set this to `true` to store secure data, such as passwords. Any such @@ -393,6 +404,11 @@ export interface SettingItem { minimum?: number; maximum?: number; step?: number; + + /** + * Either store the setting in the database or in settings.json. Defaults to database. + */ + storage?: SettingStorage; } export interface SettingSection { @@ -419,7 +435,7 @@ export type Path = string[]; // Content Script types // ================================================================= -export type PostMessageHandler = (id: string, message: any)=> Promise; +export type PostMessageHandler = (message: any)=> Promise; /** * When a content script is initialised, it receives a `context` object. diff --git a/packages/app-cli/tests/support/plugins/register_command/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/register_command/api/Joplin.d.ts index e30586e68..09d856e37 100644 --- a/packages/app-cli/tests/support/plugins/register_command/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/register_command/api/Joplin.d.ts @@ -8,6 +8,8 @@ import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; import JoplinContentScripts from './JoplinContentScripts'; +import JoplinClipboard from './JoplinClipboard'; +import JoplinWindow from './JoplinWindow'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -33,8 +35,12 @@ export default class Joplin { private interop_; private settings_; private contentScripts_; + private clipboard_; + private window_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; + get clipboard(): JoplinClipboard; + get window(): JoplinWindow; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; get contentScripts(): JoplinContentScripts; diff --git a/packages/app-cli/tests/support/plugins/register_command/api/JoplinClipboard.d.ts b/packages/app-cli/tests/support/plugins/register_command/api/JoplinClipboard.d.ts new file mode 100644 index 000000000..3abc4e9df --- /dev/null +++ b/packages/app-cli/tests/support/plugins/register_command/api/JoplinClipboard.d.ts @@ -0,0 +1,23 @@ +export default class JoplinClipboard { + private electronClipboard_; + private electronNativeImage_; + constructor(electronClipboard: any, electronNativeImage: any); + readText(): Promise; + writeText(text: string): Promise; + readHtml(): Promise; + writeHtml(html: string): Promise; + /** + * Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + readImage(): Promise; + /** + * Takes an image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + writeImage(dataUrl: string): Promise; + /** + * Returns the list available formats (mime types). + * + * For example [ 'text/plain', 'text/html' ] + */ + availableFormats(): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/register_command/api/JoplinViewsDialogs.d.ts b/packages/app-cli/tests/support/plugins/register_command/api/JoplinViewsDialogs.d.ts index 043d488ea..f1643a01d 100644 --- a/packages/app-cli/tests/support/plugins/register_command/api/JoplinViewsDialogs.d.ts +++ b/packages/app-cli/tests/support/plugins/register_command/api/JoplinViewsDialogs.d.ts @@ -2,7 +2,7 @@ import Plugin from '../Plugin'; import { ButtonSpec, ViewHandle, DialogResult } from './types'; /** * Allows creating and managing dialogs. A dialog is modal window that - * contains a webview and a row of buttons. You can update the update the + * contains a webview and a row of buttons. You can update the * webview using the `setHtml` method. Dialogs are hidden by default and * you need to call `open()` to open them. Once the user clicks on a * button, the `open` call will return an object indicating what button was @@ -59,4 +59,11 @@ export default class JoplinViewsDialogs { * Opens the dialog */ open(handle: ViewHandle): Promise; + /** + * Toggle on whether to fit the dialog size to the content or not. + * When set to false, the dialog stretches to fill the application + * window. + * @default true + */ + setFitToContent(handle: ViewHandle, status: boolean): Promise; } diff --git a/packages/app-cli/tests/support/plugins/register_command/api/JoplinWindow.d.ts b/packages/app-cli/tests/support/plugins/register_command/api/JoplinWindow.d.ts new file mode 100644 index 000000000..231c55c3d --- /dev/null +++ b/packages/app-cli/tests/support/plugins/register_command/api/JoplinWindow.d.ts @@ -0,0 +1,24 @@ +import Plugin from '../Plugin'; +export interface Implementation { + injectCustomStyles(elementId: string, cssFilePath: string): Promise; +} +export default class JoplinWindow { + private plugin_; + private store_; + private implementation_; + constructor(implementation: Implementation, plugin: Plugin, store: any); + /** + * Loads a chrome CSS file. It will apply to the window UI elements, except + * for the note viewer. It is the same as the "Custom stylesheet for + * Joplin-wide app styles" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadChromeCssFile(filePath: string): Promise; + /** + * Loads a note CSS file. It will apply to the note viewer, as well as any + * exported or printed note. It is the same as the "Custom stylesheet for + * rendered Markdown" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadNoteCssFile(filePath: string): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/register_command/api/types.ts b/packages/app-cli/tests/support/plugins/register_command/api/types.ts index 9c4aa7332..e0b2d96c0 100644 --- a/packages/app-cli/tests/support/plugins/register_command/api/types.ts +++ b/packages/app-cli/tests/support/plugins/register_command/api/types.ts @@ -334,6 +334,17 @@ export enum SettingItemType { Button = 6, } +export enum AppType { + Desktop = 'desktop', + Mobile = 'mobile', + Cli = 'cli', +} + +export enum SettingStorage { + Database = 1, + File = 2, +} + // Redefine a simplified interface to mask internal details // and to remove function calls as they would have to be async. export interface SettingItem { @@ -372,7 +383,7 @@ export interface SettingItem { /** * Reserved property. Not used at the moment. */ - appTypes?: string[]; + appTypes?: AppType[]; /** * Set this to `true` to store secure data, such as passwords. Any such @@ -393,6 +404,11 @@ export interface SettingItem { minimum?: number; maximum?: number; step?: number; + + /** + * Either store the setting in the database or in settings.json. Defaults to database. + */ + storage?: SettingStorage; } export interface SettingSection { @@ -419,7 +435,7 @@ export type Path = string[]; // Content Script types // ================================================================= -export type PostMessageHandler = (id: string, message: any)=> Promise; +export type PostMessageHandler = (message: any)=> Promise; /** * When a content script is initialised, it receives a `context` object. diff --git a/packages/app-cli/tests/support/plugins/selected_text/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/selected_text/api/Joplin.d.ts index e30586e68..09d856e37 100644 --- a/packages/app-cli/tests/support/plugins/selected_text/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/selected_text/api/Joplin.d.ts @@ -8,6 +8,8 @@ import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; import JoplinContentScripts from './JoplinContentScripts'; +import JoplinClipboard from './JoplinClipboard'; +import JoplinWindow from './JoplinWindow'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -33,8 +35,12 @@ export default class Joplin { private interop_; private settings_; private contentScripts_; + private clipboard_; + private window_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; + get clipboard(): JoplinClipboard; + get window(): JoplinWindow; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; get contentScripts(): JoplinContentScripts; diff --git a/packages/app-cli/tests/support/plugins/selected_text/api/JoplinClipboard.d.ts b/packages/app-cli/tests/support/plugins/selected_text/api/JoplinClipboard.d.ts new file mode 100644 index 000000000..3abc4e9df --- /dev/null +++ b/packages/app-cli/tests/support/plugins/selected_text/api/JoplinClipboard.d.ts @@ -0,0 +1,23 @@ +export default class JoplinClipboard { + private electronClipboard_; + private electronNativeImage_; + constructor(electronClipboard: any, electronNativeImage: any); + readText(): Promise; + writeText(text: string): Promise; + readHtml(): Promise; + writeHtml(html: string): Promise; + /** + * Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + readImage(): Promise; + /** + * Takes an image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + writeImage(dataUrl: string): Promise; + /** + * Returns the list available formats (mime types). + * + * For example [ 'text/plain', 'text/html' ] + */ + availableFormats(): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/selected_text/api/JoplinViewsDialogs.d.ts b/packages/app-cli/tests/support/plugins/selected_text/api/JoplinViewsDialogs.d.ts index 043d488ea..f1643a01d 100644 --- a/packages/app-cli/tests/support/plugins/selected_text/api/JoplinViewsDialogs.d.ts +++ b/packages/app-cli/tests/support/plugins/selected_text/api/JoplinViewsDialogs.d.ts @@ -2,7 +2,7 @@ import Plugin from '../Plugin'; import { ButtonSpec, ViewHandle, DialogResult } from './types'; /** * Allows creating and managing dialogs. A dialog is modal window that - * contains a webview and a row of buttons. You can update the update the + * contains a webview and a row of buttons. You can update the * webview using the `setHtml` method. Dialogs are hidden by default and * you need to call `open()` to open them. Once the user clicks on a * button, the `open` call will return an object indicating what button was @@ -59,4 +59,11 @@ export default class JoplinViewsDialogs { * Opens the dialog */ open(handle: ViewHandle): Promise; + /** + * Toggle on whether to fit the dialog size to the content or not. + * When set to false, the dialog stretches to fill the application + * window. + * @default true + */ + setFitToContent(handle: ViewHandle, status: boolean): Promise; } diff --git a/packages/app-cli/tests/support/plugins/selected_text/api/JoplinWindow.d.ts b/packages/app-cli/tests/support/plugins/selected_text/api/JoplinWindow.d.ts new file mode 100644 index 000000000..231c55c3d --- /dev/null +++ b/packages/app-cli/tests/support/plugins/selected_text/api/JoplinWindow.d.ts @@ -0,0 +1,24 @@ +import Plugin from '../Plugin'; +export interface Implementation { + injectCustomStyles(elementId: string, cssFilePath: string): Promise; +} +export default class JoplinWindow { + private plugin_; + private store_; + private implementation_; + constructor(implementation: Implementation, plugin: Plugin, store: any); + /** + * Loads a chrome CSS file. It will apply to the window UI elements, except + * for the note viewer. It is the same as the "Custom stylesheet for + * Joplin-wide app styles" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadChromeCssFile(filePath: string): Promise; + /** + * Loads a note CSS file. It will apply to the note viewer, as well as any + * exported or printed note. It is the same as the "Custom stylesheet for + * rendered Markdown" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadNoteCssFile(filePath: string): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/selected_text/api/types.ts b/packages/app-cli/tests/support/plugins/selected_text/api/types.ts index 9c4aa7332..e0b2d96c0 100644 --- a/packages/app-cli/tests/support/plugins/selected_text/api/types.ts +++ b/packages/app-cli/tests/support/plugins/selected_text/api/types.ts @@ -334,6 +334,17 @@ export enum SettingItemType { Button = 6, } +export enum AppType { + Desktop = 'desktop', + Mobile = 'mobile', + Cli = 'cli', +} + +export enum SettingStorage { + Database = 1, + File = 2, +} + // Redefine a simplified interface to mask internal details // and to remove function calls as they would have to be async. export interface SettingItem { @@ -372,7 +383,7 @@ export interface SettingItem { /** * Reserved property. Not used at the moment. */ - appTypes?: string[]; + appTypes?: AppType[]; /** * Set this to `true` to store secure data, such as passwords. Any such @@ -393,6 +404,11 @@ export interface SettingItem { minimum?: number; maximum?: number; step?: number; + + /** + * Either store the setting in the database or in settings.json. Defaults to database. + */ + storage?: SettingStorage; } export interface SettingSection { @@ -419,7 +435,7 @@ export type Path = string[]; // Content Script types // ================================================================= -export type PostMessageHandler = (id: string, message: any)=> Promise; +export type PostMessageHandler = (message: any)=> Promise; /** * When a content script is initialised, it receives a `context` object. diff --git a/packages/app-cli/tests/support/plugins/settings/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/settings/api/Joplin.d.ts index e30586e68..09d856e37 100644 --- a/packages/app-cli/tests/support/plugins/settings/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/settings/api/Joplin.d.ts @@ -8,6 +8,8 @@ import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; import JoplinContentScripts from './JoplinContentScripts'; +import JoplinClipboard from './JoplinClipboard'; +import JoplinWindow from './JoplinWindow'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -33,8 +35,12 @@ export default class Joplin { private interop_; private settings_; private contentScripts_; + private clipboard_; + private window_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; + get clipboard(): JoplinClipboard; + get window(): JoplinWindow; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; get contentScripts(): JoplinContentScripts; diff --git a/packages/app-cli/tests/support/plugins/settings/api/JoplinClipboard.d.ts b/packages/app-cli/tests/support/plugins/settings/api/JoplinClipboard.d.ts new file mode 100644 index 000000000..3abc4e9df --- /dev/null +++ b/packages/app-cli/tests/support/plugins/settings/api/JoplinClipboard.d.ts @@ -0,0 +1,23 @@ +export default class JoplinClipboard { + private electronClipboard_; + private electronNativeImage_; + constructor(electronClipboard: any, electronNativeImage: any); + readText(): Promise; + writeText(text: string): Promise; + readHtml(): Promise; + writeHtml(html: string): Promise; + /** + * Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + readImage(): Promise; + /** + * Takes an image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + writeImage(dataUrl: string): Promise; + /** + * Returns the list available formats (mime types). + * + * For example [ 'text/plain', 'text/html' ] + */ + availableFormats(): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/settings/api/JoplinViewsDialogs.d.ts b/packages/app-cli/tests/support/plugins/settings/api/JoplinViewsDialogs.d.ts index 043d488ea..f1643a01d 100644 --- a/packages/app-cli/tests/support/plugins/settings/api/JoplinViewsDialogs.d.ts +++ b/packages/app-cli/tests/support/plugins/settings/api/JoplinViewsDialogs.d.ts @@ -2,7 +2,7 @@ import Plugin from '../Plugin'; import { ButtonSpec, ViewHandle, DialogResult } from './types'; /** * Allows creating and managing dialogs. A dialog is modal window that - * contains a webview and a row of buttons. You can update the update the + * contains a webview and a row of buttons. You can update the * webview using the `setHtml` method. Dialogs are hidden by default and * you need to call `open()` to open them. Once the user clicks on a * button, the `open` call will return an object indicating what button was @@ -59,4 +59,11 @@ export default class JoplinViewsDialogs { * Opens the dialog */ open(handle: ViewHandle): Promise; + /** + * Toggle on whether to fit the dialog size to the content or not. + * When set to false, the dialog stretches to fill the application + * window. + * @default true + */ + setFitToContent(handle: ViewHandle, status: boolean): Promise; } diff --git a/packages/app-cli/tests/support/plugins/settings/api/JoplinWindow.d.ts b/packages/app-cli/tests/support/plugins/settings/api/JoplinWindow.d.ts new file mode 100644 index 000000000..231c55c3d --- /dev/null +++ b/packages/app-cli/tests/support/plugins/settings/api/JoplinWindow.d.ts @@ -0,0 +1,24 @@ +import Plugin from '../Plugin'; +export interface Implementation { + injectCustomStyles(elementId: string, cssFilePath: string): Promise; +} +export default class JoplinWindow { + private plugin_; + private store_; + private implementation_; + constructor(implementation: Implementation, plugin: Plugin, store: any); + /** + * Loads a chrome CSS file. It will apply to the window UI elements, except + * for the note viewer. It is the same as the "Custom stylesheet for + * Joplin-wide app styles" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadChromeCssFile(filePath: string): Promise; + /** + * Loads a note CSS file. It will apply to the note viewer, as well as any + * exported or printed note. It is the same as the "Custom stylesheet for + * rendered Markdown" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadNoteCssFile(filePath: string): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/settings/api/types.ts b/packages/app-cli/tests/support/plugins/settings/api/types.ts index 9c4aa7332..e0b2d96c0 100644 --- a/packages/app-cli/tests/support/plugins/settings/api/types.ts +++ b/packages/app-cli/tests/support/plugins/settings/api/types.ts @@ -334,6 +334,17 @@ export enum SettingItemType { Button = 6, } +export enum AppType { + Desktop = 'desktop', + Mobile = 'mobile', + Cli = 'cli', +} + +export enum SettingStorage { + Database = 1, + File = 2, +} + // Redefine a simplified interface to mask internal details // and to remove function calls as they would have to be async. export interface SettingItem { @@ -372,7 +383,7 @@ export interface SettingItem { /** * Reserved property. Not used at the moment. */ - appTypes?: string[]; + appTypes?: AppType[]; /** * Set this to `true` to store secure data, such as passwords. Any such @@ -393,6 +404,11 @@ export interface SettingItem { minimum?: number; maximum?: number; step?: number; + + /** + * Either store the setting in the database or in settings.json. Defaults to database. + */ + storage?: SettingStorage; } export interface SettingSection { @@ -419,7 +435,7 @@ export type Path = string[]; // Content Script types // ================================================================= -export type PostMessageHandler = (id: string, message: any)=> Promise; +export type PostMessageHandler = (message: any)=> Promise; /** * When a content script is initialised, it receives a `context` object. diff --git a/packages/app-cli/tests/support/plugins/toc/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/toc/api/Joplin.d.ts index e30586e68..09d856e37 100644 --- a/packages/app-cli/tests/support/plugins/toc/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/toc/api/Joplin.d.ts @@ -8,6 +8,8 @@ import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; import JoplinContentScripts from './JoplinContentScripts'; +import JoplinClipboard from './JoplinClipboard'; +import JoplinWindow from './JoplinWindow'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -33,8 +35,12 @@ export default class Joplin { private interop_; private settings_; private contentScripts_; + private clipboard_; + private window_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; + get clipboard(): JoplinClipboard; + get window(): JoplinWindow; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; get contentScripts(): JoplinContentScripts; diff --git a/packages/app-cli/tests/support/plugins/toc/api/JoplinClipboard.d.ts b/packages/app-cli/tests/support/plugins/toc/api/JoplinClipboard.d.ts new file mode 100644 index 000000000..3abc4e9df --- /dev/null +++ b/packages/app-cli/tests/support/plugins/toc/api/JoplinClipboard.d.ts @@ -0,0 +1,23 @@ +export default class JoplinClipboard { + private electronClipboard_; + private electronNativeImage_; + constructor(electronClipboard: any, electronNativeImage: any); + readText(): Promise; + writeText(text: string): Promise; + readHtml(): Promise; + writeHtml(html: string): Promise; + /** + * Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + readImage(): Promise; + /** + * Takes an image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + writeImage(dataUrl: string): Promise; + /** + * Returns the list available formats (mime types). + * + * For example [ 'text/plain', 'text/html' ] + */ + availableFormats(): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/toc/api/JoplinViewsDialogs.d.ts b/packages/app-cli/tests/support/plugins/toc/api/JoplinViewsDialogs.d.ts index 043d488ea..f1643a01d 100644 --- a/packages/app-cli/tests/support/plugins/toc/api/JoplinViewsDialogs.d.ts +++ b/packages/app-cli/tests/support/plugins/toc/api/JoplinViewsDialogs.d.ts @@ -2,7 +2,7 @@ import Plugin from '../Plugin'; import { ButtonSpec, ViewHandle, DialogResult } from './types'; /** * Allows creating and managing dialogs. A dialog is modal window that - * contains a webview and a row of buttons. You can update the update the + * contains a webview and a row of buttons. You can update the * webview using the `setHtml` method. Dialogs are hidden by default and * you need to call `open()` to open them. Once the user clicks on a * button, the `open` call will return an object indicating what button was @@ -59,4 +59,11 @@ export default class JoplinViewsDialogs { * Opens the dialog */ open(handle: ViewHandle): Promise; + /** + * Toggle on whether to fit the dialog size to the content or not. + * When set to false, the dialog stretches to fill the application + * window. + * @default true + */ + setFitToContent(handle: ViewHandle, status: boolean): Promise; } diff --git a/packages/app-cli/tests/support/plugins/toc/api/JoplinWindow.d.ts b/packages/app-cli/tests/support/plugins/toc/api/JoplinWindow.d.ts new file mode 100644 index 000000000..231c55c3d --- /dev/null +++ b/packages/app-cli/tests/support/plugins/toc/api/JoplinWindow.d.ts @@ -0,0 +1,24 @@ +import Plugin from '../Plugin'; +export interface Implementation { + injectCustomStyles(elementId: string, cssFilePath: string): Promise; +} +export default class JoplinWindow { + private plugin_; + private store_; + private implementation_; + constructor(implementation: Implementation, plugin: Plugin, store: any); + /** + * Loads a chrome CSS file. It will apply to the window UI elements, except + * for the note viewer. It is the same as the "Custom stylesheet for + * Joplin-wide app styles" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadChromeCssFile(filePath: string): Promise; + /** + * Loads a note CSS file. It will apply to the note viewer, as well as any + * exported or printed note. It is the same as the "Custom stylesheet for + * rendered Markdown" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadNoteCssFile(filePath: string): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/toc/api/types.ts b/packages/app-cli/tests/support/plugins/toc/api/types.ts index 9c4aa7332..e0b2d96c0 100644 --- a/packages/app-cli/tests/support/plugins/toc/api/types.ts +++ b/packages/app-cli/tests/support/plugins/toc/api/types.ts @@ -334,6 +334,17 @@ export enum SettingItemType { Button = 6, } +export enum AppType { + Desktop = 'desktop', + Mobile = 'mobile', + Cli = 'cli', +} + +export enum SettingStorage { + Database = 1, + File = 2, +} + // Redefine a simplified interface to mask internal details // and to remove function calls as they would have to be async. export interface SettingItem { @@ -372,7 +383,7 @@ export interface SettingItem { /** * Reserved property. Not used at the moment. */ - appTypes?: string[]; + appTypes?: AppType[]; /** * Set this to `true` to store secure data, such as passwords. Any such @@ -393,6 +404,11 @@ export interface SettingItem { minimum?: number; maximum?: number; step?: number; + + /** + * Either store the setting in the database or in settings.json. Defaults to database. + */ + storage?: SettingStorage; } export interface SettingSection { @@ -419,7 +435,7 @@ export type Path = string[]; // Content Script types // ================================================================= -export type PostMessageHandler = (id: string, message: any)=> Promise; +export type PostMessageHandler = (message: any)=> Promise; /** * When a content script is initialised, it receives a `context` object. diff --git a/packages/app-cli/tests/support/plugins/withExternalModules/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/withExternalModules/api/Joplin.d.ts index e30586e68..09d856e37 100644 --- a/packages/app-cli/tests/support/plugins/withExternalModules/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/withExternalModules/api/Joplin.d.ts @@ -8,6 +8,8 @@ import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; import JoplinContentScripts from './JoplinContentScripts'; +import JoplinClipboard from './JoplinClipboard'; +import JoplinWindow from './JoplinWindow'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -33,8 +35,12 @@ export default class Joplin { private interop_; private settings_; private contentScripts_; + private clipboard_; + private window_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; + get clipboard(): JoplinClipboard; + get window(): JoplinWindow; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; get contentScripts(): JoplinContentScripts; diff --git a/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinClipboard.d.ts b/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinClipboard.d.ts new file mode 100644 index 000000000..3abc4e9df --- /dev/null +++ b/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinClipboard.d.ts @@ -0,0 +1,23 @@ +export default class JoplinClipboard { + private electronClipboard_; + private electronNativeImage_; + constructor(electronClipboard: any, electronNativeImage: any); + readText(): Promise; + writeText(text: string): Promise; + readHtml(): Promise; + writeHtml(html: string): Promise; + /** + * Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + readImage(): Promise; + /** + * Takes an image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + writeImage(dataUrl: string): Promise; + /** + * Returns the list available formats (mime types). + * + * For example [ 'text/plain', 'text/html' ] + */ + availableFormats(): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinViewsDialogs.d.ts b/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinViewsDialogs.d.ts index 043d488ea..f1643a01d 100644 --- a/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinViewsDialogs.d.ts +++ b/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinViewsDialogs.d.ts @@ -2,7 +2,7 @@ import Plugin from '../Plugin'; import { ButtonSpec, ViewHandle, DialogResult } from './types'; /** * Allows creating and managing dialogs. A dialog is modal window that - * contains a webview and a row of buttons. You can update the update the + * contains a webview and a row of buttons. You can update the * webview using the `setHtml` method. Dialogs are hidden by default and * you need to call `open()` to open them. Once the user clicks on a * button, the `open` call will return an object indicating what button was @@ -59,4 +59,11 @@ export default class JoplinViewsDialogs { * Opens the dialog */ open(handle: ViewHandle): Promise; + /** + * Toggle on whether to fit the dialog size to the content or not. + * When set to false, the dialog stretches to fill the application + * window. + * @default true + */ + setFitToContent(handle: ViewHandle, status: boolean): Promise; } diff --git a/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinWindow.d.ts b/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinWindow.d.ts new file mode 100644 index 000000000..231c55c3d --- /dev/null +++ b/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinWindow.d.ts @@ -0,0 +1,24 @@ +import Plugin from '../Plugin'; +export interface Implementation { + injectCustomStyles(elementId: string, cssFilePath: string): Promise; +} +export default class JoplinWindow { + private plugin_; + private store_; + private implementation_; + constructor(implementation: Implementation, plugin: Plugin, store: any); + /** + * Loads a chrome CSS file. It will apply to the window UI elements, except + * for the note viewer. It is the same as the "Custom stylesheet for + * Joplin-wide app styles" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadChromeCssFile(filePath: string): Promise; + /** + * Loads a note CSS file. It will apply to the note viewer, as well as any + * exported or printed note. It is the same as the "Custom stylesheet for + * rendered Markdown" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadNoteCssFile(filePath: string): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/withExternalModules/api/types.ts b/packages/app-cli/tests/support/plugins/withExternalModules/api/types.ts index 9c4aa7332..e0b2d96c0 100644 --- a/packages/app-cli/tests/support/plugins/withExternalModules/api/types.ts +++ b/packages/app-cli/tests/support/plugins/withExternalModules/api/types.ts @@ -334,6 +334,17 @@ export enum SettingItemType { Button = 6, } +export enum AppType { + Desktop = 'desktop', + Mobile = 'mobile', + Cli = 'cli', +} + +export enum SettingStorage { + Database = 1, + File = 2, +} + // Redefine a simplified interface to mask internal details // and to remove function calls as they would have to be async. export interface SettingItem { @@ -372,7 +383,7 @@ export interface SettingItem { /** * Reserved property. Not used at the moment. */ - appTypes?: string[]; + appTypes?: AppType[]; /** * Set this to `true` to store secure data, such as passwords. Any such @@ -393,6 +404,11 @@ export interface SettingItem { minimum?: number; maximum?: number; step?: number; + + /** + * Either store the setting in the database or in settings.json. Defaults to database. + */ + storage?: SettingStorage; } export interface SettingSection { @@ -419,7 +435,7 @@ export type Path = string[]; // Content Script types // ================================================================= -export type PostMessageHandler = (id: string, message: any)=> Promise; +export type PostMessageHandler = (message: any)=> Promise; /** * When a content script is initialised, it receives a `context` object. diff --git a/packages/generator-joplin/generators/app/templates/api/Joplin.d.ts b/packages/generator-joplin/generators/app/templates/api/Joplin.d.ts index e30586e68..09d856e37 100644 --- a/packages/generator-joplin/generators/app/templates/api/Joplin.d.ts +++ b/packages/generator-joplin/generators/app/templates/api/Joplin.d.ts @@ -8,6 +8,8 @@ import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; import JoplinContentScripts from './JoplinContentScripts'; +import JoplinClipboard from './JoplinClipboard'; +import JoplinWindow from './JoplinWindow'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -33,8 +35,12 @@ export default class Joplin { private interop_; private settings_; private contentScripts_; + private clipboard_; + private window_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; + get clipboard(): JoplinClipboard; + get window(): JoplinWindow; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; get contentScripts(): JoplinContentScripts; diff --git a/packages/generator-joplin/generators/app/templates/api/JoplinClipboard.d.ts b/packages/generator-joplin/generators/app/templates/api/JoplinClipboard.d.ts new file mode 100644 index 000000000..3abc4e9df --- /dev/null +++ b/packages/generator-joplin/generators/app/templates/api/JoplinClipboard.d.ts @@ -0,0 +1,23 @@ +export default class JoplinClipboard { + private electronClipboard_; + private electronNativeImage_; + constructor(electronClipboard: any, electronNativeImage: any); + readText(): Promise; + writeText(text: string): Promise; + readHtml(): Promise; + writeHtml(html: string): Promise; + /** + * Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + readImage(): Promise; + /** + * Takes an image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format. + */ + writeImage(dataUrl: string): Promise; + /** + * Returns the list available formats (mime types). + * + * For example [ 'text/plain', 'text/html' ] + */ + availableFormats(): Promise; +} diff --git a/packages/generator-joplin/generators/app/templates/api/JoplinViewsDialogs.d.ts b/packages/generator-joplin/generators/app/templates/api/JoplinViewsDialogs.d.ts index 043d488ea..f1643a01d 100644 --- a/packages/generator-joplin/generators/app/templates/api/JoplinViewsDialogs.d.ts +++ b/packages/generator-joplin/generators/app/templates/api/JoplinViewsDialogs.d.ts @@ -2,7 +2,7 @@ import Plugin from '../Plugin'; import { ButtonSpec, ViewHandle, DialogResult } from './types'; /** * Allows creating and managing dialogs. A dialog is modal window that - * contains a webview and a row of buttons. You can update the update the + * contains a webview and a row of buttons. You can update the * webview using the `setHtml` method. Dialogs are hidden by default and * you need to call `open()` to open them. Once the user clicks on a * button, the `open` call will return an object indicating what button was @@ -59,4 +59,11 @@ export default class JoplinViewsDialogs { * Opens the dialog */ open(handle: ViewHandle): Promise; + /** + * Toggle on whether to fit the dialog size to the content or not. + * When set to false, the dialog stretches to fill the application + * window. + * @default true + */ + setFitToContent(handle: ViewHandle, status: boolean): Promise; } diff --git a/packages/generator-joplin/generators/app/templates/api/JoplinWindow.d.ts b/packages/generator-joplin/generators/app/templates/api/JoplinWindow.d.ts new file mode 100644 index 000000000..231c55c3d --- /dev/null +++ b/packages/generator-joplin/generators/app/templates/api/JoplinWindow.d.ts @@ -0,0 +1,24 @@ +import Plugin from '../Plugin'; +export interface Implementation { + injectCustomStyles(elementId: string, cssFilePath: string): Promise; +} +export default class JoplinWindow { + private plugin_; + private store_; + private implementation_; + constructor(implementation: Implementation, plugin: Plugin, store: any); + /** + * Loads a chrome CSS file. It will apply to the window UI elements, except + * for the note viewer. It is the same as the "Custom stylesheet for + * Joplin-wide app styles" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadChromeCssFile(filePath: string): Promise; + /** + * Loads a note CSS file. It will apply to the note viewer, as well as any + * exported or printed note. It is the same as the "Custom stylesheet for + * rendered Markdown" setting. See the [Load CSS Demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/load_css) + * for an example. + */ + loadNoteCssFile(filePath: string): Promise; +} diff --git a/packages/generator-joplin/generators/app/templates/api/types.ts b/packages/generator-joplin/generators/app/templates/api/types.ts index 9c4aa7332..e0b2d96c0 100644 --- a/packages/generator-joplin/generators/app/templates/api/types.ts +++ b/packages/generator-joplin/generators/app/templates/api/types.ts @@ -334,6 +334,17 @@ export enum SettingItemType { Button = 6, } +export enum AppType { + Desktop = 'desktop', + Mobile = 'mobile', + Cli = 'cli', +} + +export enum SettingStorage { + Database = 1, + File = 2, +} + // Redefine a simplified interface to mask internal details // and to remove function calls as they would have to be async. export interface SettingItem { @@ -372,7 +383,7 @@ export interface SettingItem { /** * Reserved property. Not used at the moment. */ - appTypes?: string[]; + appTypes?: AppType[]; /** * Set this to `true` to store secure data, such as passwords. Any such @@ -393,6 +404,11 @@ export interface SettingItem { minimum?: number; maximum?: number; step?: number; + + /** + * Either store the setting in the database or in settings.json. Defaults to database. + */ + storage?: SettingStorage; } export interface SettingSection { @@ -419,7 +435,7 @@ export type Path = string[]; // Content Script types // ================================================================= -export type PostMessageHandler = (id: string, message: any)=> Promise; +export type PostMessageHandler = (message: any)=> Promise; /** * When a content script is initialised, it receives a `context` object. diff --git a/packages/generator-joplin/package-lock.json b/packages/generator-joplin/package-lock.json index a4d5bff63..ed3669556 100644 --- a/packages/generator-joplin/package-lock.json +++ b/packages/generator-joplin/package-lock.json @@ -1,6 +1,6 @@ { "name": "generator-joplin", - "version": "2.0.1", + "version": "2.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { From eef6530c9571548d4efdc086d7ee83fc73300199 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Tue, 10 Aug 2021 11:35:34 +0100 Subject: [PATCH 5/6] Plugin Generator release v2.2.1 --- packages/generator-joplin/package-lock.json | 2 +- packages/generator-joplin/package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/generator-joplin/package-lock.json b/packages/generator-joplin/package-lock.json index ed3669556..e755cbd68 100644 --- a/packages/generator-joplin/package-lock.json +++ b/packages/generator-joplin/package-lock.json @@ -1,6 +1,6 @@ { "name": "generator-joplin", - "version": "2.2.0", + "version": "2.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/generator-joplin/package.json b/packages/generator-joplin/package.json index 80671beca..6b08c194e 100644 --- a/packages/generator-joplin/package.json +++ b/packages/generator-joplin/package.json @@ -1,6 +1,6 @@ { "name": "generator-joplin", - "version": "2.2.0", + "version": "2.2.1", "description": "Scaffolds out a new Joplin plugin", "homepage": "https://github.com/laurent22/joplin/tree/dev/packages/generator-joplin", "author": { @@ -34,4 +34,4 @@ "repository": "https://github.com/laurent22/generator-joplin", "license": "MIT", "private": true -} +} \ No newline at end of file From c3263a132f2b65b29ffc4567172061aaf30f603d Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Tue, 10 Aug 2021 11:56:58 +0100 Subject: [PATCH 6/6] ios-v12.2.1 --- .../ios/Joplin.xcodeproj/project.pbxproj | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/app-mobile/ios/Joplin.xcodeproj/project.pbxproj b/packages/app-mobile/ios/Joplin.xcodeproj/project.pbxproj index 57944e719..bbee9a165 100644 --- a/packages/app-mobile/ios/Joplin.xcodeproj/project.pbxproj +++ b/packages/app-mobile/ios/Joplin.xcodeproj/project.pbxproj @@ -505,13 +505,13 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Joplin/Joplin.entitlements; - CURRENT_PROJECT_VERSION = 70; + CURRENT_PROJECT_VERSION = 71; DEVELOPMENT_TEAM = A9BXAFS6CT; ENABLE_BITCODE = NO; INFOPLIST_FILE = Joplin/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 12.2.0; + MARKETING_VERSION = 12.2.1; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -533,12 +533,12 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Joplin/Joplin.entitlements; - CURRENT_PROJECT_VERSION = 70; + CURRENT_PROJECT_VERSION = 71; DEVELOPMENT_TEAM = A9BXAFS6CT; INFOPLIST_FILE = Joplin/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 12.2.0; + MARKETING_VERSION = 12.2.1; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -678,14 +678,14 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 70; + CURRENT_PROJECT_VERSION = 71; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = A9BXAFS6CT; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = ShareExtension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; - MARKETING_VERSION = 12.2.0; + MARKETING_VERSION = 12.2.1; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = net.cozic.joplin.ShareExtension; @@ -709,14 +709,14 @@ CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 70; + CURRENT_PROJECT_VERSION = 71; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = A9BXAFS6CT; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = ShareExtension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; - MARKETING_VERSION = 12.2.0; + MARKETING_VERSION = 12.2.1; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = net.cozic.joplin.ShareExtension; PRODUCT_NAME = "$(TARGET_NAME)";