- `core` module is now TS
- `constants` module is now TS
- export missing `W3C_ELEMENT_KEY`
- `JWProxy.command` returns `Promise<unknown>`. deal with it
- updated some type tests
- added a `Protocol` type for some string constants
- `proxyRouteIsAvoided` optionally accepts a `body` arg
- `Core<C>.driverForSession` does not actually return something using type `C`.
- `ExternalDriver` passes thru all type args to `Driver`. this should be non-breaking
- `StringRecord` is more appropriate type for default driver settings
- `Constraints` should be readonly
A thing we know about the `opts` object passed in to a driver constructor is that it does _not_ contain caps. This value is retained in `this.initialOpts`. Upon session creation, it _does_ contain caps.
This adds a new type, `InitialOpts`, which is the first parameter to a driver. In the future, it may accept a type argument, as currently any extension-specific options (defined via schema in `package.json`) are not typed.
Because `DriverOpts` is a superset of `InitialOpts`, this should not be a breaking change.
The mixin approach prevented subclasses of BaseDriver from narrowing the type of `this.settings`. Now, that's possible.
Also:
- removed an unused type argument from BD constructor
- and did some typedef aliasing
- remove unneeded type assertion from log mixin
This cap was conflicting with constraints defined in subclasses. Currently, it isn't possible to cleanly "override" constraints. Given `deviceName` is not used anywhere within base-driver's source, this seems like a decent workaround for now.
* fix(docutils): set mike version to major.minor by default
* Update packages/docutils/lib/builder/deploy.ts
Co-authored-by: Christopher Hiller <boneskull@boneskull.com>
---------
Co-authored-by: Christopher Hiller <boneskull@boneskull.com>
- because BaseDriver implements `findElOrEls` (technically), any subclasses must not inherit an interface containing a non-identical `findElOrEls` -- not even narrowing. so to avoid this, we will need to make it as broad as possible; no more generic `Ctx`
- likewise with `getLog`
- fix return type of `setGeoLocation`
- fix return type of `getPerformanceData`
- fix return type of `removeApp`
- fix return type of `hideKeyboard`
- fix return type of `getSystemBars`
- fix signature of various `touch*` methods
- fix return type of `setNetworkConnection`
alternatively, the deprecated methods mentioned here should be removed.
BREAKING CHANGE: This changes the def of `findElOrEls` and `findElOrElsWithProcessing` in `ExternalDriver` in a breaking manner.
So conditional types don't work like how I was using them. They work in capital-T-types (`type`), but they don't work as return values. Instead, what we should have is an overload. in this case, the function can be called one of two ways, and it returns a different thing depending on those values. _unfortunately_ this is a little hinky to implement, given that overloads are unsupported in _object literals_. they are supported in function statements or expressions, and they are supported in class definitions, but not object literals. you'll see what needs to happen to make this work in `FakeDriver` and `BaseDriver` in subsequent changesets; essentially the function must be defined outside of the object literal and then stuffed in there.
The other change here changes an `object` type (which does not allow arbitrary properties) to a `StringRecord` type within the type which converts `Constraints` to `Capabilities`. This affects caps for some drivers such as `chromedriverArgs` in `appium-android-driver`; anywhere where the constraint has `isObject: true`.
* fix(docutils): fixes some weirdness with default behavior and the "implies" keyword
- also squashes an errrant warning
- fix some diff logic when writing to `mkdocs.yml`
* fix(docutils): more robust mike-finding