Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export more types #416

Merged
merged 1 commit into from Dec 18, 2023
Merged

Export more types #416

merged 1 commit into from Dec 18, 2023

Conversation

joshkel
Copy link
Contributor

@joshkel joshkel commented Dec 18, 2023

This allows code using workerpool to easily reference pool types. For example, I could write code similar to the following in workerpool 8, but in workerpool 9, I could not find an easy way to access these types, since they're just imports within the generated index.d.ts.

import { pool, type WorkerPoolOptions, type WorkerPool } from 'workerpool';

function getOptions(): WorkerPoolOptions { /* ... */ };
function makeMyPool(): WorkerPool {
  const myPool = pool(getOptions());
  // initialize
  return myPool;
}

(workerpool 9's build-in types also rename WorkerPool to Pool, but that's an easy change to make in calling code.)

This allows code using workerpool to easily reference pool types.
@josdejong
Copy link
Owner

Thanks for the improvement @joshkel, this makes sense!

@josdejong josdejong merged commit 8214e90 into josdejong:master Dec 18, 2023
3 checks passed
@joshkel joshkel deleted the export-types branch December 18, 2023 15:10
@josdejong
Copy link
Owner

Published now in v9.0.1. Please let me know if you encounter more issues with the types!

@joshkel
Copy link
Contributor Author

joshkel commented Dec 18, 2023

Works great. Thanks, @josdejong!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants