import { AnkiConnectFetch } from '../AnkiConnectFetch' ; /**
 *
 * Modify the fields of an exist note.
 *
 * Sample request:
 *
 * {
 *    "action": "updateNoteFields",
 *    "version": 6,
 *    "params": {
 *        "note": {
 *            "id": 1514547547030,
 *            "fields": {
 *                "Front": "new front content",
 *                "Back": "new back content"
 *            }
 *        }
 *    }
 *}
 * Sample result:
 *
 * {
 *    "result": null,
 *    "error": null
 *}
 */ export class UpdateNoteFieldsClient implements IUpdateNoteFieldsClient { public async execute ( updateNote ) { const body = { action : "updateNoteFields" , version : 6 , params : { note : updateNote } } ; const init = { method : 'POST' , body : JSON . stringify ( body ) } ; await AnkiConnectFetch . fetch ( init ) ; } } export interface IUpdateNoteFieldsClient { execute ( updateNote ) : Promise < void > ; } export interface UpdateNote { readonly id : number ; readonly fields : { [ name ] : string ; } ; }