UNPKG

galeforce-tmp-sea

Version:

A customizable, promise-based, and command-oriented TypeScript library for the Riot Games API.

30 lines 1.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TakesRegion = void 0; /** * A mixin for the `.region()` method. * @template TRegion The type of the region. Specified by the type of the `type` parameter. * @template TBase The type of the object inside. * @param type A dummy parameter to allow for type inference. Use by passing in `<T>{}` or * an expression of that form. * @param Base The target class. */ function TakesRegion(type, Base) { return class extends Base { /** * Modifies the **region** associated with the Action object it is called from. * Note that associated runtime type checks are performed to ensure that * the provided region matches one of the expected API regions. * @param region The region to update the calling Action object with. * @throws Will throw an error if an invalid region is provided or the provided * region fails the runtime type check. */ region(region) { this.payload.region = region; this.region = undefined; return this; } }; } exports.TakesRegion = TakesRegion; //# sourceMappingURL=region.js.map