ts-morph 27.0.2 → 28.0.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.
- package/dist/ts-morph.js +10618 -10466
- package/lib/ts-morph.d.ts +26 -0
- package/logo.svg +16 -0
- package/package.json +3 -3
- package/readme.md +1 -1
package/lib/ts-morph.d.ts
CHANGED
|
@@ -883,6 +883,32 @@ export declare class Writers {
|
|
|
883
883
|
static returnStatement(value: WriterFunctionOrValue): WriterFunction;
|
|
884
884
|
}
|
|
885
885
|
|
|
886
|
+
/**
|
|
887
|
+
* Prints a structure to a string.
|
|
888
|
+
* @param structure - Structure to print.
|
|
889
|
+
* @param options - Options for formatting the output.
|
|
890
|
+
*/
|
|
891
|
+
export declare function printStructure(structure: Structures, options?: PrintStructureOptions): string;
|
|
892
|
+
|
|
893
|
+
/** Options for printing a structure to a string. */
|
|
894
|
+
export interface PrintStructureOptions {
|
|
895
|
+
/** Number of spaces for indentation. Defaults to 4. Ignored when useTabs is true. */
|
|
896
|
+
indentNumberOfSpaces?: number;
|
|
897
|
+
/** Whether to use tabs for indentation. Defaults to false. */
|
|
898
|
+
useTabs?: boolean;
|
|
899
|
+
/** Newline character. Defaults to "\n". */
|
|
900
|
+
newLine?: "\n" | "\r\n";
|
|
901
|
+
/** Whether to use single quotes. Defaults to false. */
|
|
902
|
+
useSingleQuote?: boolean;
|
|
903
|
+
/**
|
|
904
|
+
* Whether to insert a space after opening and before closing non-empty braces.
|
|
905
|
+
*
|
|
906
|
+
* ex. `import { Item } from "./Item";` or `import {Item} from "./Item";`
|
|
907
|
+
* @remarks Defaults to true.
|
|
908
|
+
*/
|
|
909
|
+
insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
|
|
910
|
+
}
|
|
911
|
+
|
|
886
912
|
export type WriterFunctionOrValue = string | number | WriterFunction;
|
|
887
913
|
export type AssertionKey = Identifier | StringLiteral;
|
|
888
914
|
export type PropertyName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier | NoSubstitutionTemplateLiteral | BigIntLiteral;
|
package/logo.svg
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<svg width="2190" height="500" viewBox="87 0 2190 500" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M1182.48 208.269C1136.33 274.5 1149.42 357.24 1211.72 393.074C1274.02 428.909 1361.95 404.267 1408.11 338.036C1464.45 257.193 1434.75 137.807 1317 137.807" stroke="black" stroke-width="21.557" stroke-linecap="round"/>
|
|
3
|
+
<path d="M1373.52 87.9739L1353.77 122.393L1338.76 118.393L1353.77 94.3384C1355.62 91.4702 1341.93 85.106 1307.97 106.618C1275.32 127.298 1240.15 180.575 1221.6 209.942C1218.43 214.945 1210.51 214.418 1208.01 209.051C1191.84 174.3 1153.92 86.4121 1205.3 49.9701C1265.95 6.94664 1367.2 55.4673 1373.52 87.9739Z" fill="black"/>
|
|
4
|
+
<path d="M1234.67 340.737C1235.26 340.398 1235.86 340.059 1236.45 339.72C1236.34 338.17 1236.25 336.698 1236.14 335.219C1235.51 326.149 1234.94 318.47 1234.11 311.027C1232.45 296.814 1234.81 281.863 1239.57 265.759C1239.97 264.392 1240.38 263.041 1240.81 261.659C1240.23 261.293 1239.65 260.926 1239.07 260.56C1238 261.561 1236.96 262.567 1235.94 263.627C1223.93 275.772 1215.52 293.978 1217.77 312.841C1218.82 322.573 1223.77 331.564 1230.99 337.847C1232.17 338.887 1233.38 339.823 1234.67 340.737Z" fill="black"/>
|
|
5
|
+
<path d="M1220.8 364.662C1221.23 364.128 1221.66 363.594 1222.09 363.06C1220.56 360.922 1219.17 358.821 1217.8 356.675C1207.42 340.265 1201.79 323.857 1199.52 307.042C1196.45 284.376 1201.31 260.23 1212.48 236.738C1213.57 234.445 1214.69 232.202 1215.9 229.919C1215.38 229.477 1214.86 229.035 1214.33 228.593C1212.26 230.206 1210.28 231.856 1208.33 233.639C1188.28 251.568 1175.06 280.491 1179.15 309.794C1181.87 331.479 1195.68 351.142 1213.64 361.099C1215.99 362.439 1218.34 363.598 1220.8 364.662Z" fill="black"/>
|
|
6
|
+
<path d="M1143.29 347.421C1146.77 356.666 1151.38 365.443 1157.1 373.561L986.095 499.494L975.867 486.914L1143.29 347.421Z" fill="black"/>
|
|
7
|
+
<path d="M1174.79 393.396C1180.91 398.849 1187.71 403.771 1195.19 408.06C1196.77 408.965 1198.36 409.831 1199.97 410.663L1097.63 486.914L1078.63 474.666L1174.79 393.396Z" fill="black"/>
|
|
8
|
+
<path d="M1231.07 425.407C1244.47 428.978 1253.63 427.924 1267.68 427.462L1199.97 469.013L1189.19 459.337L1231.07 425.407Z" fill="black"/>
|
|
9
|
+
<path d="M1973.99 416.715L2022.22 126.188H2092.44L2073.15 242.796H2187.63L2206.92 126.188H2277L2228.77 416.715H2158.69L2177.98 299.965H2063.5L2044.21 416.715H1973.99Z" fill="black"/>
|
|
10
|
+
<path d="M1713.78 416.715L1762.02 126.188H1882.03C1903.78 126.188 1921.89 130.396 1936.36 138.813C1950.83 147.23 1961.09 159.005 1967.14 174.136C1973.2 189.268 1974.57 206.811 1971.26 226.766C1968.04 246.91 1960.81 264.453 1949.55 279.396C1938.39 294.338 1924.02 305.923 1906.43 314.151C1888.84 322.379 1868.84 326.493 1846.42 326.493H1772.51L1781.73 271.168H1842.73C1853.42 271.168 1862.64 269.324 1870.4 265.635C1878.25 261.947 1884.54 256.793 1889.26 250.173C1893.99 243.553 1897.11 235.751 1898.63 226.766C1900.05 217.782 1899.48 210.027 1896.92 203.501C1894.37 196.881 1889.78 191.774 1883.16 188.18C1876.64 184.587 1868.13 182.79 1857.63 182.79H1823.02L1784 416.715H1713.78Z" fill="black"/>
|
|
11
|
+
<path d="M1446.17 416.715L1494.4 126.188H1614.41C1636.16 126.188 1654.32 130.113 1668.89 137.962C1683.45 145.717 1693.81 156.877 1699.95 171.441C1706.1 185.911 1707.52 203.076 1704.21 222.936C1700.99 242.985 1693.81 260.056 1682.65 274.147C1671.58 288.144 1657.3 298.831 1639.8 306.207C1622.4 313.584 1602.64 317.272 1580.51 317.272H1504.61L1513.98 261.947H1576.82C1587.32 261.947 1596.4 260.576 1604.06 257.833C1611.72 254.996 1617.82 250.74 1622.36 245.066C1626.99 239.297 1630.06 231.92 1631.58 222.936C1633 213.951 1632.33 206.528 1629.59 200.664C1626.94 194.706 1622.26 190.261 1615.55 187.329C1608.93 184.303 1600.42 182.79 1590.01 182.79H1555.4L1516.39 416.715H1446.17ZM1631.72 283.935L1682.08 416.715H1605.47L1556.68 283.935H1631.72Z" fill="black"/>
|
|
12
|
+
<path d="M810.531 126.188H897.491L941.467 306.065H944.871L1048.43 126.188H1135.39L1111.27 271.452L1099.21 344.084V348.164L1019.34 416.715H1018.78L1048.43 238.257H1046.02L946.999 414.871H903.449L863.161 237.264H860.749L830.675 416.715H762.299L810.531 126.188Z" fill="black"/>
|
|
13
|
+
<path d="M751.18 244.782L742.526 298.121H608.186L616.839 244.782H751.18Z" fill="black"/>
|
|
14
|
+
<path d="M518.784 213.857C519.54 203.17 516.703 194.895 510.272 189.031C503.936 183.168 493.911 180.236 480.198 180.236C471.119 180.236 463.364 181.418 456.933 183.783C450.502 186.052 445.442 189.268 441.754 193.429C438.066 197.496 435.749 202.224 434.803 207.615C433.952 211.871 434.188 215.654 435.512 218.964C436.836 222.274 439.153 225.206 442.463 227.759C445.868 230.312 450.076 232.535 455.089 234.426C460.196 236.318 465.917 237.973 472.254 239.391L496.086 245.066C509.894 248.187 521.857 252.348 531.977 257.549C542.19 262.656 550.465 268.851 556.802 276.133C563.138 283.32 567.489 291.596 569.853 300.958C572.217 310.321 572.406 320.819 570.42 332.451C567.394 350.798 560.159 366.544 548.716 379.69C537.367 392.836 522.519 402.908 504.172 409.906C485.92 416.904 464.688 420.404 440.477 420.404C416.267 420.404 395.697 416.763 378.769 409.481C361.935 402.104 349.735 390.992 342.169 376.144C334.603 361.296 332.57 342.57 336.069 319.967H403.168C402.128 329.33 403.31 337.132 406.715 343.374C410.214 349.616 415.605 354.345 422.887 357.56C430.169 360.776 438.964 362.383 449.273 362.383C458.73 362.383 467.005 361.107 474.098 358.553C481.286 356 487.007 352.453 491.263 347.914C495.613 343.374 498.261 338.173 499.207 332.309C500.153 326.919 499.254 322.237 496.512 318.265C493.864 314.293 489.324 310.841 482.893 307.909C476.557 304.978 468.234 302.33 457.926 299.965L428.845 292.872C404.823 287.009 386.618 277.646 374.229 264.784C361.935 251.922 357.584 234.474 361.178 212.438C364.204 194.375 371.676 178.581 383.592 165.057C395.603 151.533 410.782 141.036 429.129 133.565C447.57 125.999 467.856 122.216 489.986 122.216C512.494 122.216 531.409 126.046 546.73 133.706C562.145 141.272 573.257 151.959 580.067 165.767C586.971 179.48 588.957 195.51 586.025 213.857H518.784Z" fill="black"/>
|
|
15
|
+
<path d="M87 183.215L96.6464 126.188H342.205L332.558 183.215H244.464L205.878 416.715H136.651L175.236 183.215H87Z" fill="black"/>
|
|
16
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-morph",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "28.0.0",
|
|
4
4
|
"description": "TypeScript compiler wrapper for static analysis and code manipulation.",
|
|
5
5
|
"main": "dist/ts-morph.js",
|
|
6
6
|
"types": "lib/ts-morph.d.ts",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"homepage": "https://github.com/dsherret/ts-morph#readme",
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@ts-morph/common": "~0.
|
|
47
|
+
"@ts-morph/common": "~0.29.0",
|
|
48
48
|
"code-block-writer": "^13.0.3"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"rimraf": "^6.0.1",
|
|
62
62
|
"rollup": "=4.40.0",
|
|
63
63
|
"ts-node": "10.9.2",
|
|
64
|
-
"typescript": "~
|
|
64
|
+
"typescript": "~6.0.2"
|
|
65
65
|
},
|
|
66
66
|
"browser": {
|
|
67
67
|
"fs": false,
|
package/readme.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# ts-morph
|
|
1
|
+
# <img src="logo.svg" alt="ts-morph" height="58" />
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/js/ts-morph)
|
|
4
4
|
[](https://github.com/dsherret/ts-morph/actions?query=workflow%3ACI)
|