From 988c576156485a8fa228931d37f4fca57dabc321 Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Sat, 17 Aug 2024 20:22:12 -0700 Subject: [PATCH] remove intermediate .d.ts files --- .gitignore | 1 + dist/types-af1fe7fc.d.ts | 27 ---- dist/utils-cbe6a7fc.d.ts | 13 -- dist/warcserializer-4627762e.d.ts | 203 ------------------------------ tsconfig.json | 2 +- 5 files changed, 2 insertions(+), 244 deletions(-) delete mode 100644 dist/types-af1fe7fc.d.ts delete mode 100644 dist/utils-cbe6a7fc.d.ts delete mode 100644 dist/warcserializer-4627762e.d.ts diff --git a/.gitignore b/.gitignore index 2218039..a643037 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ yarn-error.log coverage/ .DS_Store **/*.cts +dist/*-*.d.ts diff --git a/dist/types-af1fe7fc.d.ts b/dist/types-af1fe7fc.d.ts deleted file mode 100644 index 45ad30a..0000000 --- a/dist/types-af1fe7fc.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -type SourceReader = { - read: Function; -}; -type SourceReadable = { - getReader: (...args: any) => { - read: Function; - }; -}; -type Source = SourceReader | SourceReadable | AsyncIterable | Iterable; -type StreamResult = { - filename: string; - reader: AsyncIterable; -}; -type StreamResults = StreamResult[]; -type IndexerOffsetLength = { - offset: number; - recordLength: number; -}; -type Request = { - method: string; - url: string; - headers: Map | Headers; - postData?: any; - requestBody?: any; -}; - -export { IndexerOffsetLength as I, Request as R, Source as S, StreamResults as a, SourceReader as b, SourceReadable as c, StreamResult as d }; diff --git a/dist/utils-cbe6a7fc.d.ts b/dist/utils-cbe6a7fc.d.ts deleted file mode 100644 index bfecadf..0000000 --- a/dist/utils-cbe6a7fc.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { R as Request } from './types-af1fe7fc.js'; - -declare function getSurt(url: string): string; -declare function postToGetUrl(request: Request): boolean; -declare function appendRequestQuery(url: string, query: string, method: string): string; -declare function jsonToQueryParams(json: string | any, ignoreInvalid?: boolean): URLSearchParams; -declare function mfdToQueryParams(mfd: string | Uint8Array, contentType: string): URLSearchParams; -declare function jsonToQueryString(json: any, ignoreInvalid?: boolean): string; -declare function mfdToQueryString(mfd: string | Uint8Array, contentType: string): string; -declare function concatChunks(chunks: Uint8Array[], size: number): Uint8Array; -declare function splitChunk(chunk: Uint8Array, inx: number): [Uint8Array, Uint8Array]; - -export { appendRequestQuery as a, jsonToQueryString as b, mfdToQueryString as c, concatChunks as d, getSurt as g, jsonToQueryParams as j, mfdToQueryParams as m, postToGetUrl as p, splitChunk as s }; diff --git a/dist/warcserializer-4627762e.d.ts b/dist/warcserializer-4627762e.d.ts deleted file mode 100644 index 455e2a6..0000000 --- a/dist/warcserializer-4627762e.d.ts +++ /dev/null @@ -1,203 +0,0 @@ -import { IHasher } from 'hash-wasm/dist/lib/WASMInterface.js'; -import pako from 'pako'; -import { S as Source, b as SourceReader } from './types-af1fe7fc.js'; - -declare class NoConcatInflator extends pako.Inflate { - reader: T; - ended: boolean; - chunks: Uint8Array[]; - constructor(options: pako.InflateOptions, reader: T); - onEnd(status: pako.ReturnCodes): void; -} -declare abstract class BaseAsyncIterReader { - static readFully(iter: AsyncIterable | Iterable): Promise; - abstract [Symbol.asyncIterator](): AsyncIterator; - getReadableStream(): ReadableStream; - readFully(): Promise; - abstract readlineRaw(maxLength?: number): Promise; - readline(maxLength?: number): Promise; - iterLines(maxLength?: number): AsyncGenerator; -} -type AsyncIterReaderOpts = { - raw: boolean; -}; -declare class AsyncIterReader extends BaseAsyncIterReader { - compressed: string | null; - opts: AsyncIterReaderOpts; - inflator: NoConcatInflator | null; - _sourceIter: AsyncIterator; - lastValue: Uint8Array | null; - errored: boolean; - _savedChunk: Uint8Array | null; - _rawOffset: number; - _readOffset: number; - numChunks: number; - constructor(streamOrIter: Source, compressed?: string | null, dechunk?: boolean); - _loadNext(): Promise; - dechunk(source: AsyncIterable): AsyncIterator; - unread(chunk: Uint8Array): void; - _next(): Promise; - _push(value: Uint8Array): void; - _getNextChunk(original?: Uint8Array): Uint8Array | null | undefined; - [Symbol.asyncIterator](): AsyncGenerator; - readlineRaw(maxLength?: number): Promise; - readFully(): Promise; - readSize(sizeLimit: number): Promise; - skipSize(sizeLimit: number): Promise; - _readOrSkip(sizeLimit?: number, skip?: boolean): Promise; - getReadOffset(): number; - getRawOffset(): number; - getRawLength(prevOffset: number): number; - static fromReadable(source: Readable): { - [Symbol.asyncIterator](): AsyncGenerator; - }; - static fromIter(source: Iterable): { - [Symbol.asyncIterator](): AsyncGenerator; - }; -} -declare class LimitReader extends BaseAsyncIterReader { - sourceIter: AsyncIterReader; - length: number; - limit: number; - skip: number; - constructor(streamIter: AsyncIterReader, limit: number, skip?: number); - setLimitSkip(limit: number, skip?: number): void; - [Symbol.asyncIterator](): AsyncGenerator; - readlineRaw(maxLength?: number): Promise; - skipFully(): Promise; -} - -declare class StatusAndHeaders { - statusline: string; - headers: Map | Headers; - constructor({ statusline, headers, }: { - statusline: string; - headers: Map | Headers; - }); - toString(): string; - iterSerialize(encoder: TextEncoder): AsyncGenerator; - _protocol: string; - _statusCode: number | string; - _statusText: string; - _parseResponseStatusLine(): void; - get statusCode(): string | number; - get protocol(): string; - get statusText(): string; - _method: string; - _requestPath: string; - _parseRequestStatusLine(): void; - get method(): string; - get requestPath(): string; -} -declare class StatusAndHeadersParser { - parse(reader: AsyncIterReader, { headersClass, firstLine, }?: { - firstLine?: string; - headersClass: typeof Map | typeof Headers; - }): Promise; -} - -declare const WARC_1_1 = "WARC/1.1"; -declare const WARC_1_0 = "WARC/1.0"; -type WARCType = "warcinfo" | "response" | "resource" | "request" | "metadata" | "revisit" | "conversion" | "continuation"; -type WARCRecordOpts = { - url?: string; - date?: string; - type?: WARCType; - warcHeaders?: Record; - filename?: string; - httpHeaders?: HeadersInit; - statusline?: string; - warcVersion?: typeof WARC_1_0 | typeof WARC_1_1; - keepHeadersCase?: boolean; - refersToUrl?: string; - refersToDate?: string; -}; -declare class WARCRecord extends BaseAsyncIterReader { - static create({ url, date, type, warcHeaders, filename, httpHeaders, statusline, warcVersion, keepHeadersCase, refersToUrl, refersToDate, }?: WARCRecordOpts, reader?: AsyncIterable | Iterable): WARCRecord; - static createWARCInfo(opts: WARCRecordOpts | undefined, info: Record): WARCRecord; - warcHeaders: StatusAndHeaders; - _reader: AsyncIterable | Iterable; - _contentReader: BaseAsyncIterReader | null; - payload: Uint8Array | null; - httpHeaders: StatusAndHeaders | null; - consumed: "content" | "raw" | "skipped" | ""; - _offset: number; - _length: number; - method: string; - requestBody: string; - _urlkey: string; - constructor({ warcHeaders, reader, }: { - warcHeaders: StatusAndHeaders; - reader: AsyncIterable | Iterable; - }); - getResponseInfo(): { - headers: Map | Headers; - status: string | number; - statusText: string; - } | null; - fixUp(): void; - readFully(isContent?: boolean): Promise; - get reader(): AsyncIterable | Iterable; - get contentReader(): AsyncIterable | Iterable; - _createDecodingReader(source: Source): AsyncIterReader; - readlineRaw(maxLength?: number): Promise; - contentText(): Promise; - [Symbol.asyncIterator](): AsyncGenerator; - skipFully(): Promise; - warcHeader(name: string): string | null | undefined; - get warcType(): string | null | undefined; - get warcTargetURI(): string | null | undefined; - get warcDate(): string | null | undefined; - get warcRefersToTargetURI(): string | null | undefined; - get warcRefersToDate(): string | null | undefined; - get warcPayloadDigest(): string | null | undefined; - get warcBlockDigest(): string | null | undefined; - get warcContentType(): string | null | undefined; - get warcContentLength(): number; -} - -type WARCSerializerOpts = { - gzip?: boolean; - digest?: { - algo?: AlgorithmIdentifier; - prefix?: string; - base32?: boolean; - }; - preferPako?: boolean; -}; -declare abstract class BaseSerializerBuffer { - abstract write(chunk: Uint8Array): void; - abstract readAll(): AsyncIterable; -} -declare class SerializerInMemBuffer extends BaseSerializerBuffer { - buffers: Array; - write(chunk: Uint8Array): void; - readAll(): AsyncIterable; -} -declare class WARCSerializer extends BaseAsyncIterReader { - gzip: boolean; - digestAlgo: AlgorithmIdentifier; - digestAlgoPrefix: string; - digestBase32: boolean; - preferPako: boolean; - record: WARCRecord; - externalBuffer: BaseSerializerBuffer; - _alreadyDigested: boolean; - blockHasher: IHasher | null; - payloadHasher: IHasher | null; - httpHeadersBuff: Uint8Array | null; - warcHeadersBuff: Uint8Array | null; - static serialize(record: WARCRecord, opts?: WARCSerializerOpts, externalBuffer?: BaseSerializerBuffer): Promise; - constructor(record: WARCRecord, opts?: WARCSerializerOpts, externalBuffer?: BaseSerializerBuffer); - static noComputeDigest(record: WARCRecord): string | true | null | undefined; - [Symbol.asyncIterator](): AsyncGenerator; - readlineRaw(maxLength?: number): Promise; - pakoCompress(): AsyncGenerator; - streamCompress(cs: CompressionStream): AsyncGenerator; - newHasher(): Promise | null; - getDigest(hasher: IHasher): string; - digestRecord(): Promise; - generateRecord(): AsyncGenerator; -} - -export { AsyncIterReader as A, BaseAsyncIterReader as B, LimitReader as L, NoConcatInflator as N, StatusAndHeaders as S, WARCRecord as W, StatusAndHeadersParser as a, WARCSerializer as b, BaseSerializerBuffer as c, WARC_1_0 as d, WARC_1_1 as e, WARCSerializerOpts as f, WARCRecordOpts as g, WARCType as h, AsyncIterReaderOpts as i, SerializerInMemBuffer as j }; diff --git a/tsconfig.json b/tsconfig.json index f0a8fc8..0dfff17 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,7 @@ "noUncheckedIndexedAccess": true, "removeComments": true, "resolveJsonModule": true, - "skipLibCheck": true, + "skipLibCheck": false, "strict": true } }