fcis 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/.plans/001-fcis-analyzer.md +832 -0
  2. package/.plans/002-fcis-analyzer-improvements.md +205 -0
  3. package/README.md +272 -0
  4. package/TECHNICAL.md +386 -0
  5. package/dist/cli.d.ts +1 -0
  6. package/dist/cli.js +1836 -0
  7. package/dist/cli.js.map +1 -0
  8. package/dist/index.d.ts +709 -0
  9. package/dist/index.js +1845 -0
  10. package/dist/index.js.map +1 -0
  11. package/package.json +47 -0
  12. package/pnpm-workspace.yaml +0 -0
  13. package/src/analyzer.ts +266 -0
  14. package/src/classification/classifier.ts +156 -0
  15. package/src/classification/derive-status.ts +171 -0
  16. package/src/classification/quality-scorer.ts +481 -0
  17. package/src/cli.ts +286 -0
  18. package/src/detection/detect-markers.ts +480 -0
  19. package/src/detection/markers.ts +332 -0
  20. package/src/extraction/extract-functions.ts +570 -0
  21. package/src/extraction/extractor.ts +188 -0
  22. package/src/index.ts +111 -0
  23. package/src/reporting/report-console.ts +416 -0
  24. package/src/reporting/report-json.ts +232 -0
  25. package/src/scoring/scorer.ts +504 -0
  26. package/src/types.ts +248 -0
  27. package/tests/classifier.test.ts +480 -0
  28. package/tests/derive-status.test.ts +464 -0
  29. package/tests/detect-markers.test.ts +639 -0
  30. package/tests/extractor.test.ts +155 -0
  31. package/tests/integration.test.ts +706 -0
  32. package/tests/quality-scorer.test.ts +650 -0
  33. package/tests/scorer.test.ts +768 -0
  34. package/tsconfig.json +34 -0
  35. package/tsup.config.ts +17 -0
  36. package/vendor/ts-morph/.editorconfig +10 -0
  37. package/vendor/ts-morph/.gitattributes +11 -0
  38. package/vendor/ts-morph/.github/CODE_OF_CONDUCT.md +77 -0
  39. package/vendor/ts-morph/.github/ISSUE_TEMPLATE/bug_report.md +29 -0
  40. package/vendor/ts-morph/.github/ISSUE_TEMPLATE/custom.md +4 -0
  41. package/vendor/ts-morph/.github/ISSUE_TEMPLATE/feature_request.md +18 -0
  42. package/vendor/ts-morph/.github/workflows/ci.yml +50 -0
  43. package/vendor/ts-morph/.github/workflows/publish.yml +53 -0
  44. package/vendor/ts-morph/.vscode/settings.json +10 -0
  45. package/vendor/ts-morph/CONTRIBUTING.md +23 -0
  46. package/vendor/ts-morph/DEVELOPMENT.md +32 -0
  47. package/vendor/ts-morph/LICENSE +21 -0
  48. package/vendor/ts-morph/deno.json +8 -0
  49. package/vendor/ts-morph/deno.lock +1233 -0
  50. package/vendor/ts-morph/docs/CNAME +1 -0
  51. package/vendor/ts-morph/docs/Gemfile +2 -0
  52. package/vendor/ts-morph/docs/_config.yml +5 -0
  53. package/vendor/ts-morph/docs/_layouts/default.html +159 -0
  54. package/vendor/ts-morph/docs/_script-templates/main.ts +116 -0
  55. package/vendor/ts-morph/docs/assets/css/style.scss +212 -0
  56. package/vendor/ts-morph/docs/details/ambient.md +38 -0
  57. package/vendor/ts-morph/docs/details/async.md +31 -0
  58. package/vendor/ts-morph/docs/details/classes.md +314 -0
  59. package/vendor/ts-morph/docs/details/comment-ranges.md +7 -0
  60. package/vendor/ts-morph/docs/details/comments.md +122 -0
  61. package/vendor/ts-morph/docs/details/decorators.md +119 -0
  62. package/vendor/ts-morph/docs/details/documentation.md +73 -0
  63. package/vendor/ts-morph/docs/details/enums.md +117 -0
  64. package/vendor/ts-morph/docs/details/exports.md +308 -0
  65. package/vendor/ts-morph/docs/details/expressions.md +46 -0
  66. package/vendor/ts-morph/docs/details/functions.md +150 -0
  67. package/vendor/ts-morph/docs/details/generators.md +27 -0
  68. package/vendor/ts-morph/docs/details/identifiers.md +79 -0
  69. package/vendor/ts-morph/docs/details/imports.md +191 -0
  70. package/vendor/ts-morph/docs/details/index.md +52 -0
  71. package/vendor/ts-morph/docs/details/initializers.md +40 -0
  72. package/vendor/ts-morph/docs/details/interfaces.md +218 -0
  73. package/vendor/ts-morph/docs/details/literals.md +20 -0
  74. package/vendor/ts-morph/docs/details/modifiers.md +38 -0
  75. package/vendor/ts-morph/docs/details/modules.md +113 -0
  76. package/vendor/ts-morph/docs/details/namespaces.md +7 -0
  77. package/vendor/ts-morph/docs/details/object-literal-expressions.md +106 -0
  78. package/vendor/ts-morph/docs/details/parameters.md +64 -0
  79. package/vendor/ts-morph/docs/details/signatures.md +41 -0
  80. package/vendor/ts-morph/docs/details/source-files.md +292 -0
  81. package/vendor/ts-morph/docs/details/type-aliases.md +34 -0
  82. package/vendor/ts-morph/docs/details/type-parameters.md +72 -0
  83. package/vendor/ts-morph/docs/details/types.md +254 -0
  84. package/vendor/ts-morph/docs/details/variables.md +110 -0
  85. package/vendor/ts-morph/docs/emitting.md +151 -0
  86. package/vendor/ts-morph/docs/index.md +25 -0
  87. package/vendor/ts-morph/docs/manipulation/code-writer.md +20 -0
  88. package/vendor/ts-morph/docs/manipulation/formatting.md +76 -0
  89. package/vendor/ts-morph/docs/manipulation/index.md +136 -0
  90. package/vendor/ts-morph/docs/manipulation/order.md +14 -0
  91. package/vendor/ts-morph/docs/manipulation/performance.md +222 -0
  92. package/vendor/ts-morph/docs/manipulation/removing.md +31 -0
  93. package/vendor/ts-morph/docs/manipulation/renaming.md +106 -0
  94. package/vendor/ts-morph/docs/manipulation/settings.md +76 -0
  95. package/vendor/ts-morph/docs/manipulation/structures.md +117 -0
  96. package/vendor/ts-morph/docs/manipulation/transforms.md +84 -0
  97. package/vendor/ts-morph/docs/metrics/performance.json +4 -0
  98. package/vendor/ts-morph/docs/navigation/ambient-modules.md +22 -0
  99. package/vendor/ts-morph/docs/navigation/compiler-nodes.md +82 -0
  100. package/vendor/ts-morph/docs/navigation/directories.md +287 -0
  101. package/vendor/ts-morph/docs/navigation/example.md +50 -0
  102. package/vendor/ts-morph/docs/navigation/finding-references.md +53 -0
  103. package/vendor/ts-morph/docs/navigation/getting-source-files.md +59 -0
  104. package/vendor/ts-morph/docs/navigation/images/getChildrenVsForEachChild.gif +0 -0
  105. package/vendor/ts-morph/docs/navigation/index.md +94 -0
  106. package/vendor/ts-morph/docs/navigation/language-service.md +23 -0
  107. package/vendor/ts-morph/docs/navigation/program.md +25 -0
  108. package/vendor/ts-morph/docs/navigation/type-checker.md +33 -0
  109. package/vendor/ts-morph/docs/setup/adding-source-files.md +145 -0
  110. package/vendor/ts-morph/docs/setup/ast-viewers.md +46 -0
  111. package/vendor/ts-morph/docs/setup/diagnostics.md +109 -0
  112. package/vendor/ts-morph/docs/setup/file-system.md +106 -0
  113. package/vendor/ts-morph/docs/setup/images/atom-ast.png +0 -0
  114. package/vendor/ts-morph/docs/setup/images/atom-ast_small.png +0 -0
  115. package/vendor/ts-morph/docs/setup/images/atom-command-palette.png +0 -0
  116. package/vendor/ts-morph/docs/setup/images/atom-file.png +0 -0
  117. package/vendor/ts-morph/docs/setup/images/ts-ast-viewer.png +0 -0
  118. package/vendor/ts-morph/docs/setup/index.md +94 -0
  119. package/vendor/ts-morph/docs/utilities.md +55 -0
  120. package/vendor/ts-morph/dprint.json +23 -0
  121. package/vendor/ts-morph/package.json +30 -0
  122. package/vendor/ts-morph/packages/bootstrap/LICENSE +21 -0
  123. package/vendor/ts-morph/packages/bootstrap/lib/ts-morph-bootstrap.d.ts +397 -0
  124. package/vendor/ts-morph/packages/bootstrap/package.json +46 -0
  125. package/vendor/ts-morph/packages/bootstrap/readme.md +200 -0
  126. package/vendor/ts-morph/packages/common/LICENSE +21 -0
  127. package/vendor/ts-morph/packages/common/lib/ts-morph-common.d.ts +1082 -0
  128. package/vendor/ts-morph/packages/common/lib/typescript.d.ts +11439 -0
  129. package/vendor/ts-morph/packages/common/package.json +65 -0
  130. package/vendor/ts-morph/packages/common/readme.md +5 -0
  131. package/vendor/ts-morph/packages/scripts/changeTypeScriptVersion.ts +28 -0
  132. package/vendor/ts-morph/packages/scripts/createDeclarationProject.ts +47 -0
  133. package/vendor/ts-morph/packages/scripts/deps.ts +2 -0
  134. package/vendor/ts-morph/packages/scripts/execScript.ts +31 -0
  135. package/vendor/ts-morph/packages/scripts/folders.ts +11 -0
  136. package/vendor/ts-morph/packages/scripts/getDevCompilerVersions.ts +19 -0
  137. package/vendor/ts-morph/packages/scripts/mod.ts +7 -0
  138. package/vendor/ts-morph/packages/scripts/utils/Memoize.ts +36 -0
  139. package/vendor/ts-morph/packages/scripts/utils/forEachTypeText.ts +23 -0
  140. package/vendor/ts-morph/packages/scripts/utils/makeConstructorsPrivate.ts +26 -0
  141. package/vendor/ts-morph/packages/scripts/utils/mod.ts +4 -0
  142. package/vendor/ts-morph/packages/scripts/utils/printDiagnostics.ts +10 -0
  143. package/vendor/ts-morph/packages/ts-morph/LICENSE +21 -0
  144. package/vendor/ts-morph/packages/ts-morph/lib/ts-morph.d.ts +11198 -0
  145. package/vendor/ts-morph/packages/ts-morph/package.json +78 -0
  146. package/vendor/ts-morph/packages/ts-morph/readme.md +111 -0
  147. package/vendor/ts-morph/readme.md +14 -0
  148. package/vendor/ts-morph/rfcs/README.md +13 -0
  149. package/vendor/ts-morph/rfcs/RFC-0001 - Inserting Into Statements Handling Comments.md +181 -0
  150. package/vendor/ts-morph/tsconfig.common.json +17 -0
  151. package/vitest.config.ts +16 -0
