Maxim-Mazurok/google-api-typings-generator

Property 'youtube' does not exist on type 'typeof client'.

TheLQ opened this issue · 1 comments

TheLQ commented

Trying to compile this minimal test case https://github.com/TheLQ/test-case-yt-types using @maxim_mazurok/gapi.client.youtube fails with

index.ts:1:29 - error TS2339: Property 'youtube' does not exist on type 'typeof client'.

1 const request = gapi.client.youtube.subscriptions.list({'part': 'snippet', 'mine': 'true'});
                              ~~~~~~~

Redeclaring the namespace like in DefinitelyTyped/DefinitelyTyped#9607 (comment) resolves the top level properties but all the values are any for some reason. eg gapi.client.youtube.subscriptions.asd34f34 compiles fine

The people example DefinitelyTyped/DefinitelyTyped#9607 (comment) also does not compile with a similar error

Hopefully a minimal test case can help show the problem. Is there something I'm doing wrong? Is there anything else I can try?

TheLQ commented

Nevermind. Today I learned tsc only auto-imports type definitions from @types. Using @types/gapi.client.youtube like I'm supposed to works great without changes. Or doing /// <reference path="node_modules/@maxim_mazurok/gapi.client.people/index.d.ts" />

Thanks for writing this generator!