From 1164801de81cca8798092fd0e779b75f10500508 Mon Sep 17 00:00:00 2001 From: Oleksandr Beshchuk Date: Sun, 10 Sep 2023 21:21:14 +0100 Subject: [PATCH] Added tsd testcase to for rootType use case --- dist/index.test-d.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/dist/index.test-d.ts b/dist/index.test-d.ts index 20bc143..459deb8 100644 --- a/dist/index.test-d.ts +++ b/dist/index.test-d.ts @@ -43,4 +43,19 @@ expectError(typedPath().a.W.c.$rawPath); // Types for additional handlers expectType(typedPath(testAdditionalHandlers).a.b.c.$length); -// Types for additional handlers \ No newline at end of file +// Types for additional handlers + +// Types for root handlers +function getTestAdditionalHandlers() { + return { + $rootType: () => ({} as RootType), + } +}; + +expectType( + typedPath< + TestType, + ReturnType> + >(getTestAdditionalHandlers()).a.b.c.$rootType +); +// Types for root handlers