quicktype 17.0.6 → 18.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/cli/CompressedJSONFromStream.js +26 -38
- package/dist/cli/GraphQLIntrospection.js +33 -41
- package/dist/cli/TypeSource.d.ts +1 -1
- package/dist/cli/URLGrammar.js +4 -3
- package/dist/cli/index.js +363 -364
- package/dist/quicktype-core/Annotation.js +2 -0
- package/dist/quicktype-core/ConvenienceRenderer.d.ts +17 -17
- package/dist/quicktype-core/ConvenienceRenderer.js +104 -81
- package/dist/quicktype-core/DateTime.js +1 -0
- package/dist/quicktype-core/DeclarationIR.d.ts +1 -1
- package/dist/quicktype-core/DeclarationIR.js +13 -10
- package/dist/quicktype-core/EncodedMarkovChain.js +1 -0
- package/dist/quicktype-core/GatherNames.js +47 -25
- package/dist/quicktype-core/Graph.d.ts +2 -2
- package/dist/quicktype-core/Graph.js +23 -19
- package/dist/quicktype-core/GraphRewriting.d.ts +2 -2
- package/dist/quicktype-core/GraphRewriting.js +65 -54
- package/dist/quicktype-core/MakeTransformations.js +23 -22
- package/dist/quicktype-core/MarkovChain.d.ts +3 -3
- package/dist/quicktype-core/MarkovChain.js +9 -8
- package/dist/quicktype-core/Messages.d.ts +3 -3
- package/dist/quicktype-core/Messages.js +8 -3
- package/dist/quicktype-core/Naming.d.ts +11 -11
- package/dist/quicktype-core/Naming.js +76 -61
- package/dist/quicktype-core/Renderer.d.ts +6 -6
- package/dist/quicktype-core/Renderer.js +34 -17
- package/dist/quicktype-core/RendererOptions.d.ts +5 -5
- package/dist/quicktype-core/RendererOptions.js +6 -3
- package/dist/quicktype-core/Run.d.ts +9 -9
- package/dist/quicktype-core/Run.js +72 -67
- package/dist/quicktype-core/Source.d.ts +3 -3
- package/dist/quicktype-core/Source.js +19 -18
- package/dist/quicktype-core/TargetLanguage.d.ts +10 -10
- package/dist/quicktype-core/TargetLanguage.js +6 -2
- package/dist/quicktype-core/Transformers.d.ts +25 -25
- package/dist/quicktype-core/Transformers.js +94 -66
- package/dist/quicktype-core/Type.d.ts +41 -43
- package/dist/quicktype-core/Type.js +96 -71
- package/dist/quicktype-core/TypeBuilder.d.ts +2 -2
- package/dist/quicktype-core/TypeBuilder.js +53 -47
- package/dist/quicktype-core/TypeGraph.d.ts +4 -4
- package/dist/quicktype-core/TypeGraph.js +49 -40
- package/dist/quicktype-core/TypeUtils.d.ts +2 -2
- package/dist/quicktype-core/TypeUtils.js +23 -22
- package/dist/quicktype-core/UnifyClasses.js +16 -12
- package/dist/quicktype-core/UnionBuilder.d.ts +3 -3
- package/dist/quicktype-core/UnionBuilder.js +33 -30
- package/dist/quicktype-core/attributes/AccessorNames.d.ts +2 -2
- package/dist/quicktype-core/attributes/AccessorNames.js +18 -17
- package/dist/quicktype-core/attributes/Constraints.d.ts +3 -3
- package/dist/quicktype-core/attributes/Constraints.js +8 -4
- package/dist/quicktype-core/attributes/Description.js +6 -5
- package/dist/quicktype-core/attributes/EnumValues.js +4 -3
- package/dist/quicktype-core/attributes/StringTypes.d.ts +1 -1
- package/dist/quicktype-core/attributes/StringTypes.js +24 -21
- package/dist/quicktype-core/attributes/TypeAttributes.d.ts +3 -3
- package/dist/quicktype-core/attributes/TypeAttributes.js +12 -10
- package/dist/quicktype-core/attributes/TypeNames.d.ts +9 -9
- package/dist/quicktype-core/attributes/TypeNames.js +49 -21
- package/dist/quicktype-core/attributes/URIAttributes.d.ts +1 -1
- package/dist/quicktype-core/attributes/URIAttributes.js +10 -6
- package/dist/quicktype-core/index.js +128 -125
- package/dist/quicktype-core/input/CompressedJSON.d.ts +7 -7
- package/dist/quicktype-core/input/CompressedJSON.js +49 -54
- package/dist/quicktype-core/input/FetchingJSONSchemaStore.js +5 -13
- package/dist/quicktype-core/input/Inference.d.ts +2 -2
- package/dist/quicktype-core/input/Inference.js +25 -17
- package/dist/quicktype-core/input/Inputs.d.ts +2 -2
- package/dist/quicktype-core/input/Inputs.js +38 -54
- package/dist/quicktype-core/input/JSONSchemaInput.d.ts +11 -11
- package/dist/quicktype-core/input/JSONSchemaInput.js +503 -523
- package/dist/quicktype-core/input/JSONSchemaStore.d.ts +1 -1
- package/dist/quicktype-core/input/JSONSchemaStore.js +24 -35
- package/dist/quicktype-core/input/PostmanCollection.js +2 -1
- package/dist/quicktype-core/input/io/NodeIO.js +55 -44
- package/dist/quicktype-core/input/io/get-stream/index.js +6 -2
- package/dist/quicktype-core/language/All.js +3 -2
- package/dist/quicktype-core/language/CPlusPlus.d.ts +8 -8
- package/dist/quicktype-core/language/CPlusPlus.js +185 -151
- package/dist/quicktype-core/language/CSharp.d.ts +7 -7
- package/dist/quicktype-core/language/CSharp.js +82 -72
- package/dist/quicktype-core/language/Crystal.d.ts +2 -2
- package/dist/quicktype-core/language/Crystal.js +18 -17
- package/dist/quicktype-core/language/Dart.d.ts +4 -4
- package/dist/quicktype-core/language/Dart.js +36 -34
- package/dist/quicktype-core/language/Elm.d.ts +6 -6
- package/dist/quicktype-core/language/Elm.js +47 -45
- package/dist/quicktype-core/language/Golang.d.ts +4 -4
- package/dist/quicktype-core/language/Golang.js +23 -20
- package/dist/quicktype-core/language/Haskell.d.ts +5 -5
- package/dist/quicktype-core/language/Haskell.js +25 -23
- package/dist/quicktype-core/language/JSONSchema.d.ts +3 -3
- package/dist/quicktype-core/language/JSONSchema.js +17 -16
- package/dist/quicktype-core/language/Java.d.ts +2 -2
- package/dist/quicktype-core/language/Java.js +97 -97
- package/dist/quicktype-core/language/JavaScript.d.ts +7 -7
- package/dist/quicktype-core/language/JavaScript.js +19 -17
- package/dist/quicktype-core/language/JavaScriptPropTypes.js +15 -13
- package/dist/quicktype-core/language/JavaScriptUnicodeMaps.js +12 -11
- package/dist/quicktype-core/language/Kotlin.d.ts +2 -2
- package/dist/quicktype-core/language/Kotlin.js +39 -37
- package/dist/quicktype-core/language/Objective-C.d.ts +3 -3
- package/dist/quicktype-core/language/Objective-C.js +45 -41
- package/dist/quicktype-core/language/Php.d.ts +2 -2
- package/dist/quicktype-core/language/Php.js +66 -41
- package/dist/quicktype-core/language/Pike.d.ts +1 -1
- package/dist/quicktype-core/language/Pike.js +18 -17
- package/dist/quicktype-core/language/Python.d.ts +8 -8
- package/dist/quicktype-core/language/Python.js +63 -64
- package/dist/quicktype-core/language/Rust.d.ts +2 -2
- package/dist/quicktype-core/language/Rust.js +21 -19
- package/dist/quicktype-core/language/Swift.d.ts +7 -7
- package/dist/quicktype-core/language/Swift.js +568 -565
- package/dist/quicktype-core/language/TypeScriptFlow.d.ts +7 -7
- package/dist/quicktype-core/language/TypeScriptFlow.js +28 -26
- package/dist/quicktype-core/language/ruby/index.d.ts +4 -4
- package/dist/quicktype-core/language/ruby/index.js +49 -24
- package/dist/quicktype-core/language/ruby/keywords.js +1 -0
- package/dist/quicktype-core/rewrites/CombineClasses.js +9 -8
- package/dist/quicktype-core/rewrites/ExpandStrings.d.ts +1 -1
- package/dist/quicktype-core/rewrites/ExpandStrings.js +18 -17
- package/dist/quicktype-core/rewrites/FlattenStrings.js +7 -6
- package/dist/quicktype-core/rewrites/FlattenUnions.js +9 -8
- package/dist/quicktype-core/rewrites/InferMaps.js +11 -10
- package/dist/quicktype-core/rewrites/ReplaceObjectType.js +8 -7
- package/dist/quicktype-core/rewrites/ResolveIntersections.js +68 -67
- package/dist/quicktype-core/support/Acronyms.js +3 -1
- package/dist/quicktype-core/support/Chance.js +10 -0
- package/dist/quicktype-core/support/Converters.js +1 -0
- package/dist/quicktype-core/support/Strings.d.ts +4 -4
- package/dist/quicktype-core/support/Strings.js +17 -16
- package/dist/quicktype-core/support/Support.d.ts +1 -1
- package/dist/quicktype-core/support/Support.js +30 -6
- package/dist/quicktype-graphql-input/GraphQLSchema.d.ts +4 -4
- package/dist/quicktype-graphql-input/GraphQLSchema.js +1 -0
- package/dist/quicktype-graphql-input/index.d.ts +1 -1
- package/dist/quicktype-graphql-input/index.js +229 -212
- package/dist/quicktype-typescript-input/index.js +28 -4
- package/package.json +24 -20
|
@@ -1,47 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.JSONSchemaStore = void 0;
|
|
11
4
|
const Support_1 = require("../support/Support");
|
|
12
5
|
class JSONSchemaStore {
|
|
13
|
-
|
|
14
|
-
this._schemas = new Map();
|
|
15
|
-
}
|
|
6
|
+
_schemas = new Map();
|
|
16
7
|
add(address, schema) {
|
|
17
|
-
Support_1.assert(!this._schemas.has(address), "Cannot set a schema for an address twice");
|
|
8
|
+
(0, Support_1.assert)(!this._schemas.has(address), "Cannot set a schema for an address twice");
|
|
18
9
|
this._schemas.set(address, schema);
|
|
19
10
|
}
|
|
20
|
-
get(address, debugPrint) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (schema === undefined) {
|
|
34
|
-
if (debugPrint) {
|
|
35
|
-
console.log(`couldn't fetch ${address}`);
|
|
36
|
-
}
|
|
37
|
-
return undefined;
|
|
38
|
-
}
|
|
11
|
+
async get(address, debugPrint) {
|
|
12
|
+
let schema = this._schemas.get(address);
|
|
13
|
+
if (schema !== undefined) {
|
|
14
|
+
return schema;
|
|
15
|
+
}
|
|
16
|
+
if (debugPrint) {
|
|
17
|
+
console.log(`trying to fetch ${address}`);
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
schema = await this.fetch(address);
|
|
21
|
+
}
|
|
22
|
+
catch { }
|
|
23
|
+
if (schema === undefined) {
|
|
39
24
|
if (debugPrint) {
|
|
40
|
-
console.log(`
|
|
25
|
+
console.log(`couldn't fetch ${address}`);
|
|
41
26
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
if (debugPrint) {
|
|
30
|
+
console.log(`successully fetched ${address}`);
|
|
31
|
+
}
|
|
32
|
+
this.add(address, schema);
|
|
33
|
+
return schema;
|
|
45
34
|
}
|
|
46
35
|
}
|
|
47
36
|
exports.JSONSchemaStore = JSONSchemaStore;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sourcesFromPostmanCollection = void 0;
|
|
3
4
|
const Support_1 = require("../support/Support");
|
|
4
5
|
function isValidJSON(s) {
|
|
5
6
|
try {
|
|
@@ -48,7 +49,7 @@ function sourcesFromPostmanCollection(collectionJSON, collectionJSONAddress) {
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
|
-
processCollection(Support_1.parseJSON(collectionJSON, "Postman collection", collectionJSONAddress));
|
|
52
|
+
processCollection((0, Support_1.parseJSON)(collectionJSON, "Postman collection", collectionJSONAddress));
|
|
52
53
|
const joinedDescription = descriptions.join("\n\n").trim();
|
|
53
54
|
let description = undefined;
|
|
54
55
|
if (joinedDescription !== "") {
|
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
9
24
|
};
|
|
10
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
|
|
26
|
+
exports.readFromFileOrURL = exports.readableFromFileOrURL = void 0;
|
|
27
|
+
const fs = __importStar(require("fs"));
|
|
12
28
|
const browser_or_node_1 = require("browser-or-node");
|
|
13
29
|
const get_stream_1 = require("./get-stream");
|
|
30
|
+
const ts_necessities_1 = require("@glideapps/ts-necessities");
|
|
14
31
|
const index_1 = require("../../index");
|
|
15
32
|
// The typings for this module are screwy
|
|
16
33
|
const isURL = require("is-url");
|
|
@@ -23,7 +40,7 @@ function parseHeaders(httpHeaders) {
|
|
|
23
40
|
if (httpHeader !== undefined && httpHeader.length > 0) {
|
|
24
41
|
const split = httpHeader.indexOf(":");
|
|
25
42
|
if (split < 0) {
|
|
26
|
-
return index_1.panic(`Could not parse HTTP header "${httpHeader}".`);
|
|
43
|
+
return (0, index_1.panic)(`Could not parse HTTP header "${httpHeader}".`);
|
|
27
44
|
}
|
|
28
45
|
const key = httpHeader.slice(0, split).trim();
|
|
29
46
|
const value = httpHeader.slice(split + 1).trim();
|
|
@@ -32,45 +49,39 @@ function parseHeaders(httpHeaders) {
|
|
|
32
49
|
return result;
|
|
33
50
|
}, {});
|
|
34
51
|
}
|
|
35
|
-
function readableFromFileOrURL(fileOrURL, httpHeaders) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
52
|
+
async function readableFromFileOrURL(fileOrURL, httpHeaders) {
|
|
53
|
+
try {
|
|
54
|
+
if (isURL(fileOrURL)) {
|
|
55
|
+
const response = await fetch(fileOrURL, {
|
|
56
|
+
headers: parseHeaders(httpHeaders)
|
|
57
|
+
});
|
|
58
|
+
return response.body;
|
|
59
|
+
}
|
|
60
|
+
else if (browser_or_node_1.isNode) {
|
|
61
|
+
if (fileOrURL === "-") {
|
|
62
|
+
// Cast node readable to isomorphic readable from readable-stream
|
|
63
|
+
return process.stdin;
|
|
43
64
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
const filePath = fs.lstatSync(fileOrURL).isSymbolicLink() ? fs.readlinkSync(fileOrURL) : fileOrURL;
|
|
50
|
-
if (fs.existsSync(filePath)) {
|
|
51
|
-
// Cast node readable to isomorphic readable from readable-stream
|
|
52
|
-
return fs.createReadStream(filePath, "utf8");
|
|
53
|
-
}
|
|
65
|
+
const filePath = fs.lstatSync(fileOrURL).isSymbolicLink() ? fs.readlinkSync(fileOrURL) : fileOrURL;
|
|
66
|
+
if (fs.existsSync(filePath)) {
|
|
67
|
+
// Cast node readable to isomorphic readable from readable-stream
|
|
68
|
+
return fs.createReadStream(filePath, "utf8");
|
|
54
69
|
}
|
|
55
70
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
});
|
|
71
|
+
}
|
|
72
|
+
catch (e) {
|
|
73
|
+
return (0, index_1.messageError)("MiscReadError", { fileOrURL, message: (0, ts_necessities_1.exceptionToString)(e) });
|
|
74
|
+
}
|
|
75
|
+
return (0, index_1.messageError)("DriverInputFileDoesNotExist", { filename: fileOrURL });
|
|
62
76
|
}
|
|
63
77
|
exports.readableFromFileOrURL = readableFromFileOrURL;
|
|
64
|
-
function readFromFileOrURL(fileOrURL, httpHeaders) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return index_1.messageError("MiscReadError", { fileOrURL, message });
|
|
73
|
-
}
|
|
74
|
-
});
|
|
78
|
+
async function readFromFileOrURL(fileOrURL, httpHeaders) {
|
|
79
|
+
const readable = await readableFromFileOrURL(fileOrURL, httpHeaders);
|
|
80
|
+
try {
|
|
81
|
+
return await (0, get_stream_1.getStream)(readable);
|
|
82
|
+
}
|
|
83
|
+
catch (e) {
|
|
84
|
+
return (0, index_1.messageError)("MiscReadError", { fileOrURL, message: (0, ts_necessities_1.exceptionToString)(e) });
|
|
85
|
+
}
|
|
75
86
|
}
|
|
76
87
|
exports.readFromFileOrURL = readFromFileOrURL;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
exports.array = exports.buffer = exports.getStream = void 0;
|
|
7
|
+
const buffer_stream_1 = __importDefault(require("./buffer-stream"));
|
|
4
8
|
function getStream(inputStream, opts = {}) {
|
|
5
9
|
if (!inputStream) {
|
|
6
10
|
return Promise.reject(new Error("Expected a stream"));
|
|
@@ -17,7 +21,7 @@ function getStream(inputStream, opts = {}) {
|
|
|
17
21
|
}
|
|
18
22
|
reject(err);
|
|
19
23
|
};
|
|
20
|
-
stream = buffer_stream_1.default(opts);
|
|
24
|
+
stream = (0, buffer_stream_1.default)(opts);
|
|
21
25
|
inputStream.once("error", error);
|
|
22
26
|
inputStream.pipe(stream);
|
|
23
27
|
stream.on("data", () => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.languageNamed = exports.all = void 0;
|
|
3
4
|
const collection_utils_1 = require("collection-utils");
|
|
4
5
|
const CSharp_1 = require("./CSharp");
|
|
5
6
|
const Golang_1 = require("./Golang");
|
|
@@ -48,9 +49,9 @@ function languageNamed(name, targetLanguages) {
|
|
|
48
49
|
if (targetLanguages === undefined) {
|
|
49
50
|
targetLanguages = exports.all;
|
|
50
51
|
}
|
|
51
|
-
const maybeTargetLanguage = collection_utils_1.iterableFind(targetLanguages, l => l.names.indexOf(name) >= 0 || l.displayName === name);
|
|
52
|
+
const maybeTargetLanguage = (0, collection_utils_1.iterableFind)(targetLanguages, l => l.names.indexOf(name) >= 0 || l.displayName === name);
|
|
52
53
|
if (maybeTargetLanguage !== undefined)
|
|
53
54
|
return maybeTargetLanguage;
|
|
54
|
-
return collection_utils_1.iterableFind(targetLanguages, l => l.extension === name);
|
|
55
|
+
return (0, collection_utils_1.iterableFind)(targetLanguages, l => l.extension === name);
|
|
55
56
|
}
|
|
56
57
|
exports.languageNamed = languageNamed;
|
|
@@ -25,8 +25,8 @@ export declare const cPlusPlusOptions: {
|
|
|
25
25
|
export declare class CPlusPlusTargetLanguage extends TargetLanguage {
|
|
26
26
|
constructor(displayName?: string, names?: string[], extension?: string);
|
|
27
27
|
protected getOptions(): Option<any>[];
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
get supportsUnionsWithBothNumberTypes(): boolean;
|
|
29
|
+
get supportsOptionalClassProperties(): boolean;
|
|
30
30
|
protected makeRenderer(renderContext: RenderContext, untypedOptionValues: {
|
|
31
31
|
[name: string]: any;
|
|
32
32
|
}): CPlusPlusRenderer;
|
|
@@ -67,18 +67,18 @@ export declare enum MemberNames {
|
|
|
67
67
|
GetPattern = 13,
|
|
68
68
|
SetPattern = 14
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
type ConstraintMember = {
|
|
71
71
|
name: MemberNames;
|
|
72
72
|
getter: MemberNames;
|
|
73
73
|
setter: MemberNames;
|
|
74
74
|
cppType: string;
|
|
75
75
|
cppConstType?: string;
|
|
76
76
|
};
|
|
77
|
-
export
|
|
77
|
+
export type IncludeRecord = {
|
|
78
78
|
kind: IncludeKind | undefined /** How to include that */;
|
|
79
79
|
typeKind: TypeKind | undefined /** What exactly to include */;
|
|
80
80
|
};
|
|
81
|
-
export
|
|
81
|
+
export type TypeRecord = {
|
|
82
82
|
name: Name;
|
|
83
83
|
type: Type;
|
|
84
84
|
level: number;
|
|
@@ -89,8 +89,8 @@ export declare type TypeRecord = {
|
|
|
89
89
|
* We map each and every unique type to a include kind, e.g. how
|
|
90
90
|
* to include the given type
|
|
91
91
|
*/
|
|
92
|
-
export
|
|
93
|
-
export
|
|
92
|
+
export type IncludeMap = Map<string, IncludeRecord>;
|
|
93
|
+
export type TypeContext = {
|
|
94
94
|
needsForwardIndirection: boolean;
|
|
95
95
|
needsOptionalIndirection: boolean;
|
|
96
96
|
inJsonNamespace: boolean;
|
|
@@ -145,7 +145,7 @@ export declare class CPlusPlusRenderer extends ConvenienceRenderer {
|
|
|
145
145
|
protected emitInclude(global: boolean, name: Sourcelike): void;
|
|
146
146
|
protected startFile(basename: Sourcelike, includeHelper?: boolean): void;
|
|
147
147
|
protected finishFile(): void;
|
|
148
|
-
protected
|
|
148
|
+
protected get needsTypeDeclarationBeforeUse(): boolean;
|
|
149
149
|
protected canBeForwardDeclared(t: Type): boolean;
|
|
150
150
|
protected emitDescriptionBlock(lines: Sourcelike[]): void;
|
|
151
151
|
protected emitBlock(line: Sourcelike, withSemicolon: boolean, f: () => void, withIndent?: boolean): void;
|