import type {Class as _Class} from 'type-fest'; /** * Utility type for a object with string-only props */ export type StringRecord = Record; /** * Wraps {@linkcode _Class `type-fest`'s `Class`} to include static members. */ export type Class = _Class & StaticMembers; /** * The string referring to a "driver"-type extension */ export type DriverType = 'driver'; /** * The string referring to a "plugin"-type extension */ export type PluginType = 'plugin'; /** * The strings referring to all extension types. */ export type ExtensionType = DriverType | PluginType; /** * Converts a kebab-cased string into a camel-cased string. */ export type KebabToCamel = S extends `${infer P1}-${infer P2}${infer P3}` ? `${Lowercase}${Uppercase}${KebabToCamel}` : Lowercase; /** * Converts an object with kebab-cased keys into camel-cased keys. */ export type ObjectToCamel = { [K in keyof T as KebabToCamel]: T[K] extends Record ? KeysToCamelCase : T[K]; }; /** * Converts an object or array to have camel-cased keys. */ export type KeysToCamelCase = { [K in keyof T as KebabToCamel]: T[K] extends Array ? KeysToCamelCase[] : ObjectToCamel; }; /** * Object `B` has all the keys as object `A` (even if those keys in `A` are otherwise optional). */ export type Associated]: unknown}> = { [Prop in keyof Required]: B[Prop]; }; /** * Given `string` `T`, this is a case-insensitive version of `T`. */ export type AnyCase = string extends T ? string : T extends `${infer F1}${infer F2}${infer R}` ? `${Uppercase | Lowercase}${Uppercase | Lowercase}${AnyCase}` : T extends `${infer F}${infer R}` ? `${Uppercase | Lowercase}${AnyCase}` : ''; /** * A W3C element. * @see https://www.w3.org/TR/webdriver1/#elements */ export interface Element { /** * For backwards compatibility with JSONWP only. * @deprecated Use {@linkcode element-6066-11e4-a52e-4f735466cecf} instead. */ ELEMENT?: Id; /** * This property name is the string constant W3C element identifier used to identify an object as * a W3C element. */ 'element-6066-11e4-a52e-4f735466cecf': Id; }