Skip to content

Commit f353bcd

Browse files
authored
Merge pull request #25 from MarvNC:support-updatable-dictionaries
Support Updatable Dictionaries
2 parents 917ca85 + 7703f83 commit f353bcd

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/builders/dictionaryIndex.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ export class DictionaryIndex {
2828
this.index.author = author;
2929
return this;
3030
}
31+
setIsUpdatable(isUpdatable: boolean) {
32+
this.index.isUpdatable = isUpdatable;
33+
return this;
34+
}
35+
setIndexUrl(indexUrl: string) {
36+
this.index.indexUrl = indexUrl;
37+
return this;
38+
}
39+
setDownloadUrl(downloadUrl: string) {
40+
this.index.downloadUrl = downloadUrl;
41+
return this;
42+
}
3143
setDescription(description: string) {
3244
this.index.description = description;
3345
return this;

src/types/yomitan/dictionaryindex.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,21 @@ type TagInfo = {
1616
type DictionaryIndexType = {
1717
/** Title of the dictionary. */
1818
title: string;
19-
/** Revision of the dictionary. This value is only used for displaying information. */
19+
/** Revision of the dictionary. This value is displayed, and used to check for dictionary updates. */
2020
revision: string;
2121
/** Whether or not this dictionary contains sequencing information for related terms. */
2222
sequenced?: boolean;
2323
/** Format of data found in the JSON data files. */
2424
format?: 1 | 2 | 3;
2525
/** Creator of the dictionary. */
2626
author?: string;
27-
/** URL for the source of the dictionary. */
27+
/** Whether this dictionary contains links to its latest version. */
28+
isUpdatable?: boolean;
29+
/** URL for the index file of the latest revision of the dictionary, used to check for updates. */
30+
indexUrl?: string;
31+
/** URL for the download of the latest revision of the dictionary. */
32+
downloadUrl?: string;
33+
/** URL for the source of the dictionary, displayed in the dictionary details. */
2834
url?: string;
2935
/** Description of the dictionary data. */
3036
description?: string;

0 commit comments

Comments
 (0)