galeforce-tmp-sea
Version:
A customizable, promise-based, and command-oriented TypeScript library for the Riot Games API.
26 lines • 1.28 kB
TypeScript
import { Constructor, Executable } from './executable';
/**
* An interface containing method type signatures for any Action containing a `.query()` method.
* @template TQuery The type of the request query. Defaults to `object`, but should be specified.
*/
export interface QueryChainable<TQuery extends object = object> {
query?: <K extends QueryChainable<TQuery> & Executable>(this: K, query: TQuery) => Omit<K, 'query'>;
}
/**
* A mixin for the `.query()` method.
* @template TQuery The type of the request query. 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.
*/
export declare function TakesQuery<TQuery extends object, TBase extends Constructor>(type: TQuery, Base: TBase): {
new (...args: any[]): {
/**
* Modifies the **query** associated with the Action object it is called from.
* @param query The request query to update the calling Action object with.
*/
query<K extends QueryChainable<TQuery> & Executable>(this: K, query: TQuery): Omit<K, "query">;
};
} & TBase;
//# sourceMappingURL=query.d.ts.map