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

Export @ffmpeg/ffmpeg TS types declared in src/types.ts #723

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

snelsi
Copy link

@snelsi snelsi commented Apr 7, 2024

Is your feature request related to a problem? Please describe.
The @ffmpeg/ffmpeg package.json declaration file claims that library types are exported at index.d.ts:

  "types": "./dist/esm/index.d.ts",
  "exports": {
    ".": {
      "types": "./dist/esm/index.d.ts",

However, in reality, the only type that is exported is the FFmpeg class declaration from classes.d.ts.

The FFmpeg class utilizes TypeScript types such as LogEventCallback, ProgressEventCallback, FFMessageLoadConfig, and FFMessageOptions, which are declared in types.ts.

I would like to utilize these types to create a custom wrapper around the FFmpeg class. However, currently, it seems impossible to export them.

Describe the solution you'd like
I propose exporting all types declared in types.ts at the index.ts root file as follows:

export * from "./classes.js";
+ export * from "./types.js";

Describe alternatives you've considered
I attempted to use the @ffmpeg/types library, but it mostly contains unrelated or unuseful content that doesn't meet my needs.
Additionally, I tried to directly import from the types.d.ts file in the dist, but my resolver couldn't locate such a file:

import type { LogEventCallback } from "@ffmpeg/ffmpeg/dist/esm/types.d.ts";

Copy link

netlify bot commented Apr 7, 2024

Deploy Preview for ffmpegwasm ready!

Name Link
🔨 Latest commit e3a09ac
🔍 Latest deploy log https://app.netlify.com/sites/ffmpegwasm/deploys/6612c80073163b00088f4e62
😎 Deploy Preview https://deploy-preview-723--ffmpegwasm.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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.

1 participant