import { BuiltInPowerupCodes, PORTAL_TYPE, PropertyType, RemId, RemType, RichTextInterface, SearchPortalQuery, SetRemType, SlotCodesForPowerup } from '../interfaces'; import { InternalCallMethod, NamespaceBase } from './base'; import { Card } from './card'; interface GetPowerupPropertyAsRichTextOverload { /** * Get a built-in RemNote powerup's slot value as rich text. */ (powerupCode: PowerupCode, powerupSlot: SlotCodesForPowerup): Promise; /** * Get a plugin powerup's slot value as rich text. */ (powerupCode: string, powerupSlot: string): Promise; } interface GetPowerupPropertyOverload { /** * Get a built-in RemNote powerup's slot value as a string. */ (powerupCode: PowerupCode, powerupSlot: SlotCodesForPowerup): Promise; /** * Get a plugin powerup's slot value as a string. */ (powerupCode: string, powerupSlot: string): Promise; } interface SetPowerupPropertyOverload { /** * Set a built-in RemNote powerup's slot value. */ (powerupCode: PowerupCode, powerupSlot: SlotCodesForPowerup, value: RichTextInterface): Promise; /** * Set a plugin powerup's slot value. */ (powerupCode: string, powerupSlot: string, value: RichTextInterface): Promise; } /** * A single Rem. Obtain this object with `plugin.rem.findOne(remId)` or other * similar methods in the `plugin.rem` namespace. */ export declare class RemObject { /** * The internal UUID for your Rem. This is stable and will never change. */ readonly _id: RemId; /** * When this Rem was created */ readonly createdAt: number; /** * Last time this document was changed on this local machine, either through a local edit or a sync */ readonly localUpdatedAt: number; /** * The last time that this Rem was modified on any client. */ readonly updatedAt: number; /** * The parent ID of your Rem. Null for top-level Rem. * */ readonly parent: RemId | null; /** * The ordered list of children RemIds. */ readonly children: RemId[] | undefined; /** * The Rem's type in the Concept-Descriptor Framework. */ readonly type: RemType; /** * The Rich Text representation of the your Rem's name. This is your Rem's main text * and is the front of flashcards generated from this Rem. */ readonly text: RichTextInterface | undefined; /** * The Rich Text representation of the your Rem's content. This is the text that * appears on the back of flashcards generated from this Rem. */ readonly backText?: RichTextInterface; private _callMethod; private constructor(); /** * Essentially the same as `_callMethod`, but implicitly * passes the `remId` in with the method options because * all `RemPluginObject` methods require this argument */ private call; /** * Helper method for methods that return a single rem (`RemPluginObject`) */ private callAndReturnRem; /** * Helper method for methods that return many rem (`RemPluginObjects`s) */ private callAndReturnManyRem; /** * Set the filter for this table Rem. We recommend using the `Query` class to create the filter query. * @example * const query = Query.tableColumn('column-id', Query.or([ * Query.text(TextMatcher.Contains, 'hello'), * Query.text(TextMatcher.Contains, 'world'), * ])); * await tableRem.setTableFilter(query); */ setTableFilter: (filter: SearchPortalQuery) => Promise; /** * Check if a Rem is a table rem. */ isTable: () => Promise; allRemInFolderQueue: () => Promise; /** * @alpha This method may change in a future release. * * Get the index position of the Rem amongst its siblings in `portalId`. * * If `portalId` is undefined, the current focused portal id will be used. */ positionAmongstSiblings: (portalId?: string) => Promise; /** * @alpha This method may change in a future release. * * Get the index position of the Rem amongst the visible siblings in `portalId`. * * If `portalId` is undefined, the current focused portal id will be used. */ positionAmongstVisibleSiblings: (portalId?: string) => Promise; /** * Check if a Rem has a powerup. */ hasPowerup: (powerupCode: BuiltInPowerupCodes | string) => Promise; /** * @ignore */ getHiddenExplicitlyIncludedState: (portalId?: string) => Promise<'hidden' | 'included' | 'none' | undefined>; /** * @ignore */ setHiddenExplicitlyIncludedState: (hiddenExplicitlyIncludedState: 'hidden' | 'included' | 'none', portalId?: string) => Promise; getLastPracticed: () => Promise; addPowerup: (powerupCode: string | BuiltInPowerupCodes) => Promise; getLastTimeMovedTo: () => Promise; getSchemaVersion: () => Promise; /** * Get whether or not the Rem is in embedded queue view mode. */ embeddedQueueViewMode: () => Promise; /** * Get whether or not the Rem is a collapsed portal. */ isCollapsed: (portalId: string) => Promise; /** * Set whether or not the Rem is a collapsed portal. */ setIsCollapsed: (isCollapsed: boolean, portalId: string) => Promise; /** * Get the number of times the Rem was selected in search. */ timesSelectedInSearch: () => Promise; /** * Get the portal type () */ getPortalType: () => Promise; /** * Get the Rem directly included in this portal. */ getPortalDirectlyIncludedRem: () => Promise; /** * Get the Rem's type (concept, descriptor, portal or default). */ getType: () => Promise; /** * Set this Rem's powerup property for the `powerupCode`'s `powerupSlot` to `value`. */ setPowerupProperty: SetPowerupPropertyOverload; /** * Get the powerup property for this Rem's `powerupCode`'s `powerupSlot`. * @return A string representation of the value */ getPowerupProperty: GetPowerupPropertyOverload; /** * Get the powerup property for this Rem's `powerupCode`'s `powerupSlot`. * @return The Rem storing the property */ getPowerupPropertyAsRem: (powerupCode: PowerupCode | string, powerupSlot: SlotCodesForPowerup | string) => Promise; getTagPropertyAsRem: (propertyId: RemId) => Promise; /** * Get the powerup property for this Rem's `powerupCode`'s `powerupSlot`. * @return The raw rich text representation of the value */ getPowerupPropertyAsRichText: GetPowerupPropertyAsRichTextOverload; /** * Set the Rem's text (the front of the flashcard) to `text`. */ setText: (text: RichTextInterface) => Promise; /** * Set the Rem's back text (the back of the flashcard) to `text`. */ setBackText: (backText: RichTextInterface | undefined) => Promise; getTagPropertyValue: (propertyId: RemId) => Promise; getPropertyType: () => Promise; setTagPropertyValue: (propertyId: RemId, value: RichTextInterface | undefined) => Promise; /** * Remove a tag from the Rem. Optionally also remove powerup properties. */ removeTag: (tagId: RemId, removeProperties?: boolean) => Promise; /** * Remove a powerup from the Rem. Will remove powerup slots. */ removePowerup: (powerupCode: BuiltInPowerupCodes | string) => Promise; /** * Add the `tagId` Rem as a tag. */ addTag: (tag: RemId | RemObject) => Promise; /** * Remove (delete) this Rem and all of its descendants. */ remove: () => Promise; /** * Get the list of Rem that this Rem is tagged with. */ getTagRems: () => Promise; /** * Add this Rem to the `portalId` portal. */ addToPortal: (portal: RemId | RemObject) => Promise; /** * Remove this Rem from the `portalId` portal. */ removeFromPortal: (portal: RemId | RemObject) => Promise; /** * Moves this Rem to be a child of the `parentId` Rem. By default, this Rem * will be added to the front of the `parentId` Rem's children. Specify * `positionAmongstSiblings` to insert elsewhere. * If the parentId is null, the Rem will become a top level Rem. */ setParent: (parent: RemId | RemObject | null, positionAmongstSiblings?: number) => Promise; /** * Creates an alis for the Rem with the text `aliasText`. If an equivalent alias * already exists, that alias will be returned. */ getOrCreateAliasWithText: (aliasText: RichTextInterface) => Promise; /** * Gets the list of children of this Rem. */ getChildrenRem: () => Promise; /** * Get all Rem that appear in this Portal Context. */ allRemInDocumentOrPortal: () => Promise; /** * Expands this Rem to show its children. * @param recurse If true, will recursively show all descendants of this Rem. */ expand: (portal: RemId | RemObject | undefined, recurse: boolean) => Promise; /** * Collapses this Rem to hide its children. */ collapse: (portal: RemId | RemObject | undefined) => Promise; /** * Get the Rem's siblings under its parent. */ siblingRem: () => Promise; /** * @alpha This method may change in a future release. * * Get the Rem's visible siblings in the given `portalId` context. * * If `portalId` is undefined, the current focused portal id will be used. */ visibleSiblingRem: (portalId?: string) => Promise; /** * Get the Rem which are tagged by this Rem. */ taggedRem: () => Promise; /** * Tags chain hierarchically - this returns all tags + all tags of tags in this Rem's ancestors. */ ancestorTagRem: () => Promise; /** * Tags chain hierarchically - this returns all tags + all tags of tags in this Rem's descendants. */ descendantTagRem: () => Promise; /** * Get all of the hierarchical descendants of this Rem. */ getDescendants: () => Promise; /** * Get the flashcards generated from this Rem. */ getCards: () => Promise; /** * Get this Rem's aliases. */ getAliases: () => Promise; /** * Get this Rem's parent. */ getParentRem: () => Promise; /** * Get the portals and documents this Rem is included in. */ portalsAndDocumentsIn: () => Promise; /** * Merge another Rem into this Rem. */ merge: (remIdToMergeIntoThisOne: RemId) => Promise; /** * Merge another Rem into this Rem and set an alias. */ mergeAndSetAlias: (remToMergeIntoThisOne: RemId | RemObject) => Promise; indent: (portal?: RemId | RemObject) => Promise; outdent: (portal?: RemId | RemObject) => Promise; /** * Set the Rem's type. */ setType: (type: SetRemType) => Promise; /** * Find all Rem which contain a direct reference to this Rem. */ remsReferencingThis: () => Promise; /** * Find all Rem which are referenced by this Rem. */ remsBeingReferenced: () => Promise; /** * Find all Rem which are referenced by this Rem, including the Rem which * those Rem are referencing. */ deepRemsBeingReferenced: () => Promise; /** * Get the Rem's sources. */ getSources: () => Promise; /** * Add a source Rem to this Rem's source list. */ addSource: (source: RemId | RemObject) => Promise; /** * Remove a source Rem from this Rem's source list. */ removeSource: (source: RemId | RemObject) => Promise; /** * Returns true if the Rem is a Document Rem. */ isDocument: () => Promise; /** * Set whether or not this Rem is a Document Rem */ setIsDocument: (isDocument: boolean) => Promise; /** * Returns true if this Rem is a list item. */ isListItem: () => Promise; /** * Set whether or not this Rem is a list item. */ setIsListItem: (isListItem: boolean) => Promise; /** * Returns true if this Rem is a card item. */ isCardItem: () => Promise; /** * Set whether or not this Rem is a multiline item. */ setIsCardItem: (isCardItem: boolean) => Promise; /** * Returns true if this Rem is a Quote. */ isQuote: () => Promise; /** * Set whether or not this Rem is a Quote. */ setIsQuote: (isQuote: boolean) => Promise; /** * Returns true if this Rem is a Code Block. */ isCode: () => Promise; /** * Set whether or not this Rem is a Code Block. */ setIsCode: (isCode: boolean) => Promise; /** * Returns true if this Rem is a Todo. */ isTodo: () => Promise; /** * Set whether or not this Rem is a Todo. */ setIsTodo: (isTodo: boolean) => Promise; getTodoStatus: () => Promise<'Finished' | 'Unfinished' | undefined>; setTodoStatus: (todoStatus: 'Finished' | 'Unfinished') => Promise; /** * Get the Rem's font size if it is a heading. Returns undefined for normal text. */ getFontSize: () => Promise<'H1' | 'H2' | 'H3' | undefined>; /** * Set the Rem's font size. */ setFontSize: (fontSize: 'H1' | 'H2' | 'H3' | undefined) => Promise; /** * Get the Rem's highlight color. */ getHighlightColor: () => Promise; /** * Get the Rem's highlight color. */ setHighlightColor: (highlightColor: 'Red' | 'Orange' | 'Yellow' | 'Green' | 'Blue' | 'Purple') => Promise; /** * Returns whether or not this Rem is a powerup Rem. */ isPowerup: () => Promise; /** * Returns whether or not this Rem is a powerup enum. */ isPowerupEnum: () => Promise; /** * Returns whether or not this Rem is a powerup list item. */ isPowerupPropertyListItem: () => Promise; /** * Returns whether or not this Rem is a powerup slot. */ isPowerupSlot: () => Promise; /** * Returns whether or not this Rem is a powerup property. */ isPowerupProperty: () => Promise; /** * Returns whether or not this Rem is a slot. * @deprecated Use `isProperty` instead. */ isSlot: () => Promise; /** * Set whether or not this Rem is a slot. * @deprecated Use `setIsProperty` instead. */ setIsSlot: (isSlot: boolean) => Promise; /** * Returns whether or not this Rem is a property. */ isProperty: () => Promise; /** * Set whether or not this Rem is a property. */ setIsProperty: (isProperty: boolean) => Promise; /** * Set `portalId` if you want to control whether or not to zoom into the Rem. */ openRemInContext: (portalId?: RemId) => Promise; /** * Zooms into the Rem and opens it in the current pane. */ openRemAsPage: () => Promise; /** * Returns whether or not this Rem generates flashcards to be practiced in the queue. */ getEnablePractice: () => Promise; /** * Returns which flashcard practice directions are enabled for this Rem. */ getPracticeDirection: () => Promise<'forward' | 'backward' | 'none' | 'both'>; /** * Sets whether or not this Rem generates flashcards to be practiced in the queue. */ setEnablePractice: (enablePractice: boolean) => Promise; /** * Sets which flashcard practice directions are enabled for this Rem. */ setPracticeDirection: (direction: 'forward' | 'backward' | 'none' | 'both') => Promise; copyPortalReferenceToClipboard: () => Promise; copyTagReferenceToClipboard: () => Promise; copyReferenceToClipboard: () => Promise; /** * Scroll the highlight this Rem represents into view in the PDF/HTML reader. */ scrollToReaderHighlight: () => Promise; /** * Get whether or not the Rem is a folder. */ isFolder: () => Promise; /** * Set whether or not the Rem is a folder. */ setIsFolder: (isFolder: boolean) => Promise; } /** * # Rem Namespace * * The API Rem namespace. Call with `plugin.rem.apiMethodName()`. */ export declare class RemNamespace extends NamespaceBase { /** @hidden */ constructor(_call: InternalCallMethod); /** * Find a Rem by ID. If your plugin doesn't have access to the Rem, undefined will * be returned. */ findOne: (remId: RemId | undefined) => Promise; /** * Creates a single Rem representing your parsed `markdown`. * Newlines will NOT be turned into separate sibling/child Rem. */ createSingleRemWithMarkdown: (markdown: string, parentId?: RemId) => Promise; /** * Creates a tree of Rem representing your parsed `markdown`. * Newlines will be turned into separate sibling/child Rem. */ createTreeWithMarkdown: (markdown: string, parentId?: RemId) => Promise; /** * Finds a Rem by its name. If `parentId` is null, only top-level Rem will * be returned. * @returns */ findByName: (name: RichTextInterface, parentId: RemId | null) => Promise; /** * Move a group of rems under a new parent. * @returns */ moveRems: (rems: RemId[] | RemObject[], newParent: RemId | RemObject, positionAmongstSiblings: number, portal?: RemId | RemObject) => Promise; /** * Get all Rem in the user's knowledgebase. Results will be filtered down * to only those Rem your plugin has access to. Note: may be slow for large * knowledgebases. */ getAll: () => Promise; /** * Find multiple Rem by ID. If your plugin doesn't have access to a Rem, undefined will * be returned. */ findMany: (rs: RemId[] | RemObject[]) => Promise; /** * Create a portal. */ createPortal: () => Promise; /** * Create a Rem that represents an external web link. * For example, you can create a link Rem to http://google.com/. * Clicking this link in the editor will open the URL in a separate tab. * If a Rem for this link already exists, it will be returned. * If addTitle is true, the title of the page will be used as the name of the Rem. */ createLinkRem: (url: string, addTitle?: boolean) => Promise; /** * Create a Table Rem. */ createTable: (existingTag?: RemId | RemObject) => Promise; /** Create a Rem. Your Rem will be created in a location that your plugin * has access to depending on your plugin's Access Scopes. */ createRem: () => Promise; } export declare const REM_NAMESPACE = "rem"; export {};