You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-08-27 20:29:45 +02:00
Compare commits
91 Commits
android-v2
...
cli-v2.3.2
Author | SHA1 | Date | |
---|---|---|---|
|
0aaf888aa5 | ||
|
8c93a89c0a | ||
|
bee6001462 | ||
|
dc192fb4c1 | ||
|
3abebe6a32 | ||
|
2011369c83 | ||
|
2a732ba03d | ||
|
7b2c271070 | ||
|
9783f57f75 | ||
|
e0971baec4 | ||
|
c7421dfbe1 | ||
|
543413d64b | ||
|
2c79ce25fa | ||
|
c8ccab808f | ||
|
d27f3b6ad3 | ||
|
c8dad95c38 | ||
|
8646d8240b | ||
|
8063c94ff7 | ||
|
6ae5ccb638 | ||
|
30a23ea118 | ||
|
a9961ae3ec | ||
|
d42d17e1ed | ||
|
60ef24a3f7 | ||
|
f518549cfe | ||
|
d0ffc03ccc | ||
|
32c8cc9030 | ||
|
d42d181f31 | ||
|
48f23f1ee7 | ||
|
58efe1c87f | ||
|
1478c368c5 | ||
|
feda5afe44 | ||
|
c96ec36d0d | ||
|
e57e5d3b3f | ||
|
6ce19ed680 | ||
|
d0251400a4 | ||
|
f0ad813f40 | ||
|
f07636e4b7 | ||
|
11cf8474f7 | ||
|
77a8ab8125 | ||
|
3309f42fb6 | ||
|
bd907ddeb2 | ||
|
b6d9392798 | ||
|
f7e90490e9 | ||
|
14bf50fdc9 | ||
|
385e1270af | ||
|
97726b02e6 | ||
|
81b440737d | ||
|
dcd5a8d975 | ||
|
ba3cbfa051 | ||
|
9c37a3e5e4 | ||
|
98d6aff275 | ||
|
7f1de8df30 | ||
|
5b1a970044 | ||
|
aeb8b31b86 | ||
|
c615b4245b | ||
|
b5f148c33a | ||
|
3a22674c03 | ||
|
34d6742563 | ||
|
252d65ebe1 | ||
|
9ae2f07bd3 | ||
|
15766d18f5 | ||
|
a6030a40fa | ||
|
ca6d8ec1fa | ||
|
8108af4e74 | ||
|
5526e5ca71 | ||
|
6d1a2e2e1d | ||
|
70cdaa3a22 | ||
|
6927335330 | ||
|
94232b667d | ||
|
bef6fb8168 | ||
|
77cdd3467d | ||
|
4b5318c6d0 | ||
|
d8626919e0 | ||
|
6ed186a471 | ||
|
a3b37ca59d | ||
|
895dd813df | ||
|
b90ec3af1e | ||
|
2ccbc87435 | ||
|
d6eedc88c5 | ||
|
11bd3d9e1f | ||
|
c3263a132f | ||
|
eef6530c95 | ||
|
bac0d68156 | ||
|
97349ceb6a | ||
|
f2351cbf32 | ||
|
37ade59fca | ||
|
6359c9ca98 | ||
|
afb7e1a157 | ||
|
212dacdfbe | ||
|
34d3e8f027 | ||
|
2d7c8c599a |
@@ -7,4 +7,6 @@ packages/app-cli
|
||||
packages/app-mobile
|
||||
packages/app-clipper
|
||||
packages/generator-joplin
|
||||
packages/plugin-repo-cli
|
||||
packages/plugin-repo-cli
|
||||
packages/server/db-*.sqlite
|
||||
packages/server/temp
|
||||
|
@@ -978,6 +978,9 @@ packages/lib/models/ItemChange.js.map
|
||||
packages/lib/models/MasterKey.d.ts
|
||||
packages/lib/models/MasterKey.js
|
||||
packages/lib/models/MasterKey.js.map
|
||||
packages/lib/models/MasterKey.test.d.ts
|
||||
packages/lib/models/MasterKey.test.js
|
||||
packages/lib/models/MasterKey.test.js.map
|
||||
packages/lib/models/Migration.d.ts
|
||||
packages/lib/models/Migration.js
|
||||
packages/lib/models/Migration.js.map
|
||||
@@ -1173,6 +1176,9 @@ packages/lib/services/database/types.js.map
|
||||
packages/lib/services/debug/populateDatabase.d.ts
|
||||
packages/lib/services/debug/populateDatabase.js
|
||||
packages/lib/services/debug/populateDatabase.js.map
|
||||
packages/lib/services/e2ee/utils.d.ts
|
||||
packages/lib/services/e2ee/utils.js
|
||||
packages/lib/services/e2ee/utils.js.map
|
||||
packages/lib/services/interop/InteropService.d.ts
|
||||
packages/lib/services/interop/InteropService.js
|
||||
packages/lib/services/interop/InteropService.js.map
|
||||
@@ -1500,6 +1506,12 @@ packages/lib/services/synchronizer/migrations/1.js.map
|
||||
packages/lib/services/synchronizer/migrations/2.d.ts
|
||||
packages/lib/services/synchronizer/migrations/2.js
|
||||
packages/lib/services/synchronizer/migrations/2.js.map
|
||||
packages/lib/services/synchronizer/migrations/3.d.ts
|
||||
packages/lib/services/synchronizer/migrations/3.js
|
||||
packages/lib/services/synchronizer/migrations/3.js.map
|
||||
packages/lib/services/synchronizer/syncInfoUtils.d.ts
|
||||
packages/lib/services/synchronizer/syncInfoUtils.js
|
||||
packages/lib/services/synchronizer/syncInfoUtils.js.map
|
||||
packages/lib/services/synchronizer/synchronizer_LockHandler.test.d.ts
|
||||
packages/lib/services/synchronizer/synchronizer_LockHandler.test.js
|
||||
packages/lib/services/synchronizer/synchronizer_LockHandler.test.js.map
|
||||
@@ -1719,6 +1731,9 @@ packages/tools/release-ios.js.map
|
||||
packages/tools/release-server.d.ts
|
||||
packages/tools/release-server.js
|
||||
packages/tools/release-server.js.map
|
||||
packages/tools/setupNewRelease.d.ts
|
||||
packages/tools/setupNewRelease.js
|
||||
packages/tools/setupNewRelease.js.map
|
||||
packages/tools/tool-utils.d.ts
|
||||
packages/tools/tool-utils.js
|
||||
packages/tools/tool-utils.js.map
|
||||
|
2
.github/scripts/run_ci.sh
vendored
2
.github/scripts/run_ci.sh
vendored
@@ -134,7 +134,7 @@ if [[ $GIT_TAG_NAME = v* ]]; then
|
||||
elif [[ $GIT_TAG_NAME = server-v* ]] && [[ $IS_LINUX = 1 ]]; then
|
||||
echo "Step: Building Docker Image..."
|
||||
cd "$ROOT_DIR"
|
||||
npm run buildServerDocker -- --tag-name $GIT_TAG_NAME
|
||||
npm run buildServerDocker -- --tag-name $GIT_TAG_NAME --push-images
|
||||
else
|
||||
echo "Step: Building but *not* publishing desktop application..."
|
||||
USE_HARD_LINKS=false npm run dist -- --publish=never
|
||||
|
2
.github/workflows/github-actions-main.yml
vendored
2
.github/workflows/github-actions-main.yml
vendored
@@ -39,7 +39,7 @@ jobs:
|
||||
- uses: olegtarasov/get-tag@v2.1
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '12'
|
||||
node-version: '16'
|
||||
|
||||
# Login to Docker only if we're on a server release tag. If we run this on
|
||||
# a pull request it will fail because the PR doesn't have access to
|
||||
|
15
.gitignore
vendored
15
.gitignore
vendored
@@ -963,6 +963,9 @@ packages/lib/models/ItemChange.js.map
|
||||
packages/lib/models/MasterKey.d.ts
|
||||
packages/lib/models/MasterKey.js
|
||||
packages/lib/models/MasterKey.js.map
|
||||
packages/lib/models/MasterKey.test.d.ts
|
||||
packages/lib/models/MasterKey.test.js
|
||||
packages/lib/models/MasterKey.test.js.map
|
||||
packages/lib/models/Migration.d.ts
|
||||
packages/lib/models/Migration.js
|
||||
packages/lib/models/Migration.js.map
|
||||
@@ -1158,6 +1161,9 @@ packages/lib/services/database/types.js.map
|
||||
packages/lib/services/debug/populateDatabase.d.ts
|
||||
packages/lib/services/debug/populateDatabase.js
|
||||
packages/lib/services/debug/populateDatabase.js.map
|
||||
packages/lib/services/e2ee/utils.d.ts
|
||||
packages/lib/services/e2ee/utils.js
|
||||
packages/lib/services/e2ee/utils.js.map
|
||||
packages/lib/services/interop/InteropService.d.ts
|
||||
packages/lib/services/interop/InteropService.js
|
||||
packages/lib/services/interop/InteropService.js.map
|
||||
@@ -1485,6 +1491,12 @@ packages/lib/services/synchronizer/migrations/1.js.map
|
||||
packages/lib/services/synchronizer/migrations/2.d.ts
|
||||
packages/lib/services/synchronizer/migrations/2.js
|
||||
packages/lib/services/synchronizer/migrations/2.js.map
|
||||
packages/lib/services/synchronizer/migrations/3.d.ts
|
||||
packages/lib/services/synchronizer/migrations/3.js
|
||||
packages/lib/services/synchronizer/migrations/3.js.map
|
||||
packages/lib/services/synchronizer/syncInfoUtils.d.ts
|
||||
packages/lib/services/synchronizer/syncInfoUtils.js
|
||||
packages/lib/services/synchronizer/syncInfoUtils.js.map
|
||||
packages/lib/services/synchronizer/synchronizer_LockHandler.test.d.ts
|
||||
packages/lib/services/synchronizer/synchronizer_LockHandler.test.js
|
||||
packages/lib/services/synchronizer/synchronizer_LockHandler.test.js.map
|
||||
@@ -1704,6 +1716,9 @@ packages/tools/release-ios.js.map
|
||||
packages/tools/release-server.d.ts
|
||||
packages/tools/release-server.js
|
||||
packages/tools/release-server.js.map
|
||||
packages/tools/setupNewRelease.d.ts
|
||||
packages/tools/setupNewRelease.js
|
||||
packages/tools/setupNewRelease.js.map
|
||||
packages/tools/tool-utils.d.ts
|
||||
packages/tools/tool-utils.js
|
||||
packages/tools/tool-utils.js.map
|
||||
|
@@ -113,6 +113,10 @@ blockquote {
|
||||
font-size: 16px !important;
|
||||
}
|
||||
|
||||
.button-link {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.sponsor-button i {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
@@ -287,6 +291,12 @@ p,
|
||||
/* margin-bottom: 10px; */
|
||||
}
|
||||
|
||||
div.navbar-mobile-content a.sponsor-button {
|
||||
padding: 4px 12px;
|
||||
font-size: 0.9em;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
#nav-section.white-bg a {
|
||||
color: #0557ba;
|
||||
}
|
||||
|
@@ -19,7 +19,9 @@
|
||||
{{/showJoplinCloudLinks}}
|
||||
{{> supportButton}}
|
||||
</div>
|
||||
<div class="col-9 text-right d-block d-md-none">
|
||||
<div class="col-9 text-right d-block d-md-none navbar-mobile-content">
|
||||
{{> supportButton}}
|
||||
|
||||
<span class="pointer"
|
||||
><img
|
||||
src="{{#isFrontPage}}{{imageBaseUrl}}/mobile-menu-open-icon.png{{/isFrontPage}}{{^isFrontPage}}{{imageBaseUrl}}/mobile-menu-black-open-icon.png{{/isFrontPage}}"
|
||||
|
@@ -1,10 +1,13 @@
|
||||
# https://versatile.nl/blog/deploying-lerna-web-apps-with-docker
|
||||
|
||||
FROM node:12
|
||||
FROM node:16
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get --yes install vim
|
||||
|
||||
RUN echo "Node: $(node --version)"
|
||||
RUN echo "Npm: $(npm --version)"
|
||||
|
||||
ARG user=joplin
|
||||
|
||||
RUN useradd --create-home --shell /bin/bash $user
|
||||
|
@@ -2,6 +2,17 @@
|
||||
|
||||
set -e
|
||||
|
||||
trap 'handleError' ERR
|
||||
|
||||
handleError() {
|
||||
echo ""
|
||||
echo "If you encountered an error, please consider fixing"
|
||||
echo "the script for your environment and creating a pull"
|
||||
echo "request instead of asking for support on GitHub or"
|
||||
echo "the forum. The error message above should tell you"
|
||||
echo "where and why the error happened."
|
||||
}
|
||||
|
||||
#-----------------------------------------------------
|
||||
# Variables
|
||||
#-----------------------------------------------------
|
||||
|
16
README.md
16
README.md
@@ -227,7 +227,7 @@ If the **terminal client** has been installed, it is possible to also synchronis
|
||||
|
||||
<img src="https://raw.githubusercontent.com/laurent22/joplin/dev/Assets/WebsiteAssets/images/nextcloud-logo-background.png" width="100" align="left"> <a href="https://nextcloud.com/">Nextcloud</a> is a self-hosted, private cloud solution. It can store documents, images and videos but also calendars, passwords and countless other things and can sync them to your laptop or phone. As you can host your own Nextcloud server, you own both the data on your device and infrastructure used for synchronisation. As such it is a good fit for Joplin. The platform is also well supported and with a strong community, so it is likely to be around for a while - since it's open source anyway, it is not a service that can be closed, it can exist on a server for as long as one chooses.
|
||||
|
||||
In the **desktop application** or **mobile application**, go to the Configuration screen and select Nextcloud as the synchronisation target. Then input the WebDAV URL (to get it, click on Settings in the bottom left corner of the page, in Nextcloud), this is normally `https://example.com/nextcloud/remote.php/webdav/Joplin` (**make sure to create the "Joplin" directory in Nextcloud**), and set the username and password. If it does not work, please [see this explanation](https://github.com/laurent22/joplin/issues/61#issuecomment-373282608) for more details.
|
||||
In the **desktop application** or **mobile application**, go to the [Configuration screen](https://github.com/laurent22/joplin/blob/dev/readme/config_screen.md) and select Nextcloud as the synchronisation target. Then input the WebDAV URL (to get it, click on Settings in the bottom left corner of the page, in Nextcloud), this is normally `https://example.com/nextcloud/remote.php/webdav/Joplin` (**make sure to create the "Joplin" directory in Nextcloud**), and set the username and password. If it does not work, please [see this explanation](https://github.com/laurent22/joplin/issues/61#issuecomment-373282608) for more details.
|
||||
|
||||
In the **terminal application**, you will need to set the `sync.target` config variable and all the `sync.5.path`, `sync.5.username` and `sync.5.password` config variables to, respectively the Nextcloud WebDAV URL, your username and your password. This can be done from the command line mode using:
|
||||
|
||||
@@ -261,7 +261,7 @@ WebDAV-compatible services that are known to work with Joplin:
|
||||
|
||||
When syncing with Dropbox, Joplin creates a sub-directory in Dropbox, in `/Apps/Joplin` and read/write the notes and notebooks from it. The application does not have access to anything outside this directory.
|
||||
|
||||
In the **desktop application** or **mobile application**, select "Dropbox" as the synchronisation target in the Configuration screen (it is selected by default). Then, to initiate the synchronisation process, click on the "Synchronise" button in the sidebar and follow the instructions.
|
||||
In the **desktop application** or **mobile application**, select "Dropbox" as the synchronisation target in the [Configuration screen](https://github.com/laurent22/joplin/blob/dev/readme/config_screen.md) (it is selected by default). Then, to initiate the synchronisation process, click on the "Synchronise" button in the sidebar and follow the instructions.
|
||||
|
||||
In the **terminal application**, to initiate the synchronisation process, type `:sync`. You will be asked to follow a link to authorise the application.
|
||||
|
||||
@@ -269,13 +269,13 @@ In the **terminal application**, to initiate the synchronisation process, type `
|
||||
|
||||
When syncing with OneDrive, Joplin creates a sub-directory in OneDrive, in /Apps/Joplin and read/write the notes and notebooks from it. The application does not have access to anything outside this directory.
|
||||
|
||||
In the **desktop application** or **mobile application**, select "OneDrive" as the synchronisation target in the Configuration screen. Then, to initiate the synchronisation process, click on the "Synchronise" button in the sidebar and follow the instructions.
|
||||
In the **desktop application** or **mobile application**, select "OneDrive" as the synchronisation target in the [Configuration screen](https://github.com/laurent22/joplin/blob/dev/readme/config_screen.md). Then, to initiate the synchronisation process, click on the "Synchronise" button in the sidebar and follow the instructions.
|
||||
|
||||
In the **terminal application**, to initiate the synchronisation process, type `:sync`. You will be asked to follow a link to authorise the application (simply input your Microsoft credentials - you do not need to register with OneDrive).
|
||||
|
||||
## AWS S3 synchronisation
|
||||
|
||||
In the **desktop application** or **mobile application**, select "AWS S3 (Beta)" as the synchronisation target in the Configuration screen.
|
||||
In the **desktop application** or **mobile application**, select "AWS S3 (Beta)" as the synchronisation target in the [Configuration screen](https://github.com/laurent22/joplin/blob/dev/readme/config_screen.md).
|
||||
|
||||
- **AWS S3 Bucket:** The name of your Bucket, such as `joplin-bucket`
|
||||
- **AWS S3 URL:** Fully qualified URL; By default this should be `https://s3.amazonaws.com/`
|
||||
@@ -321,7 +321,7 @@ For a more technical description, mostly relevant for development or to review t
|
||||
|
||||
The Joplin applications automatically save previous versions of your notes at regular intervals. These versions are synced across devices and can be viewed from the desktop application. To do so, click on the "Information" button on a note, then click on "Previous version of this note". From this screen you can view the previous versions of the note as well as restore any of them.
|
||||
|
||||
This feature can be disabled from the "Note history" section in the Configuration screen, and it is also possible to change for how long the history of a note is saved.
|
||||
This feature can be disabled from the "Note history" section in the [Configuration screen](https://github.com/laurent22/joplin/blob/dev/readme/config_screen.md), and it is also possible to change for how long the history of a note is saved.
|
||||
|
||||
More information please see the [Note History page](https://github.com/laurent22/joplin/blob/dev/readme/note_history.md).
|
||||
|
||||
@@ -341,7 +341,7 @@ Resources that are not attached to any note will be automatically deleted in acc
|
||||
|
||||
## Downloading attachments
|
||||
|
||||
The way the attachments are downloaded during synchronisation can be customised in the Configuration screen, under "Attachment download behaviour". The default option ("Always") is to download all the attachments, all the time, so that the data is available even when the device is offline. There is also the option to download the attachments manually (option "Manual"), by clicking on it, or automatically (Option "Auto"), in which case the attachments are downloaded only when a note is opened. These options should help saving disk space and network bandwidth, especially on mobile.
|
||||
The way the attachments are downloaded during synchronisation can be customised in the [Configuration screen](https://github.com/laurent22/joplin/blob/dev/readme/config_screen.md), under "Attachment download behaviour". The default option ("Always") is to download all the attachments, all the time, so that the data is available even when the device is offline. There is also the option to download the attachments manually (option "Manual"), by clicking on it, or automatically (Option "Auto"), in which case the attachments are downloaded only when a note is opened. These options should help saving disk space and network bandwidth, especially on mobile.
|
||||
|
||||
# Notifications
|
||||
|
||||
@@ -373,7 +373,7 @@ Joplin uses and renders a Github-flavoured Markdown with a few variations and ad
|
||||
|
||||
# Custom CSS
|
||||
|
||||
Rendered markdown can be customized by placing a userstyle file in the profile directory `~/.config/joplin-desktop/userstyle.css` (This path might be different on your device - check at the top of the `General` page of the Configuration menu for the exact path). This file supports standard CSS syntax. Joplin ***must*** be restarted for the new css to be applied, please ensure that Joplin is not closing to the tray, but is actually exiting. Note that this file is used for both displaying the notes and printing the notes. Be aware how the CSS may look printed (for example, printing white text over a black background is usually not wanted).
|
||||
Rendered markdown can be customized by placing a userstyle file in the profile directory `~/.config/joplin-desktop/userstyle.css` (This path might be different on your device - check at the top of the `General` page of the [Configuration screen](https://github.com/laurent22/joplin/blob/dev/readme/config_screen.md) for the exact path). This file supports standard CSS syntax. Joplin ***must*** be restarted for the new css to be applied, please ensure that Joplin is not closing to the tray, but is actually exiting. Note that this file is used for both displaying the notes and printing the notes. Be aware how the CSS may look printed (for example, printing white text over a black background is usually not wanted).
|
||||
|
||||
The whole UI can be customized by placing a custom editor style file in the profile directory `~/.config/joplin-desktop/userchrome.css`.
|
||||
|
||||
@@ -381,7 +381,7 @@ Important: userstyle.css and userchrome.css are provided for your convenience, b
|
||||
|
||||
# Plugins
|
||||
|
||||
The **desktop app** has the ability to extend beyond its standard functionality by the way of plugins. These plugins adhere to the Joplin plugin API and can be installed & configured within the application via the `Plugins` page in the Configuration screen. This menu allows the manual installation of the plugin using the single 'Joplin Plugin Archive' (*.jpl) file. Once the application is reloaded the plugins will appear within the plugins menu where they can be toggled on/off or removed entirely.
|
||||
The **desktop app** has the ability to extend beyond its standard functionality by the way of plugins. These plugins adhere to the Joplin plugin API and can be installed & configured within the application via the `Plugins` page in the [Configuration screen](https://github.com/laurent22/joplin/blob/dev/readme/config_screen.md). This menu allows the manual installation of the plugin using the single 'Joplin Plugin Archive' (*.jpl) file. Once the application is reloaded the plugins will appear within the plugins menu where they can be toggled on/off or removed entirely.
|
||||
|
||||
Plugins are currently maintained by the community in the [Joplin Discourse 'plugins' category](https://discourse.joplinapp.org/c/plugins/18).
|
||||
|
||||
|
18678
package-lock.json
generated
18678
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -402,8 +402,16 @@ class Application extends BaseApplication {
|
||||
}
|
||||
}
|
||||
|
||||
// We need this special case here because by the time the `version` command
|
||||
// runs, the keychain has already been setup.
|
||||
checkIfKeychainEnabled(argv) {
|
||||
return argv.indexOf('version') < 0;
|
||||
}
|
||||
|
||||
async start(argv) {
|
||||
argv = await super.start(argv);
|
||||
const keychainEnabled = this.checkIfKeychainEnabled(argv);
|
||||
|
||||
argv = await super.start(argv, { keychainEnabled });
|
||||
|
||||
cliUtils.setStdout(object => {
|
||||
return this.stdout(object);
|
||||
|
@@ -6,6 +6,8 @@ import BaseItem from '@joplin/lib/models/BaseItem';
|
||||
import Setting from '@joplin/lib/models/Setting';
|
||||
import shim from '@joplin/lib/shim';
|
||||
import * as pathUtils from '@joplin/lib/path-utils';
|
||||
import { getEncryptionEnabled } from '@joplin/lib/services/synchronizer/syncInfoUtils';
|
||||
import { generateMasterKeyAndEnableEncryption, loadMasterKeysFromSettings, setupAndDisableEncryption } from '@joplin/lib/services/e2ee/utils';
|
||||
const imageType = require('image-type');
|
||||
const readChunk = require('read-chunk');
|
||||
|
||||
@@ -39,7 +41,7 @@ class Command extends BaseCommand {
|
||||
return false;
|
||||
}
|
||||
Setting.setObjectValue('encryption.passwordCache', masterKeyId, password);
|
||||
await EncryptionService.instance().loadMasterKeysFromSettings();
|
||||
await loadMasterKeysFromSettings(EncryptionService.instance());
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -93,12 +95,12 @@ class Command extends BaseCommand {
|
||||
}
|
||||
}
|
||||
|
||||
await EncryptionService.instance().generateMasterKeyAndEnableEncryption(password);
|
||||
await generateMasterKeyAndEnableEncryption(EncryptionService.instance(), password);
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.command === 'disable') {
|
||||
await EncryptionService.instance().disableEncryption();
|
||||
await setupAndDisableEncryption(EncryptionService.instance());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -115,7 +117,7 @@ class Command extends BaseCommand {
|
||||
}
|
||||
|
||||
if (args.command === 'status') {
|
||||
this.stdout(_('Encryption is: %s', Setting.value('encryption.enabled') ? _('Enabled') : _('Disabled')));
|
||||
this.stdout(_('Encryption is: %s', getEncryptionEnabled() ? _('Enabled') : _('Disabled')));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -187,6 +187,7 @@ class Command extends BaseCommand {
|
||||
try {
|
||||
const migrationHandler = new MigrationHandler(
|
||||
sync.api(),
|
||||
reg.db(),
|
||||
sync.lockHandler(),
|
||||
Setting.value('appType'),
|
||||
Setting.value('clientId')
|
||||
|
@@ -1,6 +1,6 @@
|
||||
const { BaseCommand } = require('./base-command.js');
|
||||
const Setting = require('@joplin/lib/models/Setting').default;
|
||||
const { _ } = require('@joplin/lib/locale');
|
||||
const versionInfo = require('@joplin/lib/versionInfo').default;
|
||||
|
||||
class Command extends BaseCommand {
|
||||
usage() {
|
||||
@@ -12,8 +12,7 @@ class Command extends BaseCommand {
|
||||
}
|
||||
|
||||
async action() {
|
||||
const p = require('./package.json');
|
||||
this.stdout(_('%s %s (%s)', p.name, p.version, Setting.value('env')));
|
||||
this.stdout(versionInfo(require('./package.json')).message);
|
||||
}
|
||||
}
|
||||
|
||||
|
33259
packages/app-cli/package-lock.json
generated
33259
packages/app-cli/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -32,7 +32,7 @@
|
||||
],
|
||||
"owner": "Laurent Cozic"
|
||||
},
|
||||
"version": "2.2.0",
|
||||
"version": "2.3.2",
|
||||
"bin": {
|
||||
"joplin": "./main.js"
|
||||
},
|
||||
@@ -40,8 +40,9 @@
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@joplin/lib": "2.1",
|
||||
"@joplin/renderer": "2.1",
|
||||
"@joplin/lib": "~2.3",
|
||||
"@joplin/renderer": "~2.3",
|
||||
"aws-sdk": "^2.588.0",
|
||||
"chalk": "^4.1.0",
|
||||
"compare-version": "^0.1.2",
|
||||
"fs-extra": "^5.0.0",
|
||||
@@ -64,7 +65,7 @@
|
||||
"yargs-parser": "^7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@joplin/tools": "2.1",
|
||||
"@joplin/tools": "~2.3",
|
||||
"@types/fs-extra": "^9.0.6",
|
||||
"@types/jest": "^26.0.15",
|
||||
"@types/node": "^14.14.6",
|
||||
|
@@ -1,7 +1,6 @@
|
||||
import MdToHtml from '@joplin/renderer/MdToHtml';
|
||||
const os = require('os');
|
||||
const { filename } = require('@joplin/lib/path-utils');
|
||||
const { setupDatabaseAndSynchronizer, switchClient } = require('@joplin/lib/testing/test-utils.js');
|
||||
import { setupDatabaseAndSynchronizer, switchClient } from '@joplin/lib/testing/test-utils';
|
||||
import shim from '@joplin/lib/shim';
|
||||
const { themeStyle } = require('@joplin/lib/theme');
|
||||
|
||||
@@ -57,10 +56,8 @@ describe('MdToHtml', function() {
|
||||
const result = await mdToHtml.render(markdown, null, mdToHtmlOptions);
|
||||
let actualHtml = result.html;
|
||||
|
||||
if (os.EOL === '\r\n') {
|
||||
expectedHtml = expectedHtml.replace(/\r\n/g, '\n');
|
||||
actualHtml = actualHtml.replace(/\r\n/g, '\n');
|
||||
}
|
||||
expectedHtml = expectedHtml.replace(/\r?\n/g, '\n');
|
||||
actualHtml = actualHtml.replace(/\r?\n/g, '\n');
|
||||
|
||||
if (actualHtml !== expectedHtml) {
|
||||
console.info('');
|
||||
|
@@ -1,7 +1,6 @@
|
||||
const mdImporterService = require('@joplin/lib/services/interop/InteropService_Importer_Md').default;
|
||||
const Note = require('@joplin/lib/models/Note').default;
|
||||
const { setupDatabaseAndSynchronizer, switchClient } = require('@joplin/lib/testing/test-utils.js');
|
||||
|
||||
import { setupDatabaseAndSynchronizer, switchClient } from '@joplin/lib/testing/test-utils';
|
||||
const importer = new mdImporterService();
|
||||
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<div class="joplin-editable"><pre class="joplin-source" data-joplin-language="javascript" data-joplin-source-open="```javascript " data-joplin-source-close=" ```">function() {
|
||||
console.info('bonjour');
|
||||
}</pre><pre class="hljs"><code><span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
|
||||
<span class="hljs-built_in">console</span>.info(<span class="hljs-string">'bonjour'</span>);
|
||||
}</pre><pre class="hljs"><code><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) {
|
||||
<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">info</span>(<span class="hljs-string">'bonjour'</span>);
|
||||
}</code></pre></div>
|
||||
|
@@ -4,7 +4,7 @@ This is the official Joplin Plugin Repository
|
||||
|
||||
## Installation
|
||||
|
||||
To install any of these plugins, open the desktop application, then go to the "Plugins" section in the Configuration screen. You can then search for any plugin and install it from there.
|
||||
To install any of these plugins, open the desktop application, then go to the "Plugins" section in the [Configuration screen](https://github.com/laurent22/joplin/blob/dev/readme/config_screen.md). You can then search for any plugin and install it from there.
|
||||
|
||||
## Plugins
|
||||
|
||||
|
@@ -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;
|
||||
|
23
packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinClipboard.d.ts
vendored
Normal file
23
packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinClipboard.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
export default class JoplinClipboard {
|
||||
private electronClipboard_;
|
||||
private electronNativeImage_;
|
||||
constructor(electronClipboard: any, electronNativeImage: any);
|
||||
readText(): Promise<string>;
|
||||
writeText(text: string): Promise<void>;
|
||||
readHtml(): Promise<string>;
|
||||
writeHtml(html: string): Promise<void>;
|
||||
/**
|
||||
* Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format.
|
||||
*/
|
||||
readImage(): Promise<string>;
|
||||
/**
|
||||
* 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<void>;
|
||||
/**
|
||||
* Returns the list available formats (mime types).
|
||||
*
|
||||
* For example [ 'text/plain', 'text/html' ]
|
||||
*/
|
||||
availableFormats(): Promise<string[]>;
|
||||
}
|
@@ -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<DialogResult>;
|
||||
/**
|
||||
* 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<boolean>;
|
||||
}
|
||||
|
24
packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinWindow.d.ts
vendored
Normal file
24
packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinWindow.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import Plugin from '../Plugin';
|
||||
export interface Implementation {
|
||||
injectCustomStyles(elementId: string, cssFilePath: string): Promise<void>;
|
||||
}
|
||||
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<void>;
|
||||
/**
|
||||
* 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<void>;
|
||||
}
|
@@ -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<any>;
|
||||
export type PostMessageHandler = (message: any)=> Promise<any>;
|
||||
|
||||
/**
|
||||
* When a content script is initialised, it receives a `context` object.
|
||||
|
@@ -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;
|
||||
|
23
packages/app-cli/tests/support/plugins/content_script/api/JoplinClipboard.d.ts
vendored
Normal file
23
packages/app-cli/tests/support/plugins/content_script/api/JoplinClipboard.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
export default class JoplinClipboard {
|
||||
private electronClipboard_;
|
||||
private electronNativeImage_;
|
||||
constructor(electronClipboard: any, electronNativeImage: any);
|
||||
readText(): Promise<string>;
|
||||
writeText(text: string): Promise<void>;
|
||||
readHtml(): Promise<string>;
|
||||
writeHtml(html: string): Promise<void>;
|
||||
/**
|
||||
* Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format.
|
||||
*/
|
||||
readImage(): Promise<string>;
|
||||
/**
|
||||
* 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<void>;
|
||||
/**
|
||||
* Returns the list available formats (mime types).
|
||||
*
|
||||
* For example [ 'text/plain', 'text/html' ]
|
||||
*/
|
||||
availableFormats(): Promise<string[]>;
|
||||
}
|
@@ -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<DialogResult>;
|
||||
/**
|
||||
* 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<boolean>;
|
||||
}
|
||||
|
24
packages/app-cli/tests/support/plugins/content_script/api/JoplinWindow.d.ts
vendored
Normal file
24
packages/app-cli/tests/support/plugins/content_script/api/JoplinWindow.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import Plugin from '../Plugin';
|
||||
export interface Implementation {
|
||||
injectCustomStyles(elementId: string, cssFilePath: string): Promise<void>;
|
||||
}
|
||||
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<void>;
|
||||
/**
|
||||
* 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<void>;
|
||||
}
|
@@ -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<any>;
|
||||
export type PostMessageHandler = (message: any)=> Promise<any>;
|
||||
|
||||
/**
|
||||
* When a content script is initialised, it receives a `context` object.
|
||||
|
@@ -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;
|
||||
|
23
packages/app-cli/tests/support/plugins/dialog/api/JoplinClipboard.d.ts
vendored
Normal file
23
packages/app-cli/tests/support/plugins/dialog/api/JoplinClipboard.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
export default class JoplinClipboard {
|
||||
private electronClipboard_;
|
||||
private electronNativeImage_;
|
||||
constructor(electronClipboard: any, electronNativeImage: any);
|
||||
readText(): Promise<string>;
|
||||
writeText(text: string): Promise<void>;
|
||||
readHtml(): Promise<string>;
|
||||
writeHtml(html: string): Promise<void>;
|
||||
/**
|
||||
* Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format.
|
||||
*/
|
||||
readImage(): Promise<string>;
|
||||
/**
|
||||
* 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<void>;
|
||||
/**
|
||||
* Returns the list available formats (mime types).
|
||||
*
|
||||
* For example [ 'text/plain', 'text/html' ]
|
||||
*/
|
||||
availableFormats(): Promise<string[]>;
|
||||
}
|
@@ -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<DialogResult>;
|
||||
/**
|
||||
* 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<boolean>;
|
||||
}
|
||||
|
24
packages/app-cli/tests/support/plugins/dialog/api/JoplinWindow.d.ts
vendored
Normal file
24
packages/app-cli/tests/support/plugins/dialog/api/JoplinWindow.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import Plugin from '../Plugin';
|
||||
export interface Implementation {
|
||||
injectCustomStyles(elementId: string, cssFilePath: string): Promise<void>;
|
||||
}
|
||||
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<void>;
|
||||
/**
|
||||
* 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<void>;
|
||||
}
|
@@ -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<any>;
|
||||
export type PostMessageHandler = (message: any)=> Promise<any>;
|
||||
|
||||
/**
|
||||
* When a content script is initialised, it receives a `context` object.
|
||||
|
@@ -40,23 +40,7 @@ joplin.plugins.register({
|
||||
`);
|
||||
|
||||
const result3 = await dialogs.open(handle3);
|
||||
console.info('Got result: ' + JSON.stringify(result3));
|
||||
|
||||
|
||||
const handle4 = await dialogs.create('myDialog4');
|
||||
await dialogs.setHtml(handle4, `
|
||||
<h1>This dialog tests dynamic sizing</h1>
|
||||
<h3>Resize the window and the dialog should resize accordingly</h3>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
||||
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
||||
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
||||
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
|
||||
</p>
|
||||
`);
|
||||
await (dialogs as any).setFitToContent(handle4, false);
|
||||
await dialogs.open(handle4);
|
||||
|
||||
console.info('Got result: ' + JSON.stringify(result3));
|
||||
},
|
||||
|
||||
});
|
||||
|
@@ -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;
|
||||
|
23
packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinClipboard.d.ts
vendored
Normal file
23
packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinClipboard.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
export default class JoplinClipboard {
|
||||
private electronClipboard_;
|
||||
private electronNativeImage_;
|
||||
constructor(electronClipboard: any, electronNativeImage: any);
|
||||
readText(): Promise<string>;
|
||||
writeText(text: string): Promise<void>;
|
||||
readHtml(): Promise<string>;
|
||||
writeHtml(html: string): Promise<void>;
|
||||
/**
|
||||
* Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format.
|
||||
*/
|
||||
readImage(): Promise<string>;
|
||||
/**
|
||||
* 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<void>;
|
||||
/**
|
||||
* Returns the list available formats (mime types).
|
||||
*
|
||||
* For example [ 'text/plain', 'text/html' ]
|
||||
*/
|
||||
availableFormats(): Promise<string[]>;
|
||||
}
|
@@ -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<DialogResult>;
|
||||
/**
|
||||
* 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<boolean>;
|
||||
}
|
||||
|
24
packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinWindow.d.ts
vendored
Normal file
24
packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinWindow.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import Plugin from '../Plugin';
|
||||
export interface Implementation {
|
||||
injectCustomStyles(elementId: string, cssFilePath: string): Promise<void>;
|
||||
}
|
||||
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<void>;
|
||||
/**
|
||||
* 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<void>;
|
||||
}
|
@@ -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<any>;
|
||||
export type PostMessageHandler = (message: any)=> Promise<any>;
|
||||
|
||||
/**
|
||||
* When a content script is initialised, it receives a `context` object.
|
||||
|
@@ -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;
|
||||
|
23
packages/app-cli/tests/support/plugins/events/api/JoplinClipboard.d.ts
vendored
Normal file
23
packages/app-cli/tests/support/plugins/events/api/JoplinClipboard.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
export default class JoplinClipboard {
|
||||
private electronClipboard_;
|
||||
private electronNativeImage_;
|
||||
constructor(electronClipboard: any, electronNativeImage: any);
|
||||
readText(): Promise<string>;
|
||||
writeText(text: string): Promise<void>;
|
||||
readHtml(): Promise<string>;
|
||||
writeHtml(html: string): Promise<void>;
|
||||
/**
|
||||
* Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format.
|
||||
*/
|
||||
readImage(): Promise<string>;
|
||||
/**
|
||||
* 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<void>;
|
||||
/**
|
||||
* Returns the list available formats (mime types).
|
||||
*
|
||||
* For example [ 'text/plain', 'text/html' ]
|
||||
*/
|
||||
availableFormats(): Promise<string[]>;
|
||||
}
|
@@ -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<DialogResult>;
|
||||
/**
|
||||
* 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<boolean>;
|
||||
}
|
||||
|
24
packages/app-cli/tests/support/plugins/events/api/JoplinWindow.d.ts
vendored
Normal file
24
packages/app-cli/tests/support/plugins/events/api/JoplinWindow.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import Plugin from '../Plugin';
|
||||
export interface Implementation {
|
||||
injectCustomStyles(elementId: string, cssFilePath: string): Promise<void>;
|
||||
}
|
||||
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<void>;
|
||||
/**
|
||||
* 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<void>;
|
||||
}
|
@@ -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<any>;
|
||||
export type PostMessageHandler = (message: any)=> Promise<any>;
|
||||
|
||||
/**
|
||||
* When a content script is initialised, it receives a `context` object.
|
||||
|
@@ -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;
|
||||
|
23
packages/app-cli/tests/support/plugins/external_assets/api/JoplinClipboard.d.ts
vendored
Normal file
23
packages/app-cli/tests/support/plugins/external_assets/api/JoplinClipboard.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
export default class JoplinClipboard {
|
||||
private electronClipboard_;
|
||||
private electronNativeImage_;
|
||||
constructor(electronClipboard: any, electronNativeImage: any);
|
||||
readText(): Promise<string>;
|
||||
writeText(text: string): Promise<void>;
|
||||
readHtml(): Promise<string>;
|
||||
writeHtml(html: string): Promise<void>;
|
||||
/**
|
||||
* Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format.
|
||||
*/
|
||||
readImage(): Promise<string>;
|
||||
/**
|
||||
* 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<void>;
|
||||
/**
|
||||
* Returns the list available formats (mime types).
|
||||
*
|
||||
* For example [ 'text/plain', 'text/html' ]
|
||||
*/
|
||||
availableFormats(): Promise<string[]>;
|
||||
}
|
@@ -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<DialogResult>;
|
||||
/**
|
||||
* 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<boolean>;
|
||||
}
|
||||
|
24
packages/app-cli/tests/support/plugins/external_assets/api/JoplinWindow.d.ts
vendored
Normal file
24
packages/app-cli/tests/support/plugins/external_assets/api/JoplinWindow.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import Plugin from '../Plugin';
|
||||
export interface Implementation {
|
||||
injectCustomStyles(elementId: string, cssFilePath: string): Promise<void>;
|
||||
}
|
||||
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<void>;
|
||||
/**
|
||||
* 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<void>;
|
||||
}
|
@@ -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<any>;
|
||||
export type PostMessageHandler = (message: any)=> Promise<any>;
|
||||
|
||||
/**
|
||||
* When a content script is initialised, it receives a `context` object.
|
||||
|
@@ -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;
|
||||
|
23
packages/app-cli/tests/support/plugins/jpl_test/api/JoplinClipboard.d.ts
vendored
Normal file
23
packages/app-cli/tests/support/plugins/jpl_test/api/JoplinClipboard.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
export default class JoplinClipboard {
|
||||
private electronClipboard_;
|
||||
private electronNativeImage_;
|
||||
constructor(electronClipboard: any, electronNativeImage: any);
|
||||
readText(): Promise<string>;
|
||||
writeText(text: string): Promise<void>;
|
||||
readHtml(): Promise<string>;
|
||||
writeHtml(html: string): Promise<void>;
|
||||
/**
|
||||
* Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format.
|
||||
*/
|
||||
readImage(): Promise<string>;
|
||||
/**
|
||||
* 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<void>;
|
||||
/**
|
||||
* Returns the list available formats (mime types).
|
||||
*
|
||||
* For example [ 'text/plain', 'text/html' ]
|
||||
*/
|
||||
availableFormats(): Promise<string[]>;
|
||||
}
|
@@ -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<DialogResult>;
|
||||
/**
|
||||
* 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<boolean>;
|
||||
}
|
||||
|
24
packages/app-cli/tests/support/plugins/jpl_test/api/JoplinWindow.d.ts
vendored
Normal file
24
packages/app-cli/tests/support/plugins/jpl_test/api/JoplinWindow.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import Plugin from '../Plugin';
|
||||
export interface Implementation {
|
||||
injectCustomStyles(elementId: string, cssFilePath: string): Promise<void>;
|
||||
}
|
||||
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<void>;
|
||||
/**
|
||||
* 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<void>;
|
||||
}
|
@@ -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<any>;
|
||||
export type PostMessageHandler = (message: any)=> Promise<any>;
|
||||
|
||||
/**
|
||||
* When a content script is initialised, it receives a `context` object.
|
||||
|
@@ -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;
|
||||
|
23
packages/app-cli/tests/support/plugins/json_export/api/JoplinClipboard.d.ts
vendored
Normal file
23
packages/app-cli/tests/support/plugins/json_export/api/JoplinClipboard.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
export default class JoplinClipboard {
|
||||
private electronClipboard_;
|
||||
private electronNativeImage_;
|
||||
constructor(electronClipboard: any, electronNativeImage: any);
|
||||
readText(): Promise<string>;
|
||||
writeText(text: string): Promise<void>;
|
||||
readHtml(): Promise<string>;
|
||||
writeHtml(html: string): Promise<void>;
|
||||
/**
|
||||
* Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format.
|
||||
*/
|
||||
readImage(): Promise<string>;
|
||||
/**
|
||||
* 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<void>;
|
||||
/**
|
||||
* Returns the list available formats (mime types).
|
||||
*
|
||||
* For example [ 'text/plain', 'text/html' ]
|
||||
*/
|
||||
availableFormats(): Promise<string[]>;
|
||||
}
|
@@ -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<DialogResult>;
|
||||
/**
|
||||
* 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<boolean>;
|
||||
}
|
||||
|
24
packages/app-cli/tests/support/plugins/json_export/api/JoplinWindow.d.ts
vendored
Normal file
24
packages/app-cli/tests/support/plugins/json_export/api/JoplinWindow.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import Plugin from '../Plugin';
|
||||
export interface Implementation {
|
||||
injectCustomStyles(elementId: string, cssFilePath: string): Promise<void>;
|
||||
}
|
||||
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<void>;
|
||||
/**
|
||||
* 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<void>;
|
||||
}
|
@@ -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<any>;
|
||||
export type PostMessageHandler = (message: any)=> Promise<any>;
|
||||
|
||||
/**
|
||||
* When a content script is initialised, it receives a `context` object.
|
||||
|
@@ -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;
|
||||
|
23
packages/app-cli/tests/support/plugins/menu/api/JoplinClipboard.d.ts
vendored
Normal file
23
packages/app-cli/tests/support/plugins/menu/api/JoplinClipboard.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
export default class JoplinClipboard {
|
||||
private electronClipboard_;
|
||||
private electronNativeImage_;
|
||||
constructor(electronClipboard: any, electronNativeImage: any);
|
||||
readText(): Promise<string>;
|
||||
writeText(text: string): Promise<void>;
|
||||
readHtml(): Promise<string>;
|
||||
writeHtml(html: string): Promise<void>;
|
||||
/**
|
||||
* Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format.
|
||||
*/
|
||||
readImage(): Promise<string>;
|
||||
/**
|
||||
* 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<void>;
|
||||
/**
|
||||
* Returns the list available formats (mime types).
|
||||
*
|
||||
* For example [ 'text/plain', 'text/html' ]
|
||||
*/
|
||||
availableFormats(): Promise<string[]>;
|
||||
}
|
@@ -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<DialogResult>;
|
||||
/**
|
||||
* 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<boolean>;
|
||||
}
|
||||
|
24
packages/app-cli/tests/support/plugins/menu/api/JoplinWindow.d.ts
vendored
Normal file
24
packages/app-cli/tests/support/plugins/menu/api/JoplinWindow.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import Plugin from '../Plugin';
|
||||
export interface Implementation {
|
||||
injectCustomStyles(elementId: string, cssFilePath: string): Promise<void>;
|
||||
}
|
||||
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<void>;
|
||||
/**
|
||||
* 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<void>;
|
||||
}
|
@@ -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<any>;
|
||||
export type PostMessageHandler = (message: any)=> Promise<any>;
|
||||
|
||||
/**
|
||||
* When a content script is initialised, it receives a `context` object.
|
||||
|
@@ -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;
|
||||
|
23
packages/app-cli/tests/support/plugins/multi_selection/api/JoplinClipboard.d.ts
vendored
Normal file
23
packages/app-cli/tests/support/plugins/multi_selection/api/JoplinClipboard.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
export default class JoplinClipboard {
|
||||
private electronClipboard_;
|
||||
private electronNativeImage_;
|
||||
constructor(electronClipboard: any, electronNativeImage: any);
|
||||
readText(): Promise<string>;
|
||||
writeText(text: string): Promise<void>;
|
||||
readHtml(): Promise<string>;
|
||||
writeHtml(html: string): Promise<void>;
|
||||
/**
|
||||
* Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format.
|
||||
*/
|
||||
readImage(): Promise<string>;
|
||||
/**
|
||||
* 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<void>;
|
||||
/**
|
||||
* Returns the list available formats (mime types).
|
||||
*
|
||||
* For example [ 'text/plain', 'text/html' ]
|
||||
*/
|
||||
availableFormats(): Promise<string[]>;
|
||||
}
|
@@ -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<DialogResult>;
|
||||
/**
|
||||
* 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<boolean>;
|
||||
}
|
||||
|
24
packages/app-cli/tests/support/plugins/multi_selection/api/JoplinWindow.d.ts
vendored
Normal file
24
packages/app-cli/tests/support/plugins/multi_selection/api/JoplinWindow.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import Plugin from '../Plugin';
|
||||
export interface Implementation {
|
||||
injectCustomStyles(elementId: string, cssFilePath: string): Promise<void>;
|
||||
}
|
||||
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<void>;
|
||||
/**
|
||||
* 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<void>;
|
||||
}
|
@@ -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<any>;
|
||||
export type PostMessageHandler = (message: any)=> Promise<any>;
|
||||
|
||||
/**
|
||||
* When a content script is initialised, it receives a `context` object.
|
||||
|
@@ -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;
|
||||
|
23
packages/app-cli/tests/support/plugins/nativeModule/api/JoplinClipboard.d.ts
vendored
Normal file
23
packages/app-cli/tests/support/plugins/nativeModule/api/JoplinClipboard.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
export default class JoplinClipboard {
|
||||
private electronClipboard_;
|
||||
private electronNativeImage_;
|
||||
constructor(electronClipboard: any, electronNativeImage: any);
|
||||
readText(): Promise<string>;
|
||||
writeText(text: string): Promise<void>;
|
||||
readHtml(): Promise<string>;
|
||||
writeHtml(html: string): Promise<void>;
|
||||
/**
|
||||
* Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format.
|
||||
*/
|
||||
readImage(): Promise<string>;
|
||||
/**
|
||||
* 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<void>;
|
||||
/**
|
||||
* Returns the list available formats (mime types).
|
||||
*
|
||||
* For example [ 'text/plain', 'text/html' ]
|
||||
*/
|
||||
availableFormats(): Promise<string[]>;
|
||||
}
|
@@ -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<DialogResult>;
|
||||
/**
|
||||
* 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<boolean>;
|
||||
}
|
||||
|
24
packages/app-cli/tests/support/plugins/nativeModule/api/JoplinWindow.d.ts
vendored
Normal file
24
packages/app-cli/tests/support/plugins/nativeModule/api/JoplinWindow.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import Plugin from '../Plugin';
|
||||
export interface Implementation {
|
||||
injectCustomStyles(elementId: string, cssFilePath: string): Promise<void>;
|
||||
}
|
||||
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<void>;
|
||||
/**
|
||||
* 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<void>;
|
||||
}
|
@@ -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<any>;
|
||||
export type PostMessageHandler = (message: any)=> Promise<any>;
|
||||
|
||||
/**
|
||||
* When a content script is initialised, it receives a `context` object.
|
||||
|
@@ -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;
|
||||
|
23
packages/app-cli/tests/support/plugins/post_messages/api/JoplinClipboard.d.ts
vendored
Normal file
23
packages/app-cli/tests/support/plugins/post_messages/api/JoplinClipboard.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
export default class JoplinClipboard {
|
||||
private electronClipboard_;
|
||||
private electronNativeImage_;
|
||||
constructor(electronClipboard: any, electronNativeImage: any);
|
||||
readText(): Promise<string>;
|
||||
writeText(text: string): Promise<void>;
|
||||
readHtml(): Promise<string>;
|
||||
writeHtml(html: string): Promise<void>;
|
||||
/**
|
||||
* Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format.
|
||||
*/
|
||||
readImage(): Promise<string>;
|
||||
/**
|
||||
* 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<void>;
|
||||
/**
|
||||
* Returns the list available formats (mime types).
|
||||
*
|
||||
* For example [ 'text/plain', 'text/html' ]
|
||||
*/
|
||||
availableFormats(): Promise<string[]>;
|
||||
}
|
@@ -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<DialogResult>;
|
||||
/**
|
||||
* 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<boolean>;
|
||||
}
|
||||
|
24
packages/app-cli/tests/support/plugins/post_messages/api/JoplinWindow.d.ts
vendored
Normal file
24
packages/app-cli/tests/support/plugins/post_messages/api/JoplinWindow.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import Plugin from '../Plugin';
|
||||
export interface Implementation {
|
||||
injectCustomStyles(elementId: string, cssFilePath: string): Promise<void>;
|
||||
}
|
||||
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<void>;
|
||||
/**
|
||||
* 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<void>;
|
||||
}
|
@@ -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<any>;
|
||||
export type PostMessageHandler = (message: any)=> Promise<any>;
|
||||
|
||||
/**
|
||||
* When a content script is initialised, it receives a `context` object.
|
||||
|
@@ -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;
|
||||
|
23
packages/app-cli/tests/support/plugins/register_command/api/JoplinClipboard.d.ts
vendored
Normal file
23
packages/app-cli/tests/support/plugins/register_command/api/JoplinClipboard.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
export default class JoplinClipboard {
|
||||
private electronClipboard_;
|
||||
private electronNativeImage_;
|
||||
constructor(electronClipboard: any, electronNativeImage: any);
|
||||
readText(): Promise<string>;
|
||||
writeText(text: string): Promise<void>;
|
||||
readHtml(): Promise<string>;
|
||||
writeHtml(html: string): Promise<void>;
|
||||
/**
|
||||
* Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format.
|
||||
*/
|
||||
readImage(): Promise<string>;
|
||||
/**
|
||||
* 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<void>;
|
||||
/**
|
||||
* Returns the list available formats (mime types).
|
||||
*
|
||||
* For example [ 'text/plain', 'text/html' ]
|
||||
*/
|
||||
availableFormats(): Promise<string[]>;
|
||||
}
|
@@ -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<DialogResult>;
|
||||
/**
|
||||
* 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<boolean>;
|
||||
}
|
||||
|
24
packages/app-cli/tests/support/plugins/register_command/api/JoplinWindow.d.ts
vendored
Normal file
24
packages/app-cli/tests/support/plugins/register_command/api/JoplinWindow.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import Plugin from '../Plugin';
|
||||
export interface Implementation {
|
||||
injectCustomStyles(elementId: string, cssFilePath: string): Promise<void>;
|
||||
}
|
||||
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<void>;
|
||||
/**
|
||||
* 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<void>;
|
||||
}
|
@@ -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<any>;
|
||||
export type PostMessageHandler = (message: any)=> Promise<any>;
|
||||
|
||||
/**
|
||||
* When a content script is initialised, it receives a `context` object.
|
||||
|
@@ -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;
|
||||
|
23
packages/app-cli/tests/support/plugins/selected_text/api/JoplinClipboard.d.ts
vendored
Normal file
23
packages/app-cli/tests/support/plugins/selected_text/api/JoplinClipboard.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
export default class JoplinClipboard {
|
||||
private electronClipboard_;
|
||||
private electronNativeImage_;
|
||||
constructor(electronClipboard: any, electronNativeImage: any);
|
||||
readText(): Promise<string>;
|
||||
writeText(text: string): Promise<void>;
|
||||
readHtml(): Promise<string>;
|
||||
writeHtml(html: string): Promise<void>;
|
||||
/**
|
||||
* Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format.
|
||||
*/
|
||||
readImage(): Promise<string>;
|
||||
/**
|
||||
* 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<void>;
|
||||
/**
|
||||
* Returns the list available formats (mime types).
|
||||
*
|
||||
* For example [ 'text/plain', 'text/html' ]
|
||||
*/
|
||||
availableFormats(): Promise<string[]>;
|
||||
}
|
@@ -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<DialogResult>;
|
||||
/**
|
||||
* 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<boolean>;
|
||||
}
|
||||
|
24
packages/app-cli/tests/support/plugins/selected_text/api/JoplinWindow.d.ts
vendored
Normal file
24
packages/app-cli/tests/support/plugins/selected_text/api/JoplinWindow.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import Plugin from '../Plugin';
|
||||
export interface Implementation {
|
||||
injectCustomStyles(elementId: string, cssFilePath: string): Promise<void>;
|
||||
}
|
||||
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<void>;
|
||||
/**
|
||||
* 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<void>;
|
||||
}
|
@@ -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<any>;
|
||||
export type PostMessageHandler = (message: any)=> Promise<any>;
|
||||
|
||||
/**
|
||||
* When a content script is initialised, it receives a `context` object.
|
||||
|
@@ -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;
|
||||
|
23
packages/app-cli/tests/support/plugins/settings/api/JoplinClipboard.d.ts
vendored
Normal file
23
packages/app-cli/tests/support/plugins/settings/api/JoplinClipboard.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
export default class JoplinClipboard {
|
||||
private electronClipboard_;
|
||||
private electronNativeImage_;
|
||||
constructor(electronClipboard: any, electronNativeImage: any);
|
||||
readText(): Promise<string>;
|
||||
writeText(text: string): Promise<void>;
|
||||
readHtml(): Promise<string>;
|
||||
writeHtml(html: string): Promise<void>;
|
||||
/**
|
||||
* Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format.
|
||||
*/
|
||||
readImage(): Promise<string>;
|
||||
/**
|
||||
* 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<void>;
|
||||
/**
|
||||
* Returns the list available formats (mime types).
|
||||
*
|
||||
* For example [ 'text/plain', 'text/html' ]
|
||||
*/
|
||||
availableFormats(): Promise<string[]>;
|
||||
}
|
@@ -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<DialogResult>;
|
||||
/**
|
||||
* 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<boolean>;
|
||||
}
|
||||
|
24
packages/app-cli/tests/support/plugins/settings/api/JoplinWindow.d.ts
vendored
Normal file
24
packages/app-cli/tests/support/plugins/settings/api/JoplinWindow.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import Plugin from '../Plugin';
|
||||
export interface Implementation {
|
||||
injectCustomStyles(elementId: string, cssFilePath: string): Promise<void>;
|
||||
}
|
||||
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<void>;
|
||||
/**
|
||||
* 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<void>;
|
||||
}
|
@@ -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<any>;
|
||||
export type PostMessageHandler = (message: any)=> Promise<any>;
|
||||
|
||||
/**
|
||||
* When a content script is initialised, it receives a `context` object.
|
||||
|
@@ -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;
|
||||
|
23
packages/app-cli/tests/support/plugins/toc/api/JoplinClipboard.d.ts
vendored
Normal file
23
packages/app-cli/tests/support/plugins/toc/api/JoplinClipboard.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
export default class JoplinClipboard {
|
||||
private electronClipboard_;
|
||||
private electronNativeImage_;
|
||||
constructor(electronClipboard: any, electronNativeImage: any);
|
||||
readText(): Promise<string>;
|
||||
writeText(text: string): Promise<void>;
|
||||
readHtml(): Promise<string>;
|
||||
writeHtml(html: string): Promise<void>;
|
||||
/**
|
||||
* Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format.
|
||||
*/
|
||||
readImage(): Promise<string>;
|
||||
/**
|
||||
* 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<void>;
|
||||
/**
|
||||
* Returns the list available formats (mime types).
|
||||
*
|
||||
* For example [ 'text/plain', 'text/html' ]
|
||||
*/
|
||||
availableFormats(): Promise<string[]>;
|
||||
}
|
@@ -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<DialogResult>;
|
||||
/**
|
||||
* 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<boolean>;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user