You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { definePool, Pool, Instance } from 'prool';
...
let instance: Instance;
instance = await pool.start(1);
Type 'Instance_' is not assignable to type 'Instance'.
Property 'create' is missing in type 'Instance_' but required in type '{ _internal: object | undefined; create(parameters?: { port?: number | undefined; } | undefined): Omit<Instance<object | undefined>, "create">; host: string; ... 6 more ...; stop(): Promise<...>; }'.
That's because
type Instance_ = Omit<Instance, 'create'>
Proposed solution: do not use Instance_, make create disabled at runtime instead of removing it on the type level. Alternatively, make it a static method.
The text was updated successfully, but these errors were encountered:
I can't type my code properly:
That's because
Proposed solution: do not use
Instance_
, makecreate
disabled at runtime instead of removing it on the type level. Alternatively, make it a static method.The text was updated successfully, but these errors were encountered: