Interface ResourcesGenerator

Generator used to create resources relative to a given base identifier. Note that this is not an AsyncHandler since it returns an AsyncIterable instead of a promise.

interface ResourcesGenerator {
    generate: ((location: ResourceIdentifier, options: Dict<unknown>) => AsyncIterable<Resource>);
}

Implemented by

Properties

Properties

generate: ((location: ResourceIdentifier, options: Dict<unknown>) => AsyncIterable<Resource>)

Generates resources with the given options. The output Iterable should be sorted so that containers always appear before their contents.

Type declaration

    • (location, options): AsyncIterable<Resource>
    • Parameters

      • location: ResourceIdentifier

        Base identifier.

      • options: Dict<unknown>

        Options that can be used when generating resources.

      Returns AsyncIterable<Resource>

      A map where the keys are the identifiers and the values the corresponding representations to store.