jsii

  • Version 5.7.0
  • Published
  • 1.19 MB
  • 12 dependencies
  • Apache-2.0 license

Install

npm i jsii
yarn add jsii
pnpm add jsii

Overview

[![Join the chat at https://cdk.Dev](https://img.shields.io/static/v1?label=Slack&message=cdk.dev&color=brightgreen&logo=slack)](https://cdk.dev) [![All Contributors](https://img.shields.io/github/all-contributors/aws/jsii/main?label=%E2%9C%A8%20All%20Con

Index

Functions

Classes

Interfaces

Type Aliases

Functions

function compileJsiiForTest

compileJsiiForTest: (
source: string | { [name: string]: string; 'index.ts': string },
options?: TestCompilationOptions | ((obj: PackageJson) => void),
compilerOptions?: Omit<CompilerOptions, 'projectInfo' | 'watch'>
) => HelperCompilationResult;
  • Compile a piece of source and return the assembly and compiled sources for it

    Only usable for trivial cases and tests.

    Parameter source

    can either be a single string (the content of index.ts), or a map of fileName to content, which *must* include index.ts.

    Parameter options

    accepts a callback for historical reasons but really expects to take an options object.

function configureCategories

configureCategories: (records: {
[code: string]: ts.DiagnosticCategory;
}) => void;

    function normalizeConfigPath

    normalizeConfigPath: (
    root: string,
    pathToNormalize?: string
    ) => string | undefined;
    • TSConfig paths can either be relative to the project or absolute. This function normalizes paths to be relative to the provided root. After normalization, code using these paths can be much simpler.

      Parameter root

      the project root

      Parameter pathToNormalize

      the path to normalize, might be empty

    function normalizePath

    normalizePath: (sourcePath: string, rootDir?: string, outDir?: string) => string;
    • Ensures that the sourcePath is pointing to the source code and not compiled code. This can happen if the root directory and/or out directory is set for the project. We check to see if the out directory is present in the sourcePath, and if so, we replace it with the root directory.

    function sourceToAssemblyHelper

    sourceToAssemblyHelper: (
    source: string | MultipleSourceFiles,
    options?: TestCompilationOptions | ((obj: PackageJson) => void)
    ) => spec.Assembly;
    • Compile a piece of source and return the JSII assembly for it

      Only usable for trivial cases and tests.

      Parameter source

      can either be a single string (the content of index.ts), or a map of fileName to content, which *must* include index.ts.

      Parameter options

      accepts a callback for historical reasons but really expects to take an options object.

    function symbolIdentifier

    symbolIdentifier: (
    typeChecker: ts.TypeChecker,
    sym: ts.Symbol,
    options?: SymbolIdOptions
    ) => string | undefined;
    • Return a symbol identifier for the given symbol

      The symbol identifier identifies a TypeScript symbol in a source file inside a package. We can use this to map between jsii entries in the manifest, and entities in the TypeScript source code.

      Going via symbol id is the only way to identify symbols in submodules. Otherwise, all the TypeScript compiler sees is:

      /my/package/lib/source/directory/dist.js <containing> MyClass

      And there's no way to figure out what submodule name lib/source/directory/dist is exported as.

      The format of a symbol id is:

      relative/source/file:Name.space.Class[#member]

      We used to build this identifier ourselves. Turns out there was a built-in way to get pretty much the same, by calling typeChecker.getFullyQualifiedName(). Whoops ^_^ (this historical accident is why the format is similar to but different from what the TS checker returns).

    Classes

    class Code

    class Code<T extends DiagnosticMessageFormatter = DiagnosticMessageFormatter> {}
    • Descriptors for all valid jsii diagnostic codes.

      The category or non-error codes can be updated, for example to treat warnings as errors, or to suppress certain undesirable warnings.

    property category

    category: ts.DiagnosticCategory;
    • The diagnostic category this particular code is filed as.

    property code

    readonly code: number;

      property isError

      readonly isError: boolean;
      • Determines whether this diagnostic is a compilation error. Diagnostics where this is true cannot have their category overridden to a lower category.

      property name

      readonly name: string;

        method create

        create: (
        location: ts.Node | undefined,
        ...args: Parameters<T>
        ) => JsiiDiagnostic;
        • Creates a new JsiiDiagnostic message with source code location denoted by the provided location node.

          Parameter location

          the source code location attachment of the message.

          Parameter args

          the arguments to the message formatter.

        method createDetached

        createDetached: (...args: Parameters<T>) => JsiiDiagnostic;
        • Creates a new JsiiDiagnostic message without any source code location data.

          Parameter args

          the arguments to the message formatter.

          Deprecated

          It is preferred to specify a source code location for problem markers. Prefer the use of create while providing a value for the location parameter whenever possible.

        method lookup

        static lookup: (codeOrName: string | number) => Code | undefined;
        • Get a diagnostic code by code or name.

          Parameter codeOrName

          the looked up diagnostic code or name.

          Returns

          the JsiiDiagnosticCode instande, if one exists, or undefined

          this module is under active development and the error codes and names may change in the future.

          Modifiers

          • @experimental

        class JsiiDiagnostic

        class JsiiDiagnostic implements ts.Diagnostic {}
        • A jsii-specific diagnostic entry.

        property category

        readonly category: ts.DiagnosticCategory;

          property code

          readonly code: number;

            property file

            readonly file: any;

              property JSII_0001_PKG_MISSING_DESCRIPTION

              static readonly JSII_0001_PKG_MISSING_DESCRIPTION: Code<() => string>;

                property JSII_0002_PKG_MISSING_HOMEPAGE

                static readonly JSII_0002_PKG_MISSING_HOMEPAGE: Code<() => string>;

                  property JSII_0003_MISSING_README

                  static readonly JSII_0003_MISSING_README: Code<() => string>;

                    property JSII_0004_COULD_NOT_FIND_ENTRYPOINT

                    static readonly JSII_0004_COULD_NOT_FIND_ENTRYPOINT: Code<
                    (mainFile: string) => string
                    >;

                      property JSII_0005_MISSING_PEER_DEPENDENCY

                      static readonly JSII_0005_MISSING_PEER_DEPENDENCY: Code<
                      (assm: string, reference: string) => string
                      >;

                        property JSII_0006_MISSING_DEV_DEPENDENCY

                        static readonly JSII_0006_MISSING_DEV_DEPENDENCY: Code<
                        (
                        dependencyName: string,
                        peerRange: string,
                        minVersion: string,
                        actual: string
                        ) => string
                        >;

                          property JSII_0007_MISSING_WARNINGS_EXPORT

                          static readonly JSII_0007_MISSING_WARNINGS_EXPORT: Code<() => string>;

                            property JSII_1000_NO_CONST_ENUM

                            static readonly JSII_1000_NO_CONST_ENUM: Code<() => string>;

                              property JSII_1001_TYPE_HAS_NO_SYMBOL

                              static readonly JSII_1001_TYPE_HAS_NO_SYMBOL: Code<() => string>;

                                property JSII_1002_UNSPECIFIED_PROMISE

                                static readonly JSII_1002_UNSPECIFIED_PROMISE: Code<() => string>;

                                  property JSII_1003_UNSUPPORTED_TYPE

                                  static readonly JSII_1003_UNSUPPORTED_TYPE: Code<(messageText: any) => any>;

                                    property JSII_1004_DUPLICATE_ENUM_VALUE

                                    static readonly JSII_1004_DUPLICATE_ENUM_VALUE: Code<
                                    (enumValue: string, enumMemberNames: string[]) => string
                                    >;

                                      property JSII_1005_SEPARATE_WRITE_TYPE

                                      static readonly JSII_1005_SEPARATE_WRITE_TYPE: Code<() => string>;

                                        property JSII_1006_GENERIC_TYPE

                                        static readonly JSII_1006_GENERIC_TYPE: Code<() => string>;

                                          property JSII_1999_UNSUPPORTED

                                          static readonly JSII_1999_UNSUPPORTED: Code<
                                          ({
                                          what,
                                          alternative,
                                          suggestInternal,
                                          }: {
                                          what: string;
                                          alternative?: string;
                                          suggestInternal?: boolean;
                                          }) => string
                                          >;

                                            property JSII_2000_MISSING_DIRECTIVE_ARGUMENT

                                            static readonly JSII_2000_MISSING_DIRECTIVE_ARGUMENT: Code<() => string>;

                                              property JSII_2100_STRUCT_ON_NON_INTERFACE

                                              static readonly JSII_2100_STRUCT_ON_NON_INTERFACE: Code<() => string>;

                                                property JSII_2999_UNKNOWN_DIRECTIVE

                                                static readonly JSII_2999_UNKNOWN_DIRECTIVE: Code<(text: string) => string>;

                                                  property JSII_3000_EXPORTED_API_USES_HIDDEN_TYPE

                                                  static readonly JSII_3000_EXPORTED_API_USES_HIDDEN_TYPE: Code<
                                                  (badFqn: any) => string
                                                  >;

                                                    property JSII_3001_EXPOSED_INTERNAL_TYPE

                                                    static readonly JSII_3001_EXPOSED_INTERNAL_TYPE: Code<
                                                    (symbol: ts.Symbol, isThisType: boolean, typeUse: string) => string
                                                    >;

                                                      property JSII_3002_USE_OF_UNEXPORTED_FOREIGN_TYPE

                                                      static readonly JSII_3002_USE_OF_UNEXPORTED_FOREIGN_TYPE: Code<
                                                      (fqn: string, typeUse: string, pkg: { readonly name: string }) => string
                                                      >;

                                                        property JSII_3003_SYMBOL_IS_EXPORTED_TWICE

                                                        static readonly JSII_3003_SYMBOL_IS_EXPORTED_TWICE: Code<
                                                        (ns1: string, ns2: string) => string
                                                        >;

                                                          property JSII_3004_INVALID_SUPERTYPE

                                                          static readonly JSII_3004_INVALID_SUPERTYPE: Code<
                                                          (clause: ts.HeritageClause, badDeclaration: ts.Declaration) => string
                                                          >;

                                                            property JSII_3005_TYPE_USED_AS_INTERFACE

                                                            static readonly JSII_3005_TYPE_USED_AS_INTERFACE: Code<
                                                            (badType: spec.TypeReference) => string
                                                            >;

                                                              property JSII_3006_TYPE_USED_AS_CLASS

                                                              static readonly JSII_3006_TYPE_USED_AS_CLASS: Code<
                                                              (badType: spec.TypeReference) => string
                                                              >;

                                                                property JSII_3007_ILLEGAL_STRUCT_EXTENSION

                                                                static readonly JSII_3007_ILLEGAL_STRUCT_EXTENSION: Code<
                                                                (offender: spec.Type, struct: spec.InterfaceType) => string
                                                                >;

                                                                  property JSII_3008_STRUCT_PROPS_MUST_BE_READONLY

                                                                  static readonly JSII_3008_STRUCT_PROPS_MUST_BE_READONLY: Code<
                                                                  (propName: string, struct: spec.InterfaceType) => string
                                                                  >;

                                                                    property JSII_3009_OPTIONAL_PARAMETER_BEFORE_REQUIRED

                                                                    static readonly JSII_3009_OPTIONAL_PARAMETER_BEFORE_REQUIRED: Code<
                                                                    (param: spec.Parameter, nextParam: spec.Parameter) => string
                                                                    >;

                                                                      property JSII_3999_INCOHERENT_TYPE_MODEL

                                                                      static readonly JSII_3999_INCOHERENT_TYPE_MODEL: Code<(messageText: any) => any>;

                                                                        property JSII_4000_FAILED_TSCONFIG_VALIDATION

                                                                        static readonly JSII_4000_FAILED_TSCONFIG_VALIDATION: Code<
                                                                        (config: string, ruleSet: string, violations: Array<Violation>) => string
                                                                        >;

                                                                          property JSII_4009_DISABLED_TSCONFIG_VALIDATION

                                                                          static readonly JSII_4009_DISABLED_TSCONFIG_VALIDATION: Code<
                                                                          (config: string) => string
                                                                          >;

                                                                            property JSII_5000_JAVA_GETTERS

                                                                            static readonly JSII_5000_JAVA_GETTERS: Code<
                                                                            (badName: string, typeName: string) => string
                                                                            >;

                                                                              property JSII_5001_JAVA_SETTERS

                                                                              static readonly JSII_5001_JAVA_SETTERS: Code<
                                                                              (badName: string, typeName: string) => string
                                                                              >;

                                                                                property JSII_5002_OVERRIDE_CHANGES_VISIBILITY

                                                                                static readonly JSII_5002_OVERRIDE_CHANGES_VISIBILITY: Code<
                                                                                (
                                                                                newElement: string,
                                                                                action: string,
                                                                                newValue: 'protected' | 'public',
                                                                                oldValue: 'protected' | 'public'
                                                                                ) => string
                                                                                >;

                                                                                  property JSII_5003_OVERRIDE_CHANGES_RETURN_TYPE

                                                                                  static readonly JSII_5003_OVERRIDE_CHANGES_RETURN_TYPE: Code<
                                                                                  (
                                                                                  newElement: string,
                                                                                  action: string,
                                                                                  newValue: string,
                                                                                  oldValue: string
                                                                                  ) => string
                                                                                  >;

                                                                                    property JSII_5004_OVERRIDE_CHANGES_PROP_TYPE

                                                                                    static readonly JSII_5004_OVERRIDE_CHANGES_PROP_TYPE: Code<
                                                                                    (
                                                                                    newElement: string,
                                                                                    action: string,
                                                                                    newType: spec.TypeReference,
                                                                                    oldType: spec.TypeReference
                                                                                    ) => string
                                                                                    >;

                                                                                      property JSII_5005_OVERRIDE_CHANGES_PARAM_COUNT

                                                                                      static readonly JSII_5005_OVERRIDE_CHANGES_PARAM_COUNT: Code<
                                                                                      (
                                                                                      newElement: string,
                                                                                      action: string,
                                                                                      newCount: number,
                                                                                      oldCount: number
                                                                                      ) => string
                                                                                      >;

                                                                                        property JSII_5006_OVERRIDE_CHANGES_PARAM_TYPE

                                                                                        static readonly JSII_5006_OVERRIDE_CHANGES_PARAM_TYPE: Code<
                                                                                        (
                                                                                        newElement: string,
                                                                                        action: string,
                                                                                        newParam: spec.Parameter,
                                                                                        oldParam: spec.Parameter
                                                                                        ) => string
                                                                                        >;

                                                                                          property JSII_5007_OVERRIDE_CHANGES_VARIADIC

                                                                                          static readonly JSII_5007_OVERRIDE_CHANGES_VARIADIC: Code<
                                                                                          (
                                                                                          newElement: string,
                                                                                          action: string,
                                                                                          newVariadic?: any,
                                                                                          oldVariadic?: any
                                                                                          ) => string
                                                                                          >;

                                                                                            property JSII_5008_OVERRIDE_CHANGES_PARAM_OPTIONAL

                                                                                            static readonly JSII_5008_OVERRIDE_CHANGES_PARAM_OPTIONAL: Code<
                                                                                            (
                                                                                            newElement: string,
                                                                                            action: string,
                                                                                            newParam: spec.Parameter,
                                                                                            oldParam: spec.Parameter
                                                                                            ) => string
                                                                                            >;

                                                                                              property JSII_5009_OVERRIDE_CHANGES_PROP_OPTIONAL

                                                                                              static readonly JSII_5009_OVERRIDE_CHANGES_PROP_OPTIONAL: Code<
                                                                                              (
                                                                                              newElement: string,
                                                                                              action: string,
                                                                                              newOptional?: any,
                                                                                              oldOptional?: any
                                                                                              ) => string
                                                                                              >;

                                                                                                property JSII_5010_OVERRIDE_CHANGES_MUTABILITY

                                                                                                static readonly JSII_5010_OVERRIDE_CHANGES_MUTABILITY: Code<
                                                                                                (
                                                                                                newElement: string,
                                                                                                action: string,
                                                                                                newReadonly?: any,
                                                                                                oldReadonly?: any
                                                                                                ) => string
                                                                                                >;

                                                                                                  property JSII_5011_SUBMODULE_NAME_CONFLICT

                                                                                                  static readonly JSII_5011_SUBMODULE_NAME_CONFLICT: Code<
                                                                                                  (
                                                                                                  submoduleName: string,
                                                                                                  typeName: string,
                                                                                                  reserved: readonly string[]
                                                                                                  ) => string
                                                                                                  >;

                                                                                                    property JSII_5012_NAMESPACE_IN_TYPE

                                                                                                    static readonly JSII_5012_NAMESPACE_IN_TYPE: Code<
                                                                                                    (typeName: string, namespaceName: string) => string
                                                                                                    >;

                                                                                                      property JSII_5013_STATIC_INSTANCE_CONFLICT

                                                                                                      static readonly JSII_5013_STATIC_INSTANCE_CONFLICT: Code<
                                                                                                      (member: string, type: spec.ClassType) => string
                                                                                                      >;

                                                                                                        property JSII_5014_INHERITED_STATIC_CONFLICT

                                                                                                        static readonly JSII_5014_INHERITED_STATIC_CONFLICT: Code<
                                                                                                        (
                                                                                                        member: spec.Method | spec.Property,
                                                                                                        type: spec.ClassType,
                                                                                                        baseMember: spec.Method | spec.Property,
                                                                                                        baseType: spec.ClassType
                                                                                                        ) => string
                                                                                                        >;

                                                                                                          property JSII_5015_REDECLARED_INTERFACE_MEMBER

                                                                                                          static readonly JSII_5015_REDECLARED_INTERFACE_MEMBER: Code<
                                                                                                          (memberName: string, iface: spec.InterfaceType) => string
                                                                                                          >;

                                                                                                            property JSII_5016_PROHIBITED_MEMBER_NAME

                                                                                                            static readonly JSII_5016_PROHIBITED_MEMBER_NAME: Code<
                                                                                                            (badName: string) => string
                                                                                                            >;

                                                                                                              property JSII_5017_POSITIONAL_KEYWORD_CONFLICT

                                                                                                              static readonly JSII_5017_POSITIONAL_KEYWORD_CONFLICT: Code<
                                                                                                              (badName: string) => string
                                                                                                              >;

                                                                                                                property JSII_5018_RESERVED_WORD

                                                                                                                static readonly JSII_5018_RESERVED_WORD: Code<
                                                                                                                (badName: string, languages: readonly string[]) => string
                                                                                                                >;

                                                                                                                  property JSII_5019_MEMBER_TYPE_NAME_CONFLICT

                                                                                                                  static readonly JSII_5019_MEMBER_TYPE_NAME_CONFLICT: Code<
                                                                                                                  (
                                                                                                                  memberKind: 'method' | 'property',
                                                                                                                  memberSymbol: ts.Symbol,
                                                                                                                  declaringType: spec.Type
                                                                                                                  ) => string
                                                                                                                  >;

                                                                                                                    property JSII_5020_STATIC_MEMBER_CONFLICTS_WITH_NESTED_TYPE

                                                                                                                    static readonly JSII_5020_STATIC_MEMBER_CONFLICTS_WITH_NESTED_TYPE: Code<
                                                                                                                    (
                                                                                                                    nestingType: spec.Type,
                                                                                                                    staticMember: spec.Property | spec.Method | spec.EnumMember,
                                                                                                                    nestedType: spec.Type
                                                                                                                    ) => string
                                                                                                                    >;

                                                                                                                      property JSII_5021_ABSTRACT_CLASS_MISSING_PROP_IMPL

                                                                                                                      static readonly JSII_5021_ABSTRACT_CLASS_MISSING_PROP_IMPL: Code<
                                                                                                                      (intf: spec.InterfaceType, cls: spec.ClassType, prop: string) => string
                                                                                                                      >;

                                                                                                                        property JSII_7000_NON_EXISTENT_PARAMETER

                                                                                                                        static readonly JSII_7000_NON_EXISTENT_PARAMETER: Code<
                                                                                                                        (method: spec.Method, param: string) => string
                                                                                                                        >;

                                                                                                                          property JSII_7001_ILLEGAL_HINT

                                                                                                                          static readonly JSII_7001_ILLEGAL_HINT: Code<
                                                                                                                          (hint: keyof TypeSystemHints, ...valid: readonly string[]) => string
                                                                                                                          >;

                                                                                                                            property JSII_7999_DOCUMENTATION_ERROR

                                                                                                                            static readonly JSII_7999_DOCUMENTATION_ERROR: Code<(messageText: any) => any>;

                                                                                                                              property JSII_8000_PASCAL_CASED_TYPE_NAMES

                                                                                                                              static readonly JSII_8000_PASCAL_CASED_TYPE_NAMES: Code<
                                                                                                                              (badName: string, expectedName?: string) => string
                                                                                                                              >;

                                                                                                                                property JSII_8001_ALL_CAPS_ENUM_MEMBERS

                                                                                                                                static readonly JSII_8001_ALL_CAPS_ENUM_MEMBERS: Code<
                                                                                                                                (badName: string, typeName: string) => string
                                                                                                                                >;

                                                                                                                                  property JSII_8002_CAMEL_CASED_MEMBERS

                                                                                                                                  static readonly JSII_8002_CAMEL_CASED_MEMBERS: Code<
                                                                                                                                  (badName: string, typeName: string) => string
                                                                                                                                  >;

                                                                                                                                    property JSII_8003_STATIC_CONST_CASING

                                                                                                                                    static readonly JSII_8003_STATIC_CONST_CASING: Code<
                                                                                                                                    (badName: string, typeName: string) => string
                                                                                                                                    >;

                                                                                                                                      property JSII_8004_SUBMOULE_NAME_CASING

                                                                                                                                      static readonly JSII_8004_SUBMOULE_NAME_CASING: Code<
                                                                                                                                      (badName: string) => string
                                                                                                                                      >;

                                                                                                                                        property JSII_8005_INTERNAL_UNDERSCORE

                                                                                                                                        static readonly JSII_8005_INTERNAL_UNDERSCORE: Code<(badName: string) => string>;

                                                                                                                                          property JSII_8006_UNDERSCORE_INTERNAL

                                                                                                                                          static readonly JSII_8006_UNDERSCORE_INTERNAL: Code<(badName: string) => string>;

                                                                                                                                            property JSII_8007_BEHAVIORAL_INTERFACE_NAME

                                                                                                                                            static readonly JSII_8007_BEHAVIORAL_INTERFACE_NAME: Code<
                                                                                                                                            (badName: string) => string
                                                                                                                                            >;

                                                                                                                                              property JSII_9000_UNKNOWN_MODULE

                                                                                                                                              static readonly JSII_9000_UNKNOWN_MODULE: Code<(moduleName: any) => string>;

                                                                                                                                                property JSII_9001_TYPE_NOT_FOUND

                                                                                                                                                static readonly JSII_9001_TYPE_NOT_FOUND: Code<
                                                                                                                                                (typeRef: spec.NamedTypeReference) => string
                                                                                                                                                >;

                                                                                                                                                  property JSII_9002_UNRESOLVEABLE_TYPE

                                                                                                                                                  static readonly JSII_9002_UNRESOLVEABLE_TYPE: Code<
                                                                                                                                                  (reference: string) => string
                                                                                                                                                  >;

                                                                                                                                                    property JSII_9003_UNRESOLVEABLE_MODULE

                                                                                                                                                    static readonly JSII_9003_UNRESOLVEABLE_MODULE: Code<
                                                                                                                                                    (location: string) => string
                                                                                                                                                    >;

                                                                                                                                                      property JSII_9004_UNABLE_TO_COMPUTE_SIGNATURE

                                                                                                                                                      static readonly JSII_9004_UNABLE_TO_COMPUTE_SIGNATURE: Code<
                                                                                                                                                      (methodName: string, type: spec.Type) => string
                                                                                                                                                      >;

                                                                                                                                                        property JSII_9996_UNNECESSARY_TOKEN

                                                                                                                                                        static readonly JSII_9996_UNNECESSARY_TOKEN: Code<() => string>;

                                                                                                                                                          property JSII_9997_UNKNOWN_ERROR

                                                                                                                                                          static readonly JSII_9997_UNKNOWN_ERROR: Code<(error: Error) => string>;

                                                                                                                                                            property JSII_9998_UNSUPPORTED_NODE

                                                                                                                                                            static readonly JSII_9998_UNSUPPORTED_NODE: Code<
                                                                                                                                                            (kindOrMessage: ts.SyntaxKind | string) => string
                                                                                                                                                            >;

                                                                                                                                                              property jsiiCode

                                                                                                                                                              readonly jsiiCode: number;

                                                                                                                                                                property length

                                                                                                                                                                readonly length: number;

                                                                                                                                                                  property messageText

                                                                                                                                                                  readonly messageText: any;

                                                                                                                                                                    property relatedInformation

                                                                                                                                                                    readonly relatedInformation: ts.DiagnosticRelatedInformation[];

                                                                                                                                                                      property start

                                                                                                                                                                      readonly start: number;

                                                                                                                                                                        method addRelatedInformation

                                                                                                                                                                        addRelatedInformation: (
                                                                                                                                                                        node: ts.Node,
                                                                                                                                                                        message: JsiiDiagnostic['messageText']
                                                                                                                                                                        ) => this;

                                                                                                                                                                          method addRelatedInformationIf

                                                                                                                                                                          addRelatedInformationIf: (
                                                                                                                                                                          node: ts.Node | undefined,
                                                                                                                                                                          message: JsiiDiagnostic['messageText']
                                                                                                                                                                          ) => this;
                                                                                                                                                                          • Links the provided node with the specified message as related to the current diagnostic, unless node is undefined.

                                                                                                                                                                            Parameter node

                                                                                                                                                                            the node where the message should be attached, if any.

                                                                                                                                                                            Parameter message

                                                                                                                                                                            the message to be attached to the diagnostic entry.

                                                                                                                                                                            Returns

                                                                                                                                                                            this

                                                                                                                                                                          method format

                                                                                                                                                                          format: (projectRoot: string) => string;
                                                                                                                                                                          • Formats this diagnostic with color and context if possible, and returns it. The formatted diagnostic is cached, so that it can be re-used. This is useful for diagnostic messages involving trivia -- as the trivia may have been obliterated from the SourceFile by the TsCommentReplacer, which makes the error messages really confusing.

                                                                                                                                                                          method isJsiiDiagnostic

                                                                                                                                                                          static isJsiiDiagnostic: (diag: ts.Diagnostic) => diag is JsiiDiagnostic;
                                                                                                                                                                          • Determines whether a Diagnostic instance is a JsiiDiagnostic or not.

                                                                                                                                                                            Parameter diag

                                                                                                                                                                          method maybeAddRelatedInformation

                                                                                                                                                                          maybeAddRelatedInformation: (
                                                                                                                                                                          node: ts.Node | undefined,
                                                                                                                                                                          message: JsiiDiagnostic['messageText']
                                                                                                                                                                          ) => this;
                                                                                                                                                                          • Adds related information to this JsiiDiagnostic instance if the provided node is defined.

                                                                                                                                                                            Parameter node

                                                                                                                                                                            the node to bind as related information, or undefined.

                                                                                                                                                                            Parameter message

                                                                                                                                                                            the message to attach to the related information.

                                                                                                                                                                            Returns

                                                                                                                                                                            this

                                                                                                                                                                          class TestWorkspace

                                                                                                                                                                          class TestWorkspace {}
                                                                                                                                                                          • An NPM-ready workspace where we can install test-compile dependencies and compile new assemblies

                                                                                                                                                                          property rootDirectory

                                                                                                                                                                          readonly rootDirectory: string;

                                                                                                                                                                            method addDependency

                                                                                                                                                                            addDependency: (dependencyAssembly: HelperCompilationResult) => void;
                                                                                                                                                                            • Add a test-compiled jsii assembly as a dependency

                                                                                                                                                                            method cleanup

                                                                                                                                                                            cleanup: () => void;

                                                                                                                                                                              method create

                                                                                                                                                                              static create: () => TestWorkspace;
                                                                                                                                                                              • Create a new workspace.

                                                                                                                                                                                Creates a temporary directory, don't forget to call cleanUp

                                                                                                                                                                              method dependencyDir

                                                                                                                                                                              dependencyDir: (name: string) => string;

                                                                                                                                                                                method withWorkspace

                                                                                                                                                                                static withWorkspace: <A>(block: (ws: TestWorkspace) => A) => A;
                                                                                                                                                                                • Execute a block with a temporary workspace

                                                                                                                                                                                Interfaces

                                                                                                                                                                                interface HelperCompilationResult

                                                                                                                                                                                interface HelperCompilationResult {}

                                                                                                                                                                                  property assembly

                                                                                                                                                                                  readonly assembly: spec.Assembly;
                                                                                                                                                                                  • The generated assembly

                                                                                                                                                                                  property compressAssembly

                                                                                                                                                                                  readonly compressAssembly: boolean;
                                                                                                                                                                                  • Whether to compress the assembly file

                                                                                                                                                                                  property files

                                                                                                                                                                                  readonly files: Record<string, string>;
                                                                                                                                                                                  • Generated .js/.d.ts file(s)

                                                                                                                                                                                  property packageJson

                                                                                                                                                                                  readonly packageJson: PackageJson;
                                                                                                                                                                                  • The packageInfo used

                                                                                                                                                                                  interface TestCompilationOptions

                                                                                                                                                                                  interface TestCompilationOptions {}

                                                                                                                                                                                    property compilationDirectory

                                                                                                                                                                                    readonly compilationDirectory?: string;
                                                                                                                                                                                    • The directory in which we write and compile the files

                                                                                                                                                                                    property compressAssembly

                                                                                                                                                                                    readonly compressAssembly?: boolean;
                                                                                                                                                                                    • Whether to compress the assembly file.

                                                                                                                                                                                      false

                                                                                                                                                                                    property packageJson

                                                                                                                                                                                    readonly packageJson?: Partial<PackageJson>;
                                                                                                                                                                                    • Parts of projectInfo to override (package name etc)

                                                                                                                                                                                      - Use some default values

                                                                                                                                                                                    property projectInfo

                                                                                                                                                                                    readonly projectInfo?: Partial<PackageJson>;
                                                                                                                                                                                    • Parts of projectInfo to override (package name etc)

                                                                                                                                                                                      Deprecated

                                                                                                                                                                                      Prefer using packageJson instead.

                                                                                                                                                                                    Type Aliases

                                                                                                                                                                                    type DiagnosticMessageFormatter

                                                                                                                                                                                    type DiagnosticMessageFormatter = (...args: any[]) => JsiiDiagnostic['messageText'];

                                                                                                                                                                                      type MultipleSourceFiles

                                                                                                                                                                                      type MultipleSourceFiles = {
                                                                                                                                                                                      'index.ts': string;
                                                                                                                                                                                      [name: string]: string;
                                                                                                                                                                                      };
                                                                                                                                                                                      • A set of source files for sourceToAssemblyHelper, at least containing 'index.ts'

                                                                                                                                                                                      type PackageInfo

                                                                                                                                                                                      type PackageInfo = PackageJson;

                                                                                                                                                                                        Package Files (4)

                                                                                                                                                                                        Dependencies (12)

                                                                                                                                                                                        Dev Dependencies (33)

                                                                                                                                                                                        Peer Dependencies (0)

                                                                                                                                                                                        No peer dependencies.

                                                                                                                                                                                        Badge

                                                                                                                                                                                        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/jsii.

                                                                                                                                                                                        • Markdown
                                                                                                                                                                                          [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/jsii)
                                                                                                                                                                                        • HTML
                                                                                                                                                                                          <a href="https://www.jsdocs.io/package/jsii"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>