notu 0.10.5 → 0.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,20 @@
1
+ import Note from '../models/Note';
2
+ /** The base interface that all note components must implement */
3
+ export interface NoteComponent {
4
+ /** Gets the text which would be used for saving the current state of the note component's contents */
5
+ getText(): string;
6
+ }
7
+ /** Stores info about a found NoteComponenet in a note's text until it is ready to be generated */
8
+ export declare class NoteComponentInfo {
9
+ text: string;
10
+ start: number;
11
+ get end(): number;
12
+ processor: NoteComponentProcessor;
13
+ constructor(text: string, start: number, processor: NoteComponentProcessor);
14
+ }
15
+ /** Defines the interface for an object which can identify and then create instances of a particular type of note component */
16
+ export interface NoteComponentProcessor {
17
+ identify(text: string): NoteComponentInfo;
18
+ /** Accepts a function which converts a NoteComponentInfo object into an actual NoteComponent that can be rendered */
19
+ creator: (info: NoteComponentInfo, note: Note, save: () => Promise<void>, previous: NoteComponentInfo, next: NoteComponentInfo) => NoteComponent;
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notu",
3
- "version": "0.10.5",
3
+ "version": "0.10.6",
4
4
  "main": "dist/notu.mjs",
5
5
  "unpkg": "dist/notu.mjs",
6
6
  "types": "dist/types/index.d.ts",