index.d.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* auto-generated by NAPI-RS */
  2. /* eslint-disable */
  3. export declare class Scanner {
  4. constructor(opts: ScannerOptions)
  5. scan(): Array<string>
  6. scanFiles(input: Array<ChangedContent>): Array<string>
  7. getCandidatesWithPositions(input: ChangedContent): Array<CandidateWithPosition>
  8. get files(): Array<string>
  9. get globs(): Array<GlobEntry>
  10. get normalizedSources(): Array<GlobEntry>
  11. }
  12. export interface CandidateWithPosition {
  13. /** The candidate string */
  14. candidate: string
  15. /** The position of the candidate inside the content file */
  16. position: number
  17. }
  18. export interface ChangedContent {
  19. /** File path to the changed file */
  20. file?: string
  21. /** Contents of the changed file */
  22. content?: string
  23. /** File extension */
  24. extension: string
  25. }
  26. export interface GlobEntry {
  27. /** Base path of the glob */
  28. base: string
  29. /** Glob pattern */
  30. pattern: string
  31. }
  32. export interface ScannerOptions {
  33. /** Glob sources */
  34. sources?: Array<SourceEntry>
  35. }
  36. export interface SourceEntry {
  37. /** Base path of the glob */
  38. base: string
  39. /** Glob pattern */
  40. pattern: string
  41. /** Negated flag */
  42. negated: boolean
  43. }