Skip to content

Instantly share code, notes, and snippets.

@1nVitr0
Created March 13, 2021 13:41
Show Gist options
  • Save 1nVitr0/366a5829ac432597631ecb6de9f5df89 to your computer and use it in GitHub Desktop.
Save 1nVitr0/366a5829ac432597631ecb6de9f5df89 to your computer and use it in GitHub Desktop.
Compare new inbuilt typings with previous @types/puppeteer typings
// Utility Types
type Missing<A, B> = Omit<A, keyof B>;
type Extends<A, B extends A> = 1;
import {
Accessibility as TypesAccessibility,
BoundingBox as TypesBoundingBox,
BoxModel as TypesBoxModel,
Browser as TypesBrowser,
BrowserContext as TypesBrowserContext,
BrowserFetcher as TypesBrowserFetcher,
CDPSession as TypesCDPSession,
ClickOptions as TypesClickOptions,
ConnectOptions as TypesConnectOptions,
ConsoleMessage as TypesConsoleMessage,
ConsoleMessageLocation as TypesConsoleMessageLocation,
ConsoleMessageType as TypesConsoleMessageType,
Coverage as TypesCoverage,
CoverageEntry as TypesCoverageEntry,
CustomQueryHandler as TypesCustomQueryHandler,
Dialog as TypesDialog,
ElementHandle as TypesElementHandle,
ErrorCode as TypesErrorCode,
EvaluateFn as TypesEvaluateFn,
EvaluateFnReturnType as TypesEvaluateFnReturnType,
EventEmitter as TypesEventEmitter,
ExecutionContext as TypesExecutionContext,
FileChooser as TypesFileChooser,
Frame as TypesFrame,
JSHandle as TypesJSHandle,
JSONArray as TypesJSONArray,
JSONObject as TypesJSONObject,
Keyboard as TypesKeyboard,
LaunchOptions as TypesLaunchOptions,
Metrics as TypesMetrics,
Mouse as TypesMouse,
MouseWheelOptions as TypesMouseWheelOptions,
PDFOptions as TypesPDFOptions,
Page as TypesPage,
Permission as TypesPermission,
Platform as TypesPlatform,
Product as TypesProduct,
ResourceType as TypesResourceType,
ScreenshotOptions as TypesScreenshotOptions,
SecurityDetails as TypesSecurityDetails,
Serializable as TypesSerializable,
SerializableOrJSHandle as TypesSerializableOrJSHandle,
Target as TypesTarget,
Touchscreen as TypesTouchscreen,
Tracing as TypesTracing,
UnwrapElementHandle as TypesUnwrapElementHandle,
Viewport as TypesViewport,
WaitForSelectorOptions as TypesWaitForSelectorOptions,
WrapElementHandle as TypesWrapElementHandle,
// @ts-ignore (importing from d.ts files is usually not a thing)
} from '@types/puppeteer';
// These still exist in the inbuilt types
import {
Accessibility,
BoundingBox,
BoxModel,
Browser,
BrowserContext,
BrowserFetcher,
CDPSession,
ClickOptions,
ConnectOptions,
ConsoleMessage,
ConsoleMessageLocation,
ConsoleMessageType,
Coverage,
CoverageEntry,
CustomQueryHandler,
Dialog,
ElementHandle,
ErrorCode,
EvaluateFn,
EvaluateFnReturnType,
EventEmitter,
ExecutionContext,
FileChooser,
Frame,
JSHandle,
JSONArray,
JSONObject,
Keyboard,
LaunchOptions,
Metrics,
Mouse,
MouseWheelOptions,
PDFOptions,
Page,
Permission,
Platform,
Product,
ResourceType,
ScreenshotOptions,
SecurityDetails,
Serializable,
SerializableOrJSHandle,
Target,
Touchscreen,
Tracing,
UnwrapElementHandle,
Viewport,
WaitForSelectorOptions,
WrapElementHandle,
} from 'puppeteer';
////////////////////////////////////////////////////////////////////////////////
//////////////////////////// PROBLEMATIC ///////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/**
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").Accessibility' does not satisfy the constraint 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").Accessibility'.
Types of property 'snapshot' are incompatible.
Type '(options?: SnapshotOptions) => Promise<SerializedAXNode>' is not assignable to type '(options?: SnapshopOptions) => Promise<AXNode>'.
Types of parameters 'options' and 'options' are incompatible.
Type 'SnapshopOptions' is not assignable to type 'SnapshotOptions'.
Types of property 'root' are incompatible.
Type 'ElementHandle<Element>' is missing the following properties from type 'ElementHandle<Element>': _page, _frameManager, _scrollIntoViewIfNeeded, _clickablePoint, and 7 more.ts(2344)
*/
type TestAccessibility = Extends<TypesAccessibility, Accessibility>;
type TestRequiredAccessibility = Extends<Required<TypesAccessibility>, Required<Accessibility>>;
/**
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").Browser' does not satisfy the constraint 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").Browser'.
The types returned by 'on(...)' are incompatible between these types.
Type 'EventEmitter' is missing the following properties from type 'Browser': browserContexts, close, createIncognitoBrowserContext, disconnect, and 11 more.ts(2344)
*/
type TestBrowser = Extends<TypesBrowser, Browser>;
type TestRequiredBrowser = Extends<Required<TypesBrowser>, Required<Browser>>;
/**
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").Accessibility' does not satisfy the constraint 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").Accessibility'.
Types of property 'snapshot' are incompatible.
Type '(options?: SnapshotOptions) => Promise<SerializedAXNode>' is not assignable to type '(options?: SnapshopOptions) => Promise<AXNode>'.
Types of parameters 'options' and 'options' are incompatible.
Type 'SnapshopOptions' is not assignable to type 'SnapshotOptions'.
Types of property 'root' are incompatible.
Type 'ElementHandle<Element>' is missing the following properties from type 'ElementHandle<Element>': _page, _frameManager, _scrollIntoViewIfNeeded, _clickablePoint, and 7 more.ts(2344)
*/
type TestBrowserContext = Extends<TypesBrowserContext, BrowserContext>;
type TestRequiredBrowserContext = Extends<Required<TypesBrowserContext>, Required<BrowserContext>>;
/**
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").CDPSession' does not satisfy the constraint 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").CDPSession'.
The types returned by 'send(...)' are incompatible between these types.
Type 'Promise<void | EnableResponse | EvaluateOnCallFrameResponse | ExecuteWasmEvaluatorResponse | GetPossibleBreakpointsResponse | ... 176 more ... | GetCredentialsResponse>' is not assignable to type 'Promise<object>'.
Type 'void | EnableResponse | EvaluateOnCallFrameResponse | ExecuteWasmEvaluatorResponse | GetPossibleBreakpointsResponse | ... 176 more ... | GetCredentialsResponse' is not assignable to type 'object'.
Type 'void' is not assignable to type 'object'.ts(2344)
*/
type TestCDPSession = Extends<TypesCDPSession, CDPSession>;
type TestRequiredCDPSession = Extends<Required<TypesCDPSession>, Required<CDPSession>>;
/**
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").ConsoleMessage' does not satisfy the constraint 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").ConsoleMessage'.
The types returned by 'args()' are incompatible between these types.
Type 'JSHandle[]' is not assignable to type 'JSHandle<any>[]'.
Type 'JSHandle' is not assignable to type 'JSHandle<any>'.
The types returned by 'asElement().contentFrame()' are incompatible between these types.
Type 'Promise<import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").Frame>' is not assignable to type 'Promise<import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").Frame>'.
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").Frame' is not assignable to type 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").Frame'.
The types returned by 'executionContext()' are incompatible between these types.
Type 'Promise<import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").ExecutionContext>' is not assignable to type 'Promise<import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").ExecutionContext>'.
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").ExecutionContext' is not assignable to type 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").ExecutionContext'.
Types of property 'queryObjects' are incompatible.
Type '(prototypeHandle: JSHandle) => Promise<JSHandle>' is not assignable to type '(prototypeHandle: JSHandle<any>) => Promise<JSHandle<any>>'.
Types of parameters 'prototypeHandle' and 'prototypeHandle' are incompatible.
Type 'JSHandle<any>' is missing the following properties from type 'JSHandle': _context, _client, _remoteObject, _disposedts(2344)
*/
type TestConsoleMessage = Extends<TypesConsoleMessage, ConsoleMessage>;
type TestRequiredConsoleMessage = Extends<Required<TypesConsoleMessage>, Required<ConsoleMessage>>;
/**
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").ConsoleMessageType' does not satisfy the constraint 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").ConsoleMessageType'.
Type '"verbose"' is not assignable to type 'ConsoleMessageType'.ts(2344)
*/
type TestConsoleMessageType = Extends<TypesConsoleMessageType, ConsoleMessageType>;
type TestRequiredConsoleMessageType = Extends<Required<TypesConsoleMessageType>, Required<ConsoleMessageType>>;
/**
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").ElementHandle<Element>' does not satisfy the constraint 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").ElementHandle<Element>'.ts(2344)
Presumably due to `screenshot(options?: {}): Promise<string | Buffer | void>;`
*/
type TestElementHandle = Extends<TypesElementHandle, ElementHandle>;
type TestRequiredElementHandle = Extends<Required<TypesElementHandle>, Required<ElementHandle>>;
/**
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").ExecutionContext' does not satisfy the constraint 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").ExecutionContext'.ts(2344)
*/
type TestExecutionContext = Extends<TypesExecutionContext, ExecutionContext>;
type TestRequiredExecutionContext = Extends<Required<TypesExecutionContext>, Required<ExecutionContext>>;
/**
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").Frame' does not satisfy the constraint 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").Frame'.ts(2344)
*/
type TestFrame = Extends<TypesFrame, Frame>;
type TestRequiredFrame = Extends<Required<TypesFrame>, Required<Frame>>;
/**
Type 'JSHandle' does not satisfy the constraint 'JSHandle<any>'.ts(2344)
*/
type TestJSHandle = Extends<TypesJSHandle, JSHandle>;
type TestRequiredJSHandle = Extends<Required<TypesJSHandle>, Required<JSHandle>>;
/**
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").JSONArray' does not satisfy the constraint 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").JSONArray'.
The types returned by 'pop()' are incompatible between these types.
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").Serializable' is not assignable to type 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").Serializable'.
Type 'BigInt' is not assignable to type 'Serializable'.
Type 'BigInt' is not assignable to type 'JSONObject'.
Index signature is missing in type 'BigInt'.ts(2344)
*/
type TestJSONArray = Extends<TypesJSONArray, JSONArray>;
type TestRequiredJSONArray = Extends<Required<TypesJSONArray>, Required<JSONArray>>;
/**
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").JSONObject' does not satisfy the constraint 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").JSONObject'.
Index signatures are incompatible.
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").Serializable' is not assignable to type 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").Serializable'.ts(2344)
*/
type TestJSONObject = Extends<TypesJSONObject, JSONObject>;
type TestRequiredJSONObject = Extends<Required<TypesJSONObject>, Required<JSONObject>>;
/**
* Missing propertries in new type: {
ignoreHTTPSErrors?: boolean;
defaultViewport?: {
width?: number;
height?: number;
deviceScaleFactor?: number;
isMobile?: boolean;
hasTouch?: boolean;
isLandscape?: boolean;
};
slowMo?: number;
args?: string[];
headless?: boolean;
userDataDir?: string;
devtools?: boolean;
* }
*/
type TestLaunchOptions = Extends<TypesLaunchOptions, LaunchOptions>;
type TestRequiredLaunchOptions = Extends<Required<TypesLaunchOptions>, Required<LaunchOptions>>;
type MissingLaunchOptions = Missing<TypesLaunchOptions, LaunchOptions>;
/**
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").Metrics' does not satisfy the constraint 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").Metrics'.
Property 'Timestamp' is optional in type 'Metrics' but required in type 'Metrics'.ts(2344)
*/
type TestMetrics = Extends<TypesMetrics, Metrics>;
type TestRequiredMetrics = Extends<Required<TypesMetrics>, Required<Metrics>>;
/**
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").PDFOptions' does not satisfy the constraint 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").PDFOptions'.
Types of property 'format' are incompatible.
Type 'PaperFormat' is not assignable to type 'PDFFormat'.
Type '"letter"' is not assignable to type 'PDFFormat'.ts(2344)
*/
type TestPDFOptions = Extends<TypesPDFOptions, PDFOptions>;
type TestRequiredPDFOptions = Extends<Required<TypesPDFOptions>, Required<PDFOptions>>;
/**
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").Page' does not satisfy the constraint 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").Page'.
The types returned by 'on(...)' are incompatible between these types.
Type 'EventEmitter' is missing the following properties from type 'Page': accessibility, authenticate, bringToFront, browser, and 71 more.ts(2344)
*/
type TestPage = Extends<TypesPage, Page>;
type TestRequiredPage = Extends<Required<TypesPage>, Required<Page>>;
/**
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").Permission' does not satisfy the constraint 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").Permission'.
Type '"idle-detection"' is not assignable to type 'Permission'.ts(2344)
*/
type TestPermission = Extends<TypesPermission, Permission>;
type TestRequiredPermission = Extends<Required<TypesPermission>, Required<Permission>>;
/**
Type '"document" | "stylesheet" | "image" | "media" | "font" | "script" | "texttrack" | "xhr" | "fetch" | "eventsource" | "websocket" | "manifest" | "other" | "signedexchange" | "ping" | "cspviolationreport" | "preflight"' does not satisfy the constraint 'ResourceType'.
Type '"signedexchange"' is not assignable to type 'ResourceType'.ts(2344)
*/
type TestResourceType = Extends<TypesResourceType, ResourceType>;
type TestRequiredResourceType = Extends<Required<TypesResourceType>, Required<ResourceType>>;
/**
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").Serializable' does not satisfy the constraint 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").Serializable'.ts(2344)
*/
type TestSerializable = Extends<TypesSerializable, Serializable>;
type TestRequiredSerializable = Extends<Required<TypesSerializable>, Required<Serializable>>;
/**
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").SerializableOrJSHandle' does not satisfy the constraint 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").SerializableOrJSHandle'.
Type 'JSHandle' is not assignable to type 'SerializableOrJSHandle'.
Type 'JSHandle' is not assignable to type 'JSONObject'.
Index signature is missing in type 'JSHandle'.ts(2344)
*/
type TestSerializableOrJSHandle = Extends<TypesSerializableOrJSHandle, SerializableOrJSHandle>;
type TestRequiredSerializableOrJSHandle = Extends<Required<TypesSerializableOrJSHandle>, Required<SerializableOrJSHandle>>;
/**
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").Target' does not satisfy the constraint 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").Target'.
The types returned by 'browser()' are incompatible between these types.
Type 'import("/home/aram/projects/tests/puppeteer/node_modules/puppeteer/lib/types").Browser' is not assignable to type 'import("/home/aram/projects/tests/puppeteer/node_modules/@types/puppeteer/index").Browser'.ts(2344)
*/
type TestTarget = Extends<TypesTarget, Target>;
type TestRequiredTarget = Extends<Required<TypesTarget>, Required<Target>>;
/**
* Missing propertries in new type: {
tap: () => Promise<void>;
type: (text: string, options?: {
delay: number;
}) => Promise<void>;
_client: CDPSession;
$: (selector: string) => Promise<ElementHandle<Element>>;
... 26 more ...;
toString: () => string;
* }
*/
type TestUnwrapElementHandle = Extends<TypesUnwrapElementHandle<ElementHandle>, UnwrapElementHandle<ElementHandle>>;
type TestRequiredUnwrapElementHandle = Extends<Required<TypesUnwrapElementHandle<ElementHandle>>, Required<UnwrapElementHandle<ElementHandle>>>;
type MissingUnwrapElementHandle = Missing<TypesUnwrapElementHandle<ElementHandle>, UnwrapElementHandle<ElementHandle>>;
////////////////////////////////////////////////////////////////////////////////
//////////////////////// THESE ARE UNCHANGED ///////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
type TestBoundingBox = Extends<TypesBoundingBox, BoundingBox>;
type TestRequiredBoundingBox = Extends<Required<TypesBoundingBox>, Required<BoundingBox>>;
type TestBoxModel = Extends<TypesBoxModel, BoxModel>;
type TestRequiredBoxModel = Extends<Required<TypesBoxModel>, Required<BoxModel>>;
type TestBrowserFetcher = Extends<TypesBrowserFetcher, BrowserFetcher>;
type TestRequiredBrowserFetcher = Extends<Required<TypesBrowserFetcher>, Required<BrowserFetcher>>;
type TestClickOptions = Extends<TypesClickOptions, ClickOptions>;
type TestRequiredClickOptions = Extends<Required<TypesClickOptions>, Required<ClickOptions>>;
type TestConnectOptions = Extends<TypesConnectOptions, ConnectOptions>;
type TestRequiredConnectOptions = Extends<Required<TypesConnectOptions>, Required<ConnectOptions>>;
type TestConsoleMessageLocation = Extends<TypesConsoleMessageLocation, ConsoleMessageLocation>;
type TestRequiredConsoleMessageLocation = Extends<Required<TypesConsoleMessageLocation>, Required<ConsoleMessageLocation>>;
type TestCoverage = Extends<TypesCoverage, Coverage>;
type TestRequiredCoverage = Extends<Required<TypesCoverage>, Required<Coverage>>;
type TestCoverageEntry = Extends<TypesCoverageEntry, CoverageEntry>;
type TestRequiredCoverageEntry = Extends<Required<TypesCoverageEntry>, Required<CoverageEntry>>;
type TestCustomQueryHandler = Extends<TypesCustomQueryHandler, CustomQueryHandler>;
type TestRequiredCustomQueryHandler = Extends<Required<TypesCustomQueryHandler>, Required<CustomQueryHandler>>;
type TestDialog = Extends<TypesDialog, Dialog>;
type TestRequiredDialog = Extends<Required<TypesDialog>, Required<Dialog>>;
type TestErrorCode = Extends<TypesErrorCode, ErrorCode>;
type TestRequiredErrorCode = Extends<Required<TypesErrorCode>, Required<ErrorCode>>;
type TestEvaluateFn = Extends<TypesEvaluateFn, EvaluateFn>;
type TestRequiredEvaluateFn = Extends<Required<TypesEvaluateFn>, Required<EvaluateFn>>;
type TestEvaluateFnReturnType = Extends<TypesEvaluateFnReturnType<any>, EvaluateFnReturnType<any>>;
type TestRequiredEvaluateFnReturnType = Extends<Required<TypesEvaluateFnReturnType<any>>, Required<EvaluateFnReturnType<any>>>;
type TestEventEmitter = Extends<TypesEventEmitter, EventEmitter>;
type TestRequiredEventEmitter = Extends<Required<TypesEventEmitter>, Required<EventEmitter>>;
type TestFileChooser = Extends<TypesFileChooser, FileChooser>;
type TestRequiredFileChooser = Extends<Required<TypesFileChooser>, Required<FileChooser>>;
type TestKeyboard = Extends<TypesKeyboard, Keyboard>;
type TestRequiredKeyboard = Extends<Required<TypesKeyboard>, Required<Keyboard>>;
type TestMouse = Extends<TypesMouse, Mouse>;
type TestRequiredMouse = Extends<Required<TypesMouse>, Required<Mouse>>;
type TestMouseWheelOptions = Extends<TypesMouseWheelOptions, MouseWheelOptions>;
type TestRequiredMouseWheelOptions = Extends<Required<TypesMouseWheelOptions>, Required<MouseWheelOptions>>;
type TestPlatform = Extends<TypesPlatform, Platform>;
type TestRequiredPlatform = Extends<Required<TypesPlatform>, Required<Platform>>;
type TestProduct = Extends<TypesProduct, Product>;
type TestRequiredProduct = Extends<Required<TypesProduct>, Required<Product>>;
type TestScreenshotOptions = Extends<TypesScreenshotOptions, ScreenshotOptions>;
type TestRequiredScreenshotOptions = Extends<Required<TypesScreenshotOptions>, Required<ScreenshotOptions>>;
type TestSecurityDetails = Extends<TypesSecurityDetails, SecurityDetails>;
type TestRequiredSecurityDetails = Extends<Required<TypesSecurityDetails>, Required<SecurityDetails>>;
type TestTouchscreen = Extends<TypesTouchscreen, Touchscreen>;
type TestRequiredTouchscreen = Extends<Required<TypesTouchscreen>, Required<Touchscreen>>;
type TestTracing = Extends<TypesTracing, Tracing>;
type TestRequiredTracing = Extends<Required<TypesTracing>, Required<Tracing>>;
type TestViewport = Extends<TypesViewport, Viewport>;
type TestRequiredViewport = Extends<Required<TypesViewport>, Required<Viewport>>;
type TestWaitForSelectorOptions = Extends<TypesWaitForSelectorOptions, WaitForSelectorOptions>;
type TestRequiredWaitForSelectorOptions = Extends<Required<TypesWaitForSelectorOptions>, Required<WaitForSelectorOptions>>;
type TestWrapElementHandle = Extends<TypesWrapElementHandle<ElementHandle>, WrapElementHandle<ElementHandle>>;
type TestRequiredWrapElementHandle = Extends<Required<TypesWrapElementHandle<ElementHandle>>, Required<WrapElementHandle<ElementHandle>>>;
import {
AXNode as TypeAXNode,
AuthOptions as TypeAuthOptions,
Base64ScreenShotOptions as TypeBase64ScreenShotOptions,
BinaryScreenShotOptions as TypeBinaryScreenShotOptions,
Box as TypeBox,
BrowserContextEventObj as TypeBrowserContextEventObj,
BrowserEventObj as TypeBrowserEventObj,
BrowserOptions as TypeBrowserOptions,
ChromeArgOptions as TypeChromeArgOptions,
ConnectionTransport as TypeConnectionTransport,
Cookie as TypeCookie,
DeleteCookie as TypeDeleteCookie,
DialogType as TypeDialogType,
DirectNavigationOptions as TypeDirectNavigationOptions,
EmulateOptions as TypeEmulateOptions,
Evalable as TypeEvalable,
FetcherOptions as TypeFetcherOptions,
FrameBase as TypeFrameBase,
GeoOptions as TypeGeoOptions,
Headers as TypeHeaders,
HttpMethod as TypeHttpMethod,
JSEvalable as TypeJSEvalable,
LayoutDimension as TypeLayoutDimension,
LoadEvent as TypeLoadEvent,
MediaFeature as TypeMediaFeature,
MediaType as TypeMediaType,
MouseButtons as TypeMouseButtons,
MousePressOptions as TypeMousePressOptions,
NavigationOptions as TypeNavigationOptions,
Overrides as TypeOverrides,
PDFFormat as TypePDFFormat,
PageCloseOptions as TypePageCloseOptions,
PageEventObj as TypePageEventObj,
PageFnOptions as TypePageFnOptions,
RemoteInfo as TypeRemoteInfo,
Request as TypeRequest,
RespondOptions as TypeRespondOptions,
Response as TypeResponse,
RevisionInfo as TypeRevisionInfo,
SameSiteSetting as TypeSameSiteSetting,
ScriptTagOptions as TypeScriptTagOptions,
SetCookie as TypeSetCookie,
StartCoverageOptions as TypeStartCoverageOptions,
StyleTagOptions as TypeStyleTagOptions,
TargetAwaiter as TypeTargetAwaiter,
TargetType as TypeTargetType,
Timeoutable as TypeTimeoutable,
TracingStartOptions as TypeTracingStartOptions,
WaitForSelectorOptionsHidden as TypeWaitForSelectorOptionsHidden,
Worker as TypeWorker,
// @ts-ignore (importing from d.ts files is usually not a thing)
} from '@types/puppeteer';
// ALl these are no longer defined in puppeteer
import {
AXNode,
AuthOptions,
Base64ScreenShotOptions,
BinaryScreenShotOptions,
Box,
BrowserContextEventObj,
BrowserEventObj,
BrowserOptions,
ChromeArgOptions,
ConnectionTransport,
Cookie,
DeleteCookie,
DialogType,
DirectNavigationOptions,
EmulateOptions,
Evalable,
FetcherOptions,
FrameBase,
GeoOptions,
Headers,
HttpMethod,
JSEvalable,
LayoutDimension,
LoadEvent,
MediaFeature,
MediaType,
MouseButtons,
MousePressOptions,
NavigationOptions,
Overrides,
PDFFormat,
PageCloseOptions,
PageEventObj,
PageFnOptions,
RemoteInfo,
Request,
RespondOptions,
Response,
RevisionInfo,
SameSiteSetting,
ScriptTagOptions,
SetCookie,
StartCoverageOptions,
StyleTagOptions,
TargetAwaiter,
TargetType,
Timeoutable,
TracingStartOptions,
WaitForSelectorOptionsHidden,
Worker,
} from 'puppeteer';
{
"name": "puppeteer-type-test",
"description": "Compare puppeteer Types previously supplied by @types/puppeteer to new inbuilt Types",
"author": "Aram Becker",
"license": "MIT",
"devDependencies": {
"@types/puppeteer": "^5.4.3"
},
"dependencies": {
"puppeteer": "^8.0.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment