Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface PipelineIO

Provides file I/O support to the pipeline

Hierarchy

  • PipelineIO

Index

Properties

Readonly destinationPath

destinationPath: string

Path to destination directory

Readonly sourcePath

sourcePath: string

Path to source directory

Methods

createResPath

  • createResPath(type: MimeType, contents: string): string
  • Generates a unique resource path in destinationPath that can be used for a generated resource. This method does not create the file, only reserves the path.

    Parameters

    • type: MimeType

      MIME type of the resource to create

    • contents: string

      Contents of the file

    Returns string

    returns a unique resource path that is acceptable for the specified MIME type

createResource

  • createResource(type: MimeType, contents: string): Promise<string>
  • Creates a new output resource and generates a resource path to reference it This should be used for all generated resources, such as external stylesheets. Path will be computed by using resPath relative to destinationPath. See resolveDestinationResource for details.

    Parameters

    • type: MimeType

      MIME type of the new resource

    • contents: string

      File contents

    Returns Promise<string>

    path to resource

getDestinationResPathForAbsolutePath

  • getDestinationResPathForAbsolutePath(rawResPath: string): string

getResource

  • getResource(type: MimeType, resPath: string): Promise<string>
  • Reads a resource of a specified type from the pipeline input. Path will be computed by using resPath relative to sourcePath. See resolveSourceResource for details.

    Parameters

    • type: MimeType

      Type of resource

    • resPath: string

      Relative path to resource (source and destination)

    Returns Promise<string>

    text content of resource

getSourceResPathForAbsolutePath

  • getSourceResPathForAbsolutePath(rawResPath: string): string

resolveDestinationResource

  • resolveDestinationResource(resPath: string): string

resolveSourceResource

  • resolveSourceResource(resPath: string): string
  • Gets the absolute path to a resource in sourcePath.

    Parameters

    • resPath: string

      Raw path to resource

    Returns string

    Real path to resource

writeResource

  • writeResource(type: MimeType, resPath: string, contents: string): Promise<void>
  • Writes a resource of a specified type to the pipeline output. This resource must map directly to a source resource, for generated output use createResource(). Path will be computed by using resPath relative to destinationPath. See resolveDestinationResource for details.

    Parameters

    • type: MimeType

      Type of resource

    • resPath: string

      Relative path to resource (source and destination)

    • contents: string

      File contents as a UTF-8 string

    Returns Promise<void>

Generated using TypeDoc