-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2efa81f
commit b4a3b1f
Showing
19 changed files
with
188 additions
and
430 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,28 @@ | ||
import type Interface from "@Interface/Output.js"; | ||
import type Initializer from "@Type/Output/Visit/Initializer.js"; | ||
import type Usage from "@Type/Output/Visit/Usage.js"; | ||
import type { SourceFile } from "typescript"; | ||
|
||
/** | ||
* @module Output | ||
* | ||
*/ | ||
export default (async (...[Source]) => { | ||
const Node = ts.createSourceFile( | ||
"temp.ts", | ||
Source, | ||
ts.ScriptTarget.Latest, | ||
true, | ||
); | ||
|
||
const Usage: Usage = new Map([]); | ||
|
||
const Initializer: Initializer = new Map([]); | ||
|
||
(await import("@Function/Output/Visit.js")).default( | ||
Usage, | ||
Initializer, | ||
)(Node); | ||
|
||
return ts | ||
export default (async (...[Source]) => | ||
ts | ||
.createPrinter({ | ||
newLine: ts.NewLineKind.LineFeed, | ||
removeComments: false, | ||
omitTrailingSemicolon: false, | ||
noEmitHelpers: false, | ||
}) | ||
.printFile( | ||
ts.transform(Node, [ | ||
(await import("@Function/Output/Transformer.js")).default( | ||
Usage, | ||
Initializer, | ||
ts.transform( | ||
ts.createSourceFile( | ||
"temp.ts", | ||
Source, | ||
ts.ScriptTarget.Latest, | ||
true, | ||
), | ||
]).transformed[0] as SourceFile, | ||
); | ||
}) satisfies Interface as Interface; | ||
[(await import("@Function/Output/Transformer.js")).default], | ||
).transformed[0] as SourceFile, | ||
)) satisfies Interface as Interface; | ||
|
||
export const ts = await import("typescript"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.