Skip to content

Commit

Permalink
export more api (#3723)
Browse files Browse the repository at this point in the history
- export more apis from http-client-csharp library so that those api can
be used in follow-up emitter.
- change NetEmitterOptions to interface: it can be extended; consistent
with others e.g. SdkEmitterOptions; it can used as partial scenario to
add more fields which may more suitable for plugin framework.
  • Loading branch information
chunyu3 committed Jul 10, 2024
1 parent 76bbb40 commit 311d99f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 11 additions & 0 deletions packages/http-client-csharp/emitter/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

export { configurationFileName, tspOutputFileName } from "./constants.js";
export * from "./emitter.js";
export { createDiagnostic, getTracer, reportDiagnostic } from "./lib/lib.js";
export { LoggerLevel } from "./lib/log-level.js";
export { Logger } from "./lib/logger.js";
export {
NetEmitterOptions,
NetEmitterOptionsSchema,
defaultOptions,
resolveOptions,
resolveOutputFolder,
} from "./options.js";
6 changes: 3 additions & 3 deletions packages/http-client-csharp/emitter/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { EmitContext, JSONSchemaType, resolvePath } from "@typespec/compiler";
import { tspOutputFileName } from "./constants.js";
import { LoggerLevel } from "./lib/log-level.js";

export type NetEmitterOptions = {
export interface NetEmitterOptions extends SdkEmitterOptions {
"api-version"?: string;
outputFile?: string;
logFile?: string;
Expand Down Expand Up @@ -32,7 +32,7 @@ export type NetEmitterOptions = {
"use-model-reader-writer"?: boolean;
"disable-xml-docs"?: boolean;
"plugin-name"?: string;
} & SdkEmitterOptions;
}

export const NetEmitterOptionsSchema: JSONSchemaType<NetEmitterOptions> = {
type: "object",
Expand Down Expand Up @@ -109,7 +109,7 @@ export const NetEmitterOptionsSchema: JSONSchemaType<NetEmitterOptions> = {
required: [],
};

const defaultOptions = {
export const defaultOptions = {
"api-version": "latest",
outputFile: tspOutputFileName,
logFile: "log.json",
Expand Down

0 comments on commit 311d99f

Please sign in to comment.