Skip to content
Closed
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
35 changes: 35 additions & 0 deletions scripts/classify-docs-only.d.mts
Original file line number Diff line number Diff line change
@@ -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<string, string | undefined>;
}) => Promise<DocsOnlyClassification>;