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

bug: Symbol.asyncIterator is missing from type definition of npm layer #920

Closed
sevenc-nanashi opened this issue Feb 2, 2025 · 0 comments

Comments

@sevenc-nanashi
Copy link

I have a library whose class has [Symbol.asyncIterator] method: https://jsr.io/@sevenc-nanashi/async-channel/doc/~/UnboundedChannel#method_symbol_asynciterator_0

But it looks like this definition is missing from type definition:

import { CLOSED } from "./mod.js";
/**
 * An asynchronous channel that can be used to communicate between async functions.
 *
 * Note that this is Multi-Producer Single-Consumer (MPSC) channel, meaning that multiple async functions can send values to the channel,
 * but only one async function can receive values from the channel.
 */ export declare class UnboundedChannel<T> {
  /** Constructs a new channel. */ constructor();
  /** Sends a value to the channel. */ send(value: T): void;
  /** Closes the channel. */ close(): void;
  /** Returns whether the channel is closed. */ get isClosed(): boolean;
  /** Receives a value from the channel. If the channel is closed, returns {@link CLOSED}. */ receive(): Promise<T | typeof CLOSED>;
  /** Receives a value from the channel. If the channel is closed, throws a {@link ClosedChannelError}. */ receiveOrThrow(): Promise<T>;
  /** Peeks at the next value in the channel. If the channel is closed, returns {@link CLOSED}. */ peek(): T | undefined | typeof CLOSED;
  /** Peeks at the next value in the channel. If the channel is closed, throws a {@link ClosedChannelError}. */ peekOrThrow(): T | undefined;
  /** Returns the number of values in the channel. */ get length(): number;
  /** Returns whether the channel is empty. */ get isEmpty(): boolean;
}
//# sourceMappingURL=mpsc.d.ts.map
@github-project-automation github-project-automation bot moved this to Needs Triage in JSR Feb 2, 2025
@sevenc-nanashi sevenc-nanashi changed the title Symbol.asyncIterator is missing from type definition of npm layer bug: Symbol.asyncIterator is missing from type definition of npm layer Feb 2, 2025
@github-project-automation github-project-automation bot moved this from Needs Triage to Done in JSR Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants