warframe-worldstate-parser
Version:
An Open parser for Warframe's Worldstate in Javascript
96 lines (95 loc) • 3.02 kB
TypeScript
/**
* An object describing a type of reward, including name, description,
* test function to verify type from a string, thumbnail url, and color
* @typedef {object} RewardType
* @property {string} name - Name of the reward type
* @property {string} description - Description of the reward type
* @property {string} test - Function for testing the return type against a string
* @property {string} thumbnail - Thumbnail url for this reward type
* @property {string} color - Summary color representing this reward type
*/
/**
* Returns the type of a given item
* @param {string} item The item whose type needs to be determined
* @param {Array.<RewardType>} [types] The possible types
* @returns {string} The type name
*/
export function getItemType(item: string, types?: Array<RewardType>): string;
/**
* Returns the full type of a given item
* @param {string} item The item whose type needs to be determined
* @param {Array.<RewardType>} [types] The possible types
* @returns {RewardType} The type
*/
export function getItemTypeFull(item: string, types?: Array<RewardType>): RewardType;
/**
* Represents a mission reward
*/
export default class Reward {
/**
* @param {object} data The mission data
* @param {Dependency} deps The dependencies object
* @param {string} deps.locale Locale to use for translations
*/
constructor(data: object, { locale }?: Dependency);
/**
* The items being rewarded
* @type {Array.<string>}
*/
items: Array<string>;
/**
* The counted items being rewarded
* @type {Array.<object>}
*/
countedItems: Array<object>;
/**
* The credits being rewarded
* @type {number}
*/
credits: number;
asString: string;
itemString: string;
thumbnail: string;
color: string | number;
/**
* The types of all items that are being rewarded
* @returns {Array.<string>} types as array of string
*/
getTypes(): Array<string>;
/**
* The types of all the items that are being rewarded
* @returns {Array.<RewardType>} array of reward types
*/
getTypesFull(): Array<RewardType>;
/**
* The reward's string representation
* @returns {string} reward's string representation
*/
toString(): string;
}
/**
* An object describing a type of reward, including name, description,
* test function to verify type from a string, thumbnail url, and color
*/
export type RewardType = {
/**
* - Name of the reward type
*/
name: string;
/**
* - Description of the reward type
*/
description: string;
/**
* - Function for testing the return type against a string
*/
test: string;
/**
* - Thumbnail url for this reward type
*/
thumbnail: string;
/**
* - Summary color representing this reward type
*/
color: string;
};