anki_bridge 0.10.2

AnkiBridge is a Rust library that provides a bridge between your Rust code and the Anki application, enabling HTTP communication and seamless data transmission.
Documentation
/*
* The MIT License (MIT)
*
* Copyright (c) 2023 DaniƩl Kerkmann <daniel@kerkmann.dev>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/// Opens the _Add Cards_ dialog with the provided details prefilled.
///
/// If the dialog is already open, it will be reopened with the new provided details.
///
/// Audio, video, and picture files can be embedded into the fields via the `audio`, `video`, and `picture` keys, respectively.
/// Refer to the documentation of [add_note] and [store_media_file] for an explanation of these fields.
///
/// The result is the ID of the note that would be added in case the user chose to confirm the _Add Cards_ dialogue.
///
/// [add_note]: crate::note_actions::add_note
/// [store_media_file]: crate::media_actions::store_media_file
pub mod gui_add_cards;

/// Answers the current card.
///
/// Returns `true` if succeeded or `false` otherwise.
/// Note that the answer for the current card must be displayed before any answer can be accepted by Anki.
pub mod gui_answer_card;

/// Invokes the Card Browser dialog and searches for a given query.
///
/// Query syntax is [documented here](https://docs.ankiweb.net/searching.html).
///
/// Returns an array of the card IDs that were found.
///
/// Optionally, the `reorder_cards` property can be provided to reorder the cards shown in the _Card Browser_.
/// This is an array including the `order` and `column_id` objects. `order` can be either `ascending` or `descending` while `column_id` can be one of several column identifiers (as documented in the [Anki source code](https://github.com/ankitects/anki/blob/main/rslib/src/browser_table.rs)).
/// The specified column needs to be visible in the _Card Browser_.
pub mod gui_browse;

/// Requests a database check.
///
/// Does not wait for the check to complete.
/// Therefore, the action will always return `true` even if errors are detected during the database check.
pub mod gui_check_database;

/// Gets information about the currently displayed card.
///
/// Returns `null` if not in review mode.
pub mod gui_current_card;

/// Opens the _Deck Browser_ dialog.
pub mod gui_deck_browser;

/// Opens the _Deck Overview_ dialog for the deck with the given name.
///
/// Returns `true` if succeeded or `false` otherwise.
pub mod gui_deck_overview;

/// Starts review for the deck with the given name.
///
/// Returns `true` if succeeded or `false` otherwise.
pub mod gui_deck_review;

/// Opens the _Edit_ dialog for the given note.
///
/// This dialog is similar to the _Edit Current_ dialog, except it:
/// - has a _Preview_ button to preview the cards for the note
/// - has a _Browse_ button to open the browser with these cards
/// - has _Previous/Back_ buttons to navigate the history of the dialog
/// - has no bar with the _Close_ button
pub mod gui_edit_note;

/// Gracefully closes Anki.
///
/// This operation is asynchronous, so it will return immediately and won't wait until the Anki process actually terminates.
pub mod gui_exit_anki;

/// Opens the _Import..._ dialog, with an optional file path.
///
/// Brings up the dialog for the user to review the import.
/// Supports all file types that Anki supports.
/// Opens the system file dialog if no path is provided.
/// Forward slashes must be used in the path on Windows.
///
/// Only supported for Anki 2.1.52+.
pub mod gui_import_file;

/// Selects a card in the _Card Browser_ dialog.
///
/// The _Card Browser_ must be open. Nothing will happen if it is not.
///
/// Returns `true` if the _Card Browser_ is open, `false` otherwise.
pub mod gui_select_card;

/// Gets the selected notes in the _Card Browser_ dialog.
///
/// Returns an empty list if the _Card Browser_ dialog is not open.
pub mod gui_selected_notes;

/// Shows the answer side of the current card.
///
/// Returns `true` if in review mode or `false` otherwise.
pub mod gui_show_answer;

/// Shows the question side of the current card.
///
/// Returns `true` if in review mode or `false` otherwise.
pub mod gui_show_question;

/// Starts or resets the `timerStarted` value for the current card.
///
/// Useful for deferring the start time to when it is displayed via the API, allowing the recorded time taken to answer the card to be more accurate when calling [gui_answer_card].
pub mod gui_start_card_timer;

/// Undoes the last action/card.
///
/// Returns `true` if succeeded or `false` otherwise.
pub mod gui_undo;