vndb-api-kana
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -17,90 +17,2 @@ import * as axios from 'axios'; | ||
interface Image { | ||
/** | ||
* String, image identifier. | ||
*/ | ||
id: number; | ||
/** | ||
* String. | ||
*/ | ||
url: string; | ||
/** | ||
* Pixel dimensions of the image, array with two integer elements indicating the width and height. | ||
*/ | ||
dims: [number, number]; | ||
/** | ||
* Number between 0 and 2 (inclusive), average image flagging vote for sexual content. | ||
*/ | ||
sexual: number; | ||
/** | ||
* Number between 0 and 2 (inclusive), average image flagging vote for violence. | ||
*/ | ||
violence: number; | ||
/** | ||
* Integer, number of image flagging votes. | ||
*/ | ||
votecount: number; | ||
} | ||
/** | ||
* titles associated with the VN | ||
*/ | ||
interface Title { | ||
/** | ||
* String, language. Each language appears at most once in the titles list. | ||
*/ | ||
lang: string; | ||
/** | ||
* String, title in the original script. | ||
*/ | ||
title: string; | ||
/** | ||
* String, can be null, romanized version of title. | ||
*/ | ||
latin: string | null; | ||
/** | ||
* Boolean. | ||
*/ | ||
offical: boolean; | ||
/** | ||
* Boolean, whether this is the “main” title for the visual novel entry. Exactly one title has this flag set in the titles array and it’s always the title whose lang matches the VN’s olang field. This field is included for convenience, you can of course also use the olang field to grab the main title. | ||
*/ | ||
main: boolean; | ||
} | ||
interface Languages { | ||
/** | ||
* String, title in the original script. Can be null, in which case the title for this language is the same as the “main” language. | ||
*/ | ||
lang: string; | ||
/** | ||
* String, can be null, romanized version of title. | ||
*/ | ||
latin: string | null; | ||
/** | ||
* Boolean, whether this is a machine translation. | ||
*/ | ||
mtl: boolean; | ||
/** | ||
* Boolean, whether this language is used to determine the “main” title for the release entry. | ||
*/ | ||
main: boolean; | ||
} | ||
interface ExtLink { | ||
/** | ||
* String, URL. | ||
*/ | ||
url: string; | ||
/** | ||
* String, English human-readable label for this link. | ||
*/ | ||
label: string; | ||
/** | ||
* Internal identifier of the site, intended for applications that want to localize the label or to parse/format/extract remote identifiers. Keep in mind that the list of supported sites, their internal names and their ID types are subject to change, but I’ll try to keep things stable. | ||
*/ | ||
name: string; | ||
/** | ||
* Remote identifier for this link. Not all sites have a sensible identifier as part of their URL format, in such cases this field is simply equivalent to the URL. | ||
*/ | ||
id: string; | ||
} | ||
interface Producer { | ||
@@ -287,3 +199,101 @@ id: string; | ||
interface Image { | ||
/** | ||
* String, image identifier. | ||
*/ | ||
id: number; | ||
/** | ||
* String. | ||
*/ | ||
url: string; | ||
/** | ||
* Pixel dimensions of the image, array with two integer elements indicating the width and height. | ||
*/ | ||
dims: [number, number]; | ||
/** | ||
* Number between 0 and 2 (inclusive), average image flagging vote for sexual content. | ||
*/ | ||
sexual: number; | ||
/** | ||
* Number between 0 and 2 (inclusive), average image flagging vote for violence. | ||
*/ | ||
violence: number; | ||
/** | ||
* Integer, number of image flagging votes. | ||
*/ | ||
votecount: number; | ||
} | ||
interface ScreenShot extends Image { | ||
thumbnail: string; | ||
thumbnail_dims: [number, number]; | ||
/** | ||
*Release object. All release fields can be selected. It is very common for all screenshots of a VN to be assigned to the same release, so the fields you select here are likely to get duplicated several times in the response. If you want to fetch more than just a few fields, it is more efficient to only select release.id here and then grab detailed release info with a separate request. | ||
* | ||
* https://api.vndb.org/kana#release-fields | ||
*/ | ||
release: Omit<Release$1, 'vns'>; | ||
} | ||
/** | ||
* titles associated with the VN | ||
*/ | ||
interface Title { | ||
/** | ||
* String, language. Each language appears at most once in the titles list. | ||
*/ | ||
lang: string; | ||
/** | ||
* String, title in the original script. | ||
*/ | ||
title: string; | ||
/** | ||
* String, can be null, romanized version of title. | ||
*/ | ||
latin: string | null; | ||
/** | ||
* Boolean. | ||
*/ | ||
offical: boolean; | ||
/** | ||
* Boolean, whether this is the “main” title for the visual novel entry. Exactly one title has this flag set in the titles array and it’s always the title whose lang matches the VN’s olang field. This field is included for convenience, you can of course also use the olang field to grab the main title. | ||
*/ | ||
main: boolean; | ||
} | ||
interface Languages { | ||
/** | ||
* String, title in the original script. Can be null, in which case the title for this language is the same as the “main” language. | ||
*/ | ||
lang: string; | ||
/** | ||
* String, can be null, romanized version of title. | ||
*/ | ||
latin: string | null; | ||
/** | ||
* Boolean, whether this is a machine translation. | ||
*/ | ||
mtl: boolean; | ||
/** | ||
* Boolean, whether this language is used to determine the “main” title for the release entry. | ||
*/ | ||
main: boolean; | ||
} | ||
interface ExtLink { | ||
/** | ||
* String, URL. | ||
*/ | ||
url: string; | ||
/** | ||
* String, English human-readable label for this link. | ||
*/ | ||
label: string; | ||
/** | ||
* Internal identifier of the site, intended for applications that want to localize the label or to parse/format/extract remote identifiers. Keep in mind that the list of supported sites, their internal names and their ID types are subject to change, but I’ll try to keep things stable. | ||
*/ | ||
name: string; | ||
/** | ||
* Remote identifier for this link. Not all sites have a sensible identifier as part of their URL format, in such cases this field is simply equivalent to the URL. | ||
*/ | ||
id: string; | ||
} | ||
/** | ||
* @see https://api.vndb.org/kana#post-tag | ||
@@ -359,3 +369,3 @@ */ | ||
*/ | ||
spoiler: number; | ||
spoiler: 0 | 1 | 2; | ||
/** | ||
@@ -365,2 +375,7 @@ * String, "main" for protagonist, "primary" for main characters, "side" or "appears". | ||
role: 'main' | 'primary' | 'side' | 'appears'; | ||
/** | ||
* Object, usually null, specific release that this character appears in. | ||
* | ||
*/ | ||
release: Release$1; | ||
} | ||
@@ -371,3 +386,3 @@ interface TraitInCharacter extends Trait { | ||
*/ | ||
spoiler: number; | ||
spoiler: 0 | 1 | 2; | ||
lie: boolean; | ||
@@ -390,5 +405,7 @@ } | ||
/** | ||
* String, possibly null, "a", "b", "ab" or "o". | ||
* String, possibly null, may contain formatting codes. | ||
* | ||
* formatting codes: https://vndb.org/d9#4 | ||
*/ | ||
blood_type: 'a' | 'b' | 'ab' | 'o' | null; | ||
description: string; | ||
/** | ||
@@ -399,2 +416,6 @@ * Object, possibly null, same sub-fields as the image visual novel field. | ||
/** | ||
* String, possibly null, "a", "b", "ab" or "o". | ||
*/ | ||
blood_type: 'a' | 'b' | 'ab' | 'o' | null; | ||
/** | ||
* Integer, possibly null, cm. | ||
@@ -436,2 +457,6 @@ */ | ||
/** | ||
* Array of objects, visual novels this character appears in. The same visual novel may be listed multiple times with a different release; the spoiler level and role can be different per release. | ||
*/ | ||
vns: VnInCharacter[]; | ||
/** | ||
* Array of objects, possibly empty. | ||
@@ -516,4 +541,8 @@ */ | ||
*/ | ||
image: Image[] | null; | ||
image: Image | null; | ||
/** | ||
* Array of objects, possibly empty. | ||
*/ | ||
screenshot: ScreenShot[]; | ||
/** | ||
* Integer, possibly null, rough length estimate of the VN between 1 (very short) and 5 (very long). This field is only used as a fallback for when there are no length votes, so you’ll probably want to fetch length_minutes too. | ||
@@ -520,0 +549,0 @@ */ |
{ | ||
"name": "vndb-api-kana", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "author": "TachibanaKimika", |
@@ -46,5 +46,7 @@ # vndb-api-Kana | ||
You can also use the API directly by importing the `api` object and types from the package. | ||
```typescript | ||
import { api, CharacterFilters } from 'vndb-api-kana'; | ||
import { api, CharacterFilters, Character } from 'vndb-api-kana'; | ||
@@ -70,2 +72,7 @@ const characterFilters: CharacterFilters = [ | ||
// others function: | ||
const renderChar = (c: Character) => { | ||
// ... | ||
}; | ||
``` | ||
@@ -72,0 +79,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55306
992
80