You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-16 00:14:34 +02:00
Update plugin types
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from "./types";
|
import { Rectangle } from './types';
|
||||||
export interface Implementation {
|
export interface Implementation {
|
||||||
nativeImage: any;
|
nativeImage: any;
|
||||||
}
|
}
|
||||||
@ -32,31 +32,11 @@ export default class JoplinImaging {
|
|||||||
private createImageHandle;
|
private createImageHandle;
|
||||||
private imageByHandle;
|
private imageByHandle;
|
||||||
private cacheImage;
|
private cacheImage;
|
||||||
/**
|
|
||||||
* Create an image from a buffer - however only use this for very small
|
|
||||||
* images. It requires transferring the full image data from the plugin to
|
|
||||||
* the app, which is extremely slow and will freeze the app. Instead, use
|
|
||||||
* `createFromPath` or `createFromResource`, which will manipulate the image
|
|
||||||
* data directly from the main process.
|
|
||||||
*/
|
|
||||||
createFromBuffer(buffer: any, options?: CreateFromBufferOptions): Promise<Handle>;
|
|
||||||
createFromPath(filePath: string): Promise<Handle>;
|
createFromPath(filePath: string): Promise<Handle>;
|
||||||
createFromResource(resourceId: string): Promise<Handle>;
|
createFromResource(resourceId: string): Promise<Handle>;
|
||||||
getSize(handle: Handle): Promise<any>;
|
getSize(handle: Handle): Promise<any>;
|
||||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toDataUrl(handle: Handle): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Warnings: requires transferring the complete image from the app to the
|
|
||||||
* plugin which may freeze the app. Consider using one of the `toXxxFile()`
|
|
||||||
* or `toXxxResource()` methods instead.
|
|
||||||
*/
|
|
||||||
toBase64(handle: Handle): Promise<string>;
|
|
||||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Quality is between 0 and 100
|
* Quality is between 0 and 100
|
||||||
|
Reference in New Issue
Block a user