import { Stream, StreamIO } from '../data/Stream'; import { DictType, EastType } from '../east'; import { ModulePath } from './Module'; import { Builder, Template } from './Template'; /** A {@link Builder} to create a template {@link Module}. * * Templates can be organised into a modules, which function as a kind of "namespace" for * streams, tasks and layouts. Other {@link Builder}s can be placed "inside" a module upon * construction. Any streams, tasks and layouts constructed by that builder will exist * inside that modules namespace. * * @example * ```ts * const module_a = new ModuleBuilder("a") * const module_b = new ModuleBuilder("b", module_a) * const source_c = new SourceBuilder("c", module_b).value(...) * ``` */ export declare class ModuleBuilder extends Builder { constructor(name: string, module?: ModuleBuilder | ModulePath); /** Return the "path" to this module from the root module, as an array containing the modules. */ path(): ModulePath; /** Create a module dynamically for each key-value entry in a dictionary stream. */ forEach(stream: Stream): DynamicModuleBuilder; /** Create a {@link StaticExportBuilder} to export a {@link Stream} from a module to its parent module. * * Note that it is not possible to access data streams from outside a module unless they have been explicitly exported. */ export(stream: Stream): StaticExportBuilder; toTemplate(): Template; } export declare class StaticExportBuilder extends Builder { private stream; /** @internal */ constructor(name: string, module: ModulePath, stream: Stream); /** Return the exported datastream. */ outputStream(): Stream; toTemplate(): { streams: { [x: string]: Stream; }; tasks: { [x: string]: { task_type: "static_export"; name: string; module: ModulePath; inputs: { input: StreamIO; }; outputs: { output: StreamIO; }; }; }; }; } export declare class DynamicModuleBuilder = {}> extends Builder { private stream; constructor(name: string, module: ModulePath, stream: Stream); /** Return the "path" to this module from the root module, as an array containing the modules */ path(): ModulePath; /** Create a {@link DynamicExportBuilder} to export a {@link Stream} from a set of dynamic modules to its parent module. * As a part of this process, the streams from the various dynamic modules will be coalesced into a single collection. * * Note that it is not possible to access data streams from outside a module unless they have been explicitly exported. */ export(stream: Stream): DictExportBuilder; exports(): { [K in keyof Exports]: Stream; }; toTemplate(): Template; } export declare class DictExportBuilder extends Builder { private module_stream; private stream; /** @internal */ constructor(name: string, module: ModulePath, module_stream: Stream, stream: Stream); outputStream(): Stream>; toTemplate(): { streams: { [x: string]: Stream>; }; tasks: { [x: string]: { task_type: "dynamic_export"; name: string; module: ModulePath; inputs: { input: StreamIO; keys: StreamIO; }; outputs: { output: StreamIO>; }; }; }; }; }