From 9324c40359abd09d4df4265669aa5978e9b9f374 Mon Sep 17 00:00:00 2001 From: ScriptedAlchemy Date: Wed, 2 Sep 2026 02:51:23 +0000 Subject: [PATCH] fix(types): add declarations for classify-docs-only.mjs so root typecheck passes The classify-docs-only test added in #259 imports the untyped .mjs module, which fails tsc --noEmit with TS7016 under noImplicitAny. A declaration sibling types the classifier's exported surface. --- scripts/classify-docs-only.d.mts | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 scripts/classify-docs-only.d.mts diff --git a/scripts/classify-docs-only.d.mts b/scripts/classify-docs-only.d.mts new file mode 100644 index 000000000..354ee52c9 --- /dev/null +++ b/scripts/classify-docs-only.d.mts @@ -0,0 +1,35 @@ +/** Declarations for the docs-only classifier so test imports typecheck. */ + +export interface GhFilesListingEntry { + readonly filename: string; + readonly previousFilename: string; +} + +export type DocsOnlyReason = + | 'docs-only' + | 'empty-listing' + | 'invalid-count' + | 'listing-error' + | 'non-docs-path' + | 'truncated-listing'; + +export interface DocsOnlyClassification { + readonly docsOnly: boolean; + readonly path?: string; + readonly reason: DocsOnlyReason; +} + +export declare const isDocsOnlyPath: (filePath: string) => boolean; + +export declare const parseGhFilesListing: (text: string) => GhFilesListingEntry[]; + +export declare const classifyDocsOnlyListing: (options: { + readonly changedFilesCount: string | undefined; + readonly entries: readonly GhFilesListingEntry[]; + readonly listingOk: boolean; +}) => DocsOnlyClassification; + +export declare const runClassify: (options?: { + readonly argv?: readonly string[]; + readonly env?: Record; +}) => Promise;