@typespec/http-server-js
Version:
TypeSpec HTTP server code generator for JavaScript
38 lines • 1.73 kB
TypeScript
import { Namespace } from "@typespec/compiler";
import { JsContext, Module } from "../ctx.js";
import { OnceQueue } from "../util/once-queue.js";
/**
* Enqueue all declarations in the namespace to be included in the emit, recursively.
*
* @param ctx - The emitter context.
* @param namespace - The root namespace to begin traversing.
*/
export declare function visitAllTypes(ctx: JsContext, namespace: Namespace): void;
/**
* Create a module for a namespace, or get an existing module if one has already been created.
*
* @param ctx - The emitter context.
* @param namespace - The namespace to create a module for.
* @returns the module for the namespace.
*/
export declare function createOrGetModuleForNamespace(ctx: JsContext, namespace: Namespace, root?: Module): Module;
/**
* Get a reference to the interface representing the namespace's floating operations.
*
* This does not check that such an interface actually exists, so it should only be called in situations where it is
* known to exist (for example, if an operation comes from the namespace).
*
* @param ctx - The emitter context.
* @param namespace - The namespace to get the interface reference for.
* @param module - The module the the reference will be written to.
*/
export declare function emitNamespaceInterfaceReference(ctx: JsContext, namespace: Namespace, module: Module): string;
/**
* Emits the body of a module file.
*
* @param ctx - The emitter context.
* @param module - The module to emit.
* @param queue - The queue to add any submodules to for later processing.
*/
export declare function emitModuleBody(ctx: JsContext, module: Module, queue: OnceQueue<Module>): Iterable<string>;
//# sourceMappingURL=namespace.d.ts.map