-
-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
I can't type my code properly:
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.
Metadata
Metadata
Assignees
Labels
No labels