Skip to content

fix(types): compatibility with @types/[email protected] - #433

Merged
CodyJasonBennett merged 1 commit into
pmndrs:mainfrom
Methuselah96:update-types-r185
Jun 26, 2026
Merged

fix(types): compatibility with @types/[email protected]#433
CodyJasonBennett merged 1 commit into
pmndrs:mainfrom
Methuselah96:update-types-r185

Conversation

@Methuselah96

@Methuselah96 Methuselah96 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Why

The current type definitions are incompatible with @types/[email protected] and produce the following errors:

./../node_modules/.pnpm/[email protected][email protected]/node_modules/three-stdlib/loaders/SVGLoader.d.ts:3:18 - error TS2430: Interface 'SVGResultPaths' incorrectly extends interface 'ShapePath'.
  Types of property 'userData' are incompatible.
    Type '{ [key: string]: any; } | undefined' is not assignable to type 'Record<string, unknown>'.
      Type 'undefined' is not assignable to type 'Record<string, unknown>'.

3 export interface SVGResultPaths extends ShapePath {
                   ~~~~~~~~~~~~~~

../../node_modules/.pnpm/[email protected][email protected]/node_modules/three-stdlib/loaders/TGALoader.d.ts:13:3 - error TS2416: Property 'parse' in type 'TGALoader' is not assignable to the same property in base type 'DataTextureLoader'.
  Type '(data: ArrayBuffer) => DataTexture' is not assignable to type '(buffer: ArrayBuffer) => DataTextureLoaderTexData'.
    Call signature return types 'DataTexture' and 'DataTextureLoaderTexData' are incompatible.
      The types of 'format' are incompatible between these types.
        Type 'AnyPixelFormat' is not assignable to type 'PixelFormat | undefined'.
          Type '33776' is not assignable to type 'PixelFormat | undefined'.

13   parse(data: ArrayBuffer): DataTexture
     ~~~~~


Found 2 errors in 2 files.

Errors  Files
     1  ../../node_modules/.pnpm/[email protected][email protected]/node_modules/three-stdlib/loaders/SVGLoader.d.ts:3
     1  ../../node_modules/.pnpm/[email protected][email protected]/node_modules/three-stdlib/loaders/TGALoader.d.ts:13

What

  • Update SVGLoader.parse to return normal ShapePaths. ShapePath already has a userData property, so the SVGResultPaths interface was unnecessary
  • Correct the TGALoader.parse return type. It never returned a DataTexture.

Checklist

  • Documentation updated - N/A
  • Storybook entry added - N/A
  • Ready to be merged

Loading
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

Successfully merging this pull request may close these issues.

3 participants