Skip to content

Missing TypeScript Definitions for @mkellogg/gaussian-splats-3d #415

@rvndudz

Description

@rvndudz

I encountered an issue when using the @mkellogg/gaussian-splats-3d package in a JavaScript project. The package does not provide TypeScript declaration files, leading to the following error:

Could not find a declaration file for module '@mkellogg/gaussian-splats-3d'.
'.../node_modules/@mkellogg/gaussian-splats-3d/build/gaussian-splats-3d.umd.cjs' implicitly has an 'any' type.
Try npm i --save-dev @types/mkellogg__gaussian-splats-3d if it exists or add a new declaration (.d.ts) file containing declare module '@mkellogg/gaussian-splats-3d';

Steps to Reproduce:

  1. Install the @mkellogg/gaussian-splats-3d package in a TypeScript project.
  2. Import the module and attempt to use it:
import * as GaussianSplats3D from '@mkellogg/gaussian-splats-3d';

const viewer = new GaussianSplats3D({
    cameraUp: [0, -1, -0.6],
    initialCameraPosition: [-1, -1, 0],
    initialCameraLookAt: [0, 0, 4],
});

viewer.addSplatScene('<path to .ply, .ksplat, or .splat file>', {
    splatAlphaRemovalThreshold: 5,
    showLoadingUI: true,
    position: [0, 1, 0],
    rotation: [0, 0, 1],
    scale: [1.5, 1.5, 1.5],
});

viewer.start();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions