Comparing version 0.9.0 to 0.10.0
@@ -6,2 +6,26 @@ # Change Log | ||
# [0.10.0](https://github.com/awslabs/jsii/compare/v0.9.0...v0.10.0) (2019-04-16) | ||
### Bug Fixes | ||
* **jsii:** flatten out dependency list ([#454](https://github.com/awslabs/jsii/issues/454)) ([ebdd10d](https://github.com/awslabs/jsii/commit/ebdd10d)), closes [#453](https://github.com/awslabs/jsii/issues/453) | ||
* **jsii-spec:** show deep validation errors ([#452](https://github.com/awslabs/jsii/issues/452)) ([4d84e0b](https://github.com/awslabs/jsii/commit/4d84e0b)) | ||
### Features | ||
* **jsii-spec:** Model parameter optionality ([#432](https://github.com/awslabs/jsii/issues/432)) ([21e485a](https://github.com/awslabs/jsii/commit/21e485a)), closes [#296](https://github.com/awslabs/jsii/issues/296) [#414](https://github.com/awslabs/jsii/issues/414) | ||
### BREAKING CHANGES | ||
* **jsii-spec:** JSII assemblies generated by older versions of the tool | ||
will fail loading with this new version, and vice-versa. Re-compile your | ||
projects in order to fix this. | ||
# [0.9.0](https://github.com/awslabs/jsii/compare/v0.8.2...v0.9.0) (2019-04-04) | ||
@@ -8,0 +32,0 @@ |
@@ -9,5 +9,6 @@ export declare const SPEC_FILE_NAME = ".jsii"; | ||
*/ | ||
schema: SchemaVersion.V1_0; | ||
schema: SchemaVersion.LATEST; | ||
/** | ||
* The name of the assembly | ||
* | ||
* @minLength 1 | ||
@@ -38,2 +39,9 @@ */ | ||
url: string; | ||
/** | ||
* If the package is not in the root directory (for example, when part | ||
* of a monorepo), you should specify the directory in which it lives. | ||
* | ||
* @default the root of the repository | ||
*/ | ||
directory?: string; | ||
}; | ||
@@ -46,6 +54,10 @@ /** | ||
* Additional contributors to this package. | ||
* | ||
* @default none | ||
*/ | ||
contributors?: Person[]; | ||
/** | ||
* A fingerprint that can be used to determine if the specification has changed. | ||
* A fingerprint that can be used to determine if the specification has | ||
* changed. | ||
* | ||
* @minLength 1 | ||
@@ -69,8 +81,13 @@ */ | ||
/** | ||
* A map of target name to configuration, which is used when generating packages for | ||
* various languages. | ||
* A map of target name to configuration, which is used when generating | ||
* packages for various languages. | ||
* | ||
* @default none | ||
*/ | ||
targets?: AssemblyTargets; | ||
/** | ||
* Dependencies on other assemblies (with semver), the key is the JSII assembly name. | ||
* Direct dependencies on other assemblies (with semver), the key is the JSII | ||
* assembly name. | ||
* | ||
* @default none | ||
*/ | ||
@@ -81,4 +98,15 @@ dependencies?: { | ||
/** | ||
* List if bundled dependencies (these are not expected to be jsii assemblies). | ||
* Closure of all dependency assemblies, direct and transitive. | ||
* | ||
* @default none | ||
*/ | ||
dependencyClosure?: { | ||
[assembly: string]: PackageVersion; | ||
}; | ||
/** | ||
* List if bundled dependencies (these are not expected to be jsii | ||
* assemblies). | ||
* | ||
* @default none | ||
*/ | ||
bundled?: { | ||
@@ -89,2 +117,4 @@ [module: string]: string; | ||
* All types in the assembly, keyed by their fully-qualified-name | ||
* | ||
* @default none | ||
*/ | ||
@@ -96,2 +126,4 @@ types?: { | ||
* The top-level readme document for this assembly (if any). | ||
* | ||
* @default none | ||
*/ | ||
@@ -101,10 +133,2 @@ readme?: { | ||
}; | ||
/** | ||
* Source directory of the module root, relative to the repository root. | ||
* | ||
* If undefined or the empty string, no source location information is | ||
* available. If the module root is equal to the root of the repository, | ||
* the value is '.'. | ||
*/ | ||
locationInRepository?: string; | ||
} | ||
@@ -115,5 +139,9 @@ /** | ||
export declare enum SchemaVersion { | ||
V1_0 = "jsii/1.0" | ||
LATEST = "jsii/0.10.0" | ||
} | ||
/** | ||
* Fully Qualified Name | ||
*/ | ||
export declare type FQN = string; | ||
/** | ||
* Metadata about people or organizations associated with the project that | ||
@@ -126,3 +154,5 @@ * resulted in the Assembly. Some of this metadata is required in order to | ||
export interface Person { | ||
/** The name of the person */ | ||
/** | ||
* The name of the person | ||
*/ | ||
name: string; | ||
@@ -134,7 +164,19 @@ /** | ||
roles: string[]; | ||
/** The email of the person */ | ||
/** | ||
* The email of the person | ||
* | ||
* @default none | ||
*/ | ||
email?: string; | ||
/** The URL for the person */ | ||
/** | ||
* The URL for the person | ||
* | ||
* @default none | ||
*/ | ||
url?: string; | ||
/** If true, this person is, in fact, an organization */ | ||
/** | ||
* If true, this person is, in fact, an organization | ||
* | ||
* @default false | ||
*/ | ||
organization?: boolean; | ||
@@ -146,3 +188,5 @@ } | ||
export interface AssemblyTargets { | ||
/** Information about a particular language's targets */ | ||
/** | ||
* Information about a particular language's targets | ||
*/ | ||
[language: string]: { | ||
@@ -158,27 +202,12 @@ [key: string]: any; | ||
* Version of the package. | ||
* | ||
* @minLength 1 | ||
*/ | ||
version: string; | ||
/** Targets for a given assembly. */ | ||
targets?: AssemblyTargets; | ||
/** Dependencies of this dependency */ | ||
dependencies?: { | ||
[assembly: string]: PackageVersion; | ||
}; | ||
/** | ||
* Indicates if this dependency is a direct (peer) dependency or a | ||
* transitive dependency. | ||
* Targets for a given assembly. | ||
* | ||
* Peer dependencies are expected to be explicitly defined by the user of | ||
* this library instead of brought in as transitive dependencies. | ||
* | ||
* jsii enforces that any direct dependency on another jsii module is also | ||
* defined as a peerDependency. Otherwise, it would be impossible to safely | ||
* use two versions of this dependency in a closure. | ||
* | ||
* @see https://github.com/awslabs/aws-cdk/issues/979 | ||
* @see https://github.com/awslabs/jsii/issues/361 | ||
* @see https://nodejs.org/en/blog/npm/peer-dependencies/ | ||
* @default none | ||
*/ | ||
peer?: boolean; | ||
targets?: AssemblyTargets; | ||
} | ||
@@ -206,4 +235,6 @@ /** | ||
* | ||
* The first part of the documentation before hitting a `@remarks` tags, or the first | ||
* line of the doc comment block if there is no `@remarks` tag. | ||
* The first part of the documentation before hitting a `@remarks` tags, or | ||
* the first line of the doc comment block if there is no `@remarks` tag. | ||
* | ||
* @default none | ||
*/ | ||
@@ -214,15 +245,23 @@ summary?: string; | ||
* | ||
* Either the explicitly tagged `@remarks` section, otherwise everything past the | ||
* first paragraph if there is no `@remarks` tag. | ||
* Either the explicitly tagged `@remarks` section, otherwise everything | ||
* past the first paragraph if there is no `@remarks` tag. | ||
* | ||
* @default none | ||
*/ | ||
remarks?: string; | ||
/** | ||
* If present, this block indicates that an API item is no longer supported and may be | ||
* removed in a future release. The `@deprecated` tag must be followed by a sentence | ||
* describing the recommended alternative. Deprecation recursively applies to members | ||
* of a container. For example, if a class is deprecated, then so are all of its members. | ||
* If present, this block indicates that an API item is no longer supported | ||
* and may be removed in a future release. The `@deprecated` tag must be | ||
* followed by a sentence describing the recommended alternative. | ||
* Deprecation recursively applies to members of a container. For example, | ||
* if a class is deprecated, then so are all of its members. | ||
* | ||
* @default none | ||
*/ | ||
deprecated?: string; | ||
/** | ||
* The `@returns` block for this doc comment, or undefined if there is not one. | ||
* The `@returns` block for this doc comment, or undefined if there is not | ||
* one. | ||
* | ||
* @default none | ||
*/ | ||
@@ -239,2 +278,4 @@ returns?: string; | ||
* blocks. | ||
* | ||
* @default none | ||
*/ | ||
@@ -244,9 +285,13 @@ example?: string; | ||
* A `@see` link with more information | ||
* | ||
* @default none | ||
*/ | ||
see?: string; | ||
/** | ||
* Whether this class or interface was intended to be subclassed/implemented by library users. | ||
* Whether this class or interface was intended to be subclassed/implemented | ||
* by library users. | ||
* | ||
* Classes intended for subclassing, and interfaces intended to be implemented | ||
* by consumers, are held to stricter standards of API compatibility. | ||
* Classes intended for subclassing, and interfaces intended to be | ||
* implemented by consumers, are held to stricter standards of API | ||
* compatibility. | ||
* | ||
@@ -258,2 +303,4 @@ * @default false | ||
* Description of the default | ||
* | ||
* @default none | ||
*/ | ||
@@ -263,2 +310,4 @@ default?: string; | ||
* Custom tags that are not any of the default ones | ||
* | ||
* @default none | ||
*/ | ||
@@ -269,4 +318,13 @@ custom?: { | ||
} | ||
/** | ||
* API Stability levels. | ||
*/ | ||
export declare enum Stability { | ||
/** | ||
* Experimental APIs may change in breaking ways in a minor version update. | ||
*/ | ||
Experimental = "experimental", | ||
/** | ||
* Stable APIs may not change in breaking ways without a major version bump. | ||
*/ | ||
Stable = "stable" | ||
@@ -278,2 +336,7 @@ } | ||
export interface Documentable { | ||
/** | ||
* Documentation for this entity. | ||
* | ||
* @default none | ||
*/ | ||
docs?: Docs; | ||
@@ -291,2 +354,4 @@ } | ||
* to the location of the source in the module the assembly was built from. | ||
* | ||
* @default none | ||
*/ | ||
@@ -299,3 +364,9 @@ locationInModule?: SourceLocation; | ||
export declare enum CollectionKind { | ||
/** | ||
* An array, or a list of some element type. | ||
*/ | ||
Array = "array", | ||
/** | ||
* A map of a string to some element type. | ||
*/ | ||
Map = "map" | ||
@@ -307,5 +378,17 @@ } | ||
export declare enum PrimitiveType { | ||
/** | ||
* A JSON date (represented as it's ISO-8601 string form). | ||
*/ | ||
Date = "date", | ||
/** | ||
* A plain string. | ||
*/ | ||
String = "string", | ||
/** | ||
* A number (integer or float). | ||
*/ | ||
Number = "number", | ||
/** | ||
* A boolean value. | ||
*/ | ||
Boolean = "boolean", | ||
@@ -317,3 +400,4 @@ /** | ||
/** | ||
* Value with "any" or "unknown" type (aka Object) | ||
* Value with "any" or "unknown" type (aka Object). Values typed `any` may | ||
* be `null` or `undefined`. | ||
*/ | ||
@@ -323,22 +407,29 @@ Any = "any" | ||
/** | ||
* A reference to a type (primitive, collection or fqn). | ||
* A value that can possibly be optional. | ||
*/ | ||
export declare type TypeReference = TypeReferenceBase & (NamedTypeReference | PrimitiveTypeReference | CollectionTypeReference | UnionTypeReference); | ||
/** | ||
* Common attributes of a TypeReference. | ||
*/ | ||
export interface TypeReferenceBase { | ||
export interface OptionalValue { | ||
/** | ||
* Indicates if this value is optional. | ||
* Determines whether the value is, indeed, optional. | ||
* | ||
* @default false | ||
*/ | ||
optional?: boolean; | ||
/** | ||
* Indicates if this type refers to a promise. | ||
* The declared type of the value, when it's present. | ||
*/ | ||
promise?: boolean; | ||
type: TypeReference; | ||
} | ||
/** | ||
* Reference to a named type, defined by this assembly or one of it's dependencies. | ||
* A reference to a type (primitive, collection or fqn). | ||
*/ | ||
export interface NamedTypeReference extends TypeReferenceBase { | ||
export declare type TypeReference = NamedTypeReference | PrimitiveTypeReference | CollectionTypeReference | UnionTypeReference; | ||
/** | ||
* The standard representation of the `any` type (includes optionality marker). | ||
*/ | ||
export declare const CANONICAL_ANY: Readonly<PrimitiveTypeReference>; | ||
/** | ||
* Reference to a named type, defined by this assembly or one of its | ||
* dependencies. | ||
*/ | ||
export interface NamedTypeReference { | ||
/** | ||
@@ -348,3 +439,3 @@ * The fully-qualified-name of the type (can be located in the | ||
*/ | ||
fqn: string; | ||
fqn: FQN; | ||
} | ||
@@ -355,3 +446,3 @@ export declare function isNamedTypeReference(ref: TypeReference | undefined): ref is NamedTypeReference; | ||
*/ | ||
export interface PrimitiveTypeReference extends TypeReferenceBase { | ||
export interface PrimitiveTypeReference { | ||
/** | ||
@@ -367,3 +458,3 @@ * If this is a reference to a primitive type, this will include the | ||
*/ | ||
export interface CollectionTypeReference extends TypeReferenceBase { | ||
export interface CollectionTypeReference { | ||
collection: { | ||
@@ -384,5 +475,6 @@ /** | ||
*/ | ||
export interface UnionTypeReference extends TypeReferenceBase { | ||
export interface UnionTypeReference { | ||
/** | ||
* Indicates that this is a union type, which means it can be one of a set of types. | ||
* Indicates that this is a union type, which means it can be one of a set | ||
* of types. | ||
*/ | ||
@@ -392,2 +484,3 @@ union: { | ||
* All the possible types (including the primary type). | ||
* | ||
* @minItems 2 | ||
@@ -400,12 +493,14 @@ */ | ||
/** | ||
* Methods and properties can be overridden from parent classes or implemented from interfaces. | ||
* Methods and properties can be overridden from parent classes or implemented | ||
* from interfaces. | ||
*/ | ||
export interface Overridable { | ||
/** | ||
* The name of the parent type (class or interface) that this entity overrides or implements. If undefined, then | ||
* this entity is the first in it's hierarchy to declare this entity. | ||
* The FQN of the parent type (class or interface) that this entity | ||
* overrides or implements. If undefined, then this entity is the first in | ||
* it's hierarchy to declare this entity. | ||
* | ||
* @default undefined | ||
* @default this member is not overriding anything | ||
*/ | ||
overrides?: NamedTypeReference; | ||
overrides?: FQN; | ||
} | ||
@@ -415,5 +510,6 @@ /** | ||
*/ | ||
export interface Property extends Documentable, Overridable, SourceLocatable { | ||
export interface Property extends Documentable, OptionalValue, Overridable, SourceLocatable { | ||
/** | ||
* The name of the property. | ||
* | ||
* @minLength 1 | ||
@@ -423,7 +519,5 @@ */ | ||
/** | ||
* The type of the property. | ||
*/ | ||
type: TypeReference; | ||
/** | ||
* Indicates if this property only has a getter (immutable). | ||
* | ||
* @default false | ||
*/ | ||
@@ -433,2 +527,4 @@ immutable?: boolean; | ||
* Indicates if this property is protected (otherwise it is public) | ||
* | ||
* @default false | ||
*/ | ||
@@ -438,2 +534,4 @@ protected?: boolean; | ||
* Indicates if this property is abstract | ||
* | ||
* @default false | ||
*/ | ||
@@ -443,2 +541,4 @@ abstract?: boolean; | ||
* Indicates if this is a static property. | ||
* | ||
* @default false | ||
*/ | ||
@@ -448,4 +548,6 @@ static?: boolean; | ||
* A hint that indicates that this static, immutable property is initialized | ||
* during startup. This allows emitting "const" idioms in different target languages. | ||
* Implies `static` and `immutable`. | ||
* during startup. This allows emitting "const" idioms in different target | ||
* languages. Implies `static` and `immutable`. | ||
* | ||
* @default false | ||
*/ | ||
@@ -457,5 +559,6 @@ const?: boolean; | ||
*/ | ||
export interface Parameter extends Documentable { | ||
export interface Parameter extends Documentable, OptionalValue { | ||
/** | ||
* The name of the parameter. | ||
* | ||
* @minLength 1 | ||
@@ -465,46 +568,71 @@ */ | ||
/** | ||
* The type of the parameter. | ||
* Whether this is the last parameter of a variadic method. In such cases, | ||
* the `#type` attribute is the type of each individual item of the variadic | ||
* arguments list (as opposed to some array type, as for example TypeScript | ||
* would model it). | ||
* | ||
* @default false | ||
*/ | ||
type: TypeReference; | ||
/** | ||
* Whather this argument is the "rest" of a variadic signature. | ||
* The ``#type`` is that of every individual argument of the variadic list. | ||
*/ | ||
variadic?: boolean; | ||
} | ||
/** | ||
* Represents a method. | ||
* An Initializer or a Method. | ||
*/ | ||
export interface Method extends Documentable, Overridable, SourceLocatable { | ||
export interface Callable extends Documentable, Overridable, SourceLocatable { | ||
/** | ||
* The name of the method. Undefined if this method is a initializer. | ||
* The parameters of the Initializer or Method. | ||
* | ||
* @default none | ||
*/ | ||
name?: string; | ||
parameters?: Parameter[]; | ||
/** | ||
* The return type of the method (undefined if void or initializer) | ||
* Indicates if this Initializer or Method is protected (otherwise it is | ||
* public, since private members are not modeled). | ||
* | ||
* @default false | ||
*/ | ||
returns?: TypeReference; | ||
protected?: boolean; | ||
/** | ||
* The parameters of the method/initializer | ||
* Indicates whether this Initializer or Method is variadic or not. When | ||
* ``true``, the last element of ``#parameters`` will also be flagged | ||
* ``#variadic``. | ||
* | ||
* @default false | ||
*/ | ||
parameters?: Parameter[]; | ||
variadic?: boolean; | ||
} | ||
/** | ||
* An initializer. | ||
*/ | ||
export declare type Initializer = Callable; | ||
/** | ||
* A method with a name (i.e: not an initializer). | ||
*/ | ||
export interface Method extends Callable { | ||
/** | ||
* True if this method is an initializer, in which case it won't have a return type | ||
* The name of the method. Undefined if this method is a initializer. | ||
*/ | ||
initializer?: boolean; | ||
name: string; | ||
/** | ||
* Indicates if this method is protected (otherwise it is public) | ||
* The return type of the method (`undefined` if `void`) | ||
* | ||
* @default void | ||
*/ | ||
protected?: boolean; | ||
returns?: OptionalValue; | ||
/** | ||
* Is this method an abstract method (this means the class will also be an abstract class) | ||
* | ||
* @default false | ||
*/ | ||
abstract?: boolean; | ||
/** | ||
* Indicates whether this method is variadic or not. When ``true``, the last | ||
* element of ``#parameters`` will also be flagged ``#variadic``. | ||
* Indicates if this is an asynchronous method (it will return a promise). | ||
* | ||
* @default false | ||
*/ | ||
variadic?: boolean; | ||
async?: boolean; | ||
/** | ||
* Indicates if this is a static method. | ||
* | ||
* @default false | ||
*/ | ||
@@ -514,2 +642,8 @@ static?: boolean; | ||
/** | ||
* Determines whether a Callable is a Method or not. | ||
* | ||
* @param callable the callable to be checked. | ||
*/ | ||
export declare function isMethod(callable: Callable): callable is Method; | ||
/** | ||
* Represents a type definition (not a type reference). | ||
@@ -524,7 +658,9 @@ */ | ||
* The fully qualified name of the type (``<assembly>.<namespace>.<name>``) | ||
* | ||
* @minLength 3 | ||
*/ | ||
fqn: string; | ||
fqn: FQN; | ||
/** | ||
* The name of the assembly the type belongs to. | ||
* | ||
* @minLength 1 | ||
@@ -537,2 +673,4 @@ */ | ||
* namespace-qualified (e.g: ``<namespace>.<name>``), then the current type is a nested type. | ||
* | ||
* @default none | ||
*/ | ||
@@ -542,2 +680,3 @@ namespace?: string; | ||
* The simple name of the type (MyClass). | ||
* | ||
* @minLength 1 | ||
@@ -565,11 +704,17 @@ */ | ||
/** | ||
* Base class (optional). | ||
* The FQN of the base class of this class, if it has one. | ||
* | ||
* @default no base class | ||
*/ | ||
base?: NamedTypeReference; | ||
base?: FQN; | ||
/** | ||
* Initializer (constructor) method. | ||
* | ||
* @default no initializer | ||
*/ | ||
initializer?: Method; | ||
initializer?: Initializer; | ||
/** | ||
* List of properties. | ||
* | ||
* @default none | ||
*/ | ||
@@ -579,2 +724,4 @@ properties?: Property[]; | ||
* List of methods. | ||
* | ||
* @default none | ||
*/ | ||
@@ -584,8 +731,13 @@ methods?: Method[]; | ||
* Indicates if this class is an abstract class. | ||
* | ||
* @default false | ||
*/ | ||
abstract?: boolean; | ||
/** | ||
* The set of interfaces implemented by this class. | ||
* The FQNs of the interfaces this class implements, if any. | ||
* | ||
* @default none | ||
* @uniqueItems true | ||
*/ | ||
interfaces?: NamedTypeReference[]; | ||
interfaces?: FQN[]; | ||
} | ||
@@ -596,7 +748,12 @@ export declare function isClassType(type: Type | undefined): type is ClassType; | ||
/** | ||
* All the base interfaces that this interface extends. | ||
* The FQNs of the interfaces this interface extends, if any. | ||
* | ||
* @default none | ||
* @uniqueItems true | ||
*/ | ||
interfaces?: NamedTypeReference[]; | ||
interfaces?: FQN[]; | ||
/** | ||
* List of methods. | ||
* | ||
* @default none | ||
*/ | ||
@@ -606,2 +763,4 @@ methods?: Method[]; | ||
* List of properties. | ||
* | ||
* @default none | ||
*/ | ||
@@ -615,2 +774,4 @@ properties?: Property[]; | ||
* adheres to this interface. | ||
* | ||
* @default false | ||
*/ | ||
@@ -645,4 +806,4 @@ datatype?: boolean; | ||
/** | ||
* Return a string representation of the given type reference | ||
* Return a string representation of the given type reference. | ||
*/ | ||
export declare function describeTypeReference(a?: TypeReference): string; | ||
export declare function describeTypeReference(type?: TypeReference): string; |
@@ -9,7 +9,16 @@ "use strict"; | ||
(function (SchemaVersion) { | ||
SchemaVersion["V1_0"] = "jsii/1.0"; | ||
SchemaVersion["LATEST"] = "jsii/0.10.0"; | ||
})(SchemaVersion = exports.SchemaVersion || (exports.SchemaVersion = {})); | ||
/** | ||
* API Stability levels. | ||
*/ | ||
var Stability; | ||
(function (Stability) { | ||
/** | ||
* Experimental APIs may change in breaking ways in a minor version update. | ||
*/ | ||
Stability["Experimental"] = "experimental"; | ||
/** | ||
* Stable APIs may not change in breaking ways without a major version bump. | ||
*/ | ||
Stability["Stable"] = "stable"; | ||
@@ -22,3 +31,9 @@ })(Stability = exports.Stability || (exports.Stability = {})); | ||
(function (CollectionKind) { | ||
/** | ||
* An array, or a list of some element type. | ||
*/ | ||
CollectionKind["Array"] = "array"; | ||
/** | ||
* A map of a string to some element type. | ||
*/ | ||
CollectionKind["Map"] = "map"; | ||
@@ -31,5 +46,17 @@ })(CollectionKind = exports.CollectionKind || (exports.CollectionKind = {})); | ||
(function (PrimitiveType) { | ||
/** | ||
* A JSON date (represented as it's ISO-8601 string form). | ||
*/ | ||
PrimitiveType["Date"] = "date"; | ||
/** | ||
* A plain string. | ||
*/ | ||
PrimitiveType["String"] = "string"; | ||
/** | ||
* A number (integer or float). | ||
*/ | ||
PrimitiveType["Number"] = "number"; | ||
/** | ||
* A boolean value. | ||
*/ | ||
PrimitiveType["Boolean"] = "boolean"; | ||
@@ -41,6 +68,11 @@ /** | ||
/** | ||
* Value with "any" or "unknown" type (aka Object) | ||
* Value with "any" or "unknown" type (aka Object). Values typed `any` may | ||
* be `null` or `undefined`. | ||
*/ | ||
PrimitiveType["Any"] = "any"; | ||
})(PrimitiveType = exports.PrimitiveType || (exports.PrimitiveType = {})); | ||
/** | ||
* The standard representation of the `any` type (includes optionality marker). | ||
*/ | ||
exports.CANONICAL_ANY = { primitive: PrimitiveType.Any }; | ||
function isNamedTypeReference(ref) { | ||
@@ -63,2 +95,11 @@ return ref != null && !!ref.fqn; | ||
/** | ||
* Determines whether a Callable is a Method or not. | ||
* | ||
* @param callable the callable to be checked. | ||
*/ | ||
function isMethod(callable) { | ||
return !!callable.name; | ||
} | ||
exports.isMethod = isMethod; | ||
/** | ||
* Kinds of types. | ||
@@ -92,26 +133,20 @@ */ | ||
/** | ||
* Return a string representation of the given type reference | ||
* Return a string representation of the given type reference. | ||
*/ | ||
function describeTypeReference(a) { | ||
if (a === undefined) { | ||
return '(none)'; | ||
function describeTypeReference(type) { | ||
if (type === undefined) { | ||
return 'void'; | ||
} | ||
const optionalMarker = a.optional ? '?' : ''; | ||
if (isNamedTypeReference(a)) { | ||
return `${a.fqn}${optionalMarker}`; | ||
if (isNamedTypeReference(type)) { | ||
return type.fqn; | ||
} | ||
if (isPrimitiveTypeReference(a)) { | ||
return `${a.primitive}${optionalMarker}`; | ||
if (isPrimitiveTypeReference(type)) { | ||
return type.primitive; | ||
} | ||
if (isCollectionTypeReference(a)) { | ||
return `${a.collection.kind}<${describeTypeReference(a.collection.elementtype)}>${optionalMarker}`; | ||
if (isCollectionTypeReference(type)) { | ||
return `${type.collection.kind}<${describeTypeReference(type.collection.elementtype)}>`; | ||
} | ||
if (isUnionTypeReference(a)) { | ||
const unionType = a.union.types.map(describeTypeReference).join(' | '); | ||
if (a.optional) { | ||
return `(${unionType})${optionalMarker}`; | ||
} | ||
else { | ||
return unionType; | ||
} | ||
if (isUnionTypeReference(type)) { | ||
const unionType = type.union.types.map(describeTypeReference).join(' | '); | ||
return unionType; | ||
} | ||
@@ -118,0 +153,0 @@ throw new Error('Unrecognized type reference'); |
@@ -8,3 +8,4 @@ "use strict"; | ||
const validator = new jsonschema.Validator(); | ||
const result = validator.validate(obj, exports.schema); | ||
validator.addSchema(exports.schema); // For definitions | ||
const result = validator.validate(obj, exports.schema, { nestedErrors: true }); // nestedErrors does exist but is not in the TypeScript definitions | ||
if (result.valid) { | ||
@@ -11,0 +12,0 @@ return obj; |
{ | ||
"name": "jsii-spec", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"description": "Specification for jsii assemblies", | ||
@@ -16,5 +16,5 @@ "main": "lib/index.js", | ||
"@types/nodeunit": "^0.0.30", | ||
"jsii-build-tools": "^0.9.0", | ||
"jsii-build-tools": "^0.10.0", | ||
"nodeunit": "^0.11.3", | ||
"typescript": "^3.3.3333", | ||
"typescript": "^3.4.2", | ||
"typescript-json-schema": "^0.34.0" | ||
@@ -21,0 +21,0 @@ }, |
@@ -16,6 +16,8 @@ { | ||
}, | ||
"description": "List if bundled dependencies (these are not expected to be jsii assemblies).", | ||
"default": "none", | ||
"description": "List if bundled dependencies (these are not expected to be jsii\nassemblies).", | ||
"type": "object" | ||
}, | ||
"contributors": { | ||
"default": "none", | ||
"description": "Additional contributors to this package.", | ||
@@ -31,5 +33,14 @@ "items": { | ||
}, | ||
"description": "Dependencies on other assemblies (with semver), the key is the JSII assembly name.", | ||
"default": "none", | ||
"description": "Direct dependencies on other assemblies (with semver), the key is the JSII\nassembly name.", | ||
"type": "object" | ||
}, | ||
"dependencyClosure": { | ||
"additionalProperties": { | ||
"$ref": "#/definitions/PackageVersion" | ||
}, | ||
"default": "none", | ||
"description": "Closure of all dependency assemblies, direct and transitive.", | ||
"type": "object" | ||
}, | ||
"description": { | ||
@@ -41,6 +52,7 @@ "description": "Description of the assembly, maps to \"description\" from package.json\nThis is required since some package managers (like Maven) require it.", | ||
"$ref": "#/definitions/Docs", | ||
"description": "Key value pairs of documentation nodes.\nBased on TSDoc." | ||
"default": "none", | ||
"description": "Documentation for this entity." | ||
}, | ||
"fingerprint": { | ||
"description": "A fingerprint that can be used to determine if the specification has changed.", | ||
"description": "A fingerprint that can be used to determine if the specification has\nchanged.", | ||
"minLength": 1, | ||
@@ -62,6 +74,2 @@ "type": "string" | ||
}, | ||
"locationInRepository": { | ||
"description": "Source directory of the module root, relative to the repository root.\n\nIf undefined or the empty string, no source location information is\navailable. If the module root is equal to the root of the repository,\nthe value is '.'.", | ||
"type": "string" | ||
}, | ||
"name": { | ||
@@ -73,2 +81,3 @@ "description": "The name of the assembly", | ||
"readme": { | ||
"default": "none", | ||
"description": "The top-level readme document for this assembly (if any).", | ||
@@ -88,2 +97,7 @@ "properties": { | ||
"properties": { | ||
"directory": { | ||
"default": "the root of the repository", | ||
"description": "If the package is not in the root directory (for example, when part\nof a monorepo), you should specify the directory in which it lives.", | ||
"type": "string" | ||
}, | ||
"type": { | ||
@@ -107,3 +121,3 @@ "description": "The type of the repository (``git``, ``svn``, ...)", | ||
"enum": [ | ||
"jsii/1.0" | ||
"jsii/0.10.0" | ||
], | ||
@@ -114,3 +128,4 @@ "type": "string" | ||
"$ref": "#/definitions/AssemblyTargets", | ||
"description": "A map of target name to configuration, which is used when generating packages for\nvarious languages." | ||
"default": "none", | ||
"description": "A map of target name to configuration, which is used when generating\npackages for various languages." | ||
}, | ||
@@ -152,2 +167,3 @@ "types": { | ||
}, | ||
"default": "none", | ||
"description": "All types in the assembly, keyed by their fully-qualified-name", | ||
@@ -185,2 +201,41 @@ "type": "object" | ||
}, | ||
"Callable": { | ||
"description": "An Initializer or a Method.", | ||
"properties": { | ||
"docs": { | ||
"$ref": "#/definitions/Docs", | ||
"default": "none", | ||
"description": "Documentation for this entity." | ||
}, | ||
"locationInModule": { | ||
"$ref": "#/definitions/SourceLocation", | ||
"default": "none", | ||
"description": "Where in the module this definition was found\n\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\nfile combining compiled code and its manifest, whereas this is referring\nto the location of the source in the module the assembly was built from." | ||
}, | ||
"overrides": { | ||
"default": "this member is not overriding anything", | ||
"description": "The FQN of the parent type (class or interface) that this entity\noverrides or implements. If undefined, then this entity is the first in\nit's hierarchy to declare this entity.", | ||
"type": "string" | ||
}, | ||
"parameters": { | ||
"default": "none", | ||
"description": "The parameters of the Initializer or Method.", | ||
"items": { | ||
"$ref": "#/definitions/Parameter" | ||
}, | ||
"type": "array" | ||
}, | ||
"protected": { | ||
"default": false, | ||
"description": "Indicates if this Initializer or Method is protected (otherwise it is\npublic, since private members are not modeled).", | ||
"type": "boolean" | ||
}, | ||
"variadic": { | ||
"default": false, | ||
"description": "Indicates whether this Initializer or Method is variadic or not. When\n``true``, the last element of ``#parameters`` will also be flagged\n``#variadic``.", | ||
"type": "boolean" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"ClassType": { | ||
@@ -190,2 +245,3 @@ "description": "Represents classes.", | ||
"abstract": { | ||
"default": false, | ||
"description": "Indicates if this class is an abstract class.", | ||
@@ -200,8 +256,10 @@ "type": "boolean" | ||
"base": { | ||
"$ref": "#/definitions/NamedTypeReference", | ||
"description": "Base class (optional)." | ||
"default": "no base class", | ||
"description": "The FQN of the base class of this class, if it has one.", | ||
"type": "string" | ||
}, | ||
"docs": { | ||
"$ref": "#/definitions/Docs", | ||
"description": "Key value pairs of documentation nodes.\nBased on TSDoc." | ||
"default": "none", | ||
"description": "Documentation for this entity." | ||
}, | ||
@@ -214,11 +272,14 @@ "fqn": { | ||
"initializer": { | ||
"$ref": "#/definitions/Method", | ||
"$ref": "#/definitions/Callable", | ||
"default": "no initializer", | ||
"description": "Initializer (constructor) method." | ||
}, | ||
"interfaces": { | ||
"description": "The set of interfaces implemented by this class.", | ||
"default": "none", | ||
"description": "The FQNs of the interfaces this class implements, if any.", | ||
"items": { | ||
"$ref": "#/definitions/NamedTypeReference" | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
"type": "array", | ||
"uniqueItems": true | ||
}, | ||
@@ -234,5 +295,7 @@ "kind": { | ||
"$ref": "#/definitions/SourceLocation", | ||
"default": "none", | ||
"description": "Where in the module this definition was found\n\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\nfile combining compiled code and its manifest, whereas this is referring\nto the location of the source in the module the assembly was built from." | ||
}, | ||
"methods": { | ||
"default": "none", | ||
"description": "List of methods.", | ||
@@ -250,2 +313,3 @@ "items": { | ||
"namespace": { | ||
"default": "none", | ||
"description": "The namespace of the type (``foo.bar.baz``). When undefined, the type is located at the root of the assembly\n(it's ``fqn`` would be like ``<assembly>.<name>``). If the `namespace` corresponds to an existing type's\nnamespace-qualified (e.g: ``<namespace>.<name>``), then the current type is a nested type.", | ||
@@ -255,2 +319,3 @@ "type": "string" | ||
"properties": { | ||
"default": "none", | ||
"description": "List of properties.", | ||
@@ -287,40 +352,12 @@ "items": { | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TypeReferenceBase" | ||
}, | ||
{ | ||
"$ref": "#/definitions/NamedTypeReference" | ||
} | ||
] | ||
"$ref": "#/definitions/NamedTypeReference" | ||
}, | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TypeReferenceBase" | ||
}, | ||
{ | ||
"$ref": "#/definitions/PrimitiveTypeReference" | ||
} | ||
] | ||
"$ref": "#/definitions/PrimitiveTypeReference" | ||
}, | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TypeReferenceBase" | ||
}, | ||
{ | ||
"$ref": "#/definitions/CollectionTypeReference" | ||
} | ||
] | ||
"$ref": "#/definitions/CollectionTypeReference" | ||
}, | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TypeReferenceBase" | ||
}, | ||
{ | ||
"$ref": "#/definitions/UnionTypeReference" | ||
} | ||
] | ||
"$ref": "#/definitions/UnionTypeReference" | ||
} | ||
@@ -340,10 +377,2 @@ ], | ||
"type": "object" | ||
}, | ||
"optional": { | ||
"description": "Indicates if this value is optional.", | ||
"type": "boolean" | ||
}, | ||
"promise": { | ||
"description": "Indicates if this type refers to a promise.", | ||
"type": "boolean" | ||
} | ||
@@ -363,2 +392,3 @@ }, | ||
}, | ||
"default": "none", | ||
"description": "Custom tags that are not any of the default ones", | ||
@@ -368,2 +398,3 @@ "type": "object" | ||
"default": { | ||
"default": "none", | ||
"description": "Description of the default", | ||
@@ -373,6 +404,8 @@ "type": "string" | ||
"deprecated": { | ||
"description": "If present, this block indicates that an API item is no longer supported and may be\nremoved in a future release. The `@deprecated` tag must be followed by a sentence\ndescribing the recommended alternative. Deprecation recursively applies to members\nof a container. For example, if a class is deprecated, then so are all of its members.", | ||
"default": "none", | ||
"description": "If present, this block indicates that an API item is no longer supported\nand may be removed in a future release. The `@deprecated` tag must be\nfollowed by a sentence describing the recommended alternative.\nDeprecation recursively applies to members of a container. For example,\nif a class is deprecated, then so are all of its members.", | ||
"type": "string" | ||
}, | ||
"example": { | ||
"default": "none", | ||
"description": "Example showing the usage of this API item\n\nStarts off in running text mode, may switch to code using fenced code\nblocks.", | ||
@@ -382,10 +415,13 @@ "type": "string" | ||
"remarks": { | ||
"description": "Detailed information about an API item.\n\nEither the explicitly tagged `@remarks` section, otherwise everything past the\nfirst paragraph if there is no `@remarks` tag.", | ||
"default": "none", | ||
"description": "Detailed information about an API item.\n\nEither the explicitly tagged `@remarks` section, otherwise everything\npast the first paragraph if there is no `@remarks` tag.", | ||
"type": "string" | ||
}, | ||
"returns": { | ||
"description": "The `@returns` block for this doc comment, or undefined if there is not one.", | ||
"default": "none", | ||
"description": "The `@returns` block for this doc comment, or undefined if there is not\none.", | ||
"type": "string" | ||
}, | ||
"see": { | ||
"default": "none", | ||
"description": "A `@see` link with more information", | ||
@@ -404,7 +440,8 @@ "type": "string" | ||
"default": false, | ||
"description": "Whether this class or interface was intended to be subclassed/implemented by library users.\n\nClasses intended for subclassing, and interfaces intended to be implemented\nby consumers, are held to stricter standards of API compatibility.", | ||
"description": "Whether this class or interface was intended to be subclassed/implemented\nby library users.\n\nClasses intended for subclassing, and interfaces intended to be\nimplemented by consumers, are held to stricter standards of API\ncompatibility.", | ||
"type": "boolean" | ||
}, | ||
"summary": { | ||
"description": "Summary documentation for an API item.\n\nThe first part of the documentation before hitting a `@remarks` tags, or the first\nline of the doc comment block if there is no `@remarks` tag.", | ||
"default": "none", | ||
"description": "Summary documentation for an API item.\n\nThe first part of the documentation before hitting a `@remarks` tags, or\nthe first line of the doc comment block if there is no `@remarks` tag.", | ||
"type": "string" | ||
@@ -420,3 +457,4 @@ } | ||
"$ref": "#/definitions/Docs", | ||
"description": "Key value pairs of documentation nodes.\nBased on TSDoc." | ||
"default": "none", | ||
"description": "Documentation for this entity." | ||
}, | ||
@@ -443,3 +481,4 @@ "name": { | ||
"$ref": "#/definitions/Docs", | ||
"description": "Key value pairs of documentation nodes.\nBased on TSDoc." | ||
"default": "none", | ||
"description": "Documentation for this entity." | ||
}, | ||
@@ -460,2 +499,3 @@ "fqn": { | ||
"$ref": "#/definitions/SourceLocation", | ||
"default": "none", | ||
"description": "Where in the module this definition was found\n\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\nfile combining compiled code and its manifest, whereas this is referring\nto the location of the source in the module the assembly was built from." | ||
@@ -476,2 +516,3 @@ }, | ||
"namespace": { | ||
"default": "none", | ||
"description": "The namespace of the type (``foo.bar.baz``). When undefined, the type is located at the root of the assembly\n(it's ``fqn`` would be like ``<assembly>.<name>``). If the `namespace` corresponds to an existing type's\nnamespace-qualified (e.g: ``<namespace>.<name>``), then the current type is a nested type.", | ||
@@ -498,2 +539,3 @@ "type": "string" | ||
"datatype": { | ||
"default": false, | ||
"description": "True if this interface only contains properties. Different backends might\nhave idiomatic ways to allow defining concrete instances such interfaces.\nFor example, in Java, the generator will produce a PoJo and a builder\nwhich will allow users to create a concrete object with data which\nadheres to this interface.", | ||
@@ -504,3 +546,4 @@ "type": "boolean" | ||
"$ref": "#/definitions/Docs", | ||
"description": "Key value pairs of documentation nodes.\nBased on TSDoc." | ||
"default": "none", | ||
"description": "Documentation for this entity." | ||
}, | ||
@@ -513,7 +556,9 @@ "fqn": { | ||
"interfaces": { | ||
"description": "All the base interfaces that this interface extends.", | ||
"default": "none", | ||
"description": "The FQNs of the interfaces this interface extends, if any.", | ||
"items": { | ||
"$ref": "#/definitions/NamedTypeReference" | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
"type": "array", | ||
"uniqueItems": true | ||
}, | ||
@@ -529,5 +574,7 @@ "kind": { | ||
"$ref": "#/definitions/SourceLocation", | ||
"default": "none", | ||
"description": "Where in the module this definition was found\n\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\nfile combining compiled code and its manifest, whereas this is referring\nto the location of the source in the module the assembly was built from." | ||
}, | ||
"methods": { | ||
"default": "none", | ||
"description": "List of methods.", | ||
@@ -545,2 +592,3 @@ "items": { | ||
"namespace": { | ||
"default": "none", | ||
"description": "The namespace of the type (``foo.bar.baz``). When undefined, the type is located at the root of the assembly\n(it's ``fqn`` would be like ``<assembly>.<name>``). If the `namespace` corresponds to an existing type's\nnamespace-qualified (e.g: ``<namespace>.<name>``), then the current type is a nested type.", | ||
@@ -550,2 +598,3 @@ "type": "string" | ||
"properties": { | ||
"default": "none", | ||
"description": "List of properties.", | ||
@@ -567,18 +616,22 @@ "items": { | ||
"Method": { | ||
"description": "Represents a method.", | ||
"description": "A method with a name (i.e: not an initializer).", | ||
"properties": { | ||
"abstract": { | ||
"default": false, | ||
"description": "Is this method an abstract method (this means the class will also be an abstract class)", | ||
"type": "boolean" | ||
}, | ||
"async": { | ||
"default": false, | ||
"description": "Indicates if this is an asynchronous method (it will return a promise).", | ||
"type": "boolean" | ||
}, | ||
"docs": { | ||
"$ref": "#/definitions/Docs", | ||
"description": "Key value pairs of documentation nodes.\nBased on TSDoc." | ||
"default": "none", | ||
"description": "Documentation for this entity." | ||
}, | ||
"initializer": { | ||
"description": "True if this method is an initializer, in which case it won't have a return type", | ||
"type": "boolean" | ||
}, | ||
"locationInModule": { | ||
"$ref": "#/definitions/SourceLocation", | ||
"default": "none", | ||
"description": "Where in the module this definition was found\n\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\nfile combining compiled code and its manifest, whereas this is referring\nto the location of the source in the module the assembly was built from." | ||
@@ -591,8 +644,9 @@ }, | ||
"overrides": { | ||
"$ref": "#/definitions/NamedTypeReference", | ||
"default": "undefined", | ||
"description": "The name of the parent type (class or interface) that this entity overrides or implements. If undefined, then\nthis entity is the first in it's hierarchy to declare this entity." | ||
"default": "this member is not overriding anything", | ||
"description": "The FQN of the parent type (class or interface) that this entity\noverrides or implements. If undefined, then this entity is the first in\nit's hierarchy to declare this entity.", | ||
"type": "string" | ||
}, | ||
"parameters": { | ||
"description": "The parameters of the method/initializer", | ||
"default": "none", | ||
"description": "The parameters of the Initializer or Method.", | ||
"items": { | ||
@@ -604,51 +658,13 @@ "$ref": "#/definitions/Parameter" | ||
"protected": { | ||
"description": "Indicates if this method is protected (otherwise it is public)", | ||
"default": false, | ||
"description": "Indicates if this Initializer or Method is protected (otherwise it is\npublic, since private members are not modeled).", | ||
"type": "boolean" | ||
}, | ||
"returns": { | ||
"anyOf": [ | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TypeReferenceBase" | ||
}, | ||
{ | ||
"$ref": "#/definitions/NamedTypeReference" | ||
} | ||
] | ||
}, | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TypeReferenceBase" | ||
}, | ||
{ | ||
"$ref": "#/definitions/PrimitiveTypeReference" | ||
} | ||
] | ||
}, | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TypeReferenceBase" | ||
}, | ||
{ | ||
"$ref": "#/definitions/CollectionTypeReference" | ||
} | ||
] | ||
}, | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TypeReferenceBase" | ||
}, | ||
{ | ||
"$ref": "#/definitions/UnionTypeReference" | ||
} | ||
] | ||
} | ||
], | ||
"description": "The return type of the method (undefined if void or initializer)" | ||
"$ref": "#/definitions/OptionalValue", | ||
"default": "void", | ||
"description": "The return type of the method (`undefined` if `void`)" | ||
}, | ||
"static": { | ||
"default": false, | ||
"description": "Indicates if this is a static method.", | ||
@@ -658,10 +674,14 @@ "type": "boolean" | ||
"variadic": { | ||
"description": "Indicates whether this method is variadic or not. When ``true``, the last\nelement of ``#parameters`` will also be flagged ``#variadic``.", | ||
"default": false, | ||
"description": "Indicates whether this Initializer or Method is variadic or not. When\n``true``, the last element of ``#parameters`` will also be flagged\n``#variadic``.", | ||
"type": "boolean" | ||
} | ||
}, | ||
"required": [ | ||
"name" | ||
], | ||
"type": "object" | ||
}, | ||
"NamedTypeReference": { | ||
"description": "Reference to a named type, defined by this assembly or one of it's dependencies.", | ||
"description": "Reference to a named type, defined by this assembly or one of its\ndependencies.", | ||
"properties": { | ||
@@ -671,14 +691,37 @@ "fqn": { | ||
"type": "string" | ||
}, | ||
} | ||
}, | ||
"required": [ | ||
"fqn" | ||
], | ||
"type": "object" | ||
}, | ||
"OptionalValue": { | ||
"description": "A value that can possibly be optional.", | ||
"properties": { | ||
"optional": { | ||
"description": "Indicates if this value is optional.", | ||
"default": false, | ||
"description": "Determines whether the value is, indeed, optional.", | ||
"type": "boolean" | ||
}, | ||
"promise": { | ||
"description": "Indicates if this type refers to a promise.", | ||
"type": "boolean" | ||
"type": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/NamedTypeReference" | ||
}, | ||
{ | ||
"$ref": "#/definitions/PrimitiveTypeReference" | ||
}, | ||
{ | ||
"$ref": "#/definitions/CollectionTypeReference" | ||
}, | ||
{ | ||
"$ref": "#/definitions/UnionTypeReference" | ||
} | ||
], | ||
"description": "The declared type of the value, when it's present." | ||
} | ||
}, | ||
"required": [ | ||
"fqn" | ||
"type" | ||
], | ||
@@ -690,15 +733,5 @@ "type": "object" | ||
"properties": { | ||
"dependencies": { | ||
"additionalProperties": { | ||
"$ref": "#/definitions/PackageVersion" | ||
}, | ||
"description": "Dependencies of this dependency", | ||
"type": "object" | ||
}, | ||
"peer": { | ||
"description": "Indicates if this dependency is a direct (peer) dependency or a\ntransitive dependency.\n\nPeer dependencies are expected to be explicitly defined by the user of\nthis library instead of brought in as transitive dependencies.\n\njsii enforces that any direct dependency on another jsii module is also\ndefined as a peerDependency. Otherwise, it would be impossible to safely\nuse two versions of this dependency in a closure.", | ||
"type": "boolean" | ||
}, | ||
"targets": { | ||
"$ref": "#/definitions/AssemblyTargets", | ||
"default": "none", | ||
"description": "Targets for a given assembly." | ||
@@ -722,3 +755,4 @@ }, | ||
"$ref": "#/definitions/Docs", | ||
"description": "Key value pairs of documentation nodes.\nBased on TSDoc." | ||
"default": "none", | ||
"description": "Documentation for this entity." | ||
}, | ||
@@ -730,49 +764,27 @@ "name": { | ||
}, | ||
"optional": { | ||
"default": false, | ||
"description": "Determines whether the value is, indeed, optional.", | ||
"type": "boolean" | ||
}, | ||
"type": { | ||
"anyOf": [ | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TypeReferenceBase" | ||
}, | ||
{ | ||
"$ref": "#/definitions/NamedTypeReference" | ||
} | ||
] | ||
"$ref": "#/definitions/NamedTypeReference" | ||
}, | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TypeReferenceBase" | ||
}, | ||
{ | ||
"$ref": "#/definitions/PrimitiveTypeReference" | ||
} | ||
] | ||
"$ref": "#/definitions/PrimitiveTypeReference" | ||
}, | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TypeReferenceBase" | ||
}, | ||
{ | ||
"$ref": "#/definitions/CollectionTypeReference" | ||
} | ||
] | ||
"$ref": "#/definitions/CollectionTypeReference" | ||
}, | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TypeReferenceBase" | ||
}, | ||
{ | ||
"$ref": "#/definitions/UnionTypeReference" | ||
} | ||
] | ||
"$ref": "#/definitions/UnionTypeReference" | ||
} | ||
], | ||
"description": "The type of the parameter." | ||
"description": "The declared type of the value, when it's present." | ||
}, | ||
"variadic": { | ||
"description": "Whather this argument is the \"rest\" of a variadic signature.\nThe ``#type`` is that of every individual argument of the variadic list.", | ||
"default": false, | ||
"description": "Whether this is the last parameter of a variadic method. In such cases,\nthe `#type` attribute is the type of each individual item of the variadic\narguments list (as opposed to some array type, as for example TypeScript\nwould model it).", | ||
"type": "boolean" | ||
@@ -791,2 +803,3 @@ } | ||
"email": { | ||
"default": "none", | ||
"description": "The email of the person", | ||
@@ -800,2 +813,3 @@ "type": "string" | ||
"organization": { | ||
"default": false, | ||
"description": "If true, this person is, in fact, an organization", | ||
@@ -812,2 +826,3 @@ "type": "boolean" | ||
"url": { | ||
"default": "none", | ||
"description": "The URL for the person", | ||
@@ -838,13 +853,5 @@ "type": "string" | ||
"properties": { | ||
"optional": { | ||
"description": "Indicates if this value is optional.", | ||
"type": "boolean" | ||
}, | ||
"primitive": { | ||
"$ref": "#/definitions/PrimitiveType", | ||
"description": "If this is a reference to a primitive type, this will include the\nprimitive type kind." | ||
}, | ||
"promise": { | ||
"description": "Indicates if this type refers to a promise.", | ||
"type": "boolean" | ||
} | ||
@@ -861,2 +868,3 @@ }, | ||
"abstract": { | ||
"default": false, | ||
"description": "Indicates if this property is abstract", | ||
@@ -866,3 +874,4 @@ "type": "boolean" | ||
"const": { | ||
"description": "A hint that indicates that this static, immutable property is initialized\nduring startup. This allows emitting \"const\" idioms in different target languages.\nImplies `static` and `immutable`.", | ||
"default": false, | ||
"description": "A hint that indicates that this static, immutable property is initialized\nduring startup. This allows emitting \"const\" idioms in different target\nlanguages. Implies `static` and `immutable`.", | ||
"type": "boolean" | ||
@@ -872,5 +881,7 @@ }, | ||
"$ref": "#/definitions/Docs", | ||
"description": "Key value pairs of documentation nodes.\nBased on TSDoc." | ||
"default": "none", | ||
"description": "Documentation for this entity." | ||
}, | ||
"immutable": { | ||
"default": false, | ||
"description": "Indicates if this property only has a getter (immutable).", | ||
@@ -881,2 +892,3 @@ "type": "boolean" | ||
"$ref": "#/definitions/SourceLocation", | ||
"default": "none", | ||
"description": "Where in the module this definition was found\n\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\nfile combining compiled code and its manifest, whereas this is referring\nto the location of the source in the module the assembly was built from." | ||
@@ -889,8 +901,14 @@ }, | ||
}, | ||
"optional": { | ||
"default": false, | ||
"description": "Determines whether the value is, indeed, optional.", | ||
"type": "boolean" | ||
}, | ||
"overrides": { | ||
"$ref": "#/definitions/NamedTypeReference", | ||
"default": "undefined", | ||
"description": "The name of the parent type (class or interface) that this entity overrides or implements. If undefined, then\nthis entity is the first in it's hierarchy to declare this entity." | ||
"default": "this member is not overriding anything", | ||
"description": "The FQN of the parent type (class or interface) that this entity\noverrides or implements. If undefined, then this entity is the first in\nit's hierarchy to declare this entity.", | ||
"type": "string" | ||
}, | ||
"protected": { | ||
"default": false, | ||
"description": "Indicates if this property is protected (otherwise it is public)", | ||
@@ -900,2 +918,3 @@ "type": "boolean" | ||
"static": { | ||
"default": false, | ||
"description": "Indicates if this is a static property.", | ||
@@ -907,43 +926,15 @@ "type": "boolean" | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TypeReferenceBase" | ||
}, | ||
{ | ||
"$ref": "#/definitions/NamedTypeReference" | ||
} | ||
] | ||
"$ref": "#/definitions/NamedTypeReference" | ||
}, | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TypeReferenceBase" | ||
}, | ||
{ | ||
"$ref": "#/definitions/PrimitiveTypeReference" | ||
} | ||
] | ||
"$ref": "#/definitions/PrimitiveTypeReference" | ||
}, | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TypeReferenceBase" | ||
}, | ||
{ | ||
"$ref": "#/definitions/CollectionTypeReference" | ||
} | ||
] | ||
"$ref": "#/definitions/CollectionTypeReference" | ||
}, | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TypeReferenceBase" | ||
}, | ||
{ | ||
"$ref": "#/definitions/UnionTypeReference" | ||
} | ||
] | ||
"$ref": "#/definitions/UnionTypeReference" | ||
} | ||
], | ||
"description": "The type of the property." | ||
"description": "The declared type of the value, when it's present." | ||
} | ||
@@ -985,3 +976,4 @@ }, | ||
"$ref": "#/definitions/Docs", | ||
"description": "Key value pairs of documentation nodes.\nBased on TSDoc." | ||
"default": "none", | ||
"description": "Documentation for this entity." | ||
}, | ||
@@ -999,2 +991,3 @@ "fqn": { | ||
"$ref": "#/definitions/SourceLocation", | ||
"default": "none", | ||
"description": "Where in the module this definition was found\n\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\nfile combining compiled code and its manifest, whereas this is referring\nto the location of the source in the module the assembly was built from." | ||
@@ -1008,2 +1001,3 @@ }, | ||
"namespace": { | ||
"default": "none", | ||
"description": "The namespace of the type (``foo.bar.baz``). When undefined, the type is located at the root of the assembly\n(it's ``fqn`` would be like ``<assembly>.<name>``). If the `namespace` corresponds to an existing type's\nnamespace-qualified (e.g: ``<namespace>.<name>``), then the current type is a nested type.", | ||
@@ -1030,29 +1024,7 @@ "type": "string" | ||
}, | ||
"TypeReferenceBase": { | ||
"description": "Common attributes of a TypeReference.", | ||
"properties": { | ||
"optional": { | ||
"description": "Indicates if this value is optional.", | ||
"type": "boolean" | ||
}, | ||
"promise": { | ||
"description": "Indicates if this type refers to a promise.", | ||
"type": "boolean" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"UnionTypeReference": { | ||
"description": "Reference to a union type.", | ||
"properties": { | ||
"optional": { | ||
"description": "Indicates if this value is optional.", | ||
"type": "boolean" | ||
}, | ||
"promise": { | ||
"description": "Indicates if this type refers to a promise.", | ||
"type": "boolean" | ||
}, | ||
"union": { | ||
"description": "Indicates that this is a union type, which means it can be one of a set of types.", | ||
"description": "Indicates that this is a union type, which means it can be one of a set\nof types.", | ||
"properties": { | ||
@@ -1064,40 +1036,12 @@ "types": { | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TypeReferenceBase" | ||
}, | ||
{ | ||
"$ref": "#/definitions/NamedTypeReference" | ||
} | ||
] | ||
"$ref": "#/definitions/NamedTypeReference" | ||
}, | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TypeReferenceBase" | ||
}, | ||
{ | ||
"$ref": "#/definitions/PrimitiveTypeReference" | ||
} | ||
] | ||
"$ref": "#/definitions/PrimitiveTypeReference" | ||
}, | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TypeReferenceBase" | ||
}, | ||
{ | ||
"$ref": "#/definitions/CollectionTypeReference" | ||
} | ||
] | ||
"$ref": "#/definitions/CollectionTypeReference" | ||
}, | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TypeReferenceBase" | ||
}, | ||
{ | ||
"$ref": "#/definitions/UnionTypeReference" | ||
} | ||
] | ||
"$ref": "#/definitions/UnionTypeReference" | ||
} | ||
@@ -1104,0 +1048,0 @@ ] |
@@ -15,3 +15,3 @@ "use strict"; | ||
const assm = { | ||
schema: spec.SchemaVersion.V1_0, | ||
schema: spec.SchemaVersion.LATEST, | ||
name: assemblyName, | ||
@@ -18,0 +18,0 @@ description: 'bla', |
114579
21
2212