@lint-todo/utils
Version:
 [](https://badge.fury.io/js/%40lint-todo%2Futils) [](h
19 lines • 1.49 kB
TypeScript
import { Engine, FilePath, GenericLintData, Operation, OperationType, TodoConfig, TodoData } from './types';
import TodoMatcher from './todo-matcher';
export declare function buildFromTodoOperations(todoOperations: Operation[], engine: Engine): Map<FilePath, TodoMatcher>;
export declare function buildTodoOperations(add: Set<TodoData>, remove: Set<TodoData>): Operation[];
export declare function toTodoDatum(todoOperation: Operation): [OperationType, TodoData];
export declare function toOperation(operation: OperationType, todoDatum: TodoData): string;
/**
* Adapts a {@link https://github.com/lint-todo/utils/blob/master/src/types/lint.ts#L31|LintResult} to a {@link https://github.com/lint-todo/utils/blob/master/src/types/todo.ts#L61|TodoData}. FilePaths are absolute
* when received from a lint result, so they're converted to relative paths for stability in
* serializing the contents to disc.
*
* @param lintResult - The lint result object.
* @param lintMessage - A lint message object representing a specific violation for a file.
* @param todoConfig - An object containing the warn or error days, in integers.
* @returns - A {@link https://github.com/lint-todo/utils/blob/master/src/types/todo.ts#L61|TodoData} object.
*/
export declare function buildTodoDatum(baseDir: string, genericLintData: GenericLintData, todoConfig?: TodoConfig): TodoData;
export declare function generateHash(input: string, algorithm?: string): string;
//# sourceMappingURL=builders.d.ts.map