data-to-jsonschema-to-ts
Version:
Convert plain javascript objects to JSON Schema and TypeScript typings
56 lines • 1.14 kB
TypeScript
export type JsonSchema = {
$schema: string;
title: string;
};
export type AnyType = {
anyOf: [
{
type: "null";
},
{
type: "boolean";
},
{
type: "number";
},
{
type: "string";
},
{
type: "object";
},
{
type: "array";
}
];
};
export declare const ANY_TYPE: AnyType;
export type JsonArrayItems = undefined | {
anyOf?: JsonType[];
};
export type NullType = {
type: "null";
};
export type BooleanType = {
type: "boolean";
};
export type NumberType = {
type: "number";
};
export type StringType = {
type: "string";
};
export type ObjectType = {
type: "object";
properties?: Record<string, JsonType> | {
oneOf: JsonType[];
};
required?: string[];
additionalProperties?: boolean | AnyType;
};
export type ArrayType = {
type: "array";
items?: JsonArrayItems;
};
export type JsonType = NullType | BooleanType | NumberType | StringType | ObjectType | ArrayType;
//# sourceMappingURL=json-schema-types.d.ts.map