diff --git a/src/index.ts b/src/index.ts index aa6ad6f..9c403e9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -21,7 +21,7 @@ import { convertInternalToExpanded } from './schema-converters/internalToExpande import { convertInternalToMongodb } from './schema-converters/internalToMongoDB'; import { convertInternalToStandard } from './schema-converters/internalToStandard'; import * as schemaStats from './stats'; -import { AnyIterable, StandardJSONSchema, MongoDBJSONSchema, ExpandedJSONSchema } from './types'; +import { AnyIterable, StandardJSONSchema, MongoDBJSONSchema, ExpandedJSONSchema, JSONSchema } from './types'; import { toTypescriptTypeDefinition } from './to-typescript'; /** @@ -86,6 +86,7 @@ export type { StandardJSONSchema, MongoDBJSONSchema, ExpandedJSONSchema, + JSONSchema, SchemaAccessor }; diff --git a/src/to-typescript.ts b/src/to-typescript.ts index a1ad3d4..75cfef9 100644 --- a/src/to-typescript.ts +++ b/src/to-typescript.ts @@ -1,7 +1,4 @@ -import type { JSONSchema4 } from 'json-schema'; -import type { MongoDBJSONSchema } from './types'; - -export type JSONSchema = Partial & MongoDBJSONSchema; +import type { JSONSchema } from './types'; function getBSONType(property: JSONSchema): string | string[] | undefined { return property.bsonType || property.type; diff --git a/src/types.ts b/src/types.ts index 5c340f4..854917a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -23,6 +23,8 @@ export type ExpandedJSONSchema = StandardJSONSchema & { anyOf?: ExpandedJSONSchema[]; } +export type JSONSchema = Partial & MongoDBJSONSchema; + export type AnyIterable = Iterable | AsyncIterable; type AnySchema = InternalSchema | StandardJSONSchema | MongoDBJSONSchema | ExpandedJSONSchema;