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

Fix export typing AnyWebByteStream #1146

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions lib/core.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import type { Readable } from 'node:stream';
import { StreamReader, WebStreamReader } from 'peek-readable';

import { ReadStreamTokenizer } from './ReadStreamTokenizer.js';
import { BufferTokenizer } from './BufferTokenizer.js';
import { StreamReader, WebStreamReader } from 'peek-readable';
import type { ITokenizerOptions } from './types.js';
import type { ReadableStream as NodeReadableStream, ReadableStream } from 'node:stream/web';
import type { Readable } from 'node:stream';
import type { AnyWebByteStream } from './core.js';

export { EndOfStreamError } from 'peek-readable';
export { EndOfStreamError, type AnyWebByteStream } from 'peek-readable';
export type { ITokenizer, IFileInfo, ITokenizerOptions, IReadChunkOptions, OnClose } from './types.js';
export type { IToken, IGetToken } from '@tokenizer/token';
export { AbstractTokenizer } from './AbstractTokenizer.js';

export type AnyWebByteStream = NodeReadableStream<Uint8Array> | ReadableStream<Uint8Array>;

/**
* Construct ReadStreamTokenizer from given Stream.
* Will set fileSize, if provided given Stream has set the .path property/
Expand Down
3 changes: 1 addition & 2 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { stat as fsStat } from 'node:fs/promises';
import { type ITokenizerOptions, fromStream as coreFromStream } from './core.js';

export { fromFile } from './FileTokenizer.js';
export { EndOfStreamError, fromBuffer, fromWebStream, AbstractTokenizer} from './core.js';
export type { ITokenizer, IFileInfo, ITokenizerOptions, IReadChunkOptions, OnClose, AnyWebByteStream} from './core.js';
export * from './core.js';
export type { IToken, IGetToken } from '@tokenizer/token';

interface StreamWithFile extends Readable {
Expand Down
Loading