From 7a6278ac7b4d46ef34f33832784533dc0da29c4c Mon Sep 17 00:00:00 2001 From: Romain Marcadier-Muller Date: Wed, 19 Sep 2018 15:52:12 +0200 Subject: [PATCH] feat: Document overriden/inherited members (#238) Add a documentation line outlining the parent declaration of overridden members as well as inherited members that are not overridden locally. This should make browsing the documentation a lot nicer. Inherited and overridden statements in the documentation always refer to the fully qualified name of the super statement. Fixes #196 --- packages/jsii-pacmak/bin/jsii-pacmak.ts | 14 +- packages/jsii-pacmak/lib/targets/sphinx.ts | 108 +++- .../sphinx/_scope_jsii-calc-base.rst | 7 + .../sphinx/_scope_jsii-calc-lib.rst | 56 +- .../expected.jsii-calc/sphinx/jsii-calc.rst | 520 +++++++++++++++++- 5 files changed, 668 insertions(+), 37 deletions(-) diff --git a/packages/jsii-pacmak/bin/jsii-pacmak.ts b/packages/jsii-pacmak/bin/jsii-pacmak.ts index 39dadda5a4..2b0601c163 100644 --- a/packages/jsii-pacmak/bin/jsii-pacmak.ts +++ b/packages/jsii-pacmak/bin/jsii-pacmak.ts @@ -14,6 +14,7 @@ import { VERSION_DESC } from '../lib/version'; const targetConstructors = await Target.findAll(); const argv = yargs .usage('Usage: jsii-pacmak [-t target,...] [-o outdir] [package-dir]') + .env('JSII_PACMAK') .option('targets', { alias: ['target', 't'], type: 'array', @@ -47,6 +48,11 @@ import { VERSION_DESC } from '../lib/version'; desc: 'force generation of new artifacts, even if the fingerprints match', default: false }) + .option('force-subdirectory', { + type: 'boolean', + desc: 'force generation into a target-named subdirectory, even in single-target mode', + default: false + }) .option('recurse', { alias: 'R', type: 'boolean', @@ -80,9 +86,9 @@ import { VERSION_DESC } from '../lib/version'; const rootDir = path.resolve(process.cwd(), argv._[0] || '.'); const visited = new Set(); - await buildPackage(rootDir); + await buildPackage(rootDir, true /* isRoot */, argv.forceSubdirectory); - async function buildPackage(packageDir: string, isRoot = true) { + async function buildPackage(packageDir: string, isRoot: boolean, forceSubdirectory: boolean) { if (visited.has(packageDir)) { return; // already built } @@ -103,7 +109,7 @@ import { VERSION_DESC } from '../lib/version'; if (argv.recurse) { for (const dep of Object.keys(pkg.dependencies || { })) { const depDir = resolveDependencyDirectory(packageDir, dep); - await buildPackage(depDir, /* isRoot */ false); + await buildPackage(depDir, /* isRoot */ false, forceSubdirectory); } } @@ -127,7 +133,7 @@ import { VERSION_DESC } from '../lib/version'; const tarball = await npmPack(packageDir, tmpdir); for (const targetName of targets) { // if we are targeting a single language, output to outdir, otherwise outdir/ - const targetOutputDir = targets.length > 1 ? path.join(outDir, targetName) : outDir; + const targetOutputDir = (targets.length > 1 || forceSubdirectory) ? path.join(outDir, targetName) : outDir; logging.debug(`Building ${pkg.name}/${targetName}: ${targetOutputDir}`); await generateTarget(packageDir, targetName, targetOutputDir, tarball); } diff --git a/packages/jsii-pacmak/lib/targets/sphinx.ts b/packages/jsii-pacmak/lib/targets/sphinx.ts index 10bcaec59a..423142ea99 100644 --- a/packages/jsii-pacmak/lib/targets/sphinx.ts +++ b/packages/jsii-pacmak/lib/targets/sphinx.ts @@ -233,7 +233,8 @@ class SphinxDocsGenerator extends Generator { this.namespaceStack.push({ name: className, underClass: true }); } - protected onEndClass(_cls: spec.ClassType) { + protected onEndClass(cls: spec.ClassType) { + this.renderInheritedMembers(cls); this.code.closeBlock(); this.namespaceStack.pop(); if (!this.topNamespace.underClass) { this.closeSection(); } @@ -342,7 +343,8 @@ class SphinxDocsGenerator extends Generator { this.code.line(); } - protected onEndInterface(_ifc: spec.InterfaceType) { + protected onEndInterface(ifc: spec.InterfaceType) { + this.renderInheritedMembers(ifc); this.code.closeBlock(); if (!this.topNamespace.underClass) { this.closeSection(); } } @@ -359,6 +361,62 @@ class SphinxDocsGenerator extends Generator { this.renderProperty(property); } + private renderInheritedMembers(entity: spec.ClassType | spec.InterfaceType) { + const inherited = this.getInheritedMembers(entity); + if (Object.keys(inherited).length === 0) { return; } + for (const source of Object.keys(inherited).sort()) { + const entities = inherited[source]; + for (const method of entities.methods) { + this.renderMethod(method, source); + for (const overload of this.createOverloadsForOptionals(method)) { + this.renderMethod(overload, source); + } + } + for (const property of entities.properties) { + this.renderProperty(property, source); + } + } + } + + private getInheritedMembers(entity: spec.ClassType | spec.InterfaceType): InheritedMembers { + const parents = parentTypes(entity); + const knownMembers = new Set([ + ...(entity.methods || []).map(m => m.name!), + ...(entity.properties || []).map(p => p.name) + ]); + const result: InheritedMembers = {}; + for (const parent of parents) { + const parentType = this.findType(parent.fqn) as spec.ClassType | spec.InterfaceType; + for (const method of parentType.methods || []) { + if (method.static || knownMembers.has(method.name!)) { continue; } + result[parentType.fqn] = result[parentType.fqn] || { methods: [], properties: [] }; + result[parentType.fqn].methods.push(method); + knownMembers.add(method.name!); + } + for (const property of parentType.properties || []) { + if (property.static || knownMembers.has(property.name!)) { continue; } + result[parentType.fqn] = result[parentType.fqn] || { methods: [], properties: [] }; + result[parentType.fqn].properties.push(property); + knownMembers.add(property.name); + } + for (const superType of parentTypes(parentType)) { + parents.push(superType); + } + } + return result; + + function parentTypes(type: spec.ClassType | spec.InterfaceType) { + const types = new Array(); + if (spec.isClassType(type) && type.base) { + types.push(type.base); + } + if (type.interfaces) { + types.push(...type.interfaces); + } + return types; + } + } + /** * Adds a title to the current code file, using the appropriate header * adornment given the current TOC depth. It will start using simple @@ -402,7 +460,7 @@ class SphinxDocsGenerator extends Generator { signature += ', '; } - if (p.type.optional) { + if (p.type.optional && !params.slice(idx + 1).find(e => !e.type.optional)) { signature += '['; signaturePosfix += ']'; } @@ -437,7 +495,7 @@ class SphinxDocsGenerator extends Generator { } } - private renderMethod(method: spec.Method) { + private renderMethod(method: spec.Method, inheritedFrom?: string) { const signature = this.renderMethodSignature(method); const type = method.static ? `py:staticmethod` : `py:method`; @@ -445,14 +503,32 @@ class SphinxDocsGenerator extends Generator { this.code.line(); this.code.openBlock(`.. ${type}:: ${method.name}${signature}`); + if (inheritedFrom) { + this.code.line(); + this.code.line(`*Inherited from* :py:meth:\`${inheritedFrom} <${inheritedFrom}.${method.name}>\``); + } else if (method.overrides) { + this.code.line(); + const superType = this.findType(method.overrides.fqn) as spec.ClassType | spec.InterfaceType; + if (spec.isInterfaceType(superType) || superType.methods!.find(m => m.name === method.name && !!m.abstract)) { + this.code.line(`*Implements* :py:meth:\`${method.overrides.fqn}.${method.name}\``); + } else { + this.code.line(`*Overrides* :py:meth:\`${method.overrides.fqn}.${method.name}\``); + } + } this.renderDocsLine(method); this.code.line(); + if (method.protected) { + this.code.line('*Protected method*'); + this.code.line(); + } this.renderMethodParameters(method); // @return doc if (method.docs && method.docs.return) { - this.code.line(`:return: ${method.docs.return}`); + const [firstLine, ...rest] = method.docs.return.split('\n'); + this.code.line(`:return: ${firstLine}`); + rest.forEach(line => this.code.line(` ${line}`)); } if (method.returns) { @@ -542,7 +618,7 @@ class SphinxDocsGenerator extends Generator { } else { throw new Error('Unexpected type ref'); } - if (type.optional) { result.ref = `${result.ref} or undefined`; } + if (type.optional) { result.ref = `${result.ref} or \`\`undefined\`\``; } return result; // Wrap a string between parenthesis if it contains " or " @@ -552,12 +628,28 @@ class SphinxDocsGenerator extends Generator { } } - private renderProperty(prop: spec.Property) { + private renderProperty(prop: spec.Property, inheritedFrom?: string) { this.code.line(); const type = this.renderTypeRef(prop.type); this.code.openBlock(`.. py:attribute:: ${prop.name}`); + if (inheritedFrom) { + this.code.line(); + this.code.line(`*Inherited from* :py:attr:\`${inheritedFrom} <${inheritedFrom}.${prop.name}>\``); + } else if (prop.overrides) { + this.code.line(); + const superType = this.findType(prop.overrides.fqn) as spec.ClassType | spec.InterfaceType; + if (spec.isInterfaceType(superType) || superType.properties!.find(p => p.name === prop.name && !!p.abstract)) { + this.code.line(`*Implements* :py:meth:\`${prop.overrides.fqn}.${prop.name}\``); + } else { + this.code.line(`*Overrides* :py:attr:\`${prop.overrides.fqn}.${prop.name}\``); + } + } this.renderDocsLine(prop); this.code.line(); + if (prop.protected) { + this.code.line('*Protected property*'); + this.code.line(); + } const readonly = prop.immutable ? ' *(readonly)*' : ''; const abs = prop.abstract ? ' *(abstract)*' : ''; const stat = prop.static ? ' *(static)*' : ''; @@ -665,3 +757,5 @@ function formatLanguage(language: string): string { return language; } } + +type InheritedMembers = { [typeFqn: string]: { methods: spec.Method[], properties: spec.Property[] } }; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/sphinx/_scope_jsii-calc-base.rst b/packages/jsii-pacmak/test/expected.jsii-calc-base/sphinx/_scope_jsii-calc-base.rst index de6f7e52fa..317a4b90b1 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/sphinx/_scope_jsii-calc-base.rst +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/sphinx/_scope_jsii-calc-base.rst @@ -196,3 +196,10 @@ BaseProps (interface) :type: string *(abstract)* + .. py:attribute:: foo + + *Inherited from* :py:attr:`@scope/jsii-calc-base-of-base.VeryBaseProps <@scope/jsii-calc-base-of-base.VeryBaseProps.foo>` + + :type: :py:class:`@scope/jsii-calc-base-of-base.Very`\ *(abstract)* + + diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/sphinx/_scope_jsii-calc-lib.rst b/packages/jsii-pacmak/test/expected.jsii-calc-lib/sphinx/_scope_jsii-calc-lib.rst index f9b48bd9bf..14a916a4e5 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/sphinx/_scope_jsii-calc-lib.rst +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/sphinx/_scope_jsii-calc-lib.rst @@ -249,7 +249,7 @@ MyFirstStruct (interface) .. py:attribute:: firstOptional - :type: string[] or undefined *(abstract)* + :type: string[] or ``undefined`` *(abstract)* Number @@ -296,12 +296,32 @@ Number .. py:attribute:: value + *Implements* :py:meth:`@scope/jsii-calc-lib.Value.value` + The number. :type: number *(readonly)* + .. py:method:: typeName() -> any + + *Inherited from* :py:meth:`@scope/jsii-calc-base.Base <@scope/jsii-calc-base.Base.typeName>` + + :return: the name of the class (to verify native type names are created for derived classes). + :rtype: any + + + .. py:method:: toString() -> string + + *Inherited from* :py:meth:`@scope/jsii-calc-lib.Value <@scope/jsii-calc-lib.Value.toString>` + + String representation of the value. + + + :rtype: string + + Operation ^^^^^^^^^ @@ -337,6 +357,8 @@ Operation .. py:method:: toString() -> string + *Overrides* :py:meth:`@scope/jsii-calc-lib.Value.toString` + String representation of the value. @@ -344,6 +366,24 @@ Operation :abstract: Yes + .. py:method:: typeName() -> any + + *Inherited from* :py:meth:`@scope/jsii-calc-base.Base <@scope/jsii-calc-base.Base.typeName>` + + :return: the name of the class (to verify native type names are created for derived classes). + :rtype: any + + + .. py:attribute:: value + + *Inherited from* :py:attr:`@scope/jsii-calc-lib.Value <@scope/jsii-calc-lib.Value.value>` + + The value. + + + :type: number *(readonly)* *(abstract)* + + StructWithOnlyOptionals (interface) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -381,17 +421,17 @@ StructWithOnlyOptionals (interface) The first optional! - :type: string or undefined *(abstract)* + :type: string or ``undefined`` *(abstract)* .. py:attribute:: optional2 - :type: number or undefined *(abstract)* + :type: number or ``undefined`` *(abstract)* .. py:attribute:: optional3 - :type: boolean or undefined *(abstract)* + :type: boolean or ``undefined`` *(abstract)* Value @@ -443,3 +483,11 @@ Value :type: number *(readonly)* *(abstract)* + .. py:method:: typeName() -> any + + *Inherited from* :py:meth:`@scope/jsii-calc-base.Base <@scope/jsii-calc-base.Base.typeName>` + + :return: the name of the class (to verify native type names are created for derived classes). + :rtype: any + + diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/sphinx/jsii-calc.rst b/packages/jsii-pacmak/test/expected.jsii-calc/sphinx/jsii-calc.rst index 3318a85d4e..0afe2c1115 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/sphinx/jsii-calc.rst +++ b/packages/jsii-pacmak/test/expected.jsii-calc/sphinx/jsii-calc.rst @@ -171,9 +171,18 @@ AbstractClass .. py:attribute:: propFromInterface + *Implements* :py:meth:`jsii-calc.InterfaceImplementedByAbstractClass.propFromInterface` + :type: string *(readonly)* + .. py:attribute:: abstractProperty + + *Inherited from* :py:attr:`jsii-calc.AbstractClassBase ` + + :type: string *(readonly)* *(abstract)* + + AbstractClassBase ^^^^^^^^^^^^^^^^^ @@ -289,6 +298,8 @@ Add .. py:method:: toString() -> string + *Implements* :py:meth:`@scope/jsii-calc-lib.Operation.toString` + String representation of the value. @@ -297,12 +308,52 @@ Add .. py:attribute:: value + *Implements* :py:meth:`@scope/jsii-calc-lib.Value.value` + The value. :type: number *(readonly)* + .. py:method:: typeName() -> any + + *Inherited from* :py:meth:`@scope/jsii-calc-base.Base <@scope/jsii-calc-base.Base.typeName>` + + :return: the name of the class (to verify native type names are created for derived classes). + :rtype: any + + + .. py:method:: hello() -> string + + *Inherited from* :py:meth:`jsii-calc.BinaryOperation ` + + Say hello! + + + :rtype: string + + + .. py:attribute:: lhs + + *Inherited from* :py:attr:`jsii-calc.BinaryOperation ` + + Left-hand side operand + + + :type: :py:class:`@scope/jsii-calc-lib.Value`\ *(readonly)* + + + .. py:attribute:: rhs + + *Inherited from* :py:attr:`jsii-calc.BinaryOperation ` + + Right-hand side operand + + + :type: :py:class:`@scope/jsii-calc-lib.Value`\ *(readonly)* + + AllTypes ^^^^^^^^ @@ -428,7 +479,7 @@ AllTypes .. py:attribute:: optionalEnumValue - :type: :py:class:`~jsii-calc.StringEnum`\ or undefined + :type: :py:class:`~jsii-calc.StringEnum`\ or ``undefined`` .. py:attribute:: unknownProperty @@ -643,6 +694,8 @@ BinaryOperation .. py:method:: hello() -> string + *Implements* :py:meth:`@scope/jsii-calc-lib.IFriendly.hello` + Say hello! @@ -665,6 +718,35 @@ BinaryOperation :type: :py:class:`@scope/jsii-calc-lib.Value`\ *(readonly)* + .. py:method:: typeName() -> any + + *Inherited from* :py:meth:`@scope/jsii-calc-base.Base <@scope/jsii-calc-base.Base.typeName>` + + :return: the name of the class (to verify native type names are created for derived classes). + :rtype: any + + + .. py:method:: toString() -> string + + *Inherited from* :py:meth:`@scope/jsii-calc-lib.Operation <@scope/jsii-calc-lib.Operation.toString>` + + String representation of the value. + + + :rtype: string + :abstract: Yes + + + .. py:attribute:: value + + *Inherited from* :py:attr:`@scope/jsii-calc-lib.Value <@scope/jsii-calc-lib.Value.value>` + + The value. + + + :type: number *(readonly)* *(abstract)* + + Calculator ^^^^^^^^^^ @@ -697,7 +779,7 @@ Calculator :extends: :py:class:`~jsii-calc.composition.CompositeOperation`\ :param props: Initialization properties. - :type props: :py:class:`~jsii-calc.CalculatorProps`\ or undefined + :type props: :py:class:`~jsii-calc.CalculatorProps`\ or ``undefined`` .. py:method:: add(value) @@ -743,6 +825,8 @@ Calculator .. py:attribute:: expression + *Implements* :py:meth:`jsii-calc.composition.CompositeOperation.expression` + Returns the expression. @@ -778,7 +862,7 @@ Calculator The maximum value allows in this calculator. - :type: number or undefined + :type: number or ``undefined`` .. py:attribute:: unionProperty @@ -786,7 +870,65 @@ Calculator Example of a property that accepts a union of types. - :type: :py:class:`~jsii-calc.Add`\ or :py:class:`~jsii-calc.Multiply`\ or :py:class:`~jsii-calc.Power`\ or undefined + :type: :py:class:`~jsii-calc.Add`\ or :py:class:`~jsii-calc.Multiply`\ or :py:class:`~jsii-calc.Power`\ or ``undefined`` + + + .. py:method:: typeName() -> any + + *Inherited from* :py:meth:`@scope/jsii-calc-base.Base <@scope/jsii-calc-base.Base.typeName>` + + :return: the name of the class (to verify native type names are created for derived classes). + :rtype: any + + + .. py:method:: toString() -> string + + *Inherited from* :py:meth:`jsii-calc.composition.CompositeOperation ` + + String representation of the value. + + + :rtype: string + + + .. py:attribute:: value + + *Inherited from* :py:attr:`jsii-calc.composition.CompositeOperation ` + + The value. + + + :type: number *(readonly)* + + + .. py:attribute:: decorationPostfixes + + *Inherited from* :py:attr:`jsii-calc.composition.CompositeOperation ` + + A set of postfixes to include in a decorated .toString(). + + + :type: string[] + + + .. py:attribute:: decorationPrefixes + + *Inherited from* :py:attr:`jsii-calc.composition.CompositeOperation ` + + A set of prefixes to include in a decorated .toString(). + + + :type: string[] + + + .. py:attribute:: stringStyle + + *Inherited from* :py:attr:`jsii-calc.composition.CompositeOperation ` + + The .toString() style. + + + :type: :py:class:`~jsii-calc.composition.CompositeOperation.CompositionStringStyle`\ CalculatorProps (interface) @@ -823,18 +965,18 @@ CalculatorProps (interface) .. py:attribute:: initialValue - :type: number or undefined *(abstract)* + :type: number or ``undefined`` *(abstract)* .. py:attribute:: maximumValue - :type: number or undefined *(abstract)* + :type: number or ``undefined`` *(abstract)* DefaultedConstructorArgument ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. py:class:: DefaultedConstructorArgument([arg1, arg2, [arg3]]) +.. py:class:: DefaultedConstructorArgument(arg1, arg2, [arg3]) **Language-specific names:** @@ -859,11 +1001,11 @@ DefaultedConstructorArgument :param arg1: - :type arg1: number or undefined + :type arg1: number or ``undefined`` :param arg2: :type arg2: string :param arg3: - :type arg3: date or undefined + :type arg3: date or ``undefined`` .. py:attribute:: arg1 @@ -947,6 +1089,13 @@ Derived :extends: :py:class:`~jsii-calc.DerivedClassHasNoProperties.Base`\ + .. py:attribute:: prop + + *Inherited from* :py:attr:`jsii-calc.DerivedClassHasNoProperties.Base ` + + :type: string + + .. py:currentmodule:: jsii-calc @@ -1006,7 +1155,7 @@ DerivedStruct (interface) This is optional. - :type: string => :py:class:`@scope/jsii-calc-lib.Value`\ or undefined *(abstract)* + :type: string => :py:class:`@scope/jsii-calc-lib.Value`\ or ``undefined`` *(abstract)* .. py:attribute:: optionalAny @@ -1016,7 +1165,34 @@ DerivedStruct (interface) .. py:attribute:: optionalArray - :type: string[] or undefined *(abstract)* + :type: string[] or ``undefined`` *(abstract)* + + + .. py:attribute:: anumber + + *Inherited from* :py:attr:`@scope/jsii-calc-lib.MyFirstStruct <@scope/jsii-calc-lib.MyFirstStruct.anumber>` + + An awesome number value + + + :type: number *(abstract)* + + + .. py:attribute:: astring + + *Inherited from* :py:attr:`@scope/jsii-calc-lib.MyFirstStruct <@scope/jsii-calc-lib.MyFirstStruct.astring>` + + A string value + + + :type: string *(abstract)* + + + .. py:attribute:: firstOptional + + *Inherited from* :py:attr:`@scope/jsii-calc-lib.MyFirstStruct <@scope/jsii-calc-lib.MyFirstStruct.firstOptional>` + + :type: string[] or ``undefined`` *(abstract)* DoubleTrouble @@ -1050,6 +1226,8 @@ DoubleTrouble .. py:method:: hello() -> string + *Implements* :py:meth:`@scope/jsii-calc-lib.IFriendly.hello` + Say hello! @@ -1058,6 +1236,8 @@ DoubleTrouble .. py:method:: next() -> number + *Implements* :py:meth:`jsii-calc.IRandomNumberGenerator.next` + Returns another random number. @@ -1179,6 +1359,17 @@ IFriendlier (interface) :abstract: Yes + .. py:method:: hello() -> string + + *Inherited from* :py:meth:`@scope/jsii-calc-lib.IFriendly <@scope/jsii-calc-lib.IFriendly.hello>` + + Say hello! + + + :rtype: string + :abstract: Yes + + IFriendlyRandomGenerator (interface) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1210,6 +1401,29 @@ IFriendlyRandomGenerator (interface) :extends: :py:class:`@scope/jsii-calc-lib.IFriendly`\ + .. py:method:: hello() -> string + + *Inherited from* :py:meth:`@scope/jsii-calc-lib.IFriendly <@scope/jsii-calc-lib.IFriendly.hello>` + + Say hello! + + + :rtype: string + :abstract: Yes + + + .. py:method:: next() -> number + + *Inherited from* :py:meth:`jsii-calc.IRandomNumberGenerator ` + + Returns another random number. + + + :return: A random number. + :rtype: number + :abstract: Yes + + IInterfaceWithProperties (interface) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1284,6 +1498,20 @@ IInterfaceWithPropertiesExtension (interface) :type: number *(abstract)* + .. py:attribute:: readOnlyString + + *Inherited from* :py:attr:`jsii-calc.IInterfaceWithProperties ` + + :type: string *(readonly)* *(abstract)* + + + .. py:attribute:: readWriteString + + *Inherited from* :py:attr:`jsii-calc.IInterfaceWithProperties ` + + :type: string *(abstract)* + + IRandomNumberGenerator (interface) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1361,6 +1589,20 @@ ImplictBaseOfBase (interface) :type: date *(abstract)* + .. py:attribute:: foo + + *Inherited from* :py:attr:`@scope/jsii-calc-base-of-base.VeryBaseProps <@scope/jsii-calc-base-of-base.VeryBaseProps.foo>` + + :type: :py:class:`@scope/jsii-calc-base-of-base.Very`\ *(abstract)* + + + .. py:attribute:: bar + + *Inherited from* :py:attr:`@scope/jsii-calc-base.BaseProps <@scope/jsii-calc-base.BaseProps.bar>` + + :type: string *(abstract)* + + InterfaceImplementedByAbstractClass (interface) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1433,7 +1675,7 @@ Foo .. py:attribute:: bar - :type: string or undefined + :type: string or ``undefined`` Hello (interface) @@ -1552,7 +1794,7 @@ InterfaceWithOptionalMethodArguments (interface) :param arg1: :type arg1: string :param arg2: - :type arg2: number or undefined + :type arg2: number or ``undefined`` :abstract: Yes @@ -1946,6 +2188,8 @@ Multiply .. py:method:: farewell() -> string + *Implements* :py:meth:`jsii-calc.IFriendlier.farewell` + Say farewell. @@ -1954,6 +2198,8 @@ Multiply .. py:method:: goodbye() -> string + *Implements* :py:meth:`jsii-calc.IFriendlier.goodbye` + Say goodbye. @@ -1962,6 +2208,8 @@ Multiply .. py:method:: next() -> number + *Implements* :py:meth:`jsii-calc.IRandomNumberGenerator.next` + Returns another random number. @@ -1970,6 +2218,8 @@ Multiply .. py:method:: toString() -> string + *Implements* :py:meth:`@scope/jsii-calc-lib.Operation.toString` + String representation of the value. @@ -1978,12 +2228,52 @@ Multiply .. py:attribute:: value + *Implements* :py:meth:`@scope/jsii-calc-lib.Value.value` + The value. :type: number *(readonly)* + .. py:method:: typeName() -> any + + *Inherited from* :py:meth:`@scope/jsii-calc-base.Base <@scope/jsii-calc-base.Base.typeName>` + + :return: the name of the class (to verify native type names are created for derived classes). + :rtype: any + + + .. py:method:: hello() -> string + + *Inherited from* :py:meth:`jsii-calc.BinaryOperation ` + + Say hello! + + + :rtype: string + + + .. py:attribute:: lhs + + *Inherited from* :py:attr:`jsii-calc.BinaryOperation ` + + Left-hand side operand + + + :type: :py:class:`@scope/jsii-calc-lib.Value`\ *(readonly)* + + + .. py:attribute:: rhs + + *Inherited from* :py:attr:`jsii-calc.BinaryOperation ` + + Right-hand side operand + + + :type: :py:class:`@scope/jsii-calc-lib.Value`\ *(readonly)* + + Negate ^^^^^^ @@ -2021,6 +2311,8 @@ Negate .. py:method:: farewell() -> string + *Implements* :py:meth:`jsii-calc.IFriendlier.farewell` + Say farewell. @@ -2029,6 +2321,8 @@ Negate .. py:method:: goodbye() -> string + *Implements* :py:meth:`jsii-calc.IFriendlier.goodbye` + Say goodbye. @@ -2037,6 +2331,8 @@ Negate .. py:method:: hello() -> string + *Implements* :py:meth:`@scope/jsii-calc-lib.IFriendly.hello` + Say hello! @@ -2045,6 +2341,8 @@ Negate .. py:method:: toString() -> string + *Implements* :py:meth:`@scope/jsii-calc-lib.Operation.toString` + String representation of the value. @@ -2053,12 +2351,29 @@ Negate .. py:attribute:: value + *Implements* :py:meth:`@scope/jsii-calc-lib.Value.value` + The value. :type: number *(readonly)* + .. py:method:: typeName() -> any + + *Inherited from* :py:meth:`@scope/jsii-calc-base.Base <@scope/jsii-calc-base.Base.typeName>` + + :return: the name of the class (to verify native type names are created for derived classes). + :rtype: any + + + .. py:attribute:: operand + + *Inherited from* :py:attr:`jsii-calc.UnaryOperation ` + + :type: :py:class:`@scope/jsii-calc-lib.Value`\ *(readonly)* + + NodeStandardLibrary ^^^^^^^^^^^^^^^^^^^ @@ -2258,7 +2573,7 @@ OptionalConstructorArgument :param arg2: :type arg2: string :param arg3: - :type arg3: date or undefined + :type arg3: date or ``undefined`` .. py:attribute:: arg1 @@ -2272,7 +2587,7 @@ OptionalConstructorArgument .. py:attribute:: arg3 - :type: date or undefined *(readonly)* + :type: date or ``undefined`` *(readonly)* OverrideReturnsObject @@ -2391,6 +2706,8 @@ Power .. py:attribute:: expression + *Implements* :py:meth:`jsii-calc.composition.CompositeOperation.expression` + The expression that this operation consists of. Must be implemented by derived classes. @@ -2405,6 +2722,64 @@ Power :type: :py:class:`@scope/jsii-calc-lib.Value`\ *(readonly)* + .. py:method:: typeName() -> any + + *Inherited from* :py:meth:`@scope/jsii-calc-base.Base <@scope/jsii-calc-base.Base.typeName>` + + :return: the name of the class (to verify native type names are created for derived classes). + :rtype: any + + + .. py:method:: toString() -> string + + *Inherited from* :py:meth:`jsii-calc.composition.CompositeOperation ` + + String representation of the value. + + + :rtype: string + + + .. py:attribute:: value + + *Inherited from* :py:attr:`jsii-calc.composition.CompositeOperation ` + + The value. + + + :type: number *(readonly)* + + + .. py:attribute:: decorationPostfixes + + *Inherited from* :py:attr:`jsii-calc.composition.CompositeOperation ` + + A set of postfixes to include in a decorated .toString(). + + + :type: string[] + + + .. py:attribute:: decorationPrefixes + + *Inherited from* :py:attr:`jsii-calc.composition.CompositeOperation ` + + A set of prefixes to include in a decorated .toString(). + + + :type: string[] + + + .. py:attribute:: stringStyle + + *Inherited from* :py:attr:`jsii-calc.composition.CompositeOperation ` + + The .toString() style. + + + :type: :py:class:`~jsii-calc.composition.CompositeOperation.CompositionStringStyle`\ + + ReferenceEnumFromScopedPackage ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2438,7 +2813,7 @@ ReferenceEnumFromScopedPackage .. py:method:: loadFoo() -> @scope/jsii-calc-lib.EnumFromScopedModule - :rtype: :py:class:`@scope/jsii-calc-lib.EnumFromScopedModule`\ or undefined + :rtype: :py:class:`@scope/jsii-calc-lib.EnumFromScopedModule`\ or ``undefined`` .. py:method:: saveFoo(value) @@ -2449,7 +2824,7 @@ ReferenceEnumFromScopedPackage .. py:attribute:: foo - :type: :py:class:`@scope/jsii-calc-lib.EnumFromScopedModule`\ or undefined + :type: :py:class:`@scope/jsii-calc-lib.EnumFromScopedModule`\ or ``undefined`` ReturnsNumber (interface) @@ -2520,14 +2895,14 @@ RuntimeTypeChecking - .. py:method:: methodWithDefaultedArguments([arg1, arg2, [arg3]]) + .. py:method:: methodWithDefaultedArguments(arg1, arg2, [arg3]) :param arg1: - :type arg1: number or undefined + :type arg1: number or ``undefined`` :param arg2: :type arg2: string :param arg3: - :type arg3: date or undefined + :type arg3: date or ``undefined`` .. py:method:: methodWithOptionalAnyArgument([arg]) @@ -2546,7 +2921,7 @@ RuntimeTypeChecking :param arg2: :type arg2: string :param arg3: - :type arg3: date or undefined + :type arg3: date or ``undefined`` Statics @@ -2709,6 +3084,8 @@ Sum .. py:attribute:: expression + *Implements* :py:meth:`jsii-calc.composition.CompositeOperation.expression` + The expression that this operation consists of. Must be implemented by derived classes. @@ -2723,6 +3100,64 @@ Sum :type: :py:class:`@scope/jsii-calc-lib.Value`\ [] + .. py:method:: typeName() -> any + + *Inherited from* :py:meth:`@scope/jsii-calc-base.Base <@scope/jsii-calc-base.Base.typeName>` + + :return: the name of the class (to verify native type names are created for derived classes). + :rtype: any + + + .. py:method:: toString() -> string + + *Inherited from* :py:meth:`jsii-calc.composition.CompositeOperation ` + + String representation of the value. + + + :rtype: string + + + .. py:attribute:: value + + *Inherited from* :py:attr:`jsii-calc.composition.CompositeOperation ` + + The value. + + + :type: number *(readonly)* + + + .. py:attribute:: decorationPostfixes + + *Inherited from* :py:attr:`jsii-calc.composition.CompositeOperation ` + + A set of postfixes to include in a decorated .toString(). + + + :type: string[] + + + .. py:attribute:: decorationPrefixes + + *Inherited from* :py:attr:`jsii-calc.composition.CompositeOperation ` + + A set of prefixes to include in a decorated .toString(). + + + :type: string[] + + + .. py:attribute:: stringStyle + + *Inherited from* :py:attr:`jsii-calc.composition.CompositeOperation ` + + The .toString() style. + + + :type: :py:class:`~jsii-calc.composition.CompositeOperation.CompositionStringStyle`\ + + SyncVirtualMethods ^^^^^^^^^^^^^^^^^^ @@ -2908,6 +3343,35 @@ UnaryOperation :type: :py:class:`@scope/jsii-calc-lib.Value`\ *(readonly)* + .. py:method:: typeName() -> any + + *Inherited from* :py:meth:`@scope/jsii-calc-base.Base <@scope/jsii-calc-base.Base.typeName>` + + :return: the name of the class (to verify native type names are created for derived classes). + :rtype: any + + + .. py:method:: toString() -> string + + *Inherited from* :py:meth:`@scope/jsii-calc-lib.Operation <@scope/jsii-calc-lib.Operation.toString>` + + String representation of the value. + + + :rtype: string + :abstract: Yes + + + .. py:attribute:: value + + *Inherited from* :py:attr:`@scope/jsii-calc-lib.Value <@scope/jsii-calc-lib.Value.value>` + + The value. + + + :type: number *(readonly)* *(abstract)* + + UnionProperties (interface) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2944,7 +3408,7 @@ UnionProperties (interface) .. py:attribute:: foo - :type: string or number or undefined *(abstract)* + :type: string or number or ``undefined`` *(abstract)* UseBundledDependency @@ -3212,6 +3676,8 @@ CompositeOperation .. py:method:: toString() -> string + *Implements* :py:meth:`@scope/jsii-calc-lib.Operation.toString` + String representation of the value. @@ -3228,6 +3694,8 @@ CompositeOperation .. py:attribute:: value + *Implements* :py:meth:`@scope/jsii-calc-lib.Value.value` + The value. @@ -3296,6 +3764,14 @@ CompositeOperation + .. py:method:: typeName() -> any + + *Inherited from* :py:meth:`@scope/jsii-calc-base.Base <@scope/jsii-calc-base.Base.typeName>` + + :return: the name of the class (to verify native type names are created for derived classes). + :rtype: any + + .. py:currentmodule:: jsii-calc