@typespec/compiler 0.67.0-dev.9 → 0.67.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/generated-defs/TypeSpec.d.ts +28 -1
- package/dist/generated-defs/TypeSpec.d.ts.map +1 -1
- package/dist/manifest.js +2 -2
- package/dist/src/ast/index.d.ts +14 -0
- package/dist/src/ast/index.d.ts.map +1 -0
- package/dist/src/ast/index.js +13 -0
- package/dist/src/ast/index.js.map +1 -0
- package/dist/src/config/config-loader.d.ts.map +1 -1
- package/dist/src/config/config-loader.js +2 -1
- package/dist/src/config/config-loader.js.map +1 -1
- package/dist/src/config/config-to-options.d.ts.map +1 -1
- package/dist/src/config/config-to-options.js +2 -1
- package/dist/src/config/config-to-options.js.map +1 -1
- package/dist/src/core/binder.d.ts.map +1 -1
- package/dist/src/core/binder.js +18 -137
- package/dist/src/core/binder.js.map +1 -1
- package/dist/src/core/checker.d.ts +7 -23
- package/dist/src/core/checker.d.ts.map +1 -1
- package/dist/src/core/checker.js +59 -780
- package/dist/src/core/checker.js.map +1 -1
- package/dist/src/core/cli/actions/compile/args.d.ts +1 -0
- package/dist/src/core/cli/actions/compile/args.d.ts.map +1 -1
- package/dist/src/core/cli/actions/compile/args.js +3 -0
- package/dist/src/core/cli/actions/compile/args.js.map +1 -1
- package/dist/src/core/cli/actions/compile/compile.js +1 -1
- package/dist/src/core/cli/actions/compile/compile.js.map +1 -1
- package/dist/src/core/cli/cli.js +14 -4
- package/dist/src/core/cli/cli.js.map +1 -1
- package/dist/src/core/cli/utils.d.ts.map +1 -1
- package/dist/src/core/cli/utils.js +5 -1
- package/dist/src/core/cli/utils.js.map +1 -1
- package/dist/src/core/decorator-utils.d.ts.map +1 -1
- package/dist/src/core/decorator-utils.js +1 -3
- package/dist/src/core/decorator-utils.js.map +1 -1
- package/dist/src/core/diagnostic-error.d.ts +7 -0
- package/dist/src/core/diagnostic-error.d.ts.map +1 -0
- package/dist/src/core/diagnostic-error.js +9 -0
- package/dist/src/core/diagnostic-error.js.map +1 -0
- package/dist/src/core/diagnostics.d.ts +6 -6
- package/dist/src/core/diagnostics.d.ts.map +1 -1
- package/dist/src/core/diagnostics.js +10 -11
- package/dist/src/core/diagnostics.js.map +1 -1
- package/dist/src/core/emitter-utils.js +2 -2
- package/dist/src/core/emitter-utils.js.map +1 -1
- package/dist/src/core/entrypoint-resolution.d.ts.map +1 -1
- package/dist/src/core/entrypoint-resolution.js +2 -1
- package/dist/src/core/entrypoint-resolution.js.map +1 -1
- package/dist/src/core/helpers/discriminator-utils.d.ts +1 -6
- package/dist/src/core/helpers/discriminator-utils.d.ts.map +1 -1
- package/dist/src/core/helpers/discriminator-utils.js +1 -57
- package/dist/src/core/helpers/discriminator-utils.js.map +1 -1
- package/dist/src/core/helpers/index.d.ts +1 -1
- package/dist/src/core/helpers/index.d.ts.map +1 -1
- package/dist/src/core/helpers/index.js +1 -1
- package/dist/src/core/helpers/index.js.map +1 -1
- package/dist/src/core/helpers/syntax-utils.d.ts +2 -1
- package/dist/src/core/helpers/syntax-utils.d.ts.map +1 -1
- package/dist/src/core/helpers/syntax-utils.js +8 -4
- package/dist/src/core/helpers/syntax-utils.js.map +1 -1
- package/dist/src/core/inspector/symbol.d.ts.map +1 -1
- package/dist/src/core/inspector/symbol.js +9 -11
- package/dist/src/core/inspector/symbol.js.map +1 -1
- package/dist/src/core/js-marshaller.d.ts +0 -9
- package/dist/src/core/js-marshaller.d.ts.map +1 -1
- package/dist/src/core/js-marshaller.js +0 -26
- package/dist/src/core/js-marshaller.js.map +1 -1
- package/dist/src/core/logger/console-sink.browser.d.ts.map +1 -1
- package/dist/src/core/logger/console-sink.browser.js +0 -16
- package/dist/src/core/logger/console-sink.browser.js.map +1 -1
- package/dist/src/core/logger/console-sink.d.ts +2 -3
- package/dist/src/core/logger/console-sink.d.ts.map +1 -1
- package/dist/src/core/logger/console-sink.js +16 -43
- package/dist/src/core/logger/console-sink.js.map +1 -1
- package/dist/src/core/logger/dynamic-task.d.ts +16 -0
- package/dist/src/core/logger/dynamic-task.d.ts.map +1 -0
- package/dist/src/core/logger/dynamic-task.js +93 -0
- package/dist/src/core/logger/dynamic-task.js.map +1 -0
- package/dist/src/core/logger/logger.d.ts.map +1 -1
- package/dist/src/core/logger/logger.js +11 -1
- package/dist/src/core/logger/logger.js.map +1 -1
- package/dist/src/core/messages.d.ts +35 -45
- package/dist/src/core/messages.d.ts.map +1 -1
- package/dist/src/core/messages.js +9 -11
- package/dist/src/core/messages.js.map +1 -1
- package/dist/src/core/name-resolver.d.ts.map +1 -1
- package/dist/src/core/name-resolver.js +12 -23
- package/dist/src/core/name-resolver.js.map +1 -1
- package/dist/src/core/node-host.d.ts +0 -3
- package/dist/src/core/node-host.d.ts.map +1 -1
- package/dist/src/core/node-host.js +5 -51
- package/dist/src/core/node-host.js.map +1 -1
- package/dist/src/core/node-system-host.d.ts +9 -0
- package/dist/src/core/node-system-host.d.ts.map +1 -0
- package/dist/src/core/node-system-host.js +57 -0
- package/dist/src/core/node-system-host.js.map +1 -0
- package/dist/src/core/options.d.ts +9 -0
- package/dist/src/core/options.d.ts.map +1 -1
- package/dist/src/core/parser.d.ts.map +1 -1
- package/dist/src/core/parser.js +50 -654
- package/dist/src/core/parser.js.map +1 -1
- package/dist/src/core/program.d.ts +6 -16
- package/dist/src/core/program.d.ts.map +1 -1
- package/dist/src/core/program.js +48 -24
- package/dist/src/core/program.js.map +1 -1
- package/dist/src/core/scanner.d.ts +37 -1
- package/dist/src/core/scanner.d.ts.map +1 -1
- package/dist/src/core/scanner.js +150 -3
- package/dist/src/core/scanner.js.map +1 -1
- package/dist/src/core/semantic-walker.d.ts.map +1 -1
- package/dist/src/core/semantic-walker.js +0 -9
- package/dist/src/core/semantic-walker.js.map +1 -1
- package/dist/src/core/source-loader.d.ts.map +1 -1
- package/dist/src/core/source-loader.js +2 -1
- package/dist/src/core/source-loader.js.map +1 -1
- package/dist/src/core/state-accessors.d.ts +53 -12
- package/dist/src/core/state-accessors.d.ts.map +1 -1
- package/dist/src/core/state-accessors.js +75 -48
- package/dist/src/core/state-accessors.js.map +1 -1
- package/dist/src/core/type-relation-checker.d.ts.map +1 -1
- package/dist/src/core/type-relation-checker.js +4 -22
- package/dist/src/core/type-relation-checker.js.map +1 -1
- package/dist/src/core/type-utils.js +2 -2
- package/dist/src/core/type-utils.js.map +1 -1
- package/dist/src/core/types.d.ts +58 -324
- package/dist/src/core/types.d.ts.map +1 -1
- package/dist/src/core/types.js +24 -55
- package/dist/src/core/types.js.map +1 -1
- package/dist/src/core/visibility/lifecycle.d.ts.map +1 -1
- package/dist/src/core/visibility/lifecycle.js +2 -11
- package/dist/src/core/visibility/lifecycle.js.map +1 -1
- package/dist/src/emitter-framework/asset-emitter.js +2 -2
- package/dist/src/emitter-framework/asset-emitter.js.map +1 -1
- package/dist/src/emitter-framework/index.d.ts +74 -8
- package/dist/src/emitter-framework/index.d.ts.map +1 -1
- package/dist/src/emitter-framework/index.js +32 -8
- package/dist/src/emitter-framework/index.js.map +1 -1
- package/dist/src/experimental/freeze-graph.d.ts.map +1 -1
- package/dist/src/experimental/freeze-graph.js +0 -3
- package/dist/src/experimental/freeze-graph.js.map +1 -1
- package/dist/src/experimental/mutators.d.ts +2 -2
- package/dist/src/experimental/mutators.d.ts.map +1 -1
- package/dist/src/experimental/mutators.js +1 -7
- package/dist/src/experimental/mutators.js.map +1 -1
- package/dist/src/experimental/typekit/kits/model.d.ts +6 -0
- package/dist/src/experimental/typekit/kits/model.d.ts.map +1 -1
- package/dist/src/experimental/typekit/kits/model.js +10 -0
- package/dist/src/experimental/typekit/kits/model.js.map +1 -1
- package/dist/src/experimental/typekit/kits/type.d.ts +0 -6
- package/dist/src/experimental/typekit/kits/type.d.ts.map +1 -1
- package/dist/src/experimental/typekit/kits/type.js +15 -9
- package/dist/src/experimental/typekit/kits/type.js.map +1 -1
- package/dist/src/experimental/typekit/kits/union.d.ts +6 -0
- package/dist/src/experimental/typekit/kits/union.d.ts.map +1 -1
- package/dist/src/experimental/typekit/kits/union.js +4 -0
- package/dist/src/experimental/typekit/kits/union.js.map +1 -1
- package/dist/src/formatter/print/comment-handler.js +1 -0
- package/dist/src/formatter/print/comment-handler.js.map +1 -1
- package/dist/src/formatter/print/needs-parens.d.ts.map +1 -1
- package/dist/src/formatter/print/needs-parens.js +0 -4
- package/dist/src/formatter/print/needs-parens.js.map +1 -1
- package/dist/src/formatter/print/printer.d.ts +4 -12
- package/dist/src/formatter/print/printer.d.ts.map +1 -1
- package/dist/src/formatter/print/printer.js +14 -196
- package/dist/src/formatter/print/printer.js.map +1 -1
- package/dist/src/index.d.ts +11 -14
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +17 -13
- package/dist/src/index.js.map +1 -1
- package/dist/src/init/core-templates.d.ts +2 -2
- package/dist/src/init/core-templates.d.ts.map +1 -1
- package/dist/src/init/core-templates.js.map +1 -1
- package/dist/src/init/init.d.ts +0 -2
- package/dist/src/init/init.d.ts.map +1 -1
- package/dist/src/init/init.js +17 -51
- package/dist/src/init/init.js.map +1 -1
- package/dist/src/init/scaffold.d.ts +4 -3
- package/dist/src/init/scaffold.d.ts.map +1 -1
- package/dist/src/init/scaffold.js +3 -4
- package/dist/src/init/scaffold.js.map +1 -1
- package/dist/src/install/config.d.ts +9 -0
- package/dist/src/install/config.d.ts.map +1 -0
- package/dist/src/install/config.js +16 -0
- package/dist/src/install/config.js.map +1 -0
- package/dist/src/install/install.d.ts +14 -0
- package/dist/src/install/install.d.ts.map +1 -0
- package/dist/src/install/install.js +191 -0
- package/dist/src/install/install.js.map +1 -0
- package/dist/src/install/spec.d.ts +39 -0
- package/dist/src/install/spec.d.ts.map +1 -0
- package/dist/src/install/spec.js +152 -0
- package/dist/src/install/spec.js.map +1 -0
- package/dist/src/internals/index.d.ts +8 -0
- package/dist/src/internals/index.d.ts.map +1 -0
- package/dist/src/internals/index.js +11 -0
- package/dist/src/internals/index.js.map +1 -0
- package/dist/src/lib/decorators.d.ts +16 -4
- package/dist/src/lib/decorators.d.ts.map +1 -1
- package/dist/src/lib/decorators.js +86 -46
- package/dist/src/lib/decorators.js.map +1 -1
- package/dist/src/lib/examples.js +1 -5
- package/dist/src/lib/examples.js.map +1 -1
- package/dist/src/lib/service.d.ts.map +1 -1
- package/dist/src/lib/service.js +0 -4
- package/dist/src/lib/service.js.map +1 -1
- package/dist/src/lib/tsp-index.d.ts.map +1 -1
- package/dist/src/lib/tsp-index.js +2 -2
- package/dist/src/lib/tsp-index.js.map +1 -1
- package/dist/src/module-resolver/module-resolver.d.ts.map +1 -1
- package/dist/src/module-resolver/module-resolver.js +20 -13
- package/dist/src/module-resolver/module-resolver.js.map +1 -1
- package/dist/src/package-manger/npm-registry-utils.d.ts +83 -0
- package/dist/src/package-manger/npm-registry-utils.d.ts.map +1 -0
- package/dist/src/package-manger/npm-registry-utils.js +42 -0
- package/dist/src/package-manger/npm-registry-utils.js.map +1 -0
- package/dist/src/server/classify.d.ts.map +1 -1
- package/dist/src/server/classify.js +0 -26
- package/dist/src/server/classify.js.map +1 -1
- package/dist/src/server/compile-service.d.ts.map +1 -1
- package/dist/src/server/compile-service.js +2 -1
- package/dist/src/server/compile-service.js.map +1 -1
- package/dist/src/server/completion.d.ts.map +1 -1
- package/dist/src/server/completion.js +21 -10
- package/dist/src/server/completion.js.map +1 -1
- package/dist/src/server/constants.js +1 -1
- package/dist/src/server/server.js +1 -1
- package/dist/src/server/server.js.map +1 -1
- package/dist/src/server/serverlib.d.ts.map +1 -1
- package/dist/src/server/serverlib.js +2 -1
- package/dist/src/server/serverlib.js.map +1 -1
- package/dist/src/server/tmlanguage.d.ts.map +1 -1
- package/dist/src/server/tmlanguage.js +0 -125
- package/dist/src/server/tmlanguage.js.map +1 -1
- package/dist/src/server/type-signature.js +4 -15
- package/dist/src/server/type-signature.js.map +1 -1
- package/dist/src/testing/code-fix-testing.js +1 -1
- package/dist/src/testing/code-fix-testing.js.map +1 -1
- package/dist/src/testing/expect.d.ts +1 -7
- package/dist/src/testing/expect.d.ts.map +1 -1
- package/dist/src/testing/expect.js +0 -12
- package/dist/src/testing/expect.js.map +1 -1
- package/dist/src/testing/index.d.ts +6 -6
- package/dist/src/testing/index.d.ts.map +1 -1
- package/dist/src/testing/index.js +5 -6
- package/dist/src/testing/index.js.map +1 -1
- package/dist/src/testing/source-utils.d.ts +20 -0
- package/dist/src/testing/source-utils.d.ts.map +1 -0
- package/dist/src/testing/source-utils.js +23 -0
- package/dist/src/testing/source-utils.js.map +1 -0
- package/dist/src/testing/test-host.d.ts.map +1 -1
- package/dist/src/testing/test-host.js +0 -4
- package/dist/src/testing/test-host.js.map +1 -1
- package/dist/src/testing/test-server-host.d.ts +0 -19
- package/dist/src/testing/test-server-host.d.ts.map +1 -1
- package/dist/src/testing/test-server-host.js +0 -22
- package/dist/src/testing/test-server-host.js.map +1 -1
- package/dist/src/testing/test-utils.js +1 -1
- package/dist/src/testing/test-utils.js.map +1 -1
- package/dist/src/types/package-json.d.ts +14 -0
- package/dist/src/types/package-json.d.ts.map +1 -1
- package/dist/src/utils/custom-key-map.d.ts.map +1 -0
- package/dist/src/utils/custom-key-map.js.map +1 -0
- package/dist/src/utils/fs-utils.d.ts +3 -0
- package/dist/src/utils/fs-utils.d.ts.map +1 -0
- package/dist/src/utils/fs-utils.js +19 -0
- package/dist/src/utils/fs-utils.js.map +1 -0
- package/dist/src/utils/io.d.ts +16 -0
- package/dist/src/utils/io.d.ts.map +1 -0
- package/dist/src/utils/io.js +77 -0
- package/dist/src/utils/io.js.map +1 -0
- package/dist/src/utils/misc.d.ts +4 -18
- package/dist/src/utils/misc.d.ts.map +1 -1
- package/dist/src/utils/misc.js +1 -77
- package/dist/src/utils/misc.js.map +1 -1
- package/dist/typespec.tmLanguage +0 -342
- package/lib/std/decorators.tsp +37 -2
- package/package.json +13 -7
- package/templates/__snapshots__/emitter-ts/src/emitter.ts +4 -6
- package/templates/emitter-ts/src/emitter.ts +4 -6
- package/templates/scaffolding.json +4 -4
- package/dist/src/core/helpers/projected-names-utils.d.ts +0 -20
- package/dist/src/core/helpers/projected-names-utils.d.ts.map +0 -1
- package/dist/src/core/helpers/projected-names-utils.js +0 -42
- package/dist/src/core/helpers/projected-names-utils.js.map +0 -1
- package/dist/src/core/install.d.ts +0 -3
- package/dist/src/core/install.d.ts.map +0 -1
- package/dist/src/core/install.js +0 -60
- package/dist/src/core/install.js.map +0 -1
- package/dist/src/core/projected-program.d.ts +0 -3
- package/dist/src/core/projected-program.d.ts.map +0 -1
- package/dist/src/core/projected-program.js +0 -4
- package/dist/src/core/projected-program.js.map +0 -1
- package/dist/src/core/projection-members.d.ts +0 -8
- package/dist/src/core/projection-members.d.ts.map +0 -1
- package/dist/src/core/projection-members.js +0 -382
- package/dist/src/core/projection-members.js.map +0 -1
- package/dist/src/core/projector.d.ts +0 -26
- package/dist/src/core/projector.d.ts.map +0 -1
- package/dist/src/core/projector.js +0 -572
- package/dist/src/core/projector.js.map +0 -1
- package/dist/src/emitter-framework/custom-key-map.d.ts.map +0 -1
- package/dist/src/emitter-framework/custom-key-map.js.map +0 -1
- /package/dist/src/{emitter-framework → utils}/custom-key-map.d.ts +0 -0
- /package/dist/src/{emitter-framework → utils}/custom-key-map.js +0 -0
package/dist/src/core/types.d.ts
CHANGED
|
@@ -30,16 +30,6 @@ export interface BaseType {
|
|
|
30
30
|
kind: string;
|
|
31
31
|
node?: Node;
|
|
32
32
|
instantiationParameters?: Type[];
|
|
33
|
-
/** @deprecated */
|
|
34
|
-
get projections(): ProjectionStatementNode[];
|
|
35
|
-
/** @deprecated */
|
|
36
|
-
projectionsByName(name: string): ProjectionStatementNode[];
|
|
37
|
-
/** @deprecated */
|
|
38
|
-
projectionSource?: Type;
|
|
39
|
-
/** @deprecated */
|
|
40
|
-
projectionBase?: Type;
|
|
41
|
-
/** @deprecated */
|
|
42
|
-
projector?: Projector;
|
|
43
33
|
/**
|
|
44
34
|
* Reflect if a type has been finished(Decorators have been called).
|
|
45
35
|
* There is multiple reasons a type might not be finished:
|
|
@@ -72,37 +62,16 @@ export interface TemplatedTypeBase {
|
|
|
72
62
|
* - Value Constraints
|
|
73
63
|
*/
|
|
74
64
|
export type Entity = Type | Value | MixedParameterConstraint | IndeterminateEntity;
|
|
75
|
-
export type Type = BooleanLiteral | Decorator | Enum | EnumMember | FunctionParameter |
|
|
65
|
+
export type Type = BooleanLiteral | Decorator | Enum | EnumMember | FunctionParameter | Interface | IntrinsicType | Model | ModelProperty | Namespace | NumericLiteral | Operation | Scalar | ScalarConstructor | StringLiteral | StringTemplate | StringTemplateSpan | TemplateParameter | Tuple | Union | UnionVariant;
|
|
76
66
|
export type StdTypes = {
|
|
77
67
|
Array: Model;
|
|
78
68
|
Record: Model;
|
|
79
69
|
} & Record<IntrinsicScalarName, Scalar>;
|
|
80
70
|
export type StdTypeName = keyof StdTypes;
|
|
81
|
-
export type TypeOrReturnRecord = Type | ReturnRecord;
|
|
82
71
|
export interface ObjectType extends BaseType {
|
|
83
72
|
kind: "Object";
|
|
84
73
|
properties: Record<string, Type>;
|
|
85
74
|
}
|
|
86
|
-
export interface Projection extends BaseType {
|
|
87
|
-
kind: "Projection";
|
|
88
|
-
node: undefined;
|
|
89
|
-
nodeByKind: Map<string, ProjectionStatementNode>;
|
|
90
|
-
nodeByType: Map<Type, ProjectionStatementNode>;
|
|
91
|
-
}
|
|
92
|
-
export interface ProjectionApplication {
|
|
93
|
-
scope?: Type;
|
|
94
|
-
projectionName: string;
|
|
95
|
-
arguments: DecoratorArgumentValue[];
|
|
96
|
-
direction?: "from" | "to";
|
|
97
|
-
}
|
|
98
|
-
export interface Projector {
|
|
99
|
-
parentProjector?: Projector;
|
|
100
|
-
projections: ProjectionApplication[];
|
|
101
|
-
projectedTypes: Map<Type, Type>;
|
|
102
|
-
projectType(type: Type | Value): Type | Value;
|
|
103
|
-
projectedStartNode?: Type;
|
|
104
|
-
projectedGlobalNamespace?: Namespace;
|
|
105
|
-
}
|
|
106
75
|
export interface MixedParameterConstraint {
|
|
107
76
|
readonly entityKind: "MixedParameterConstraint";
|
|
108
77
|
readonly node?: UnionExpressionNode | Expression;
|
|
@@ -135,24 +104,7 @@ export interface UnknownType extends IntrinsicType {
|
|
|
135
104
|
export interface NullType extends IntrinsicType {
|
|
136
105
|
name: "null";
|
|
137
106
|
}
|
|
138
|
-
export interface ReturnRecord {
|
|
139
|
-
kind: "Return";
|
|
140
|
-
value: Type;
|
|
141
|
-
}
|
|
142
107
|
export type IntrinsicScalarName = "bytes" | "numeric" | "integer" | "float" | "int64" | "int32" | "int16" | "int8" | "uint64" | "uint32" | "uint16" | "uint8" | "safeint" | "float32" | "float64" | "decimal" | "decimal128" | "string" | "plainDate" | "plainTime" | "utcDateTime" | "offsetDateTime" | "duration" | "boolean" | "url";
|
|
143
|
-
/**
|
|
144
|
-
* Valid keys when looking up meta members for a particular type.
|
|
145
|
-
* Array is a special case because it doesn't have a unique type, but does
|
|
146
|
-
* carry unique meta-members.
|
|
147
|
-
*/
|
|
148
|
-
export type MetaMemberKey = Type["kind"] | "Array";
|
|
149
|
-
/**
|
|
150
|
-
* A table to ease lookup of meta member interfaces during identifier resolution.
|
|
151
|
-
* Only `type` exists today, but `value` will be added in the future.
|
|
152
|
-
*/
|
|
153
|
-
export interface MetaMembersTable {
|
|
154
|
-
type: Partial<Record<MetaMemberKey, Sym>>;
|
|
155
|
-
}
|
|
156
108
|
export type NeverIndexer = {
|
|
157
109
|
readonly key: NeverType;
|
|
158
110
|
readonly value: undefined;
|
|
@@ -176,7 +128,7 @@ export interface RecordModelType extends Model {
|
|
|
176
128
|
export interface Model extends BaseType, DecoratedType, TemplatedTypeBase {
|
|
177
129
|
kind: "Model";
|
|
178
130
|
name: string;
|
|
179
|
-
node?: ModelStatementNode | ModelExpressionNode | IntersectionExpressionNode |
|
|
131
|
+
node?: ModelStatementNode | ModelExpressionNode | IntersectionExpressionNode | ObjectLiteralNode;
|
|
180
132
|
namespace?: Namespace;
|
|
181
133
|
indexer?: ModelIndexer;
|
|
182
134
|
/**
|
|
@@ -222,7 +174,7 @@ export interface SourceModel {
|
|
|
222
174
|
}
|
|
223
175
|
export interface ModelProperty extends BaseType, DecoratedType {
|
|
224
176
|
kind: "ModelProperty";
|
|
225
|
-
node: ModelPropertyNode | ModelSpreadPropertyNode |
|
|
177
|
+
node: ModelPropertyNode | ModelSpreadPropertyNode | ObjectLiteralPropertyNode;
|
|
226
178
|
name: string;
|
|
227
179
|
type: Type;
|
|
228
180
|
sourceProperty?: ModelProperty;
|
|
@@ -430,12 +382,6 @@ export interface Namespace extends BaseType, DecoratedType {
|
|
|
430
382
|
* Order is implementation-defined and may change.
|
|
431
383
|
*/
|
|
432
384
|
decoratorDeclarations: Map<string, Decorator>;
|
|
433
|
-
/**
|
|
434
|
-
* The functions declared in the namespace.
|
|
435
|
-
*
|
|
436
|
-
* Order is implementation-defined and may change.
|
|
437
|
-
*/
|
|
438
|
-
functionDeclarations: Map<string, FunctionType>;
|
|
439
385
|
}
|
|
440
386
|
export type LiteralType = StringLiteral | NumericLiteral | BooleanLiteral;
|
|
441
387
|
export interface StringLiteral extends BaseType {
|
|
@@ -515,15 +461,6 @@ export interface Decorator extends BaseType {
|
|
|
515
461
|
parameters: MixedFunctionParameter[];
|
|
516
462
|
implementation: (...args: unknown[]) => void;
|
|
517
463
|
}
|
|
518
|
-
export interface FunctionType extends BaseType {
|
|
519
|
-
kind: "Function";
|
|
520
|
-
node?: FunctionDeclarationStatementNode;
|
|
521
|
-
namespace?: Namespace;
|
|
522
|
-
name: string;
|
|
523
|
-
parameters: MixedFunctionParameter[];
|
|
524
|
-
returnType: Type;
|
|
525
|
-
implementation: (...args: unknown[]) => unknown;
|
|
526
|
-
}
|
|
527
464
|
export interface FunctionParameterBase extends BaseType {
|
|
528
465
|
kind: "FunctionParameter";
|
|
529
466
|
node: FunctionParameterNode;
|
|
@@ -707,17 +644,15 @@ export declare const enum SymbolFlags {
|
|
|
707
644
|
Union = 64,
|
|
708
645
|
Alias = 128,
|
|
709
646
|
Namespace = 256,
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
Member = 262144,
|
|
720
|
-
Const = 524288,
|
|
647
|
+
Decorator = 512,
|
|
648
|
+
TemplateParameter = 1024,
|
|
649
|
+
Function = 2048,
|
|
650
|
+
FunctionParameter = 4096,
|
|
651
|
+
Using = 8192,
|
|
652
|
+
DuplicateUsing = 16384,
|
|
653
|
+
SourceFile = 32768,
|
|
654
|
+
Member = 65536,
|
|
655
|
+
Const = 131072,
|
|
721
656
|
/**
|
|
722
657
|
* A symbol which represents a declaration. Such symbols will have at least
|
|
723
658
|
* one entry in the `declarations[]` array referring to a node with an `id`.
|
|
@@ -731,7 +666,7 @@ export declare const enum SymbolFlags {
|
|
|
731
666
|
* by this symbol is stored directly in the symbol.
|
|
732
667
|
*/
|
|
733
668
|
LateBound = 4194304,
|
|
734
|
-
ExportContainer =
|
|
669
|
+
ExportContainer = 33024,
|
|
735
670
|
/**
|
|
736
671
|
* Symbols whose members will be late bound (and stored on the type)
|
|
737
672
|
*/
|
|
@@ -808,61 +743,30 @@ export declare enum SyntaxKind {
|
|
|
808
743
|
UnknownKeyword = 43,
|
|
809
744
|
ValueOfExpression = 44,
|
|
810
745
|
TypeReference = 45,
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
ProjectionEnumMemberSelector = 70,
|
|
836
|
-
ProjectionExpressionStatement = 71,
|
|
837
|
-
ProjectionIfExpression = 72,
|
|
838
|
-
ProjectionBlockExpression = 73,
|
|
839
|
-
ProjectionMemberExpression = 74,
|
|
840
|
-
ProjectionLogicalExpression = 75,
|
|
841
|
-
ProjectionEqualityExpression = 76,
|
|
842
|
-
ProjectionUnaryExpression = 77,
|
|
843
|
-
ProjectionRelationalExpression = 78,
|
|
844
|
-
ProjectionArithmeticExpression = 79,
|
|
845
|
-
ProjectionCallExpression = 80,
|
|
846
|
-
ProjectionLambdaExpression = 81,
|
|
847
|
-
ProjectionLambdaParameterDeclaration = 82,
|
|
848
|
-
ProjectionModelExpression = 83,
|
|
849
|
-
ProjectionModelProperty = 84,
|
|
850
|
-
ProjectionModelSpreadProperty = 85,
|
|
851
|
-
ProjectionSpreadProperty = 86,
|
|
852
|
-
ProjectionTupleExpression = 87,
|
|
853
|
-
ProjectionStatement = 88,
|
|
854
|
-
ProjectionDecoratorReferenceExpression = 89,
|
|
855
|
-
Return = 90,
|
|
856
|
-
JsNamespaceDeclaration = 91,
|
|
857
|
-
TemplateArgument = 92,
|
|
858
|
-
TypeOfExpression = 93,
|
|
859
|
-
ObjectLiteral = 94,
|
|
860
|
-
ObjectLiteralProperty = 95,
|
|
861
|
-
ObjectLiteralSpreadProperty = 96,
|
|
862
|
-
ArrayLiteral = 97,
|
|
863
|
-
ConstStatement = 98,
|
|
864
|
-
CallExpression = 99,
|
|
865
|
-
ScalarConstructor = 100
|
|
746
|
+
TemplateParameterDeclaration = 46,
|
|
747
|
+
EmptyStatement = 47,
|
|
748
|
+
InvalidStatement = 48,
|
|
749
|
+
LineComment = 49,
|
|
750
|
+
BlockComment = 50,
|
|
751
|
+
Doc = 51,
|
|
752
|
+
DocText = 52,
|
|
753
|
+
DocParamTag = 53,
|
|
754
|
+
DocPropTag = 54,
|
|
755
|
+
DocReturnsTag = 55,
|
|
756
|
+
DocErrorsTag = 56,
|
|
757
|
+
DocTemplateTag = 57,
|
|
758
|
+
DocUnknownTag = 58,
|
|
759
|
+
Return = 59,
|
|
760
|
+
JsNamespaceDeclaration = 60,
|
|
761
|
+
TemplateArgument = 61,
|
|
762
|
+
TypeOfExpression = 62,
|
|
763
|
+
ObjectLiteral = 63,
|
|
764
|
+
ObjectLiteralProperty = 64,
|
|
765
|
+
ObjectLiteralSpreadProperty = 65,
|
|
766
|
+
ArrayLiteral = 66,
|
|
767
|
+
ConstStatement = 67,
|
|
768
|
+
CallExpression = 68,
|
|
769
|
+
ScalarConstructor = 69
|
|
866
770
|
}
|
|
867
771
|
export declare const enum NodeFlags {
|
|
868
772
|
None = 0,
|
|
@@ -898,11 +802,6 @@ export interface BaseNode extends TextRange {
|
|
|
898
802
|
readonly directives?: readonly DirectiveExpressionNode[];
|
|
899
803
|
readonly docs?: readonly DocNode[];
|
|
900
804
|
readonly flags: NodeFlags;
|
|
901
|
-
/**
|
|
902
|
-
* Could be undefined but making this optional creates a lot of noise. In practice,
|
|
903
|
-
* you will likely only access symbol in cases where you know the node has a symbol.
|
|
904
|
-
*/
|
|
905
|
-
readonly symbol: Sym;
|
|
906
805
|
/** Unique id across the process used to look up NodeLinks */
|
|
907
806
|
_id?: number;
|
|
908
807
|
}
|
|
@@ -944,7 +843,7 @@ export interface PositionDetail {
|
|
|
944
843
|
/** get the PositionDetail of positionAfterTrivia */
|
|
945
844
|
readonly getPositionDetailAfterTrivia: () => PositionDetail;
|
|
946
845
|
}
|
|
947
|
-
export type Node = TypeSpecScriptNode | JsSourceFileNode | JsNamespaceDeclarationNode | TemplateArgumentNode | TemplateParameterDeclarationNode |
|
|
846
|
+
export type Node = TypeSpecScriptNode | JsSourceFileNode | JsNamespaceDeclarationNode | TemplateArgumentNode | TemplateParameterDeclarationNode | ModelPropertyNode | UnionVariantNode | OperationStatementNode | OperationSignatureDeclarationNode | OperationSignatureReferenceNode | EnumMemberNode | EnumSpreadMemberNode | ModelSpreadPropertyNode | DecoratorExpressionNode | DirectiveExpressionNode | Statement | Expression | FunctionParameterNode | StringTemplateSpanNode | StringTemplateHeadNode | StringTemplateMiddleNode | StringTemplateTailNode | Modifier | DocNode | DocContent | DocTag | ReferenceExpression | ObjectLiteralNode | ObjectLiteralPropertyNode | ObjectLiteralSpreadPropertyNode | ScalarConstructorNode | ArrayLiteralNode;
|
|
948
847
|
/**
|
|
949
848
|
* Node that can be used as template
|
|
950
849
|
*/
|
|
@@ -987,12 +886,12 @@ export interface TypeSpecScriptNode extends DeclarationNode, BaseNode {
|
|
|
987
886
|
readonly locals: SymbolTable;
|
|
988
887
|
readonly parseOptions: ParseOptions;
|
|
989
888
|
}
|
|
990
|
-
export type Statement = ImportStatementNode | ModelStatementNode | ScalarStatementNode | NamespaceStatementNode | InterfaceStatementNode | UnionStatementNode | UsingStatementNode | EnumStatementNode | AliasStatementNode | OperationStatementNode | DecoratorDeclarationStatementNode | FunctionDeclarationStatementNode | AugmentDecoratorStatementNode | ConstStatementNode | CallExpressionNode | EmptyStatementNode | InvalidStatementNode
|
|
889
|
+
export type Statement = ImportStatementNode | ModelStatementNode | ScalarStatementNode | NamespaceStatementNode | InterfaceStatementNode | UnionStatementNode | UsingStatementNode | EnumStatementNode | AliasStatementNode | OperationStatementNode | DecoratorDeclarationStatementNode | FunctionDeclarationStatementNode | AugmentDecoratorStatementNode | ConstStatementNode | CallExpressionNode | EmptyStatementNode | InvalidStatementNode;
|
|
991
890
|
export interface DeclarationNode {
|
|
992
891
|
readonly id: IdentifierNode;
|
|
993
892
|
}
|
|
994
|
-
export type Declaration = ModelStatementNode | ScalarStatementNode | InterfaceStatementNode | UnionStatementNode | NamespaceStatementNode | OperationStatementNode | TemplateParameterDeclarationNode |
|
|
995
|
-
export type ScopeNode = NamespaceStatementNode | ModelStatementNode | InterfaceStatementNode | AliasStatementNode | TypeSpecScriptNode | JsSourceFileNode
|
|
893
|
+
export type Declaration = ModelStatementNode | ScalarStatementNode | InterfaceStatementNode | UnionStatementNode | NamespaceStatementNode | OperationStatementNode | TemplateParameterDeclarationNode | EnumStatementNode | AliasStatementNode | ConstStatementNode | DecoratorDeclarationStatementNode | FunctionDeclarationStatementNode;
|
|
894
|
+
export type ScopeNode = NamespaceStatementNode | ModelStatementNode | InterfaceStatementNode | AliasStatementNode | TypeSpecScriptNode | JsSourceFileNode;
|
|
996
895
|
export interface ImportStatementNode extends BaseNode {
|
|
997
896
|
readonly kind: SyntaxKind.ImportStatement;
|
|
998
897
|
readonly path: StringLiteralNode;
|
|
@@ -1021,7 +920,6 @@ export interface DirectiveExpressionNode extends BaseNode {
|
|
|
1021
920
|
}
|
|
1022
921
|
export type DirectiveArgument = StringLiteralNode | IdentifierNode;
|
|
1023
922
|
export type Expression = ArrayExpressionNode | MemberExpressionNode | ModelExpressionNode | ObjectLiteralNode | ArrayLiteralNode | TupleExpressionNode | UnionExpressionNode | IntersectionExpressionNode | TypeReferenceNode | ValueOfExpressionNode | TypeOfExpressionNode | CallExpressionNode | StringLiteralNode | NumericLiteralNode | BooleanLiteralNode | StringTemplateExpressionNode | VoidKeywordNode | NeverKeywordNode | AnyKeywordNode;
|
|
1024
|
-
export type ProjectionExpression = ProjectionLogicalExpressionNode | ProjectionRelationalExpressionNode | ProjectionEqualityExpressionNode | ProjectionUnaryExpressionNode | ProjectionArithmeticExpressionNode | ProjectionCallExpressionNode | ProjectionMemberExpressionNode | ProjectionDecoratorReferenceExpressionNode | ProjectionTupleExpressionNode | ProjectionModelExpressionNode | ProjectionIfExpressionNode | ProjectionBlockExpressionNode | ProjectionLambdaExpressionNode | StringLiteralNode | NumericLiteralNode | BooleanLiteralNode | IdentifierNode | VoidKeywordNode | NeverKeywordNode | AnyKeywordNode | ReturnExpressionNode;
|
|
1025
923
|
export type ReferenceExpression = TypeReferenceNode | MemberExpressionNode | IdentifierNode | VoidKeywordNode | NeverKeywordNode;
|
|
1026
924
|
export interface MemberExpressionNode extends BaseNode {
|
|
1027
925
|
readonly kind: SyntaxKind.MemberExpression;
|
|
@@ -1236,10 +1134,6 @@ export interface NeverKeywordNode extends BaseNode {
|
|
|
1236
1134
|
export interface AnyKeywordNode extends BaseNode {
|
|
1237
1135
|
readonly kind: SyntaxKind.UnknownKeyword;
|
|
1238
1136
|
}
|
|
1239
|
-
export interface ReturnExpressionNode extends BaseNode {
|
|
1240
|
-
readonly kind: SyntaxKind.Return;
|
|
1241
|
-
readonly value: ProjectionExpression;
|
|
1242
|
-
}
|
|
1243
1137
|
export interface UnionExpressionNode extends BaseNode {
|
|
1244
1138
|
readonly kind: SyntaxKind.UnionExpression;
|
|
1245
1139
|
readonly options: readonly Expression[];
|
|
@@ -1266,11 +1160,6 @@ export interface TemplateArgumentNode extends BaseNode {
|
|
|
1266
1160
|
readonly name?: IdentifierNode;
|
|
1267
1161
|
readonly argument: Expression;
|
|
1268
1162
|
}
|
|
1269
|
-
export interface ProjectionReferenceNode extends BaseNode {
|
|
1270
|
-
readonly kind: SyntaxKind.ProjectionReference;
|
|
1271
|
-
readonly target: MemberExpressionNode | IdentifierNode;
|
|
1272
|
-
readonly arguments: readonly Expression[];
|
|
1273
|
-
}
|
|
1274
1163
|
export interface TemplateParameterDeclarationNode extends DeclarationNode, BaseNode {
|
|
1275
1164
|
readonly kind: SyntaxKind.TemplateParameterDeclaration;
|
|
1276
1165
|
readonly constraint?: Expression;
|
|
@@ -1331,146 +1220,6 @@ export interface FunctionDeclarationStatementNode extends BaseNode, DeclarationN
|
|
|
1331
1220
|
readonly returnType?: Expression;
|
|
1332
1221
|
readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;
|
|
1333
1222
|
}
|
|
1334
|
-
export interface ProjectionModelSelectorNode extends BaseNode {
|
|
1335
|
-
readonly kind: SyntaxKind.ProjectionModelSelector;
|
|
1336
|
-
}
|
|
1337
|
-
export interface ProjectionScalarSelectorNode extends BaseNode {
|
|
1338
|
-
readonly kind: SyntaxKind.ProjectionScalarSelector;
|
|
1339
|
-
}
|
|
1340
|
-
export interface ProjectionModelPropertySelectorNode extends BaseNode {
|
|
1341
|
-
readonly kind: SyntaxKind.ProjectionModelPropertySelector;
|
|
1342
|
-
}
|
|
1343
|
-
export interface ProjectionInterfaceSelectorNode extends BaseNode {
|
|
1344
|
-
readonly kind: SyntaxKind.ProjectionInterfaceSelector;
|
|
1345
|
-
}
|
|
1346
|
-
export interface ProjectionOperationSelectorNode extends BaseNode {
|
|
1347
|
-
readonly kind: SyntaxKind.ProjectionOperationSelector;
|
|
1348
|
-
}
|
|
1349
|
-
export interface ProjectionUnionSelectorNode extends BaseNode {
|
|
1350
|
-
readonly kind: SyntaxKind.ProjectionUnionSelector;
|
|
1351
|
-
}
|
|
1352
|
-
export interface ProjectionUnionVariantSelectorNode extends BaseNode {
|
|
1353
|
-
readonly kind: SyntaxKind.ProjectionUnionVariantSelector;
|
|
1354
|
-
}
|
|
1355
|
-
export interface ProjectionEnumSelectorNode extends BaseNode {
|
|
1356
|
-
readonly kind: SyntaxKind.ProjectionEnumSelector;
|
|
1357
|
-
}
|
|
1358
|
-
export interface ProjectionEnumMemberSelectorNode extends BaseNode {
|
|
1359
|
-
readonly kind: SyntaxKind.ProjectionEnumMemberSelector;
|
|
1360
|
-
}
|
|
1361
|
-
export type ProjectionStatementItem = ProjectionExpressionStatementNode;
|
|
1362
|
-
export interface ProjectionParameterDeclarationNode extends DeclarationNode, BaseNode {
|
|
1363
|
-
readonly kind: SyntaxKind.ProjectionParameterDeclaration;
|
|
1364
|
-
}
|
|
1365
|
-
export interface ProjectionExpressionStatementNode extends BaseNode {
|
|
1366
|
-
readonly kind: SyntaxKind.ProjectionExpressionStatement;
|
|
1367
|
-
readonly expr: ProjectionExpression;
|
|
1368
|
-
}
|
|
1369
|
-
export interface ProjectionLogicalExpressionNode extends BaseNode {
|
|
1370
|
-
readonly kind: SyntaxKind.ProjectionLogicalExpression;
|
|
1371
|
-
readonly op: "||" | "&&";
|
|
1372
|
-
readonly left: ProjectionExpression;
|
|
1373
|
-
readonly right: ProjectionExpression;
|
|
1374
|
-
}
|
|
1375
|
-
export interface ProjectionRelationalExpressionNode extends BaseNode {
|
|
1376
|
-
readonly kind: SyntaxKind.ProjectionRelationalExpression;
|
|
1377
|
-
readonly op: "<=" | "<" | ">" | ">=";
|
|
1378
|
-
readonly left: ProjectionExpression;
|
|
1379
|
-
readonly right: ProjectionExpression;
|
|
1380
|
-
}
|
|
1381
|
-
export interface ProjectionEqualityExpressionNode extends BaseNode {
|
|
1382
|
-
readonly kind: SyntaxKind.ProjectionEqualityExpression;
|
|
1383
|
-
readonly op: "==" | "!=";
|
|
1384
|
-
readonly left: ProjectionExpression;
|
|
1385
|
-
readonly right: ProjectionExpression;
|
|
1386
|
-
}
|
|
1387
|
-
export interface ProjectionArithmeticExpressionNode extends BaseNode {
|
|
1388
|
-
readonly kind: SyntaxKind.ProjectionArithmeticExpression;
|
|
1389
|
-
readonly op: "+" | "-" | "*" | "/";
|
|
1390
|
-
readonly left: ProjectionExpression;
|
|
1391
|
-
readonly right: ProjectionExpression;
|
|
1392
|
-
}
|
|
1393
|
-
export interface ProjectionUnaryExpressionNode extends BaseNode {
|
|
1394
|
-
readonly kind: SyntaxKind.ProjectionUnaryExpression;
|
|
1395
|
-
readonly op: "!";
|
|
1396
|
-
readonly target: ProjectionExpression;
|
|
1397
|
-
}
|
|
1398
|
-
export interface ProjectionCallExpressionNode extends BaseNode {
|
|
1399
|
-
readonly kind: SyntaxKind.ProjectionCallExpression;
|
|
1400
|
-
readonly callKind: "method" | "template";
|
|
1401
|
-
readonly target: ProjectionExpression;
|
|
1402
|
-
readonly arguments: ProjectionExpression[];
|
|
1403
|
-
}
|
|
1404
|
-
export interface ProjectionMemberExpressionNode extends BaseNode {
|
|
1405
|
-
readonly kind: SyntaxKind.ProjectionMemberExpression;
|
|
1406
|
-
readonly base: ProjectionExpression;
|
|
1407
|
-
readonly id: IdentifierNode;
|
|
1408
|
-
readonly selector: "." | "::";
|
|
1409
|
-
}
|
|
1410
|
-
export interface ProjectionModelExpressionNode extends BaseNode {
|
|
1411
|
-
readonly kind: SyntaxKind.ProjectionModelExpression;
|
|
1412
|
-
readonly properties: (ProjectionModelPropertyNode | ProjectionModelSpreadPropertyNode)[];
|
|
1413
|
-
}
|
|
1414
|
-
export interface ProjectionTupleExpressionNode extends BaseNode {
|
|
1415
|
-
readonly kind: SyntaxKind.ProjectionTupleExpression;
|
|
1416
|
-
readonly values: ProjectionExpression[];
|
|
1417
|
-
}
|
|
1418
|
-
export interface ProjectionModelPropertyNode extends BaseNode {
|
|
1419
|
-
readonly kind: SyntaxKind.ProjectionModelProperty;
|
|
1420
|
-
readonly id: IdentifierNode;
|
|
1421
|
-
readonly value: ProjectionExpression;
|
|
1422
|
-
readonly decorators: readonly DecoratorExpressionNode[];
|
|
1423
|
-
readonly optional: boolean;
|
|
1424
|
-
readonly default?: ProjectionExpression;
|
|
1425
|
-
}
|
|
1426
|
-
export interface ProjectionModelSpreadPropertyNode extends BaseNode {
|
|
1427
|
-
readonly kind: SyntaxKind.ProjectionModelSpreadProperty;
|
|
1428
|
-
readonly target: ProjectionExpression;
|
|
1429
|
-
}
|
|
1430
|
-
export interface ProjectionIfExpressionNode extends BaseNode {
|
|
1431
|
-
readonly kind: SyntaxKind.ProjectionIfExpression;
|
|
1432
|
-
readonly test: ProjectionExpression;
|
|
1433
|
-
readonly consequent: ProjectionBlockExpressionNode;
|
|
1434
|
-
readonly alternate?: ProjectionBlockExpressionNode | ProjectionIfExpressionNode;
|
|
1435
|
-
}
|
|
1436
|
-
export interface ProjectionBlockExpressionNode extends BaseNode {
|
|
1437
|
-
readonly kind: SyntaxKind.ProjectionBlockExpression;
|
|
1438
|
-
readonly statements: ProjectionStatementItem[];
|
|
1439
|
-
}
|
|
1440
|
-
export interface ProjectionLambdaExpressionNode extends BaseNode {
|
|
1441
|
-
readonly kind: SyntaxKind.ProjectionLambdaExpression;
|
|
1442
|
-
readonly parameters: readonly ProjectionLambdaParameterDeclarationNode[];
|
|
1443
|
-
readonly locals?: SymbolTable;
|
|
1444
|
-
readonly body: ProjectionBlockExpressionNode;
|
|
1445
|
-
}
|
|
1446
|
-
export interface ProjectionLambdaParameterDeclarationNode extends DeclarationNode, BaseNode {
|
|
1447
|
-
readonly kind: SyntaxKind.ProjectionLambdaParameterDeclaration;
|
|
1448
|
-
}
|
|
1449
|
-
export interface ProjectionNode extends BaseNode {
|
|
1450
|
-
readonly kind: SyntaxKind.Projection;
|
|
1451
|
-
readonly direction: "to" | "from" | "pre_to" | "pre_from" | "<error>";
|
|
1452
|
-
readonly directionId: IdentifierNode;
|
|
1453
|
-
readonly modifierIds: readonly IdentifierNode[];
|
|
1454
|
-
readonly parameters: ProjectionParameterDeclarationNode[];
|
|
1455
|
-
readonly body: readonly ProjectionStatementItem[];
|
|
1456
|
-
readonly locals?: SymbolTable;
|
|
1457
|
-
}
|
|
1458
|
-
/** @deprecated */
|
|
1459
|
-
export interface ProjectionStatementNode extends BaseNode, DeclarationNode {
|
|
1460
|
-
readonly kind: SyntaxKind.ProjectionStatement;
|
|
1461
|
-
readonly selector: ProjectionModelSelectorNode | ProjectionModelPropertySelectorNode | ProjectionScalarSelectorNode | ProjectionInterfaceSelectorNode | ProjectionOperationSelectorNode | ProjectionUnionSelectorNode | ProjectionUnionVariantSelectorNode | ProjectionEnumSelectorNode | ProjectionEnumMemberSelectorNode | MemberExpressionNode | IdentifierNode;
|
|
1462
|
-
readonly to?: ProjectionNode;
|
|
1463
|
-
readonly from?: ProjectionNode;
|
|
1464
|
-
readonly preTo?: ProjectionNode;
|
|
1465
|
-
readonly preFrom?: ProjectionNode;
|
|
1466
|
-
readonly projections: readonly ProjectionNode[];
|
|
1467
|
-
readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;
|
|
1468
|
-
}
|
|
1469
|
-
/** @deprecated */
|
|
1470
|
-
export interface ProjectionDecoratorReferenceExpressionNode extends BaseNode {
|
|
1471
|
-
readonly kind: SyntaxKind.ProjectionDecoratorReferenceExpression;
|
|
1472
|
-
readonly target: MemberExpressionNode | IdentifierNode;
|
|
1473
|
-
}
|
|
1474
1223
|
export interface IdentifierContext {
|
|
1475
1224
|
kind: IdentifierKind;
|
|
1476
1225
|
node: Node;
|
|
@@ -1546,7 +1295,6 @@ export interface JsSourceFileNode extends DeclarationNode, BaseNode {
|
|
|
1546
1295
|
readonly kind: SyntaxKind.JsSourceFile;
|
|
1547
1296
|
readonly file: SourceFile;
|
|
1548
1297
|
readonly esmExports: any;
|
|
1549
|
-
readonly namespaceSymbols: Sym[];
|
|
1550
1298
|
}
|
|
1551
1299
|
export interface JsNamespaceDeclarationNode extends DeclarationNode, BaseNode {
|
|
1552
1300
|
readonly kind: SyntaxKind.JsNamespaceDeclaration;
|
|
@@ -1718,11 +1466,6 @@ export interface DeprecatedDirective extends DirectiveBase {
|
|
|
1718
1466
|
name: "deprecated";
|
|
1719
1467
|
message: string;
|
|
1720
1468
|
}
|
|
1721
|
-
export interface Dirent {
|
|
1722
|
-
isFile(): boolean;
|
|
1723
|
-
name: string;
|
|
1724
|
-
isDirectory(): boolean;
|
|
1725
|
-
}
|
|
1726
1469
|
export interface RmOptions {
|
|
1727
1470
|
/**
|
|
1728
1471
|
* If `true`, perform a recursive directory removal. In
|
|
@@ -1732,15 +1475,11 @@ export interface RmOptions {
|
|
|
1732
1475
|
*/
|
|
1733
1476
|
recursive?: boolean;
|
|
1734
1477
|
}
|
|
1735
|
-
export interface
|
|
1478
|
+
export interface SystemHost {
|
|
1736
1479
|
/** read a file at the given url. */
|
|
1737
1480
|
readUrl(url: string): Promise<SourceFile>;
|
|
1738
1481
|
/** read a utf-8 or utf-8 with bom encoded file */
|
|
1739
1482
|
readFile(path: string): Promise<SourceFile>;
|
|
1740
|
-
/**
|
|
1741
|
-
* Optional cache to reuse the results of parsing and binding across programs.
|
|
1742
|
-
*/
|
|
1743
|
-
parseCache?: WeakMap<SourceFile, TypeSpecScriptNode>;
|
|
1744
1483
|
/**
|
|
1745
1484
|
* Write the file.
|
|
1746
1485
|
* @param path Path to the file.
|
|
@@ -1763,15 +1502,21 @@ export interface CompilerHost {
|
|
|
1763
1502
|
* @param path Path to the directory.
|
|
1764
1503
|
*/
|
|
1765
1504
|
mkdirp(path: string): Promise<string | undefined>;
|
|
1766
|
-
getExecutionRoot(): string;
|
|
1767
|
-
getLibDirs(): string[];
|
|
1768
|
-
getJsImport(path: string): Promise<Record<string, any>>;
|
|
1769
1505
|
stat(path: string): Promise<{
|
|
1770
1506
|
isDirectory(): boolean;
|
|
1771
1507
|
isFile(): boolean;
|
|
1772
1508
|
}>;
|
|
1773
|
-
getSourceFileKind(path: string): SourceFileKind | undefined;
|
|
1774
1509
|
realpath(path: string): Promise<string>;
|
|
1510
|
+
}
|
|
1511
|
+
export interface CompilerHost extends SystemHost {
|
|
1512
|
+
/**
|
|
1513
|
+
* Optional cache to reuse the results of parsing and binding across programs.
|
|
1514
|
+
*/
|
|
1515
|
+
parseCache?: WeakMap<SourceFile, TypeSpecScriptNode>;
|
|
1516
|
+
getExecutionRoot(): string;
|
|
1517
|
+
getLibDirs(): string[];
|
|
1518
|
+
getJsImport(path: string): Promise<Record<string, any>>;
|
|
1519
|
+
getSourceFileKind(path: string): SourceFileKind | undefined;
|
|
1775
1520
|
fileURLToPath(url: string): string;
|
|
1776
1521
|
pathToFileURL(path: string): string;
|
|
1777
1522
|
logSink: LogSink;
|
|
@@ -1874,6 +1619,10 @@ export interface StateDef {
|
|
|
1874
1619
|
*/
|
|
1875
1620
|
readonly description?: string;
|
|
1876
1621
|
}
|
|
1622
|
+
export interface TypeSpecLibraryCapabilities {
|
|
1623
|
+
/** Only applicable for emitters. Specify that this emitter will respect the dryRun flag and run, report diagnostic but not write any output. */
|
|
1624
|
+
readonly dryRun?: boolean;
|
|
1625
|
+
}
|
|
1877
1626
|
export interface TypeSpecLibraryDef<T extends {
|
|
1878
1627
|
[code: string]: DiagnosticMessages;
|
|
1879
1628
|
}, E extends Record<string, any> = Record<string, never>, State extends string = never> {
|
|
@@ -1881,6 +1630,8 @@ export interface TypeSpecLibraryDef<T extends {
|
|
|
1881
1630
|
* Library name. MUST match package.json name.
|
|
1882
1631
|
*/
|
|
1883
1632
|
readonly name: string;
|
|
1633
|
+
/** Optional registration of capabilities the library/emitter provides */
|
|
1634
|
+
readonly capabilities?: TypeSpecLibraryCapabilities;
|
|
1884
1635
|
/**
|
|
1885
1636
|
* Map of potential diagnostics that can be emitted in this library where the key is the diagnostic code.
|
|
1886
1637
|
*/
|
|
@@ -1917,22 +1668,6 @@ export interface DecoratorImplementations {
|
|
|
1917
1668
|
};
|
|
1918
1669
|
}
|
|
1919
1670
|
export interface PackageFlags {
|
|
1920
|
-
/**
|
|
1921
|
-
* Decorator arg marshalling algorithm. Specify how TypeSpec values are marshalled to decorator arguments.
|
|
1922
|
-
* - `new` - New recommended behavior
|
|
1923
|
-
* - string value -> `string`
|
|
1924
|
-
* - numeric value -> `number` if the constraint can be represented as a JS number, Numeric otherwise(e.g. for types int64, decimal128, numeric, etc.)
|
|
1925
|
-
* - boolean value -> `boolean`
|
|
1926
|
-
* - null value -> `null`
|
|
1927
|
-
*
|
|
1928
|
-
* - `legacy` - DEPRECATED - Behavior before version 0.56.0.
|
|
1929
|
-
* - string value -> `string`
|
|
1930
|
-
* - numeric value -> `number`
|
|
1931
|
-
* - boolean value -> `boolean`
|
|
1932
|
-
* - null value -> `NullType`
|
|
1933
|
-
* @default new
|
|
1934
|
-
*/
|
|
1935
|
-
readonly decoratorArgMarshalling?: "legacy" | "new";
|
|
1936
1671
|
}
|
|
1937
1672
|
export interface LinterDefinition {
|
|
1938
1673
|
rules: LinterRuleDefinition<string, DiagnosticMessages>[];
|
|
@@ -2069,7 +1804,6 @@ export interface Logger {
|
|
|
2069
1804
|
warn(message: string): void;
|
|
2070
1805
|
error(message: string): void;
|
|
2071
1806
|
log(log: LogInfo): void;
|
|
2072
|
-
trackAction<T>(message: string, finalMessage: string, asyncAction: () => Promise<T>): Promise<T>;
|
|
2073
1807
|
}
|
|
2074
1808
|
export interface TracerOptions {
|
|
2075
1809
|
filter?: string[];
|