@appium/types
Advanced tools
Comparing version 0.13.1 to 0.13.2
@@ -9,3 +9,5 @@ /** | ||
*/ | ||
export type AddressConfig = string; | ||
export type AddressConfig = AddressConfig1 & AddressConfig2; | ||
export type AddressConfig1 = string; | ||
export type AddressConfig2 = string; | ||
/** | ||
@@ -12,0 +14,0 @@ * Whether the Appium server should allow web browser connections from any host |
@@ -32,7 +32,7 @@ import { ConditionalPick, MultidimensionalReadonlyArray } from 'type-fest'; | ||
*/ | ||
export type MethodMap<T extends Plugin | Driver<any>> = T extends Plugin ? Readonly<PluginMethodMap<T>> : T extends Driver<any> ? Readonly<DriverMethodMap<T>> : never; | ||
export type MethodMap<T extends Plugin | Driver> = T extends Plugin ? Readonly<PluginMethodMap<T>> : 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]: { | ||
@@ -104,3 +104,3 @@ GET?: DriverMethodDef<T>; | ||
*/ | ||
export interface DriverExecuteMethodDef<T extends Driver<any>> extends BaseExecuteMethodDef { | ||
export interface DriverExecuteMethodDef<T extends Driver> extends BaseExecuteMethodDef { | ||
command: keyof ConditionalPick<T, DriverCommand>; | ||
@@ -117,3 +117,3 @@ } | ||
*/ | ||
export type ExecuteMethodMap<T extends Plugin | Driver<any>> = T extends Plugin ? Readonly<StringRecord<PluginExecuteMethodDef<T>>> : T extends Driver<any> ? Readonly<StringRecord<DriverExecuteMethodDef<T>>> : never; | ||
export type ExecuteMethodMap<T extends Plugin | Driver> = T extends Plugin ? Readonly<StringRecord<PluginExecuteMethodDef<T>>> : T extends Driver ? Readonly<StringRecord<DriverExecuteMethodDef<T>>> : never; | ||
//# sourceMappingURL=command.d.ts.map |
@@ -9,5 +9,2 @@ export declare const BASE_DESIRED_CAP_CONSTRAINTS: { | ||
}; | ||
readonly deviceName: { | ||
readonly isString: true; | ||
}; | ||
readonly platformVersion: { | ||
@@ -14,0 +11,0 @@ readonly isString: true; |
@@ -12,5 +12,2 @@ "use strict"; | ||
}, | ||
deviceName: { | ||
isString: true, | ||
}, | ||
platformVersion: { | ||
@@ -17,0 +14,0 @@ isString: true, |
@@ -11,3 +11,5 @@ /* eslint-disable */ | ||
*/ | ||
export type AddressConfig = string; | ||
export type AddressConfig = AddressConfig1 & AddressConfig2; | ||
export type AddressConfig1 = string; | ||
export type AddressConfig2 = string; | ||
/** | ||
@@ -14,0 +16,0 @@ * Whether the Appium server should allow web browser connections from any host |
@@ -33,5 +33,5 @@ import {ConditionalPick, MultidimensionalReadonlyArray} from 'type-fest'; | ||
*/ | ||
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>> | ||
@@ -43,3 +43,3 @@ : never; | ||
*/ | ||
export interface DriverMethodMap<T extends Driver<any>> { | ||
export interface DriverMethodMap<T extends Driver> { | ||
[key: string]: { | ||
@@ -123,3 +123,3 @@ GET?: DriverMethodDef<T>; | ||
*/ | ||
export interface DriverExecuteMethodDef<T extends Driver<any>> extends BaseExecuteMethodDef { | ||
export interface DriverExecuteMethodDef<T extends Driver> extends BaseExecuteMethodDef { | ||
command: keyof ConditionalPick<T, DriverCommand>; | ||
@@ -138,6 +138,6 @@ } | ||
*/ | ||
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; |
@@ -1,2 +0,2 @@ | ||
import {Constraints} from './driver'; | ||
import type {Constraints} from './driver'; | ||
@@ -11,5 +11,2 @@ export const BASE_DESIRED_CAP_CONSTRAINTS = { | ||
}, | ||
deviceName: { | ||
isString: true, | ||
}, | ||
platformVersion: { | ||
@@ -16,0 +13,0 @@ isString: true, |
@@ -1,11 +0,11 @@ | ||
import type {EventEmitter} from 'events'; | ||
import {Entries} from 'type-fest'; | ||
import {ActionSequence} from './action'; | ||
import {Capabilities, DriverCaps, W3CCapabilities, W3CDriverCaps} from './capabilities'; | ||
import {ExecuteMethodMap, MethodMap} from './command'; | ||
import {ServerArgs} from './config'; | ||
import {HTTPHeaders, HTTPMethod} from './http'; | ||
import {AppiumLogger} from './logger'; | ||
import {AppiumServer, UpdateServerCallback} from './server'; | ||
import {Class, StringRecord, Element} from './util'; | ||
import type {EventEmitter} from 'node:events'; | ||
import type {Merge} from 'type-fest'; | ||
import type {ActionSequence} from './action'; | ||
import type {Capabilities, DriverCaps, W3CCapabilities, W3CDriverCaps} from './capabilities'; | ||
import type {ExecuteMethodMap, MethodMap} from './command'; | ||
import type {ServerArgs} from './config'; | ||
import type {HTTPHeaders, HTTPMethod} from './http'; | ||
import type {AppiumLogger} from './logger'; | ||
import type {AppiumServer, UpdateServerCallback} from './server'; | ||
import type {Class, Element, StringRecord} from './util'; | ||
@@ -374,3 +374,3 @@ /** | ||
export interface ISettingsCommands<T extends StringRecord = StringRecord> { | ||
export interface ISettingsCommands<T extends object = object> { | ||
/** | ||
@@ -382,3 +382,3 @@ * Update the session's settings dictionary with a new settings object | ||
*/ | ||
updateSettings: (settings: StringRecord) => Promise<void>; | ||
updateSettings: (settings: T) => Promise<void>; | ||
@@ -446,3 +446,3 @@ /** | ||
*/ | ||
deleteSession(sessionId?: string, driverData?: DriverData[]): Promise<DeleteResult>; | ||
deleteSession(sessionId?: string, driverData?: DriverData[]): Promise<DeleteResult | void>; | ||
@@ -484,5 +484,5 @@ /** | ||
*/ | ||
export interface Constraints { | ||
[name: string]: Constraint; | ||
} | ||
export type Constraints = { | ||
readonly [name: string]: Constraint; | ||
}; | ||
@@ -575,2 +575,4 @@ export interface DriverHelpers { | ||
export type Protocol = 'MJSONWP' | 'W3C'; | ||
/** | ||
@@ -585,4 +587,4 @@ * Methods and properties which both `AppiumDriver` and `BaseDriver` inherit. | ||
opts: DriverOpts<C>; | ||
initialOpts: Partial<DriverOpts<C>>; | ||
protocol?: string; | ||
initialOpts: InitialOpts; | ||
protocol?: Protocol; | ||
helpers: DriverHelpers; | ||
@@ -645,3 +647,3 @@ basePath: string; | ||
canProxy(sessionId?: string): boolean; | ||
proxyRouteIsAvoided(sessionId: string, method: string, url: string): boolean; | ||
proxyRouteIsAvoided(sessionId: string, method: string, url: string, body?: any): boolean; | ||
addManagedDriver(driver: Driver): void; | ||
@@ -651,3 +653,3 @@ getManagedDrivers(): Driver<Constraints>[]; | ||
logEvent(eventName: string): void; | ||
driverForSession(sessionId: string): Core<C> | null; | ||
driverForSession(sessionId: string): Core<Constraints> | null; | ||
} | ||
@@ -773,4 +775,11 @@ | ||
*/ | ||
export interface ExternalDriver<C extends Constraints = Constraints, Ctx = string> | ||
extends Driver<C> { | ||
export interface ExternalDriver< | ||
C extends Constraints = Constraints, | ||
Ctx = string, | ||
CArgs extends StringRecord = StringRecord, | ||
Settings extends StringRecord = StringRecord, | ||
CreateResult = DefaultCreateSessionResult<C>, | ||
DeleteResult = DefaultDeleteSessionResult, | ||
SessionData extends StringRecord = StringRecord | ||
> extends Driver<C, CArgs, Settings, CreateResult, DeleteResult, SessionData> { | ||
// WebDriver spec commands | ||
@@ -2021,9 +2030,12 @@ | ||
/** | ||
* Options as passed into a driver constructor, which is just a union of {@linkcode ServerArgs} and {@linkcode Capabilities}. | ||
* | ||
* The combination happens within Appium prior to calling the constructor. | ||
* Options as set within {@linkcode ExternalDriver.createSession}, which is a union of {@linkcode InitialOpts} and {@linkcode DriverCaps}. | ||
*/ | ||
export type DriverOpts<C extends Constraints> = ServerArgs & ExtraDriverOpts & DriverCaps<C>; | ||
export type DriverOpts<C extends Constraints> = InitialOpts & DriverCaps<C>; | ||
/** | ||
* Options as provided to the {@linkcode Driver} constructor. | ||
*/ | ||
export type InitialOpts = Merge<ServerArgs, ExtraDriverOpts>; | ||
/** | ||
* An instance method of a driver class, whose name may be referenced by {@linkcode MethodDef.command}, and serves as an Appium command. | ||
@@ -2030,0 +2042,0 @@ * |
{ | ||
"name": "@appium/types", | ||
"version": "0.13.1", | ||
"version": "0.13.2", | ||
"description": "Various type declarations used across Appium", | ||
@@ -36,3 +36,3 @@ "keywords": [ | ||
"build": "node ./scripts/generate-schema-types.js", | ||
"clean": "git checkout -- ./types/lib/appium-config.ts || true", | ||
"clean": "git checkout -- ./lib/appium-config.ts || true", | ||
"test:smoke": "node ./index.js", | ||
@@ -42,3 +42,3 @@ "test:types": "tsd" | ||
"dependencies": { | ||
"@appium/schema": "^0.3.0", | ||
"@appium/schema": "^0.3.1", | ||
"@appium/tsconfig": "^0.3.0", | ||
@@ -57,3 +57,3 @@ "@types/express": "4.17.17", | ||
}, | ||
"gitHead": "58b71869d1ebdac9f5357e515ba6d287065fec66", | ||
"gitHead": "8a6a4ba7e74da0785aa65767aaaef84cc4a8134b", | ||
"typedoc": { | ||
@@ -60,0 +60,0 @@ "entryPoint": "./lib/index.ts" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
276325
6240
Updated@appium/schema@^0.3.1