import * as S from './schema'; import { Schema, Literals } from './schema'; export type FormatField = { typeId: number; $ref: string; description?: string; deprecated?: string; }; export type FormatFields = { [key: string]: FormatField; }; export type FormatObjectType = { type: 'Object'; name: string; fields: FormatFields; namespace?: string; }; export type FormatStructType = { type: 'Struct'; name?: string; fields: FormatFields; namespace?: string; }; export type FormatScalarType = { type: 'Scalar'; valueType: string; valueName: string; }; export type FormatLiteralType = { type: 'Literal'; value: Literals; }; export type FormatRecordType = { type: 'Record'; valueTypeId: number; $ref: string; }; export type FormatListType = { type: 'List'; itemTypeId: number; $ref: string; }; export type FormatNullableType = { type: 'Nullable'; itemTypeId: number; $ref: string; }; export type FormatOptionalType = { type: 'Optional'; itemTypeId: number; $ref: string; }; export type FormatUnionType = { type: 'Union'; name?: string; itemTypes: { typeId: number; $ref: string; }[]; namespace?: string; }; export type FormatIntersectType = { type: 'Intersect'; name?: string; itemTypes: { typeId: number; $ref: string; }[]; namespace?: string; }; export type FormatTupleType = { type: 'Tuple'; name?: string; itemTypes: { typeId: number; $ref: string; }[]; namespace?: string; }; export type FormatStrictType = { type: 'Strict'; itemTypeId: number; $ref: string; }; export type FormatNonStrictType = { type: 'NonStrict'; itemTypeId: number; $ref: string; }; export type FormatReadOnlyType = { type: 'ReadOnly'; itemTypeId: number; $ref: string; }; export type FormatReadonlyDeepType = { type: 'ReadOnlyDeep'; itemTypeId: number; $ref: string; }; export type FormatType = FormatScalarType | FormatObjectType | FormatUnionType | FormatStructType | FormatRecordType | FormatListType | FormatLiteralType | FormatNullableType | FormatOptionalType | FormatIntersectType | FormatTupleType | FormatStrictType | FormatNonStrictType | FormatReadOnlyType | FormatReadonlyDeepType; export type FormatTypes = { [key: string]: FormatType; }; export type FormatContext = { addType: (type: FormatType) => number; formatCache: WeakMap; }; export type FormatterMethods = { format(context: FormatContext): number; }; export type FormatterImpl = FormatterMethods | ((schema: T) => FormatterMethods); export type NamedFormatType = FormatTupleType | FormatStructType | FormatUnionType | FormatIntersectType | FormatObjectType; export declare const isNamedFormatType: (input: FormatType) => input is NamedFormatType; export declare const Formatter: { impl(Ctor: abstract new () => T, impl: FormatterImpl): void; get(Ctor: T_1): FormatterMethods | undefined; formatSchema(Ctor: T_2, ctx: FormatContext): number; format(Ctor: T_3, context?: FormatContext): { typeId: number; types: FormatTypes; }; }; export declare const formatSchema: (Ctor: T, context?: FormatContext) => { typeId: number; types: FormatTypes; };