1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
* The MIT License (MIT)
*
* Copyright (c) 2023 Codecrafter_404 <codecrafter_404@t-online.de>
*
* 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.
*/
/// Creates a new model to be used in Anki.
/// Find and replace string in an existing model template.
///
/// Please note that this replaces the matched text in the card types/templates, not the cards themselves.
/// It is possible to replace matches only in the _Front Template_, _Back Template_ and _Styling_.
///
/// Returns the number of models updated.
/// Gets a list of models by their IDs.
/// Gets a list of models by their names.
/// Adds a new field to a model.
///
/// The `index` value can optionally be provided, which works exactly the same as the `index` in [model_field_descriptions].
/// By default, the field is added to the end of the field list.
/// Gets the complete list of field descriptions for the provided model.
///
/// The field descriptions is the placeholder text seen in the _Card Edit_ dialog when a field is empty.
/// Gets a complete list of available fonts along with their font sizes.
/// Gets a complete list of field names for the model.
/// Deletes a field from a model.
/// Renames a field.
/// Reposition the field within the field list of a given model.
///
/// The value of `index` starts at 0.
/// For example, an index of `0` puts the field in the first position, and an index of `2` puts the field in the third position.
/// Sets a field description.
///
/// The field descriptions is the placeholder text seen in the _Card Edit_ dialog when a field is empty.
///
/// Anki 2.1.49 and below do not have field descriptions. In that case, this will return with `false`.
/// Sets a field font.
/// Sets a field font size.
/// Gets a list of the fields on the question and answer side of each card template.
///
/// The question side is given first in each array.
/// Gets the complete list of model names for the current user.
/// Gets the complete list of model names and their corresponding IDs for the current user.
/// Gets the CSS styling for the provided model by name.
/// Adds a template to an existing model by name.
///
/// Use [update_model_templates] if you want to update an existing template instead.
/// Removes a template from an existing model.
/// Renames a template in an existing model.
/// Repositions a template in an existing model.
///
/// The value of `index` starts at 0.
/// For example, an index of `0` puts the template in the first position, and an index of `2` puts the template in the third position.
/// Gets the template content for each card connected to the provided model.
/// Modify the CSS styling of an existing model.
/// Modify the templates of an existing model.
///
/// Only specified cards and specified sides will be modified.
/// If an existing card or side is not included in the request, it will be left unchanged.