Skip to content

Commit

Permalink
chore: Extract some named types for better self-documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Iku-turso committed Feb 8, 2023
1 parent 94fed1e commit 6885495
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/injectable/core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,15 @@ export function getInjectionToken<
id: string;
}): InjectionToken<InjectionInstance, InstantiationParam>;

interface Inject {
interface InjectWithoutParameter {
<InjectionInstance>(
key:
| Injectable<InjectionInstance, unknown, void>
| Injectable<InjectionInstance, unknown>
| InjectionToken<InjectionInstance, void>,
): InjectionInstance;
}

interface InjectWithParameter {
<InjectionInstance, InstantiationParam>(
key:
| Injectable<InjectionInstance, unknown, InstantiationParam>
Expand All @@ -110,6 +112,8 @@ interface Inject {
): InjectionInstance;
}

type Inject = InjectWithoutParameter & InjectWithParameter;

interface InjectMany {
<InjectionInstance>(
key:
Expand Down

0 comments on commit 6885495

Please sign in to comment.