Skip to content

Commit

Permalink
chore(appium,types): remove some useless type arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
boneskull committed Jul 3, 2023
1 parent 01061b2 commit e30ad0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/appium/lib/appium.js
Expand Up @@ -163,7 +163,7 @@ class AppiumDriver extends DriverCore {
async getSessions() {
return _.toPairs(this.sessions).map(([id, driver]) => ({
id,
capabilities: /** @type {import('@appium/types').DriverCaps} */ (driver.caps),
capabilities: /** @type {import('@appium/types').DriverCaps<any>} */ (driver.caps),
}));
}

Expand Down
12 changes: 6 additions & 6 deletions packages/types/lib/command.ts
Expand Up @@ -30,16 +30,16 @@ export interface PayloadParams {
* }
* ```
*/
export type MethodMap<T extends Plugin | Driver<any>> = T extends Plugin
export type MethodMap<T extends Plugin | Driver> = T extends Plugin
? Readonly<PluginMethodMap<T>>
: T extends Driver<any>
: T extends Driver
? Readonly<DriverMethodMap<T>>
: never;

/**
* A {@linkcode MethodMap} for a {@linkcode Driver}.
*/
export interface DriverMethodMap<T extends Driver<any>> {
export interface DriverMethodMap<T extends Driver> {
[key: string]: {
GET?: DriverMethodDef<T>;
POST?: DriverMethodDef<T>;
Expand Down Expand Up @@ -118,7 +118,7 @@ export interface BaseExecuteMethodDef {
/**
* A definition of an execute method in a {@linkcode Driver}.
*/
export interface DriverExecuteMethodDef<T extends Driver<any>> extends BaseExecuteMethodDef {
export interface DriverExecuteMethodDef<T extends Driver> extends BaseExecuteMethodDef {
command: keyof ConditionalPick<T, DriverCommand>;
}

Expand All @@ -132,8 +132,8 @@ export interface PluginExecuteMethodDef<T extends Plugin> extends BaseExecuteMet
/**
* Definition of an execute method (which overloads the behavior of the `execute` command) in a {@linkcode Driver} or {@linkcode Plugin}.
*/
export type ExecuteMethodMap<T extends Plugin | Driver<any>> = T extends Plugin
export type ExecuteMethodMap<T extends Plugin | Driver> = T extends Plugin
? Readonly<StringRecord<PluginExecuteMethodDef<T>>>
: T extends Driver<any>
: T extends Driver
? Readonly<StringRecord<DriverExecuteMethodDef<T>>>
: never;

0 comments on commit e30ad0e

Please sign in to comment.