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

Type error with string key using provide/inject. #56

Closed
Mister-Hope opened this issue Aug 10, 2019 · 0 comments
Closed

Type error with string key using provide/inject. #56

Mister-Hope opened this issue Aug 10, 2019 · 0 comments

Comments

@Mister-Hope
Copy link
Contributor

Mister-Hope commented Aug 10, 2019

Here is the declaration file:

import { AnyObject } from '../types/basic';
import { Wrapper } from '../wrappers';
export interface Key<T> extends Symbol {
}
export declare function provide(data: AnyObject): void;
export declare function provide<T>(key: Key<T>, value: T | Wrapper<T>): void;
export declare function inject<T>(key: Key<T>): Wrapper<T> | void;

But the doc says:

provide, inject

▸ provide(key: string | symbol, value: any)

▸ inject(key: string | symbol)

Equivalent with provide and inject from 2.x

So when I use string instead of exporting and importing symbols accross file, I got type error.

@Mister-Hope Mister-Hope changed the title Bug: decalre file about provide /inject Bug: declaration file about provide /inject Aug 10, 2019
@liximomo liximomo changed the title Bug: declaration file about provide /inject Type error with string key using provide/inject. Aug 11, 2019
@liximomo liximomo reopened this Aug 15, 2019
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

No branches or pull requests

2 participants