Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

index.d.ts 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. Copyright 2019 Mark Lee and contributors
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. declare function sumchecker(algorithm: string, checksumFilename: string, baseDir: string, filesToCheck: string[] | string): Promise<void>;
  14. declare namespace sumchecker {
  15. type ChecksumOptions = {
  16. defaultTextEncoding?: string;
  17. };
  18. class ErrorWithFilename extends Error {
  19. constructor(filename: string);
  20. }
  21. class ChecksumMismatchError extends ErrorWithFilename {
  22. constructor(filename: string);
  23. }
  24. class ChecksumParseError extends Error {
  25. constructor(lineNumber: number, line: string);
  26. }
  27. class NoChecksumFoundError extends ErrorWithFilename {
  28. constructor(filename: string);
  29. }
  30. class ChecksumValidator {
  31. constructor(algorithm: string, checksumFilename: string, options?: ChecksumOptions);
  32. encoding(binary: boolean): string;
  33. parseChecksumFile(data: string): void;
  34. readFile(filename: string, binary: boolean): Promise<string>;
  35. validate(baseDir: string, filesToCheck: string[] | string): Promise<void>;
  36. validateFile(baseDir: string, filename: string): Promise<void>;
  37. validateFiles(baseDir: string, filesToCheck: string[]): Promise<void>;
  38. }
  39. }
  40. export = sumchecker