Skip to content

Commit

Permalink
feat: Expose typing of getKeyedSingletonCompositeKey
Browse files Browse the repository at this point in the history
  • Loading branch information
Iku-turso committed Oct 22, 2023
1 parent e29528d commit 2e94d50
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/injectable/core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,3 +391,7 @@ export function createContainer(
containerId: string,
options?: { detectCycles?: boolean },
): DiContainer;

export function getKeyedSingletonCompositeKey<T extends [...unknown[]]>(
...keys: T
): { keys: T };
3 changes: 3 additions & 0 deletions packages/injectable/core/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
isInjectable,
isInjectionToken,
getInjectableBunch,
getKeyedSingletonCompositeKey,
} from '.';

const di = createContainer('some-container');
Expand Down Expand Up @@ -541,3 +542,5 @@ const someInjectableBunch = getInjectableBunch({
expectType<{ someInjectable: Injectable<string, unknown, number> }>(
someInjectableBunch,
);

expectType<{ keys: [1, 2, 3] }>(getKeyedSingletonCompositeKey(1, 2, 3));

0 comments on commit 2e94d50

Please sign in to comment.