comment.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /* @flow */
  2. /* eslint no-use-before-define: 0 */
  3. type DocumentationConfig = {
  4. inferPrivate?: string,
  5. noPackage?: boolean,
  6. toc?: Array<Object>,
  7. paths?: { [key: string]: number },
  8. access?: Array<string>,
  9. defaultGlobals?: boolean,
  10. defaultGlobalsEnvs?: Array<string>,
  11. external?: Array<string>,
  12. theme: string,
  13. requireExtension?: Array<string>,
  14. parseExtension: Array<string>,
  15. noReferenceLinks?: boolean,
  16. markdownToc?: boolean,
  17. markdownTocMaxDepth?: number,
  18. documentExported?: boolean,
  19. resolve?: string,
  20. hljs?: Object
  21. };
  22. type CommentError = {
  23. message: string,
  24. commentLineNumber?: number
  25. };
  26. type DoctrineType = {
  27. elements?: Array<DoctrineType>,
  28. expression?: DoctrineType,
  29. applications?: Array<DoctrineType>,
  30. type: string,
  31. name?: string
  32. };
  33. type CommentLoc = {
  34. start: {
  35. line: number
  36. },
  37. end: {
  38. line: number
  39. }
  40. };
  41. type SourceFile = {
  42. source?: string,
  43. file: string
  44. };
  45. type CommentContext = {
  46. sortKey: string,
  47. file: string,
  48. ast?: Object,
  49. loc: CommentLoc,
  50. code: string,
  51. github?: CommentContextGitHub
  52. };
  53. type CommentContextGitHub = {
  54. path: string,
  55. url: string
  56. };
  57. type CommentTag = {
  58. name?: string,
  59. title: string,
  60. description?: Object,
  61. default?: any,
  62. lineNumber?: number,
  63. type?: DoctrineType,
  64. properties?: Array<CommentTag>,
  65. readonly?: boolean
  66. };
  67. type Comment = {
  68. errors: Array<CommentError>,
  69. tags: Array<CommentTag>,
  70. augments: Array<CommentTag>,
  71. examples: Array<CommentExample>,
  72. implements: Array<CommentTag>,
  73. params: Array<CommentTag>,
  74. properties: Array<CommentTag>,
  75. returns: Array<CommentTag>,
  76. sees: Array<Remark>,
  77. throws: Array<CommentTag>,
  78. todos: Array<CommentTag>,
  79. description?: Remark,
  80. summary?: Remark,
  81. deprecated?: Remark,
  82. classdesc?: Remark,
  83. members: CommentMembers,
  84. constructorComment?: Comment,
  85. name?: string,
  86. kind?: Kind,
  87. memberof?: string,
  88. scope?: Scope,
  89. access?: Access,
  90. readonly?: boolean,
  91. abstract?: boolean,
  92. generator?: boolean,
  93. alias?: string,
  94. copyright?: string,
  95. author?: string,
  96. license?: string,
  97. version?: string,
  98. since?: string,
  99. lends?: string,
  100. override?: boolean,
  101. hideconstructor?: true,
  102. type?: DoctrineType,
  103. context: CommentContext,
  104. loc: CommentLoc,
  105. path?: Array<{
  106. name: string,
  107. scope: Scope
  108. }>,
  109. ignore?: boolean
  110. };
  111. type CommentMembers = {
  112. static: Array<Comment>,
  113. instance: Array<Comment>,
  114. events: Array<Comment>,
  115. global: Array<Comment>,
  116. inner: Array<Comment>
  117. };
  118. type CommentExample = {
  119. caption?: string,
  120. description?: Object
  121. };
  122. type Remark = {
  123. type: string,
  124. children: Array<Object>
  125. };
  126. type Access = 'private' | 'public' | 'protected';
  127. type Scope = 'instance' | 'static' | 'inner' | 'global';
  128. type Kind =
  129. | 'class'
  130. | 'constant'
  131. | 'event'
  132. | 'external'
  133. | 'file'
  134. | 'function'
  135. | 'member'
  136. | 'mixin'
  137. | 'module'
  138. | 'namespace'
  139. | 'typedef'
  140. | 'interface';