@@ -13,6 +13,8 @@ import {
1313 PvPTeamGetResult ,
1414 PvPTeamSearchParams ,
1515 PvPTeamSearchResult ,
16+ SearchIndexResult ,
17+ SearchIndexes ,
1618 SearchResult ,
1719} from "./utils" ;
1820export * from "./utils" ;
@@ -43,36 +45,7 @@ declare module "@xivapi/js" {
4345 /**
4446 * Search a specific series of indexes separated by commas.
4547 */
46- indexes : [
47- | "Achievement"
48- | "Title"
49- | "Action"
50- | "CraftAction"
51- | "Trait"
52- | "PvPAction"
53- | "PvPTrait"
54- | "Status"
55- | "BNpcName"
56- | "ENpcResident"
57- | "Companion"
58- | "Mount"
59- | "Leve"
60- | "Emote"
61- | "InstanceContent"
62- | "Item"
63- | "Recipe"
64- | "Fate"
65- | "Quest"
66- | "ContentFinderCondition"
67- | "Balloon"
68- | "BuddyEquip"
69- | "Orchestrion"
70- | "PlaceName"
71- | "Weather"
72- | "World"
73- | "Map"
74- | "lore_finder"
75- ] ;
48+ indexes : SearchIndexes [ ] ;
7649
7750 /**
7851 * Search for lore! This is a special built search endpoint which searches a string through various lore specific content.
@@ -105,9 +78,9 @@ declare module "@xivapi/js" {
10578 }
10679
10780 export default class XIVAPI {
108- public readonly options : XIVAPIOptions ;
109- public readonly endpoint : string ;
110- public readonly globalParams : { [ key : string ] : string | number } ;
81+ private readonly options : XIVAPIOptions ;
82+ private readonly endpoint : string ;
83+ private readonly globalParams : { [ key : string ] : string | number } ;
11184
11285 constructor ( options : string | XIVAPIOptions ) ;
11386 constructor ( options : string | XIVAPIOptions , legacyOptions ?: XIVAPIOptions ) ;
@@ -125,7 +98,10 @@ declare module "@xivapi/js" {
12598 * await xiv.search("aiming", { indexes: ["Item", "Recipe"] }); // with params
12699 * ```
127100 */
128- public search ( input : string , params ?: DataSearchParams ) : Promise < SearchResult > ;
101+ public search (
102+ input : keyof typeof SearchIndexes ,
103+ params ?: DataSearchParams
104+ ) : Promise < SearchIndexResult > ;
129105
130106 /**
131107 * Obtain game content data of Final Fantasy XIV.
@@ -157,8 +133,8 @@ declare module "@xivapi/js" {
157133 * ```
158134 */
159135 list : (
160- name : string ,
161- params : {
136+ name : keyof typeof SearchIndexes ,
137+ params ? : {
162138 /**
163139 * Limit the number of items returned by the API.
164140 * @min 100
@@ -171,7 +147,7 @@ declare module "@xivapi/js" {
171147 */
172148 ids ?: number [ ] ;
173149 }
174- ) => Promise < SearchResult > ;
150+ ) => Promise < SearchIndexResult > ;
175151
176152 /**
177153 * Returns information about a specific object including extended information.
0 commit comments