2022-07-03 15:32:29 +02:00
|
|
|
// PlatformImplementation provides access to platform specific dependencies,
|
|
|
|
// such as the clipboard, message dialog, etc. It allows having the same plugin
|
|
|
|
|
|
|
|
import { VersionInfo } from './api/types';
|
|
|
|
import { Implementation as WindowImplementation } from './api/JoplinWindow';
|
2023-09-17 12:40:50 +02:00
|
|
|
import { Implementation as ImagingImplementation } from './api/JoplinImaging';
|
2022-07-03 15:32:29 +02:00
|
|
|
|
|
|
|
export interface JoplinViewsDialogs {
|
|
|
|
showMessageBox(message: string): Promise<number>;
|
2023-10-31 17:29:19 +02:00
|
|
|
showOpenDialog(options: any): Promise<any>;
|
2022-07-03 15:32:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface JoplinViews {
|
|
|
|
dialogs: JoplinViewsDialogs;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface Joplin {
|
|
|
|
views: JoplinViews;
|
|
|
|
}
|
|
|
|
|
|
|
|
// API for all platforms, but with different implementations.
|
|
|
|
export default class BasePlatformImplementation {
|
|
|
|
|
|
|
|
public get versionInfo(): VersionInfo {
|
|
|
|
throw new Error('Not implemented');
|
|
|
|
}
|
|
|
|
|
|
|
|
public get clipboard(): any {
|
|
|
|
throw new Error('Not implemented');
|
|
|
|
}
|
|
|
|
|
|
|
|
public get nativeImage(): any {
|
|
|
|
throw new Error('Not implemented');
|
|
|
|
}
|
|
|
|
|
|
|
|
public get window(): WindowImplementation {
|
|
|
|
throw new Error('Not implemented');
|
|
|
|
}
|
|
|
|
|
|
|
|
public registerComponent(_name: string, _component: any) {
|
|
|
|
throw new Error('Not implemented');
|
|
|
|
}
|
|
|
|
|
|
|
|
public unregisterComponent(_name: string) {
|
|
|
|
throw new Error('Not implemented');
|
|
|
|
}
|
|
|
|
|
|
|
|
public get joplin(): Joplin {
|
|
|
|
throw new Error('Not implemented');
|
|
|
|
}
|
|
|
|
|
2023-09-17 12:40:50 +02:00
|
|
|
public get imaging(): ImagingImplementation {
|
|
|
|
throw new Error('Not implemented');
|
|
|
|
}
|
|
|
|
|
2022-07-03 15:32:29 +02:00
|
|
|
}
|