Closed mrjackdavis closed 9 months ago
I've been trying to incorporate this code and add tests via https://github.com/ai/check-dts but it doesn't seem to work as you describe.
import { ScopeTuple, createScope, InferableScope } from "../";
const myScope = createScope<string|undefined>(undefined);
// Two type errors here
const myTuple2:InferableScope<string|undefined> = [myScope, "Foo"];
myScope
has the error: Type 'MoleculeScope<string | undefined>' is not assignable to type 'string | undefined'.ts(2322)
"Foo"
has the error: Type 'string' is not assignable to type 'never'.ts(2322)
What am I missing in your implementation?
@mrjackdavis with the recent changes in Bunshi 2.1 it might not be relevant anymore.
Sorry that this PR sat around for so long. If you provide some context, I can add some Vitest type checks
All good 👍
Description of the change
Fixes #11 by making a new inferable scope type.
I tried to edit ScopeTuple, but it's used in so many places and would've been a breaking change so I went for this approach
Type of change
Links
N/A
Checklists
Development
Paperwork
Code review