fix: change injected.ts imports (#8987)

* fix: change injected.ts imports

Not sure why api-extractor generates broken .d.ts
files if the start import is used for Poller and TextContext.

* test: use generated types.d.ts in tsd
This commit is contained in:
Alex Rudenko 2022-09-20 10:28:31 +02:00 committed by GitHub
parent c6912f3ecd
commit 10a114d36f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 5 deletions

View File

@ -15,23 +15,35 @@
*/ */
import {createDeferredPromise} from '../util/DeferredPromise.js'; import {createDeferredPromise} from '../util/DeferredPromise.js';
import * as Poller from './Poller.js'; import {RAFPoller, MutationPoller, IntervalPoller} from './Poller.js';
import * as TextContent from './TextContent.js'; import {
isSuitableNodeForTextMatching,
createTextContent,
} from './TextContent.js';
import * as TextQuerySelector from './TextQuerySelector.js'; import * as TextQuerySelector from './TextQuerySelector.js';
import * as XPathQuerySelector from './XPathQuerySelector.js'; import * as XPathQuerySelector from './XPathQuerySelector.js';
import * as PierceQuerySelector from './PierceQuerySelector.js'; import * as PierceQuerySelector from './PierceQuerySelector.js';
import * as util from './util.js'; import * as util from './util.js';
/**
* @internal
*/
const PuppeteerUtil = Object.freeze({ const PuppeteerUtil = Object.freeze({
...util, ...util,
...Poller,
...TextContent,
...TextQuerySelector, ...TextQuerySelector,
...XPathQuerySelector, ...XPathQuerySelector,
...PierceQuerySelector, ...PierceQuerySelector,
createDeferredPromise, createDeferredPromise,
createTextContent,
IntervalPoller,
isSuitableNodeForTextMatching,
MutationPoller,
RAFPoller,
}); });
/**
* @internal
*/
type PuppeteerUtil = typeof PuppeteerUtil; type PuppeteerUtil = typeof PuppeteerUtil;
/** /**

View File

@ -6,7 +6,7 @@ import {
executablePath, executablePath,
launch, launch,
default as puppeteer, default as puppeteer,
} from '../lib/esm/puppeteer/puppeteer.js'; } from '..';
expectType<typeof launch>(puppeteer.launch); expectType<typeof launch>(puppeteer.launch);
expectType<typeof connect>(puppeteer.connect); expectType<typeof connect>(puppeteer.connect);