mongodb-schema
Version:
Infer the probabilistic schema for a MongoDB collection.
14 lines (13 loc) • 1.65 kB
TypeScript
import { SchemaAccessor } from './schema-accessor';
import { SchemaAnalyzer } from './schema-analyzer';
import type { ArraySchemaType, BaseSchemaType, ConstantSchemaType, DocumentSchemaType, PrimitiveSchemaType, SchemaType, Schema as InternalSchema, SchemaField, SchemaParseOptions, SimplifiedSchemaBaseType, SimplifiedSchemaArrayType, SimplifiedSchemaDocumentType, SimplifiedSchemaType, SimplifiedSchemaField, SimplifiedSchema } from './schema-analyzer';
import * as schemaStats from './stats';
import { AnyIterable, StandardJSONSchema, MongoDBJSONSchema, ExpandedJSONSchema, JSONSchema } from './types';
import { toTypescriptTypeDefinition } from './to-typescript';
declare function analyzeDocuments(source: AnyIterable, options?: SchemaParseOptions): Promise<SchemaAccessor>;
declare function parseSchema(source: AnyIterable, options?: Partial<SchemaParseOptions>): Promise<InternalSchema>;
declare function getSchemaPaths(source: AnyIterable): Promise<string[][]>;
declare function getSimplifiedSchema(source: AnyIterable): Promise<SimplifiedSchema>;
export default parseSchema;
export type { ArraySchemaType, BaseSchemaType, ConstantSchemaType, DocumentSchemaType, PrimitiveSchemaType, SchemaType, InternalSchema as Schema, InternalSchema, SchemaField, SchemaParseOptions, SimplifiedSchemaBaseType, SimplifiedSchemaArrayType, SimplifiedSchemaDocumentType, SimplifiedSchemaType, SimplifiedSchemaField, SimplifiedSchema, StandardJSONSchema, MongoDBJSONSchema, ExpandedJSONSchema, JSONSchema, SchemaAccessor };
export { parseSchema, analyzeDocuments, getSchemaPaths, getSimplifiedSchema, SchemaAnalyzer, schemaStats, toTypescriptTypeDefinition };