Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. // Type definitions for vfile-message 1.0
  2. // Project: https://github.com/vfile/vfile-message#readme
  3. // Definitions by: Junyoung Choi <https://github.com/rokt33r>
  4. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
  5. // TypeScript Version: 3.0
  6.  
  7. /// <reference types='node' />
  8.  
  9. import * as Unist from 'unist';
  10.  
  11. declare namespace vfileMessage {
  12. /**
  13. * Create a virtual message.
  14. */
  15. interface VFileMessage extends Error {
  16. /**
  17. * Constructor of a message for `reason` at `position` from `origin`.
  18. * When an error is passed in as `reason`, copies the `stack`.
  19. *
  20. * @param reason Reason for message (`string` or `Error`). Uses the stack and message of the error if given.
  21. * @param position Place at which the message occurred in a file (`Node`, `Position`, or `Point`, optional).
  22. * @param origin Place in code the message originates from (`string`, optional).
  23. */
  24. (reason: string | Error, position?: Unist.Node | Unist.Position | Unist.Point, origin?: string): VFileMessage;
  25. /**
  26. * Category of message.
  27. */
  28. ruleId: string | null;
  29. /**
  30. * Reason for message.
  31. */
  32. reason: string;
  33. /**
  34. * Starting line of error.
  35. */
  36. line: number | null;
  37. /**
  38. * Starting column of error.
  39. */
  40. column: number | null;
  41. /**
  42. * Full range information, when available.
  43. * Has start and end properties, both set to an object with line and column, set to number?.
  44. */
  45. location: Unist.Position;
  46. /**
  47. * Namespace of warning.
  48. */
  49. source: string | null;
  50. /**
  51. * If true, marks associated file as no longer processable.
  52. */
  53. fatal?: boolean | null;
  54. /**
  55. * You may add a file property with a path of a file (used throughout the VFile ecosystem).
  56. */
  57. file?: string;
  58. /**
  59. * You may add a note property with a long form description of the message (supported by vfile-reporter).
  60. */
  61. note?: string;
  62. /**
  63. * You may add a url property with a link to documentation for the message.
  64. */
  65. url?: string;
  66. /**
  67. * It’s OK to store custom data directly on the VMessage, some of those are handled by utilities.
  68. */
  69. [key: string]: unknown;
  70. }
  71. }
  72.  
  73. declare const vfileMessage: vfileMessage.VFileMessage;
  74.  
  75. export = vfileMessage;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement