Skip to content

Commit

Permalink
Export various emitter-related types from the JSON Schema package (#2144
Browse files Browse the repository at this point in the history
)
  • Loading branch information
bterlson authored Jul 5, 2023
1 parent 5764672 commit 874cceb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/json-schema",
"comment": "Export the emitter and related types from the package.",
"type": "none"
}
],
"packageName": "@typespec/json-schema"
}
4 changes: 3 additions & 1 deletion packages/json-schema/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import {
import { JsonSchemaEmitter } from "./json-schema-emitter.js";
import { JSONSchemaEmitterOptions, createStateSymbol } from "./lib.js";

export { $lib } from "./lib.js";
export { JsonSchemaEmitter } from "./json-schema-emitter.js";
export { $lib, EmitterOptionsSchema, JSONSchemaEmitterOptions } from "./lib.js";

export const namespace = "TypeSpec.JsonSchema";
export type JsonSchemaDeclaration = Model | Union | Enum | Scalar;

Expand Down
3 changes: 2 additions & 1 deletion packages/json-schema/src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface JSONSchemaEmitterOptions {
emitAllRefs?: boolean;
}

const EmitterOptionsSchema: JSONSchemaType<JSONSchemaEmitterOptions> = {
export const EmitterOptionsSchema: JSONSchemaType<JSONSchemaEmitterOptions> = {
type: "object",
additionalProperties: false,
properties: {
Expand Down Expand Up @@ -89,6 +89,7 @@ export const libDef = {
} as const;

export const $lib = createTypeSpecLibrary(libDef);

export const { reportDiagnostic, createStateSymbol } = $lib;

export type JsonSchemaLibrary = typeof $lib;

0 comments on commit 874cceb

Please sign in to comment.