PdfPartBuilderBase abstract class

PdfPartBuilderBase is class that build all pdfParts and can contain them in one array of with type PdfPartProcessor with abstract async method buildParts that returns Content from pdfmake/interfaces module

It contains information about localization, pdfStyle and Openapi specification parsed with SwaggerParser

Also PdfPartBuilderBase can add new part to array of parts with abstract async method addPart and addParts

Abstract

Hierarchy

Constructors

Properties

_openapiInfo: OpenapiInfoV3
_options?: IRavageOptions
_pdfParts: PdfPartProcessor[]

Methods

  • Add new part to array of parts

    Example

    async function main() {
    const partsBuilder = new PartBuilder(
    localization,
    pdfStyle,
    includeExamples
    );
    await partsBuilder.addPart(new Part1());
    }

    main();

    Parameters

    Returns Promise<void>

  • Add new parts to array of parts

    Example

    async function main() {
    const partsBuilder = new PartBuilder(
    localization,
    pdfStyle,
    includeExamples
    );
    await partsBuilder.addParts([new Part1(), new Part2()]);
    }

    main();

    Parameters

    Returns Promise<void>

  • Build all pdfParts and return array of them

    Example

    async function main() {
    const partsBuilder = new PartBuilder(
    localization,
    pdfStyle,
    includeExamples
    );
    await partsBuilder.addPart(new Part1());
    await partsBuilder.addPart(new Part2());
    await partsBuilder.buildParts();
    }

    main();

    Example

    async function main() {
    const partsBuilder = new PartBuilder(
    localization,
    pdfStyle,
    includeExamples
    );
    await partsBuilder.addParts([new Part1(), new Part2()]);
    await partsBuilder.buildParts();
    }

    main();

    Parameters

    • apiPath: string | Document<{}>

      path to api specification file or url

    Returns Promise<Content>

  • Method that clean array of parts

    Example

    async function main() {
    const partsBuilder = new PartBuilder(
    localization,
    pdfStyle,
    includeExamples
    );
    partsBuilder.cleanParts();
    }

    main();

    Returns Promise<void>

Generated using TypeDoc