tsc-ts 0.0.2 → 0.0.4

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.
@@ -0,0 +1,101 @@
1
+ // The hand-written node types of tsc-ts's public API; the node interfaces are generated in
2
+ // ast.generated.ts (scripts/generate-api.mjs). They describe tsc-ts's own nodes, which the API hands
3
+ // out as they are: every node has its kind, flags, position and parent, and its children in the fields
4
+ // TypeScript 7's AST names. Lists are NodeList objects.
5
+
6
+ import type {
7
+ EndOfFile,
8
+ EntityName,
9
+ Identifier,
10
+ KeywordSyntaxKind,
11
+ ModifierSyntaxKind,
12
+ PropertyAccessExpression,
13
+ PunctuationSyntaxKind,
14
+ Statement,
15
+ ThisExpression,
16
+ Token,
17
+ } from './ast.generated.js';
18
+ import type { LanguageVariant, ModifierFlags, NodeFlags, ScriptKind, SyntaxKind } from './enums.generated.js';
19
+
20
+ export interface TextRange {
21
+ readonly pos: number;
22
+ readonly end: number;
23
+ }
24
+
25
+ /**
26
+ * A node. `pos` is where the node's leading trivia starts and `end` where the node ends, as UTF-16
27
+ * offsets into the file's text; `tokenStartOfNode` gives the start of its first token. `parent` is the
28
+ * enclosing node, and the source file for its statements; a source file's `parent` is undefined.
29
+ */
30
+ export interface Node extends TextRange {
31
+ readonly kind: SyntaxKind;
32
+ readonly flags: NodeFlags;
33
+ readonly parent: Node;
34
+ }
35
+
36
+ /** The children of a node in one list: `nodes`, and the range from the list's opening to its closing token. */
37
+ export interface NodeList<T extends Node = Node> extends TextRange {
38
+ readonly nodes: readonly T[];
39
+ /** Whether a comma follows the last node before the list's end. */
40
+ hasTrailingComma(): boolean;
41
+ }
42
+
43
+ /** The modifiers of a declaration, with the flags of all of them. */
44
+ export interface ModifierList<T extends Node = Node> extends NodeList<T> {
45
+ readonly modifierFlags: ModifierFlags;
46
+ }
47
+
48
+ /** A `/// <reference path>`, `types` or `lib` directive. */
49
+ export interface FileReference extends TextRange {
50
+ readonly fileName: string;
51
+ /** The `resolution-mode` attribute: ModuleKind.ESNext, ModuleKind.CommonJS, or ModuleKind.None without one. */
52
+ readonly resolutionMode: number;
53
+ readonly preserve: boolean;
54
+ }
55
+
56
+ export interface LineAndCharacter {
57
+ /** 0-based line number. */
58
+ readonly line: number;
59
+ /** 0-based character offset, in UTF-16 code units, from the start of the line. */
60
+ readonly character: number;
61
+ }
62
+
63
+ export interface SourceFile extends Node {
64
+ readonly kind: SyntaxKind.SourceFile;
65
+ readonly statements: NodeList<Statement>;
66
+ readonly endOfFileToken: EndOfFile;
67
+ readonly text: string;
68
+ readonly fileName: string;
69
+ /** The file's path: its absolute, normalized file name, lower-cased where file names are case-insensitive. */
70
+ readonly path: string;
71
+ readonly languageVariant: LanguageVariant;
72
+ readonly scriptKind: ScriptKind;
73
+ readonly isDeclarationFile: boolean;
74
+ readonly referencedFiles: readonly FileReference[];
75
+ readonly typeReferenceDirectives: readonly FileReference[];
76
+ readonly libReferenceDirectives: readonly FileReference[];
77
+ /** The module specifiers of the file's imports, exports, `require` calls and import types, in source order. */
78
+ readonly imports: readonly Node[];
79
+ readonly moduleAugmentations: readonly Node[];
80
+ readonly ambientModuleNames: readonly string[];
81
+ /** The first import or export that makes the file a module, or undefined for a script. */
82
+ readonly externalModuleIndicator: Node | undefined;
83
+ }
84
+
85
+ export type PunctuationToken<TKind extends PunctuationSyntaxKind> = Token<TKind>;
86
+ export type KeywordToken<TKind extends KeywordSyntaxKind> = Token<TKind>;
87
+ export type ModifierToken<TKind extends ModifierSyntaxKind> = KeywordToken<TKind>;
88
+
89
+ export interface PropertyAccessEntityNameExpression extends PropertyAccessExpression {
90
+ readonly expression: EntityNameExpression;
91
+ readonly name: Identifier;
92
+ }
93
+
94
+ export type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression;
95
+ export type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression;
96
+
97
+ export interface JsxTagNamePropertyAccess extends PropertyAccessExpression {
98
+ readonly expression: Identifier | ThisExpression | JsxTagNamePropertyAccess;
99
+ }
100
+
101
+ export * from './ast.generated.js';
@@ -0,0 +1,114 @@
1
+ // Generated by scripts/generate-api.mjs from typescript-go _packages/native-preview/src/api/compilerOptions.ts (TypeScript 7.0.2).
2
+ // TypeScript is Copyright Microsoft Corporation, licensed under Apache-2.0. Do not edit.
3
+
4
+ import type { JsxEmit } from './enums.generated.js';
5
+ import type { ModuleDetectionKind } from './enums.generated.js';
6
+ import type { ModuleKind } from './enums.generated.js';
7
+ import type { ModuleResolutionKind } from './enums.generated.js';
8
+ import type { NewLineKind } from './enums.generated.js';
9
+ import type { ScriptTarget } from './enums.generated.js';
10
+
11
+ // Keep in sync with compileroptions.go, obviously
12
+
13
+ export interface CompilerOptions {
14
+ allowJs?: boolean;
15
+ allowArbitraryExtensions?: boolean;
16
+ allowImportingTsExtensions?: boolean;
17
+ allowNonTsExtensions?: boolean;
18
+ allowUmdGlobalAccess?: boolean;
19
+ allowUnreachableCode?: boolean;
20
+ allowUnusedLabels?: boolean;
21
+ assumeChangesOnlyAffectDirectDependencies?: boolean;
22
+ checkJs?: boolean;
23
+ customConditions?: string[];
24
+ composite?: boolean;
25
+ emitDeclarationOnly?: boolean;
26
+ emitBOM?: boolean;
27
+ emitDecoratorMetadata?: boolean;
28
+ declaration?: boolean;
29
+ declarationDir?: string;
30
+ declarationMap?: boolean;
31
+ deduplicatePackages?: boolean;
32
+ disableSizeLimit?: boolean;
33
+ disableSourceOfProjectReferenceRedirect?: boolean;
34
+ disableSolutionSearching?: boolean;
35
+ disableReferencedProjectLoad?: boolean;
36
+ erasableSyntaxOnly?: boolean;
37
+ exactOptionalPropertyTypes?: boolean;
38
+ experimentalDecorators?: boolean;
39
+ forceConsistentCasingInFileNames?: boolean;
40
+ isolatedModules?: boolean;
41
+ isolatedDeclarations?: boolean;
42
+ ignoreConfig?: boolean;
43
+ ignoreDeprecations?: string;
44
+ importHelpers?: boolean;
45
+ inlineSourceMap?: boolean;
46
+ inlineSources?: boolean;
47
+ init?: boolean;
48
+ incremental?: boolean;
49
+ jsx?: JsxEmit;
50
+ jsxFactory?: string;
51
+ jsxFragmentFactory?: string;
52
+ jsxImportSource?: string;
53
+ lib?: string[];
54
+ libReplacement?: boolean;
55
+ locale?: string;
56
+ mapRoot?: string;
57
+ module?: ModuleKind;
58
+ moduleResolution?: ModuleResolutionKind;
59
+ moduleSuffixes?: string[];
60
+ moduleDetection?: ModuleDetectionKind;
61
+ newLine?: NewLineKind;
62
+ noEmit?: boolean;
63
+ noCheck?: boolean;
64
+ noErrorTruncation?: boolean;
65
+ noFallthroughCasesInSwitch?: boolean;
66
+ noImplicitAny?: boolean;
67
+ noImplicitThis?: boolean;
68
+ noImplicitReturns?: boolean;
69
+ noEmitHelpers?: boolean;
70
+ noLib?: boolean;
71
+ noPropertyAccessFromIndexSignature?: boolean;
72
+ noUncheckedIndexedAccess?: boolean;
73
+ noEmitOnError?: boolean;
74
+ noUnusedLocals?: boolean;
75
+ noUnusedParameters?: boolean;
76
+ noResolve?: boolean;
77
+ noImplicitOverride?: boolean;
78
+ noUncheckedSideEffectImports?: boolean;
79
+ outDir?: string;
80
+ paths?: Record<string, string[]>;
81
+ preserveConstEnums?: boolean;
82
+ preserveSymlinks?: boolean;
83
+ project?: string;
84
+ resolveJsonModule?: boolean;
85
+ resolvePackageJsonExports?: boolean;
86
+ resolvePackageJsonImports?: boolean;
87
+ removeComments?: boolean;
88
+ rewriteRelativeImportExtensions?: boolean;
89
+ reactNamespace?: string;
90
+ rootDir?: string;
91
+ rootDirs?: string[];
92
+ skipLibCheck?: boolean;
93
+ stableTypeOrdering?: boolean;
94
+ strict?: boolean;
95
+ strictBindCallApply?: boolean;
96
+ strictBuiltinIteratorReturn?: boolean;
97
+ strictFunctionTypes?: boolean;
98
+ strictNullChecks?: boolean;
99
+ strictPropertyInitialization?: boolean;
100
+ stripInternal?: boolean;
101
+ skipDefaultLibCheck?: boolean;
102
+ sourceMap?: boolean;
103
+ sourceRoot?: string;
104
+ suppressOutputPathCheck?: boolean;
105
+ target?: ScriptTarget;
106
+ traceResolution?: boolean;
107
+ tsBuildInfoFile?: string;
108
+ typeRoots?: string[];
109
+ types?: string[];
110
+ useDefineForClassFields?: boolean;
111
+ useUnknownInCatchVariables?: boolean;
112
+ verbatimModuleSyntax?: boolean;
113
+ maxNodeModuleJsDepth?: number;
114
+ }