Skip to content

fix(TS): ProcessData#readCallback type/jsdocs#178

Merged
agviegas merged 2 commits into
ThatOpen:mainfrom
ShaMan123:fix/readCallback-type
Apr 15, 2026
Merged

fix(TS): ProcessData#readCallback type/jsdocs#178
agviegas merged 2 commits into
ThatOpen:mainfrom
ShaMan123:fix/readCallback-type

Conversation

@ShaMan123
Copy link
Copy Markdown
Contributor

@ShaMan123 ShaMan123 commented Mar 22, 2026

Description

Fix readCallback type and add docs

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following:

  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Follow the Conventional Commits v1.0.0 standard for PR naming (e.g. feat(examples): add hello-world example).
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@ShaMan123 ShaMan123 force-pushed the fix/readCallback-type branch from 8ea4417 to 4a20be9 Compare March 22, 2026 07:53
@ShaMan123
Copy link
Copy Markdown
Contributor Author

ShaMan123 commented Mar 22, 2026

Ideally I would do something like:

export type ProcessData = (
  | {
      bytes: Uint8Array;
      readFromCallback?: false;
      readCallback?: never;
    }
  | {
      bytes?: never;
      readFromCallback: true;
      readCallback: ModelLoadCallback;
    }
) & {
  id?: string;
  raw?: boolean;
  progressCallback?: (progress: number, data: ProgressData) => void;
};

But this requires a bit more refactoring since it is referenced as an interface across the codebase.
If you are up for it I can do it.

@ShaMan123 ShaMan123 changed the title fix(TS): ProcessData#readCallback type fix(TS): ProcessData#readCallback type/docs Mar 22, 2026
@ShaMan123 ShaMan123 changed the title fix(TS): ProcessData#readCallback type/docs fix(TS): ProcessData#readCallback type/jsdocs Mar 22, 2026
@agviegas agviegas merged commit 0f89ec0 into ThatOpen:main Apr 15, 2026
@ShaMan123 ShaMan123 deleted the fix/readCallback-type branch April 17, 2026 20:33
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.

2 participants