-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
23,209 additions
and
13,986 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { Rectangle } from './types'; | ||
export interface Implementation { | ||
nativeImage: any; | ||
} | ||
export interface CreateFromBufferOptions { | ||
width?: number; | ||
height?: number; | ||
scaleFactor?: number; | ||
} | ||
export interface ResizeOptions { | ||
width?: number; | ||
height?: number; | ||
quality?: 'good' | 'better' | 'best'; | ||
} | ||
export type Handle = string; | ||
/** | ||
* Provides imaging functions to resize or process images. You create an image | ||
* using one of the `createFrom` functions, then use the other functions to | ||
* process the image. | ||
* | ||
* Images are associated with a handle which is what will be available to the | ||
* plugin. Once you are done with an image, free it using the `free()` function. | ||
* | ||
* [View the | ||
* example](https://github.com/laurent22/joplin/blob/dev/packages/app-cli/tests/support/plugins/imaging/src/index.ts) | ||
* | ||
*/ | ||
export default class JoplinImaging { | ||
private implementation_; | ||
private images_; | ||
constructor(implementation: Implementation); | ||
private createImageHandle; | ||
private imageByHandle; | ||
private cacheImage; | ||
createFromPath(filePath: string): Promise<Handle>; | ||
createFromResource(resourceId: string): Promise<Handle>; | ||
getSize(handle: Handle): Promise<any>; | ||
resize(handle: Handle, options?: ResizeOptions): Promise<string>; | ||
crop(handle: Handle, rectange: Rectangle): Promise<string>; | ||
toPngFile(handle: Handle, filePath: string): Promise<void>; | ||
/** | ||
* Quality is between 0 and 100 | ||
*/ | ||
toJpgFile(handle: Handle, filePath: string, quality?: number): Promise<void>; | ||
private tempFilePath; | ||
/** | ||
* Creates a new Joplin resource from the image data. The image will be | ||
* first converted to a JPEG. | ||
*/ | ||
toJpgResource(handle: Handle, resourceProps: any, quality?: number): Promise<import("../../database/types").ResourceEntity>; | ||
/** | ||
* Creates a new Joplin resource from the image data. The image will be | ||
* first converted to a PNG. | ||
*/ | ||
toPngResource(handle: Handle, resourceProps: any): Promise<import("../../database/types").ResourceEntity>; | ||
/** | ||
* Image data is not automatically deleted by Joplin so make sure you call | ||
* this method on the handle once you are done. | ||
*/ | ||
free(handle: Handle): Promise<void>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Store } from 'redux'; | ||
import Plugin from '../Plugin'; | ||
import { ListRenderer } from './noteListType'; | ||
/** | ||
* This API allows you to customise how each note in the note list is rendered. | ||
* The renderer you implement follows a unidirectional data flow. | ||
* | ||
* The app provides the required dependencies whenever a note is updated - you | ||
* process these dependencies, and return some props, which are then passed to | ||
* your template and rendered. See [[[ListRenderer]]] for a detailed description | ||
* of each property of the renderer. | ||
* | ||
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/note_list_renderer) | ||
* | ||
* The default list renderer is implemented using the same API, so it worth checking it too: | ||
* | ||
* [Default list renderer](https://github.com/laurent22/joplin/tree/dev/packages/lib/services/noteList/defaultListRenderer.ts) | ||
*/ | ||
export default class JoplinViewsNoteList { | ||
private plugin_; | ||
private store_; | ||
constructor(plugin: Plugin, store: Store); | ||
registerRenderer(renderer: ListRenderer): Promise<void>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.