quicktype 18.0.5 → 19.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.
- package/README.md +1 -1
- package/dist/{cli/CompressedJSONFromStream.d.ts → CompressedJSONFromStream.d.ts} +1 -1
- package/dist/{cli/CompressedJSONFromStream.js → CompressedJSONFromStream.js} +2 -2
- package/dist/{cli/GraphQLIntrospection.d.ts → GraphQLIntrospection.d.ts} +0 -0
- package/dist/{cli/GraphQLIntrospection.js → GraphQLIntrospection.js} +1 -1
- package/dist/{cli/TypeSource.d.ts → TypeSource.d.ts} +2 -2
- package/dist/{cli/TypeSource.js → TypeSource.js} +0 -0
- package/dist/{cli/URLGrammar.d.ts → URLGrammar.d.ts} +0 -0
- package/dist/{cli/URLGrammar.js → URLGrammar.js} +1 -1
- package/dist/{cli/index.d.ts → index.d.ts} +1 -1
- package/dist/{cli/index.js → index.js} +4 -5
- package/package.json +61 -77
- package/dist/quicktype-core/Annotation.d.ts +0 -8
- package/dist/quicktype-core/Annotation.js +0 -16
- package/dist/quicktype-core/ConvenienceRenderer.d.ts +0 -138
- package/dist/quicktype-core/ConvenienceRenderer.js +0 -668
- package/dist/quicktype-core/DateTime.d.ts +0 -10
- package/dist/quicktype-core/DateTime.js +0 -57
- package/dist/quicktype-core/DeclarationIR.d.ts +0 -14
- package/dist/quicktype-core/DeclarationIR.js +0 -167
- package/dist/quicktype-core/EncodedMarkovChain.d.ts +0 -1
- package/dist/quicktype-core/EncodedMarkovChain.js +0 -4
- package/dist/quicktype-core/GatherNames.d.ts +0 -2
- package/dist/quicktype-core/GatherNames.js +0 -333
- package/dist/quicktype-core/Graph.d.ts +0 -12
- package/dist/quicktype-core/Graph.js +0 -220
- package/dist/quicktype-core/GraphRewriting.d.ts +0 -87
- package/dist/quicktype-core/GraphRewriting.js +0 -421
- package/dist/quicktype-core/MakeTransformations.d.ts +0 -4
- package/dist/quicktype-core/MakeTransformations.js +0 -193
- package/dist/quicktype-core/MarkovChain.d.ts +0 -15
- package/dist/quicktype-core/MarkovChain.js +0 -154
- package/dist/quicktype-core/Messages.d.ts +0 -294
- package/dist/quicktype-core/Messages.js +0 -105
- package/dist/quicktype-core/Naming.d.ts +0 -64
- package/dist/quicktype-core/Naming.js +0 -356
- package/dist/quicktype-core/Renderer.d.ts +0 -50
- package/dist/quicktype-core/Renderer.js +0 -274
- package/dist/quicktype-core/RendererOptions.d.ts +0 -71
- package/dist/quicktype-core/RendererOptions.js +0 -141
- package/dist/quicktype-core/Run.d.ts +0 -174
- package/dist/quicktype-core/Run.js +0 -393
- package/dist/quicktype-core/Source.d.ts +0 -65
- package/dist/quicktype-core/Source.js +0 -204
- package/dist/quicktype-core/TargetLanguage.d.ts +0 -34
- package/dist/quicktype-core/TargetLanguage.js +0 -66
- package/dist/quicktype-core/Transformers.d.ts +0 -209
- package/dist/quicktype-core/Transformers.js +0 -836
- package/dist/quicktype-core/Type.d.ts +0 -206
- package/dist/quicktype-core/Type.js +0 -716
- package/dist/quicktype-core/TypeBuilder.d.ts +0 -61
- package/dist/quicktype-core/TypeBuilder.js +0 -324
- package/dist/quicktype-core/TypeGraph.d.ts +0 -75
- package/dist/quicktype-core/TypeGraph.js +0 -420
- package/dist/quicktype-core/TypeUtils.d.ts +0 -33
- package/dist/quicktype-core/TypeUtils.js +0 -230
- package/dist/quicktype-core/UnifyClasses.d.ts +0 -16
- package/dist/quicktype-core/UnifyClasses.js +0 -159
- package/dist/quicktype-core/UnionBuilder.d.ts +0 -49
- package/dist/quicktype-core/UnionBuilder.js +0 -282
- package/dist/quicktype-core/attributes/AccessorNames.d.ts +0 -18
- package/dist/quicktype-core/attributes/AccessorNames.js +0 -182
- package/dist/quicktype-core/attributes/Constraints.d.ts +0 -38
- package/dist/quicktype-core/attributes/Constraints.js +0 -172
- package/dist/quicktype-core/attributes/Description.d.ts +0 -9
- package/dist/quicktype-core/attributes/Description.js +0 -97
- package/dist/quicktype-core/attributes/EnumValues.d.ts +0 -8
- package/dist/quicktype-core/attributes/EnumValues.js +0 -31
- package/dist/quicktype-core/attributes/StringTypes.d.ts +0 -28
- package/dist/quicktype-core/attributes/StringTypes.js +0 -189
- package/dist/quicktype-core/attributes/TypeAttributes.d.ts +0 -34
- package/dist/quicktype-core/attributes/TypeAttributes.js +0 -119
- package/dist/quicktype-core/attributes/TypeNames.d.ts +0 -46
- package/dist/quicktype-core/attributes/TypeNames.js +0 -274
- package/dist/quicktype-core/attributes/URIAttributes.d.ts +0 -8
- package/dist/quicktype-core/attributes/URIAttributes.js +0 -85
- package/dist/quicktype-core/index.d.ts +0 -48
- package/dist/quicktype-core/index.js +0 -180
- package/dist/quicktype-core/input/CompressedJSON.d.ts +0 -69
- package/dist/quicktype-core/input/CompressedJSON.js +0 -276
- package/dist/quicktype-core/input/FetchingJSONSchemaStore.d.ts +0 -6
- package/dist/quicktype-core/input/FetchingJSONSchemaStore.js +0 -18
- package/dist/quicktype-core/input/Inference.d.ts +0 -22
- package/dist/quicktype-core/input/Inference.js +0 -240
- package/dist/quicktype-core/input/Inputs.d.ts +0 -48
- package/dist/quicktype-core/input/Inputs.js +0 -145
- package/dist/quicktype-core/input/JSONSchemaInput.d.ts +0 -91
- package/dist/quicktype-core/input/JSONSchemaInput.js +0 -1041
- package/dist/quicktype-core/input/JSONSchemaStore.d.ts +0 -8
- package/dist/quicktype-core/input/JSONSchemaStore.js +0 -36
- package/dist/quicktype-core/input/PostmanCollection.d.ts +0 -5
- package/dist/quicktype-core/input/PostmanCollection.js +0 -60
- package/dist/quicktype-core/input/io/NodeIO.d.ts +0 -3
- package/dist/quicktype-core/input/io/NodeIO.js +0 -87
- package/dist/quicktype-core/input/io/get-stream/buffer-stream.d.ts +0 -2
- package/dist/quicktype-core/input/io/get-stream/buffer-stream.js +0 -45
- package/dist/quicktype-core/input/io/get-stream/index.d.ts +0 -9
- package/dist/quicktype-core/input/io/get-stream/index.js +0 -52
- package/dist/quicktype-core/language/All.d.ts +0 -3
- package/dist/quicktype-core/language/All.js +0 -57
- package/dist/quicktype-core/language/CPlusPlus.d.ts +0 -241
- package/dist/quicktype-core/language/CPlusPlus.js +0 -1847
- package/dist/quicktype-core/language/CSharp.d.ts +0 -201
- package/dist/quicktype-core/language/CSharp.js +0 -1850
- package/dist/quicktype-core/language/Crystal.d.ts +0 -37
- package/dist/quicktype-core/language/Crystal.js +0 -337
- package/dist/quicktype-core/language/Dart.d.ts +0 -66
- package/dist/quicktype-core/language/Dart.js +0 -576
- package/dist/quicktype-core/language/Elm.d.ts +0 -58
- package/dist/quicktype-core/language/Elm.js +0 -522
- package/dist/quicktype-core/language/Golang.d.ts +0 -51
- package/dist/quicktype-core/language/Golang.js +0 -460
- package/dist/quicktype-core/language/Haskell.d.ts +0 -56
- package/dist/quicktype-core/language/Haskell.js +0 -411
- package/dist/quicktype-core/language/JSONSchema.d.ts +0 -31
- package/dist/quicktype-core/language/JSONSchema.js +0 -169
- package/dist/quicktype-core/language/Java.d.ts +0 -125
- package/dist/quicktype-core/language/Java.js +0 -1081
- package/dist/quicktype-core/language/JavaScript.d.ts +0 -68
- package/dist/quicktype-core/language/JavaScript.js +0 -435
- package/dist/quicktype-core/language/JavaScriptPropTypes.d.ts +0 -40
- package/dist/quicktype-core/language/JavaScriptPropTypes.js +0 -213
- package/dist/quicktype-core/language/JavaScriptUnicodeMaps.d.ts +0 -2
- package/dist/quicktype-core/language/JavaScriptUnicodeMaps.js +0 -134
- package/dist/quicktype-core/language/Kotlin.d.ts +0 -109
- package/dist/quicktype-core/language/Kotlin.js +0 -832
- package/dist/quicktype-core/language/Objective-C.d.ts +0 -79
- package/dist/quicktype-core/language/Objective-C.js +0 -777
- package/dist/quicktype-core/language/Php.d.ts +0 -80
- package/dist/quicktype-core/language/Php.js +0 -702
- package/dist/quicktype-core/language/Pike.d.ts +0 -37
- package/dist/quicktype-core/language/Pike.js +0 -276
- package/dist/quicktype-core/language/Python.d.ts +0 -107
- package/dist/quicktype-core/language/Python.js +0 -969
- package/dist/quicktype-core/language/Rust.d.ts +0 -56
- package/dist/quicktype-core/language/Rust.js +0 -309
- package/dist/quicktype-core/language/Swift.d.ts +0 -96
- package/dist/quicktype-core/language/Swift.js +0 -1211
- package/dist/quicktype-core/language/TypeScriptFlow.d.ts +0 -77
- package/dist/quicktype-core/language/TypeScriptFlow.js +0 -286
- package/dist/quicktype-core/language/ruby/index.d.ts +0 -52
- package/dist/quicktype-core/language/ruby/index.js +0 -557
- package/dist/quicktype-core/language/ruby/keywords.d.ts +0 -3
- package/dist/quicktype-core/language/ruby/keywords.js +0 -358
- package/dist/quicktype-core/rewrites/CombineClasses.d.ts +0 -3
- package/dist/quicktype-core/rewrites/CombineClasses.js +0 -125
- package/dist/quicktype-core/rewrites/ExpandStrings.d.ts +0 -4
- package/dist/quicktype-core/rewrites/ExpandStrings.js +0 -143
- package/dist/quicktype-core/rewrites/FlattenStrings.d.ts +0 -3
- package/dist/quicktype-core/rewrites/FlattenStrings.js +0 -45
- package/dist/quicktype-core/rewrites/FlattenUnions.d.ts +0 -3
- package/dist/quicktype-core/rewrites/FlattenUnions.js +0 -47
- package/dist/quicktype-core/rewrites/InferMaps.d.ts +0 -3
- package/dist/quicktype-core/rewrites/InferMaps.js +0 -117
- package/dist/quicktype-core/rewrites/ReplaceObjectType.d.ts +0 -3
- package/dist/quicktype-core/rewrites/ReplaceObjectType.js +0 -60
- package/dist/quicktype-core/rewrites/ResolveIntersections.d.ts +0 -3
- package/dist/quicktype-core/rewrites/ResolveIntersections.js +0 -244
- package/dist/quicktype-core/support/Acronyms.d.ts +0 -10
- package/dist/quicktype-core/support/Acronyms.js +0 -1128
- package/dist/quicktype-core/support/Chance.d.ts +0 -38
- package/dist/quicktype-core/support/Chance.js +0 -2146
- package/dist/quicktype-core/support/Converters.d.ts +0 -6
- package/dist/quicktype-core/support/Converters.js +0 -16
- package/dist/quicktype-core/support/Strings.d.ts +0 -44
- package/dist/quicktype-core/support/Strings.js +0 -525
- package/dist/quicktype-core/support/Support.d.ts +0 -29
- package/dist/quicktype-core/support/Support.js +0 -162
- package/dist/quicktype-graphql-input/GraphQLSchema.d.ts +0 -645
- package/dist/quicktype-graphql-input/GraphQLSchema.js +0 -39
- package/dist/quicktype-graphql-input/index.d.ts +0 -17
- package/dist/quicktype-graphql-input/index.js +0 -407
- package/dist/quicktype-typescript-input/index.d.ts +0 -2
- package/dist/quicktype-typescript-input/index.js +0 -98
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Primary options show up in the web UI in the "Language" settings tab,
|
|
3
|
-
* secondary options in "Other".
|
|
4
|
-
*/
|
|
5
|
-
export type OptionKind = "primary" | "secondary";
|
|
6
|
-
export interface OptionDefinition {
|
|
7
|
-
name: string;
|
|
8
|
-
type: StringConstructor | BooleanConstructor;
|
|
9
|
-
kind?: OptionKind;
|
|
10
|
-
renderer?: boolean;
|
|
11
|
-
alias?: string;
|
|
12
|
-
multiple?: boolean;
|
|
13
|
-
defaultOption?: boolean;
|
|
14
|
-
defaultValue?: any;
|
|
15
|
-
typeLabel?: string;
|
|
16
|
-
description: string;
|
|
17
|
-
legalValues?: string[];
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* The superclass for target language options. You probably want to use one of its
|
|
21
|
-
* subclasses, `BooleanOption`, `EnumOption`, or `StringOption`.
|
|
22
|
-
*/
|
|
23
|
-
export declare abstract class Option<T> {
|
|
24
|
-
readonly definition: OptionDefinition;
|
|
25
|
-
constructor(definition: OptionDefinition);
|
|
26
|
-
getValue(values: {
|
|
27
|
-
[name: string]: any;
|
|
28
|
-
}): T;
|
|
29
|
-
get cliDefinitions(): {
|
|
30
|
-
display: OptionDefinition[];
|
|
31
|
-
actual: OptionDefinition[];
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export type OptionValueType<O> = O extends Option<infer T> ? T : never;
|
|
35
|
-
export type OptionValues<T> = {
|
|
36
|
-
[P in keyof T]: OptionValueType<T[P]>;
|
|
37
|
-
};
|
|
38
|
-
export declare function getOptionValues<T extends {
|
|
39
|
-
[name: string]: Option<any>;
|
|
40
|
-
}>(options: T, untypedOptionValues: {
|
|
41
|
-
[name: string]: any;
|
|
42
|
-
}): OptionValues<T>;
|
|
43
|
-
/**
|
|
44
|
-
* A target language option that allows setting a boolean flag.
|
|
45
|
-
*/
|
|
46
|
-
export declare class BooleanOption extends Option<boolean> {
|
|
47
|
-
/**
|
|
48
|
-
* @param name The shorthand name.
|
|
49
|
-
* @param description Short-ish description of the option.
|
|
50
|
-
* @param defaultValue The default value.
|
|
51
|
-
* @param kind Whether it's a primary or secondary option.
|
|
52
|
-
*/
|
|
53
|
-
constructor(name: string, description: string, defaultValue: boolean, kind?: OptionKind);
|
|
54
|
-
get cliDefinitions(): {
|
|
55
|
-
display: OptionDefinition[];
|
|
56
|
-
actual: OptionDefinition[];
|
|
57
|
-
};
|
|
58
|
-
getValue(values: {
|
|
59
|
-
[name: string]: any;
|
|
60
|
-
}): boolean;
|
|
61
|
-
}
|
|
62
|
-
export declare class StringOption extends Option<string> {
|
|
63
|
-
constructor(name: string, description: string, typeLabel: string, defaultValue: string, kind?: OptionKind);
|
|
64
|
-
}
|
|
65
|
-
export declare class EnumOption<T> extends Option<T> {
|
|
66
|
-
private readonly _values;
|
|
67
|
-
constructor(name: string, description: string, values: [string, T][], defaultValue?: string | undefined, kind?: OptionKind);
|
|
68
|
-
getValue(values: {
|
|
69
|
-
[name: string]: any;
|
|
70
|
-
}): T;
|
|
71
|
-
}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EnumOption = exports.StringOption = exports.BooleanOption = exports.getOptionValues = exports.Option = void 0;
|
|
4
|
-
const Support_1 = require("./support/Support");
|
|
5
|
-
const Messages_1 = require("./Messages");
|
|
6
|
-
const collection_utils_1 = require("collection-utils");
|
|
7
|
-
/**
|
|
8
|
-
* The superclass for target language options. You probably want to use one of its
|
|
9
|
-
* subclasses, `BooleanOption`, `EnumOption`, or `StringOption`.
|
|
10
|
-
*/
|
|
11
|
-
class Option {
|
|
12
|
-
definition;
|
|
13
|
-
constructor(definition) {
|
|
14
|
-
definition.renderer = true;
|
|
15
|
-
this.definition = definition;
|
|
16
|
-
(0, Support_1.assert)(definition.kind !== undefined, "Renderer option kind must be defined");
|
|
17
|
-
}
|
|
18
|
-
getValue(values) {
|
|
19
|
-
const value = values[this.definition.name];
|
|
20
|
-
if (value === undefined) {
|
|
21
|
-
return this.definition.defaultValue;
|
|
22
|
-
}
|
|
23
|
-
return value;
|
|
24
|
-
}
|
|
25
|
-
get cliDefinitions() {
|
|
26
|
-
return { actual: [this.definition], display: [this.definition] };
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.Option = Option;
|
|
30
|
-
function getOptionValues(options, untypedOptionValues) {
|
|
31
|
-
const optionValues = {};
|
|
32
|
-
for (const name of Object.getOwnPropertyNames(options)) {
|
|
33
|
-
optionValues[name] = options[name].getValue(untypedOptionValues);
|
|
34
|
-
}
|
|
35
|
-
return optionValues;
|
|
36
|
-
}
|
|
37
|
-
exports.getOptionValues = getOptionValues;
|
|
38
|
-
/**
|
|
39
|
-
* A target language option that allows setting a boolean flag.
|
|
40
|
-
*/
|
|
41
|
-
class BooleanOption extends Option {
|
|
42
|
-
/**
|
|
43
|
-
* @param name The shorthand name.
|
|
44
|
-
* @param description Short-ish description of the option.
|
|
45
|
-
* @param defaultValue The default value.
|
|
46
|
-
* @param kind Whether it's a primary or secondary option.
|
|
47
|
-
*/
|
|
48
|
-
constructor(name, description, defaultValue, kind = "primary") {
|
|
49
|
-
super({
|
|
50
|
-
name,
|
|
51
|
-
kind,
|
|
52
|
-
type: Boolean,
|
|
53
|
-
description,
|
|
54
|
-
defaultValue
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
get cliDefinitions() {
|
|
58
|
-
const negated = Object.assign({}, this.definition, {
|
|
59
|
-
name: `no-${this.definition.name}`,
|
|
60
|
-
defaultValue: !this.definition.defaultValue
|
|
61
|
-
});
|
|
62
|
-
const display = Object.assign({}, this.definition, {
|
|
63
|
-
name: `[no-]${this.definition.name}`,
|
|
64
|
-
description: `${this.definition.description} (${this.definition.defaultValue ? "on" : "off"} by default)`
|
|
65
|
-
});
|
|
66
|
-
return {
|
|
67
|
-
display: [display],
|
|
68
|
-
actual: [this.definition, negated]
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
getValue(values) {
|
|
72
|
-
let value = values[this.definition.name];
|
|
73
|
-
if (value === undefined) {
|
|
74
|
-
value = this.definition.defaultValue;
|
|
75
|
-
}
|
|
76
|
-
let negated = values[`no-${this.definition.name}`];
|
|
77
|
-
if (negated === undefined) {
|
|
78
|
-
negated = !this.definition.defaultValue;
|
|
79
|
-
}
|
|
80
|
-
if (value === "true") {
|
|
81
|
-
value = true;
|
|
82
|
-
}
|
|
83
|
-
else if (value === "false") {
|
|
84
|
-
value = false;
|
|
85
|
-
}
|
|
86
|
-
if (this.definition.defaultValue) {
|
|
87
|
-
return value && !negated;
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
return value || !negated;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
exports.BooleanOption = BooleanOption;
|
|
95
|
-
class StringOption extends Option {
|
|
96
|
-
constructor(name, description, typeLabel, defaultValue, kind = "primary") {
|
|
97
|
-
const definition = {
|
|
98
|
-
name,
|
|
99
|
-
kind,
|
|
100
|
-
type: String,
|
|
101
|
-
description,
|
|
102
|
-
typeLabel,
|
|
103
|
-
defaultValue
|
|
104
|
-
};
|
|
105
|
-
super(definition);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
exports.StringOption = StringOption;
|
|
109
|
-
class EnumOption extends Option {
|
|
110
|
-
_values;
|
|
111
|
-
constructor(name, description, values, defaultValue = undefined, kind = "primary") {
|
|
112
|
-
if (defaultValue === undefined) {
|
|
113
|
-
defaultValue = values[0][0];
|
|
114
|
-
}
|
|
115
|
-
const definition = {
|
|
116
|
-
name,
|
|
117
|
-
kind,
|
|
118
|
-
type: String,
|
|
119
|
-
description,
|
|
120
|
-
typeLabel: values.map(([n, _]) => n).join("|"),
|
|
121
|
-
legalValues: values.map(([n, _]) => n),
|
|
122
|
-
defaultValue
|
|
123
|
-
};
|
|
124
|
-
super(definition);
|
|
125
|
-
this._values = {};
|
|
126
|
-
for (const [n, v] of values) {
|
|
127
|
-
this._values[n] = v;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
getValue(values) {
|
|
131
|
-
let name = values[this.definition.name];
|
|
132
|
-
if (name === undefined) {
|
|
133
|
-
name = this.definition.defaultValue;
|
|
134
|
-
}
|
|
135
|
-
if (!(0, collection_utils_1.hasOwnProperty)(this._values, name)) {
|
|
136
|
-
return (0, Messages_1.messageError)("RendererUnknownOptionValue", { value: name, name: this.definition.name });
|
|
137
|
-
}
|
|
138
|
-
return this._values[name];
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
exports.EnumOption = EnumOption;
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { TargetLanguage, MultiFileRenderResult } from "./TargetLanguage";
|
|
2
|
-
import { SerializedRenderResult } from "./Source";
|
|
3
|
-
import { StringTypeMapping } from "./TypeBuilder";
|
|
4
|
-
import { InputData } from "./input/Inputs";
|
|
5
|
-
import { TransformedStringTypeKind } from "./Type";
|
|
6
|
-
export declare function getTargetLanguage(nameOrInstance: string | TargetLanguage): TargetLanguage;
|
|
7
|
-
export type RendererOptions = {
|
|
8
|
-
[name: string]: string;
|
|
9
|
-
};
|
|
10
|
-
export interface InferenceFlag {
|
|
11
|
-
description: string;
|
|
12
|
-
negationDescription: string;
|
|
13
|
-
explanation: string;
|
|
14
|
-
order: number;
|
|
15
|
-
stringType?: TransformedStringTypeKind;
|
|
16
|
-
}
|
|
17
|
-
export declare const inferenceFlagsObject: {
|
|
18
|
-
/** Whether to infer map types from JSON data */
|
|
19
|
-
inferMaps: {
|
|
20
|
-
description: string;
|
|
21
|
-
negationDescription: string;
|
|
22
|
-
explanation: string;
|
|
23
|
-
order: number;
|
|
24
|
-
};
|
|
25
|
-
/** Whether to infer enum types from JSON data */
|
|
26
|
-
inferEnums: {
|
|
27
|
-
description: string;
|
|
28
|
-
negationDescription: string;
|
|
29
|
-
explanation: string;
|
|
30
|
-
order: number;
|
|
31
|
-
};
|
|
32
|
-
/** Whether to convert UUID strings to UUID objects */
|
|
33
|
-
inferUuids: {
|
|
34
|
-
description: string;
|
|
35
|
-
negationDescription: string;
|
|
36
|
-
explanation: string;
|
|
37
|
-
stringType: "date" | "time" | "date-time" | "uuid" | "uri" | "integer-string" | "bool-string";
|
|
38
|
-
order: number;
|
|
39
|
-
};
|
|
40
|
-
/** Whether to assume that JSON strings that look like dates are dates */
|
|
41
|
-
inferDateTimes: {
|
|
42
|
-
description: string;
|
|
43
|
-
negationDescription: string;
|
|
44
|
-
explanation: string;
|
|
45
|
-
stringType: "date" | "time" | "date-time" | "uuid" | "uri" | "integer-string" | "bool-string";
|
|
46
|
-
order: number;
|
|
47
|
-
};
|
|
48
|
-
/** Whether to convert stringified integers to integers */
|
|
49
|
-
inferIntegerStrings: {
|
|
50
|
-
description: string;
|
|
51
|
-
negationDescription: string;
|
|
52
|
-
explanation: string;
|
|
53
|
-
stringType: "date" | "time" | "date-time" | "uuid" | "uri" | "integer-string" | "bool-string";
|
|
54
|
-
order: number;
|
|
55
|
-
};
|
|
56
|
-
/** Whether to convert stringified booleans to boolean values */
|
|
57
|
-
inferBooleanStrings: {
|
|
58
|
-
description: string;
|
|
59
|
-
negationDescription: string;
|
|
60
|
-
explanation: string;
|
|
61
|
-
stringType: "date" | "time" | "date-time" | "uuid" | "uri" | "integer-string" | "bool-string";
|
|
62
|
-
order: number;
|
|
63
|
-
};
|
|
64
|
-
/** Combine similar classes. This doesn't apply to classes from a schema, only from inference. */
|
|
65
|
-
combineClasses: {
|
|
66
|
-
description: string;
|
|
67
|
-
negationDescription: string;
|
|
68
|
-
explanation: string;
|
|
69
|
-
order: number;
|
|
70
|
-
};
|
|
71
|
-
/** Whether to treat $ref as references within JSON */
|
|
72
|
-
ignoreJsonRefs: {
|
|
73
|
-
description: string;
|
|
74
|
-
negationDescription: string;
|
|
75
|
-
explanation: string;
|
|
76
|
-
order: number;
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
export type InferenceFlagName = keyof typeof inferenceFlagsObject;
|
|
80
|
-
export declare const inferenceFlagNames: ("inferMaps" | "inferEnums" | "inferUuids" | "inferDateTimes" | "inferIntegerStrings" | "inferBooleanStrings" | "combineClasses" | "ignoreJsonRefs")[];
|
|
81
|
-
export declare const inferenceFlags: {
|
|
82
|
-
[F in InferenceFlagName]: InferenceFlag;
|
|
83
|
-
};
|
|
84
|
-
export type InferenceFlags = {
|
|
85
|
-
[F in InferenceFlagName]: boolean;
|
|
86
|
-
};
|
|
87
|
-
/**
|
|
88
|
-
* The options type for the main quicktype entry points,
|
|
89
|
-
* `quicktypeMultiFile` and `quicktype`.
|
|
90
|
-
*/
|
|
91
|
-
export type NonInferenceOptions = {
|
|
92
|
-
/**
|
|
93
|
-
* The target language for which to produce code. This can be either an instance of `TargetLanguage`,
|
|
94
|
-
* or a string specifying one of the names for quicktype's built-in target languages. For example,
|
|
95
|
-
* both `cs` and `csharp` will generate C#.
|
|
96
|
-
*/
|
|
97
|
-
lang: string | TargetLanguage;
|
|
98
|
-
/** The input data from which to produce types */
|
|
99
|
-
inputData: InputData;
|
|
100
|
-
/** Put class properties in alphabetical order, instead of in the order found in the JSON */
|
|
101
|
-
alphabetizeProperties: boolean;
|
|
102
|
-
/** Make all class property optional */
|
|
103
|
-
allPropertiesOptional: boolean;
|
|
104
|
-
/**
|
|
105
|
-
* Make top-levels classes from JSON fixed. That means even if two top-level classes are exactly
|
|
106
|
-
* the same, quicktype will still generate two separate types for them.
|
|
107
|
-
*/
|
|
108
|
-
fixedTopLevels: boolean;
|
|
109
|
-
/** Don't render output. This is mainly useful for benchmarking. */
|
|
110
|
-
noRender: boolean;
|
|
111
|
-
/** If given, output these comments at the beginning of the main output file */
|
|
112
|
-
leadingComments: string[] | undefined;
|
|
113
|
-
/** Options for the target language's renderer */
|
|
114
|
-
rendererOptions: RendererOptions;
|
|
115
|
-
/** String to use for one indentation level. If not given, use the target language's default. */
|
|
116
|
-
indentation: string | undefined;
|
|
117
|
-
/** Name of the output file. Note that quicktype will not write that file, but you'll get its name
|
|
118
|
-
* back as a key in the resulting `Map`.
|
|
119
|
-
*/
|
|
120
|
-
outputFilename: string;
|
|
121
|
-
/** Print the type graph to the console at every processing step */
|
|
122
|
-
debugPrintGraph: boolean;
|
|
123
|
-
/** Check that we're propagating all type attributes (unless we actually can't) */
|
|
124
|
-
checkProvenance: boolean;
|
|
125
|
-
/**
|
|
126
|
-
* Print type reconstitution debug information to the console. You'll only ever need this if
|
|
127
|
-
* you're working deep inside quicktype-core.
|
|
128
|
-
*/
|
|
129
|
-
debugPrintReconstitution: boolean;
|
|
130
|
-
/**
|
|
131
|
-
* Print name gathering debug information to the console. This might help to figure out why
|
|
132
|
-
* your types get weird names, but the output is quite arcane.
|
|
133
|
-
*/
|
|
134
|
-
debugPrintGatherNames: boolean;
|
|
135
|
-
/** Print all transformations to the console prior to generating code */
|
|
136
|
-
debugPrintTransformations: boolean;
|
|
137
|
-
/** Print the time it took for each pass to run */
|
|
138
|
-
debugPrintTimes: boolean;
|
|
139
|
-
/** Print schema resolving steps */
|
|
140
|
-
debugPrintSchemaResolving: boolean;
|
|
141
|
-
};
|
|
142
|
-
export type Options = NonInferenceOptions & InferenceFlags;
|
|
143
|
-
export interface RunContext {
|
|
144
|
-
stringTypeMapping: StringTypeMapping;
|
|
145
|
-
debugPrintReconstitution: boolean;
|
|
146
|
-
debugPrintTransformations: boolean;
|
|
147
|
-
debugPrintSchemaResolving: boolean;
|
|
148
|
-
timeSync<T>(name: string, f: () => Promise<T>): Promise<T>;
|
|
149
|
-
time<T>(name: string, f: () => T): T;
|
|
150
|
-
}
|
|
151
|
-
export declare const defaultInferenceFlags: InferenceFlags;
|
|
152
|
-
/**
|
|
153
|
-
* Run quicktype and produce one or more output files.
|
|
154
|
-
*
|
|
155
|
-
* @param options Partial options. For options that are not defined, the
|
|
156
|
-
* defaults will be used.
|
|
157
|
-
*/
|
|
158
|
-
export declare function quicktypeMultiFile(options: Partial<Options>): Promise<MultiFileRenderResult>;
|
|
159
|
-
export declare function quicktypeMultiFileSync(options: Partial<Options>): MultiFileRenderResult;
|
|
160
|
-
/**
|
|
161
|
-
* Combines a multi-file render result into a single output. All the files
|
|
162
|
-
* are concatenated and prefixed with a `//`-style comment giving the
|
|
163
|
-
* filename.
|
|
164
|
-
*/
|
|
165
|
-
export declare function combineRenderResults(result: MultiFileRenderResult): SerializedRenderResult;
|
|
166
|
-
/**
|
|
167
|
-
* Run quicktype like `quicktypeMultiFile`, but if there are multiple
|
|
168
|
-
* output files they will all be squashed into one output, with comments at the
|
|
169
|
-
* start of each file.
|
|
170
|
-
*
|
|
171
|
-
* @param options Partial options. For options that are not defined, the
|
|
172
|
-
* defaults will be used.
|
|
173
|
-
*/
|
|
174
|
-
export declare function quicktype(options: Partial<Options>): Promise<SerializedRenderResult>;
|