Skip to content

Commit

Permalink
fix: change injected.ts imports (#8987)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
OrKoN committed Sep 20, 2022
1 parent c6912f3 commit 10a114d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
20 changes: 16 additions & 4 deletions src/injected/injected.ts
Expand Up @@ -15,23 +15,35 @@
*/

import {createDeferredPromise} from '../util/DeferredPromise.js';
import * as Poller from './Poller.js';
import * as TextContent from './TextContent.js';
import {RAFPoller, MutationPoller, IntervalPoller} from './Poller.js';
import {
isSuitableNodeForTextMatching,
createTextContent,
} from './TextContent.js';
import * as TextQuerySelector from './TextQuerySelector.js';
import * as XPathQuerySelector from './XPathQuerySelector.js';
import * as PierceQuerySelector from './PierceQuerySelector.js';
import * as util from './util.js';

/**
* @internal
*/
const PuppeteerUtil = Object.freeze({
...util,
...Poller,
...TextContent,
...TextQuerySelector,
...XPathQuerySelector,
...PierceQuerySelector,
createDeferredPromise,
createTextContent,
IntervalPoller,
isSuitableNodeForTextMatching,
MutationPoller,
RAFPoller,
});

/**
* @internal
*/
type PuppeteerUtil = typeof PuppeteerUtil;

/**
Expand Down
2 changes: 1 addition & 1 deletion test-d/puppeteer.test-d.ts
Expand Up @@ -6,7 +6,7 @@ import {
executablePath,
launch,
default as puppeteer,
} from '../lib/esm/puppeteer/puppeteer.js';
} from '..';

expectType<typeof launch>(puppeteer.launch);
expectType<typeof connect>(puppeteer.connect);
Expand Down

0 comments on commit 10a114d

Please sign in to comment.