feat: a better type system and type hints that depend on it

This commit is contained in:
2025-03-18 02:32:45 +08:00
parent 85eecbf6ac
commit fb58f35a6a
14 changed files with 215 additions and 222 deletions

View File

@@ -4,7 +4,7 @@ import {
EbmlElementType,
EbmlStreamDecoder as Decoder,
EbmlDataTag,
type EbmlTagTrait,
type EbmlTagType,
} from 'konoebml';
const bufFrom = (data: Uint8Array | readonly number[]): ArrayBuffer =>
@@ -16,8 +16,8 @@ const getDecoderWithNullSink = () => {
return decoder;
};
async function collectTags(decoder: Decoder): Promise<EbmlTagTrait[]> {
const tags: EbmlTagTrait[] = [];
async function collectTags(decoder: Decoder): Promise<EbmlTagType[]> {
const tags: EbmlTagType[] = [];
await decoder.readable.pipeTo(
new WritableStream({
write: (tag) => {