@typespec/http-server-js
Version:
TypeSpec HTTP server code generator for JavaScript
26 lines • 1.25 kB
TypeScript
import { Model } from "@typespec/compiler";
import { JsContext, Module } from "../ctx.js";
/**
* Emit a model declaration.
*
* @param ctx - The emitter context.
* @param model - The model to emit.
* @param module - The module that this model is written into.
* @param altName - An alternative name to use for the model if it is not named.
*/
export declare function emitModel(ctx: JsContext, model: Model, module: Module, altName?: string): Iterable<string>;
export declare function emitModelLiteral(ctx: JsContext, model: Model, module: Module): string;
/**
* Determines whether a model is an instance of a well-known model, such as TypeSpec.Record or TypeSpec.Array.
*/
export declare function isWellKnownModel(ctx: JsContext, type: Model): boolean;
/**
* Emits a well-known model, such as TypeSpec.Record or TypeSpec.Array.
*
* @param ctx - The emitter context.
* @param type - The model to emit.
* @param module - The module that this model is written into.
* @param preferredAlternativeName - An alternative name to use for the model if it is not named.
*/
export declare function emitWellKnownModel(ctx: JsContext, type: Model, module: Module, preferredAlternativeName?: string): string;
//# sourceMappingURL=model.d.ts.map