import type { IUserRegistry, ValidationIssue } from '@opentask/taskin-task-manager'; import type { User } from '@opentask/taskin-types'; /** * What the `Assignee:` line of a task actually points at. * * @public */ export type AssigneeIdentity = { readonly kind: 'resolved'; readonly raw: string; readonly user: User; } | { readonly kind: 'unassigned'; readonly raw: string; } /** A registered user written as anything but their id — the display name included. */ | { readonly kind: 'correctable'; readonly raw: string; readonly user: User; } | { readonly kind: 'unknown'; readonly raw: string; }; /** * Classifies the raw `Assignee:` value of a task against the user registry. * * @param raw - The value as written in the task * @param registry - The directory to resolve against * @public */ /** * Collapses spelling differences that carry no meaning: case, and every * separator a human might or might not type (`sidarta-veloso`, `sidarta veloso` * and `sidartaveloso` all fold together). * * Deliberately not a fuzzy distance: a typo like `sidartaeloso` must NOT be * silently "corrected" into someone's name. */ export declare const foldAssignee: (value: string) => string; export declare function classifyAssignee(raw: string, registry: Pick): AssigneeIdentity; /** * Turns the identities that need a human decision into lint issues. * * `resolved` and `unassigned` produce nothing: one is correct, the other is a * legitimate "nobody yet" that `createTask` writes itself. * * @param tasks - The tasks to check, with the file each one came from * @param registry - The directory to resolve against * @public */ export declare function validateAssignees(tasks: readonly { readonly file: string; readonly assignee: string | undefined; }[], registry: Pick): ValidationIssue[]; /** * Rewrites the `Assignee:` line for every identity that folds onto exactly one * registered user. * * Only the unambiguous case is touched. A typo with no single match, or a * spelling that folds onto two users, stays as written — guessing someone's * identity from an edit distance is worse than leaving the warning up. * * @returns The files that were rewritten * @public */ export declare function fixAssignees(tasks: readonly { readonly file: string; readonly assignee: string | undefined; }[], registry: Pick, io: { readFile: (path: string) => Promise; writeFile: (path: string, content: string) => Promise; }): Promise; /** * Reports a seeded synthetic user that no task points at. * * Report only: it is still user data, so removing it is the human's call. * * @param assignees - Every raw `Assignee:` value in use * @param registry - The directory to inspect * @public */ export declare function validateSeededUsers(assignees: readonly (string | undefined)[], registry: Pick): ValidationIssue[]; //# sourceMappingURL=assignee-identity.d.ts.map