@@ -0,0 +1 @@
1
+ ts-morph.com
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gem 'github-pages', group: :jekyll_plugins
@@ -0,0 +1,5 @@
1
+ repository: dsherret/ts-morph
2
+ port: 4001
3
+ title: ts-morph
4
+ description: TypeScript Compiler API wrapper for static analysis and programmatic code changes.
5
+ markdown: GFM
@@ -0,0 +1,159 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6
+ <title>{{ site.title | default: site.github.repository_name }} - {{ page.title }}</title>
7
+
8
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
9
+ <link rel="stylesheet" href="{{ 'assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">
10
+ <!--
11
+ <link rel="stylesheet" href="{{ 'assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">
12
+ <link rel="stylesheet" href="{{ 'assets/css/custom-style.css?v=' | append: site.github.build_revision | relative_url }}">
13
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
14
+ <script src="{{ '/assets/js/main.js' | relative_url }}"></script>-->
15
+ </head>
16
+ <body>
17
+ <div class="main">
18
+ <header class="container">
19
+ <div class="row">
20
+ <h1 onclick="document.location.href = '{{ "/" | prepend: site.baseurl }}'" class="headerLink">{{ site.title | default: site.github.repository_name }}</h1>
21
+ <!--<p class="subText">{{ site.description | default: site.github.project_tagline }}</p>-->
22
+ </div>
23
+ </header>
24
+
25
+ <div class="container">
26
+ <div class="row">
27
+ <div class="col-md-3">
28
+ <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
29
+ <span class="navbar-toggler-icon"></span>
30
+ </button>
31
+
32
+ <nav class="sidebar-nav" id="navbarSupportedContent">
33
+ <ul class="navbar-nav navbar-default">
34
+ <li class="nav-item{% if page.path == 'index.md' %} active{% endif %}">
35
+ <a class="nav-link" href="{{ "/" | prepend: site.baseurl }}">Overview</a>
36
+ </li>
37
+ <li class="nav-item{% if page.dir == '/setup/' %} active{% endif %}">
38
+ <a class="nav-link" href="{{ "/setup" | prepend: site.baseurl }}">Setup</a>
39
+ {% if page.dir == '/setup/' %}
40
+ <ul>
41
+ <li class="{% if page.path == 'setup/index.md' %}active{% endif %}"><a href="{{ "/setup/index" | prepend: site.baseurl }}">Instantiating</a></li>
42
+ <li class="{% if page.path == 'setup/adding-source-files.md' %}active{% endif %}"><a href="{{ "/setup/adding-source-files" | prepend: site.baseurl }}">Adding Source Files</a></li>
43
+ <li class="{% if page.path == 'setup/diagnostics.md' %}active{% endif %}"><a href="{{ "/setup/diagnostics" | prepend: site.baseurl }}">Diagnostics</a></li>
44
+ <li class="{% if page.path == 'setup/file-system.md' %}active{% endif %}"><a href="{{ "/setup/file-system" | prepend: site.baseurl }}">File System</a></li>
45
+ <li class="{% if page.path == 'setup/ast-viewers.md' %}active{% endif %}"><a href="{{ "/setup/ast-viewers" | prepend: site.baseurl }}">AST Viewers</a></li>
46
+ </ul>
47
+ {% endif %}
48
+ </li>
49
+ <li class="nav-item{% if page.dir == '/navigation/' %} active{% endif %}">
50
+ <a class="nav-link" href="{{ "/navigation" | prepend: site.baseurl }}">Navigation</a>
51
+ {% if page.dir == '/navigation/' %}
52
+ <ul>
53
+ <li class="{% if page.path == 'navigation/getting-source-files.md' %}active{% endif %}"><a href="{{ "/navigation/getting-source-files" | prepend: site.baseurl }}">Getting Source Files</a></li>
54
+ <li class="{% if page.path == 'navigation/directories.md' %}active{% endif %}"><a href="{{ "/navigation/directories" | prepend: site.baseurl }}">Directories</a></li>
55
+ <li class="{% if page.path == 'navigation/example.md' %}active{% endif %}"><a href="{{ "/navigation/example" | prepend: site.baseurl }}">Example</a></li>
56
+ <li class="{% if page.path == 'navigation/compiler-nodes.md' %}active{% endif %}"><a href="{{ "/navigation/compiler-nodes" | prepend: site.baseurl }}">Compiler Nodes</a></li>
57
+ <li class="{% if page.path == 'navigation/finding-references.md' %}active{% endif %}"><a href="{{ "/navigation/finding-references" | prepend: site.baseurl }}">Finding References</a></li>
58
+ <li class="{% if page.path == 'navigation/language-service.md' %}active{% endif %}"><a href="{{ "/navigation/language-service" | prepend: site.baseurl }}">Language Service</a></li>
59
+ <li class="{% if page.path == 'navigation/program.md' %}active{% endif %}"><a href="{{ "/navigation/program" | prepend: site.baseurl }}">Program</a></li>
60
+ <li class="{% if page.path == 'navigation/type-checker.md' %}active{% endif %}"><a href="{{ "/navigation/type-checker" | prepend: site.baseurl }}">Type Checker</a></li>
61
+ <li class="{% if page.path == 'navigation/ambient-modules.md' %}active{% endif %}"><a href="{{ "/navigation/ambient-modules" | prepend: site.baseurl }}">Ambient Modules</a></li>
62
+ </ul>
63
+ {% endif %}
64
+ </li>
65
+ <li class="nav-item{% if page.dir == '/manipulation/' %} active{% endif %}">
66
+ <a class="nav-link" href="{{ "/manipulation" | prepend: site.baseurl }}">Manipulation</a>
67
+ {% if page.dir == '/manipulation/' %}
68
+ <ul>
69
+ <li class="{% if page.path == 'manipulation/settings.md' %}active{% endif %}"><a href="{{ "/manipulation/settings" | prepend: site.baseurl }}">Settings</a></li>
70
+ <li class="{% if page.path == 'manipulation/renaming.md' %}active{% endif %}"><a href="{{ "/manipulation/renaming" | prepend: site.baseurl }}">Renaming</a></li>
71
+ <li class="{% if page.path == 'manipulation/removing.md' %}active{% endif %}"><a href="{{ "/manipulation/removing" | prepend: site.baseurl }}">Removing</a></li>
72
+ <li class="{% if page.path == 'manipulation/structures.md' %}active{% endif %}"><a href="{{ "/manipulation/structures" | prepend: site.baseurl }}">Structures</a></li>
73
+ <li class="{% if page.path == 'manipulation/formatting.md' %}active{% endif %}"><a href="{{ "/manipulation/formatting" | prepend: site.baseurl }}">Formatting</a></li>
74
+ <li class="{% if page.path == 'manipulation/order.md' %}active{% endif %}"><a href="{{ "/manipulation/order" | prepend: site.baseurl }}">Order</a></li>
75
+ <li class="{% if page.path == 'manipulation/code-writer.md' %}active{% endif %}"><a href="{{ "/manipulation/code-writer" | prepend: site.baseurl }}">Code Writer</a></li>
76
+ <li class="{% if page.path == 'manipulation/performance.md' %}active{% endif %}"><a href="{{ "/manipulation/performance" | prepend: site.baseurl }}">Performance</a></li>
77
+ <li class="{% if page.path == 'manipulation/transforms.md' %}active{% endif %}"><a href="{{ "/manipulation/transforms" | prepend: site.baseurl }}">Transforms</a></li>
78
+ </ul>
79
+ {% endif %}
80
+ </li>
81
+ <li class="nav-item{% if page.path == 'emitting.md' %} active{% endif %}">
82
+ <a class="nav-link" href="{{ "/emitting" | prepend: site.baseurl }}">Emitting</a>
83
+ </li>
84
+ <li class="{% if page.path == 'details/index.md' %}active{% endif %}">
85
+ <a class="nav-link" href="{{ "/details/index" | prepend: site.baseurl }}">Details</a>
86
+ {% if page.dir == '/details/' %}
87
+ <ul>
88
+ <li class="{% if page.path == 'details/source-files.md' %}active{% endif %}"><a href="{{ "/details/source-files" | prepend: site.baseurl }}">Source Files</a></li>
89
+ <li class="{% if page.path == 'details/classes.md' %}active{% endif %}"><a href="{{ "/details/classes" | prepend: site.baseurl }}">Classes</a></li>
90
+ <li class="{% if page.path == 'details/decorators.md' %}active{% endif %}"><a href="{{ "/details/decorators" | prepend: site.baseurl }}">Decorators</a></li>
91
+ <li class="{% if page.path == 'details/enums.md' %}active{% endif %}"><a href="{{ "/details/enums" | prepend: site.baseurl }}">Enums</a></li>
92
+ <li class="{% if page.path == 'details/functions.md' %}active{% endif %}"><a href="{{ "/details/functions" | prepend: site.baseurl }}">Functions</a></li>
93
+ <li class="{% if page.path == 'details/imports.md' %}active{% endif %}"><a href="{{ "/details/imports" | prepend: site.baseurl }}">Imports</a></li>
94
+ <li class="{% if page.path == 'details/interfaces.md' %}active{% endif %}"><a href="{{ "/details/interfaces" | prepend: site.baseurl }}">Interfaces</a></li>
95
+ <li class="{% if page.path == 'details/modules.md' %}active{% endif %}"><a href="{{ "/details/modules" | prepend: site.baseurl }}">Modules</a></li>
96
+ <li class="{% if page.path == 'details/parameters.md' %}active{% endif %}"><a href="{{ "/details/parameters" | prepend: site.baseurl }}">Parameters</a></li>
97
+ <li class="{% if page.path == 'details/type-parameters.md' %}active{% endif %}"><a href="{{ "/details/type-parameters" | prepend: site.baseurl }}">Type Parameters</a></li>
98
+ <li class="{% if page.path == 'details/type-aliases.md' %}active{% endif %}"><a href="{{ "/details/type-aliases" | prepend: site.baseurl }}">Type Aliases</a></li>
99
+ <li class="{% if page.path == 'details/variables.md' %}active{% endif %}"><a href="{{ "/details/variables" | prepend: site.baseurl }}">Variables</a></li>
100
+ <li>--</li>
101
+ <li class="{% if page.path == 'details/types.md' %}active{% endif %}"><a href="{{ "/details/types" | prepend: site.baseurl }}">Types</a></li>
102
+ <li class="{% if page.path == 'details/signatures.md' %}active{% endif %}"><a href="{{ "/details/signatures" | prepend: site.baseurl }}">Signatures</a></li>
103
+ <li>--</li>
104
+ <li class="{% if page.path == 'details/expressions.md' %}active{% endif %}"><a href="{{ "/details/expressions" | prepend: site.baseurl }}">Expressions</a></li>
105
+ <li class="{% if page.path == 'details/object-literal-expressions.md' %}active{% endif %}"><a href="{{ "/details/object-literal-expressions" | prepend: site.baseurl }}">Object Literal Expressions</a></li>
106
+ <li class="{% if page.path == 'details/identifiers.md' %}active{% endif %}"><a href="{{ "/details/identifiers" | prepend: site.baseurl }}">Identifiers</a></li>
107
+ <li class="{% if page.path == 'details/ambient.md' %}active{% endif %}"><a href="{{ "/details/ambient" | prepend: site.baseurl }}">Ambient</a></li>
108
+ <li class="{% if page.path == 'details/async.md' %}active{% endif %}"><a href="{{ "/details/async" | prepend: site.baseurl }}">Async</a></li>
109
+ <li class="{% if page.path == 'details/exports.md' %}active{% endif %}"><a href="{{ "/details/exports" | prepend: site.baseurl }}">Exports</a></li>
110
+ <li class="{% if page.path == 'details/generators.md' %}active{% endif %}"><a href="{{ "/details/generators" | prepend: site.baseurl }}">Generators</a></li>
111
+ <li class="{% if page.path == 'details/initializers.md' %}active{% endif %}"><a href="{{ "/details/initializers" | prepend: site.baseurl }}">Initializers</a></li>
112
+ <li class="{% if page.path == 'details/documentation.md' %}active{% endif %}"><a href="{{ "/details/documentation" | prepend: site.baseurl }}">JS Docs</a></li>
113
+ <li class="{% if page.path == 'details/literals.md' %}active{% endif %}"><a href="{{ "/details/literals" | prepend: site.baseurl }}">Literals</a></li>
114
+ <li class="{% if page.path == 'details/modifiers.md' %}active{% endif %}"><a href="{{ "/details/modifiers" | prepend: site.baseurl }}">Modifiers</a></li>
115
+ <li class="{% if page.path == 'details/comments.md' %}active{% endif %}"><a href="{{ "/details/comments" | prepend: site.baseurl }}">Comments</a></li>
116
+ </ul>
117
+ {% endif %}
118
+ </li>
119
+ <li class="nav-item{% if page.path == 'utilities.md' %} active{% endif %}">
120
+ <a class="nav-link" href="{{ "/utilities" | prepend: site.baseurl }}">Utilities</a>
121
+ </li>
122
+ <li class="nav-item">
123
+ <a class="nav-link" href="{{ site.github.repository_url }}">View on GitHub</a>
124
+ </li>
125
+ </ul>
126
+ </nav>
127
+ </div>
128
+ <section class="container-fluid col-md-9">
129
+ {{ content }}
130
+ </section>
131
+ </div>
132
+ </div>
133
+
134
+ <footer>
135
+ </footer>
136
+ </div>
137
+
138
+ <script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
139
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
140
+ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
141
+ <script>
142
+ $('h1, h2, h3, h4, h5, h6').filter('[id]').each(function () {
143
+ const a = $('<a/>').attr('href', '#' + this.id).text(this.textContent);
144
+ $(this).empty().append(a);
145
+ })
146
+ </script>
147
+ <!--[if !IE]><script>fixScale(document);</script><![endif]-->
148
+ {% if site.google_analytics %}
149
+ <script type="text/javascript">
150
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
151
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
152
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
153
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
154
+ ga('create', '{{ site.google_analytics }}', 'auto');
155
+ ga('send', 'pageview');
156
+ </script>
157
+ {% endif %}
158
+ </body>
159
+ </html>
@@ -0,0 +1,116 @@
1
+ import {
2
+ CallExpression,
3
+ CallLikeExpression,
4
+ CallSignatureDeclaration,
5
+ ClassDeclaration,
6
+ ClassDeclarationStructure,
7
+ ConstructSignatureDeclaration,
8
+ createWrappedNode,
9
+ Decorator,
10
+ Diagnostic,
11
+ DiagnosticMessageChain,
12
+ Directory,
13
+ EnumDeclaration,
14
+ EnumMember,
15
+ ExportAssignment,
16
+ ExportDeclaration,
17
+ ExportSpecifier,
18
+ ExpressionWithTypeArguments,
19
+ FileSystemHost,
20
+ forEachStructureChild,
21
+ FunctionDeclaration,
22
+ GetAccessorDeclaration,
23
+ Identifier,
24
+ ImportDeclaration,
25
+ ImportSpecifier,
26
+ IndentationText,
27
+ IndexSignatureDeclaration,
28
+ InterfaceDeclaration,
29
+ JSDoc,
30
+ LanguageService,
31
+ MethodDeclaration,
32
+ MethodSignature,
33
+ ModuleDeclaration,
34
+ ModuleDeclarationKind,
35
+ Node,
36
+ NumericLiteral,
37
+ ObjectLiteralExpression,
38
+ ParameterDeclaration,
39
+ Program,
40
+ Project,
41
+ PropertyAccessExpression,
42
+ PropertyDeclaration,
43
+ PropertySignature,
44
+ QuoteKind,
45
+ SetAccessorDeclaration,
46
+ ShorthandPropertyAssignment,
47
+ Signature,
48
+ SourceFile,
49
+ SourceFileStructure,
50
+ SpreadAssignment,
51
+ Structure,
52
+ StructureKind,
53
+ Structures,
54
+ Symbol,
55
+ SyntaxKind,
56
+ ts,
57
+ Type,
58
+ TypeAliasDeclaration,
59
+ TypeChecker,
60
+ TypeFormatFlags,
61
+ TypeNode,
62
+ TypeParameterDeclaration,
63
+ VariableDeclaration,
64
+ VariableDeclarationKind,
65
+ VariableStatement,
66
+ } from "../../packages/ts-morph/src/main";
67
+
68
+ let project: Project,
69
+ node: Node,
70
+ classDeclaration: ClassDeclaration,
71
+ functionDeclaration: FunctionDeclaration,
72
+ sourceFile: SourceFile,
73
+ method: MethodDeclaration,
74
+ decorator: Decorator,
75
+ enumDeclaration: EnumDeclaration,
76
+ enumMember: EnumMember,
77
+ exportDeclaration: ExportDeclaration,
78
+ namedExport: ExportSpecifier,
79
+ importDeclaration: ImportDeclaration,
80
+ namedImport: ImportSpecifier,
81
+ interfaceDeclaration: InterfaceDeclaration,
82
+ shorthandPropertyAssignment: ShorthandPropertyAssignment,
83
+ spreadAssignment: SpreadAssignment,
84
+ objectLiteralExpression: ObjectLiteralExpression,
85
+ parameter: ParameterDeclaration,
86
+ type: Type,
87
+ symbol: Symbol,
88
+ signature: Signature,
89
+ moduleDeclaration: ModuleDeclaration,
90
+ directory: Directory,
91
+ diagnostic: Diagnostic,
92
+ dmc: DiagnosticMessageChain,
93
+ getAccessor: GetAccessorDeclaration,
94
+ setAccessor: SetAccessorDeclaration,
95
+ propertyDeclaration: PropertyDeclaration,
96
+ jsDoc: JSDoc,
97
+ exportAssignment: ExportAssignment,
98
+ expressionWithTypeArgs: ExpressionWithTypeArguments,
99
+ callExpression: CallExpression,
100
+ functionOverload: FunctionDeclaration,
101
+ identifier: Identifier,
102
+ variableDeclaration: VariableDeclaration,
103
+ constructSignature: ConstructSignatureDeclaration,
104
+ callSignature: CallSignatureDeclaration,
105
+ indexSignature: IndexSignatureDeclaration,
106
+ methodSignature: MethodSignature,
107
+ propertySignature: PropertySignature,
108
+ typeAliasDeclaration: TypeAliasDeclaration,
109
+ numericLiteral: NumericLiteral,
110
+ variableStatement: VariableStatement,
111
+ propertyAccessExpression: PropertyAccessExpression,
112
+ languageService: LanguageService,
113
+ program: Program,
114
+ typeChecker: TypeChecker,
115
+ typeParameter: TypeParameterDeclaration,
116
+ callLikeExpression: CallLikeExpression;
@@ -0,0 +1,212 @@
1
+ ---
2
+ ---
3
+
4
+ /* For some reason @import statements weren't working. I didn't want to spend time diagnosing the problem so I have everything in one file for now... */
5
+
6
+ $primary-color: #292b2c;
7
+
8
+ body {
9
+ overflow-y: scroll;
10
+ }
11
+
12
+ .main {
13
+ position: relative;
14
+ margin-left: auto;
15
+ margin-right: auto;
16
+ padding-bottom: 50px;
17
+ @media (min-width: 1200px) {
18
+ width: 1200px;
19
+ max-width: 100%;
20
+ padding-left: 15px;
21
+ padding-right: 15px;
22
+ }
23
+ }
24
+
25
+ aside.warning {
26
+ border: 1px dashed #bd4147;
27
+ padding: 10px;
28
+ }
29
+
30
+ nav {
31
+ padding-top: 10px;
32
+ line-height: 1.4rem;
33
+ color: lighten($primary-color, 30%);
34
+
35
+ ul {
36
+ list-style-type: none;
37
+
38
+ ul {
39
+ padding-left: 20px;
40
+ margin-top: 0px;
41
+ padding-bottom: 5px;
42
+ ul {
43
+ margin-top: 0px;
44
+ }
45
+ li {
46
+ margin-bottom: 2px;
47
+ }
48
+ }
49
+
50
+ li {
51
+ > a {
52
+ color: lighten($primary-color, 30%);
53
+ &:hover {
54
+ text-decoration: none;
55
+ }
56
+ }
57
+
58
+ &.active > a {
59
+ color: #2266cc;
60
+ }
61
+ }
62
+ }
63
+
64
+ .nav-link {
65
+ padding: 0.3rem 0.5rem;
66
+ }
67
+ }
68
+
69
+ header {
70
+ padding-top: 2rem;
71
+ padding-bottom: 0.5rem;
72
+
73
+ h1, p {
74
+ display: inline-block;
75
+ }
76
+ h1 {
77
+ padding-left: 15px;
78
+ padding-right: 10px;
79
+ }
80
+ .subText {
81
+ color: rgba(0,0,0,0.8);
82
+ font-size: 0.9rem;
83
+ }
84
+ }
85
+
86
+ h2 {
87
+ font-size: 2.2rem;
88
+ margin-bottom: 1rem;
89
+ &:not(:first-child) {
90
+ margin-top: 1rem;
91
+ }
92
+ }
93
+
94
+ h3 {
95
+ padding-top: 1rem;
96
+ margin-bottom: .7rem;
97
+ color: #559955;
98
+ }
99
+
100
+ h4 {
101
+ color: #555;
102
+ }
103
+
104
+ h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
105
+ color: inherit;
106
+ &:hover {
107
+ color: inherit;
108
+ text-decoration: none;
109
+ }
110
+ }
111
+
112
+ pre.highlight {
113
+ padding: 8px 15px;
114
+ background: #333;
115
+ border-radius: 3px;
116
+ border: 1px solid #c7c7c7;
117
+ overflow: auto;
118
+ overflow-y: hidden;
119
+ }
120
+
121
+ code {
122
+ font-family: Consolas, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace !important;
123
+ }
124
+
125
+ .headerLink {
126
+ cursor: pointer;
127
+ }
128
+
129
+ /** Start Rouge Theme */
130
+
131
+ /*
132
+ generated by rouge http://rouge.jneen.net/
133
+ original base16 by Chris Kempson (https://github.com/chriskempson/base16)
134
+ */
135
+
136
+ .highlight table td { padding: 5px; }
137
+ .highlight table pre { margin: 0; }
138
+ .highlight, .highlight .w {
139
+ color: #d0d0d0;
140
+ }
141
+ .highlight .err {
142
+ color: inherit;
143
+ }
144
+ .highlight .c, .highlight .cd, .highlight .cm, .highlight .c1, .highlight .cs {
145
+ color: #888;
146
+ }
147
+ .highlight .cp {
148
+ color: #f4bf75;
149
+ }
150
+ .highlight .nt {
151
+ color: #f4bf75;
152
+ }
153
+ .highlight .o, .highlight .ow {
154
+ color: #d0d0d0;
155
+ }
156
+ .highlight .p, .highlight .pi {
157
+ color: #d0d0d0;
158
+ }
159
+ .highlight .gi {
160
+ color: #90a959;
161
+ }
162
+ .highlight .gd {
163
+ color: #ac4142;
164
+ }
165
+ .highlight .gh {
166
+ color: #6a9fb5;
167
+ font-weight: bold;
168
+ }
169
+ .highlight .k, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kv {
170
+ color: #aa759f;
171
+ }
172
+ .highlight .kc {
173
+ color: #d28445;
174
+ }
175
+ .highlight .kt {
176
+ color: #d28445;
177
+ }
178
+ .highlight .kd {
179
+ color: #d28445;
180
+ }
181
+ .highlight .s, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .s2, .highlight .sh, .highlight .sx, .highlight .s1 {
182
+ color: #90a959;
183
+ }
184
+ .highlight .sr {
185
+ color: #75b5aa;
186
+ }
187
+ .highlight .si {
188
+ color: #8f5536;
189
+ }
190
+ .highlight .se {
191
+ color: #8f5536;
192
+ }
193
+ .highlight .nn {
194
+ color: #f4bf75;
195
+ }
196
+ .highlight .nc {
197
+ color: #f4bf75;
198
+ }
199
+ .highlight .no {
200
+ color: #f4bf75;
201
+ }
202
+ .highlight .na {
203
+ color: #6a9fb5;
204
+ }
205
+ .highlight .m, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .il, .highlight .mo, .highlight .mb, .highlight .mx {
206
+ color: #90a959;
207
+ }
208
+ .highlight .ss {
209
+ color: #90a959;
210
+ }
211
+
212
+ /** End Rouge Theme */
@@ -0,0 +1,38 @@
1
+ ---
2
+ title: Ambient
3
+ ---
4
+
5
+ ## Ambient
6
+
7
+ Certain nodes in TypeScript can be ambient. For example, all nodes within a declaration file are ambient.
8
+
9
+ ### Testing if ambient
10
+
11
+ Use `isAmbient()`:
12
+
13
+ ```ts
14
+ classDeclaration.isAmbient(); // returns: boolean
15
+ ```
16
+
17
+ This will do several checks to see if it's an ambient declaration.
18
+
19
+ ### `declare` keyword
20
+
21
+ Check for the `declare` keyword:
22
+
23
+ ```ts
24
+ classDeclaration.hasDeclareKeyword(); // returns: boolean
25
+ ```
26
+
27
+ Or get the `declare` keyword if it exists:
28
+
29
+ ```ts
30
+ classDeclaration.getDeclareKeyword();
31
+ ```
32
+
33
+ Or set if it has a `declare` keyword:
34
+
35
+ ```ts
36
+ classDeclaration.setHasDeclareKeyword(true);
37
+ classDeclaration.setHasDeclareKeyword(false);
38
+ ```
@@ -0,0 +1,31 @@
1
+ ---
2
+ title: Async
3
+ ---
4
+
5
+ ## Async
6
+
7
+ Certain nodes in TypeScript can have an `async` keyword modifier.
8
+
9
+ ### Is async
10
+
11
+ A node can be tested if it's async using the `isAsync()` method:
12
+
13
+ ```ts
14
+ functionDeclaration.isAsync(); // returns: boolean
15
+ ```
16
+
17
+ ### `async` keyword
18
+
19
+ Get the `async` keyword if it exists:
20
+
21
+ ```ts
22
+ functionDeclaration.getAsyncKeyword();
23
+ ```
24
+
25
+ ### Set async
26
+
27
+ Set if the declaration is async using `setIsAsync`:
28
+
29
+ ```ts
30
+ functionDeclaration.setIsAsync(true);
31
+ ```