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

Types augment breaks with TypeScript 5.5.x #10

Open
thebuilder opened this issue Oct 23, 2024 · 1 comment
Open

Types augment breaks with TypeScript 5.5.x #10

thebuilder opened this issue Oct 23, 2024 · 1 comment

Comments

@thebuilder
Copy link
Contributor

The augment to the library is no longer able to correctly infer the contentType generated by openapi-typescript.

import { components } from '@/openapi/umbraco';

type ApiBlockItemModel = components['schemas']['ApiBlockItemModel'];

declare module '@charlietango/react-umbraco' {
  interface UmbracoBlockItemModel extends ApiBlockItemModel {}
}

Error

app/components/RichText.tsx:37:20 - error TS2339: Property 'contentType' does not exist on type '{ id: string; properties: { [key: string]: unknown; }; }'.

37   switch (content?.contentType) {
                      ~~~~~~~~~~~

It correctly augment the type, but it's unable to narrow contentType.

@thebuilder
Copy link
Contributor Author

This might be related to using an older verision of openapi-typescript

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

1 participant