import * as _ from '@preserves/core'; import { Value, GenericEmbedded, Embeddable, Position, EncodableDictionary, Preservable, PreserveWritable } from '@preserves/core'; declare const $1 = 1; declare const $Boolean: symbol; declare const $ByteString: symbol; declare const $Double: symbol; declare const $SignedInteger: symbol; declare const $String: symbol; declare const $Symbol: symbol; declare const $and: symbol; declare const $any$1: symbol; declare const $atom: symbol; declare const $bundle: symbol; declare const $definitions: symbol; declare const $dict: symbol; declare const $dictof: symbol; declare const $embedded$1: symbol; declare const $embeddedType: symbol; declare const $lit: symbol; declare const $named: symbol; declare const $or: symbol; declare const $rec$1: symbol; declare const $ref$1: symbol; declare const $schema: symbol; declare const $seqof: symbol; declare const $setof: symbol; declare const $tuple: symbol; declare const $tuplePrefix: symbol; declare const $version: symbol; declare const __lit6 = false; declare function _schema$1(): _.Value<_.GenericEmbedded>; declare const _imports$1: {}; type Bundle<_embedded extends _.Embeddable = _.GenericEmbedded> = ({ "modules": Modules<_embedded>; } & _.Preservable<_embedded> & _.PreserveWritable<_embedded> & { __as_preserve__(): _.Value<_embedded>; }); declare function Bundle<_embedded extends _.Embeddable = _.GenericEmbedded>(modules: Modules<_embedded>): Bundle<_embedded>; declare namespace Bundle { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; }; var __from_preserve__: typeof toBundle; } type Modules<_embedded extends _.Embeddable = _.GenericEmbedded> = _.EncodableDictionary<_embedded, ModulePath, Schema<_embedded>>; declare function Modules<_embedded extends _.Embeddable = _.GenericEmbedded>(value: _.EncodableDictionary<_embedded, ModulePath, Schema<_embedded>>): Modules<_embedded>; declare namespace Modules { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; }; var __from_preserve__: typeof toModules; } type Schema<_embedded extends _.Embeddable = _.GenericEmbedded> = ({ "version": Version; "embeddedType": EmbeddedTypeName; "definitions": Definitions<_embedded>; } & _.Preservable<_embedded> & _.PreserveWritable<_embedded> & { __as_preserve__(): _.Value<_embedded>; }); declare function Schema<_embedded extends _.Embeddable = _.GenericEmbedded>({ version, embeddedType, definitions }: { version: Version; embeddedType: EmbeddedTypeName; definitions: Definitions<_embedded>; }): Schema<_embedded>; declare namespace Schema { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; }; var __from_preserve__: typeof toSchema; } type Version = ({} & _.Preservable & _.PreserveWritable & { __as_preserve__<_embedded extends _.Embeddable = _.GenericEmbedded>(): _.Value<_embedded>; }); declare function Version(): Version; declare namespace Version { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; }; var __from_preserve__: typeof toVersion; } type Definitions<_embedded extends _.Embeddable = _.GenericEmbedded> = _.JsDictionary>; declare function Definitions<_embedded extends _.Embeddable = _.GenericEmbedded>(value: _.JsDictionary>): Definitions<_embedded>; declare namespace Definitions { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; }; var __from_preserve__: typeof toDefinitions; } type DictionaryEntries<_embedded extends _.Embeddable = _.GenericEmbedded> = _.EncodableDictionary<_embedded, _.Value<_embedded>, NamedSimplePattern<_embedded>>; declare function DictionaryEntries<_embedded extends _.Embeddable = _.GenericEmbedded>(value: _.EncodableDictionary<_embedded, _.Value<_embedded>, NamedSimplePattern<_embedded>>): DictionaryEntries<_embedded>; declare namespace DictionaryEntries { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; }; var __from_preserve__: typeof toDictionaryEntries; } type NamedAlternative<_embedded extends _.Embeddable = _.GenericEmbedded> = ({ "variantLabel": string; "pattern": Pattern<_embedded>; } & _.Preservable<_embedded> & _.PreserveWritable<_embedded> & { __as_preserve__(): _.Value<_embedded>; }); declare function NamedAlternative<_embedded extends _.Embeddable = _.GenericEmbedded>({ variantLabel, pattern }: { variantLabel: string; pattern: Pattern<_embedded>; }): NamedAlternative<_embedded>; declare namespace NamedAlternative { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; }; var __from_preserve__: typeof toNamedAlternative; } type Binding<_embedded extends _.Embeddable = _.GenericEmbedded> = ({ "name": symbol; "pattern": SimplePattern<_embedded>; } & _.Preservable<_embedded> & _.PreserveWritable<_embedded> & { __as_preserve__(): _.Value<_embedded>; }); declare function Binding<_embedded extends _.Embeddable = _.GenericEmbedded>({ name, pattern }: { name: symbol; pattern: SimplePattern<_embedded>; }): Binding<_embedded>; declare namespace Binding { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; }; var __from_preserve__: typeof toBinding; } type Ref = ({ "module": ModulePath; "name": symbol; } & _.Preservable & _.PreserveWritable & { __as_preserve__<_embedded extends _.Embeddable = _.GenericEmbedded>(): _.Value<_embedded>; }); declare function Ref({ module, name }: { module: ModulePath; name: symbol; }): Ref; declare namespace Ref { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; }; var __from_preserve__: typeof toRef; } type ModulePath = Array; declare function ModulePath(value: Array): ModulePath; declare namespace ModulePath { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; }; var __from_preserve__: typeof toModulePath; } declare function asBundle<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): Bundle<_embedded>; declare function toBundle<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | Bundle<_embedded>; declare function fromBundle<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: Bundle<_embedded>): _.Value<_embedded>; declare function asModules<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): Modules<_embedded>; declare function toModules<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | Modules<_embedded>; declare function fromModules<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: Modules<_embedded>): _.Value<_embedded>; declare function asSchema<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): Schema<_embedded>; declare function toSchema<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | Schema<_embedded>; declare function fromSchema<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: Schema<_embedded>): _.Value<_embedded>; declare function asVersion<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): Version; declare function toVersion<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | Version; declare function fromVersion<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: Version): _.Value<_embedded>; declare function asEmbeddedTypeName<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): EmbeddedTypeName; declare function toEmbeddedTypeName<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | EmbeddedTypeName; type EmbeddedTypeName = (({ "_variant": "false"; } | { "_variant": "Ref"; "value": Ref; }) & _.Preservable & _.PreserveWritable & { __as_preserve__<_embedded extends _.Embeddable = _.GenericEmbedded>(): _.Value<_embedded>; }); declare namespace EmbeddedTypeName { function $false(): EmbeddedTypeName; namespace $false { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function Ref(value: Ref): EmbeddedTypeName; namespace Ref { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } } declare namespace EmbeddedTypeName { const __from_preserve__: typeof toEmbeddedTypeName; } declare function fromEmbeddedTypeName<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: EmbeddedTypeName): _.Value<_embedded>; declare function asDefinitions<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): Definitions<_embedded>; declare function toDefinitions<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | Definitions<_embedded>; declare function fromDefinitions<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: Definitions<_embedded>): _.Value<_embedded>; declare function asDefinition$1<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): Definition$1<_embedded>; declare function toDefinition$1<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | Definition$1<_embedded>; type Definition$1<_embedded extends _.Embeddable = _.GenericEmbedded> = (({ "_variant": "or"; "pattern0": NamedAlternative<_embedded>; "pattern1": NamedAlternative<_embedded>; "patternN": Array>; } | { "_variant": "and"; "pattern0": NamedPattern<_embedded>; "pattern1": NamedPattern<_embedded>; "patternN": Array>; } | { "_variant": "Pattern"; "value": Pattern<_embedded>; }) & _.Preservable<_embedded> & _.PreserveWritable<_embedded> & { __as_preserve__(): _.Value<_embedded>; }); declare namespace Definition$1 { function or<_embedded extends _.Embeddable = _.GenericEmbedded>({ pattern0, pattern1, patternN }: { pattern0: NamedAlternative<_embedded>; pattern1: NamedAlternative<_embedded>; patternN: Array>; }): Definition$1<_embedded>; namespace or { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function and<_embedded extends _.Embeddable = _.GenericEmbedded>({ pattern0, pattern1, patternN }: { pattern0: NamedPattern<_embedded>; pattern1: NamedPattern<_embedded>; patternN: Array>; }): Definition$1<_embedded>; namespace and { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function Pattern<_embedded extends _.Embeddable = _.GenericEmbedded>(value: Pattern<_embedded>): Definition$1<_embedded>; namespace Pattern { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } } declare namespace Definition$1 { const __from_preserve__: typeof toDefinition$1; } declare function fromDefinition$1<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: Definition$1<_embedded>): _.Value<_embedded>; declare function asPattern<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): Pattern<_embedded>; declare function toPattern<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | Pattern<_embedded>; type Pattern<_embedded extends _.Embeddable = _.GenericEmbedded> = (({ "_variant": "SimplePattern"; "value": SimplePattern<_embedded>; } | { "_variant": "CompoundPattern"; "value": CompoundPattern<_embedded>; }) & _.Preservable<_embedded> & _.PreserveWritable<_embedded> & { __as_preserve__(): _.Value<_embedded>; }); declare namespace Pattern { function SimplePattern<_embedded extends _.Embeddable = _.GenericEmbedded>(value: SimplePattern<_embedded>): Pattern<_embedded>; namespace SimplePattern { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function CompoundPattern<_embedded extends _.Embeddable = _.GenericEmbedded>(value: CompoundPattern<_embedded>): Pattern<_embedded>; namespace CompoundPattern { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } } declare namespace Pattern { const __from_preserve__: typeof toPattern; } declare function fromPattern<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: Pattern<_embedded>): _.Value<_embedded>; declare function asSimplePattern<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): SimplePattern<_embedded>; declare function toSimplePattern<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | SimplePattern<_embedded>; type SimplePattern<_embedded extends _.Embeddable = _.GenericEmbedded> = (({ "_variant": "any"; } | { "_variant": "atom"; "atomKind": AtomKind; } | { "_variant": "embedded"; "interface": SimplePattern<_embedded>; } | { "_variant": "lit"; "value": _.Value<_embedded>; } | { "_variant": "seqof"; "pattern": SimplePattern<_embedded>; } | { "_variant": "setof"; "pattern": SimplePattern<_embedded>; } | { "_variant": "dictof"; "key": SimplePattern<_embedded>; "value": SimplePattern<_embedded>; } | { "_variant": "Ref"; "value": Ref; }) & _.Preservable<_embedded> & _.PreserveWritable<_embedded> & { __as_preserve__(): _.Value<_embedded>; }); declare namespace SimplePattern { function any<_embedded extends _.Embeddable = _.GenericEmbedded>(): SimplePattern<_embedded>; namespace any { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function atom<_embedded extends _.Embeddable = _.GenericEmbedded>(atomKind: AtomKind): SimplePattern<_embedded>; namespace atom { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function embedded<_embedded extends _.Embeddable = _.GenericEmbedded>($interface: SimplePattern<_embedded>): SimplePattern<_embedded>; namespace embedded { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function lit<_embedded extends _.Embeddable = _.GenericEmbedded>(value: _.Value<_embedded>): SimplePattern<_embedded>; namespace lit { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function seqof<_embedded extends _.Embeddable = _.GenericEmbedded>(pattern: SimplePattern<_embedded>): SimplePattern<_embedded>; namespace seqof { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function setof<_embedded extends _.Embeddable = _.GenericEmbedded>(pattern: SimplePattern<_embedded>): SimplePattern<_embedded>; namespace setof { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function dictof<_embedded extends _.Embeddable = _.GenericEmbedded>({ key, value }: { key: SimplePattern<_embedded>; value: SimplePattern<_embedded>; }): SimplePattern<_embedded>; namespace dictof { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function Ref<_embedded extends _.Embeddable = _.GenericEmbedded>(value: Ref): SimplePattern<_embedded>; namespace Ref { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } } declare namespace SimplePattern { const __from_preserve__: typeof toSimplePattern; } declare function fromSimplePattern<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: SimplePattern<_embedded>): _.Value<_embedded>; declare function asCompoundPattern<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): CompoundPattern<_embedded>; declare function toCompoundPattern<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | CompoundPattern<_embedded>; type CompoundPattern<_embedded extends _.Embeddable = _.GenericEmbedded> = (({ "_variant": "rec"; "label": NamedPattern<_embedded>; "fields": NamedPattern<_embedded>; } | { "_variant": "tuple"; "patterns": Array>; } | { "_variant": "tuplePrefix"; "fixed": Array>; "variable": NamedSimplePattern<_embedded>; } | { "_variant": "dict"; "entries": DictionaryEntries<_embedded>; }) & _.Preservable<_embedded> & _.PreserveWritable<_embedded> & { __as_preserve__(): _.Value<_embedded>; }); declare namespace CompoundPattern { function rec<_embedded extends _.Embeddable = _.GenericEmbedded>({ label, fields }: { label: NamedPattern<_embedded>; fields: NamedPattern<_embedded>; }): CompoundPattern<_embedded>; namespace rec { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function tuple<_embedded extends _.Embeddable = _.GenericEmbedded>(patterns: Array>): CompoundPattern<_embedded>; namespace tuple { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function tuplePrefix<_embedded extends _.Embeddable = _.GenericEmbedded>({ fixed, variable }: { fixed: Array>; variable: NamedSimplePattern<_embedded>; }): CompoundPattern<_embedded>; namespace tuplePrefix { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function dict<_embedded extends _.Embeddable = _.GenericEmbedded>(entries: DictionaryEntries<_embedded>): CompoundPattern<_embedded>; namespace dict { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } } declare namespace CompoundPattern { const __from_preserve__: typeof toCompoundPattern; } declare function fromCompoundPattern<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: CompoundPattern<_embedded>): _.Value<_embedded>; declare function asDictionaryEntries<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): DictionaryEntries<_embedded>; declare function toDictionaryEntries<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | DictionaryEntries<_embedded>; declare function fromDictionaryEntries<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: DictionaryEntries<_embedded>): _.Value<_embedded>; declare function asAtomKind<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): AtomKind; declare function toAtomKind<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | AtomKind; type AtomKind = (({ "_variant": "Boolean"; } | { "_variant": "Double"; } | { "_variant": "SignedInteger"; } | { "_variant": "String"; } | { "_variant": "ByteString"; } | { "_variant": "Symbol"; }) & _.Preservable & _.PreserveWritable & { __as_preserve__<_embedded extends _.Embeddable = _.GenericEmbedded>(): _.Value<_embedded>; }); declare namespace AtomKind { function Boolean(): AtomKind; namespace Boolean { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function Double(): AtomKind; namespace Double { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function SignedInteger(): AtomKind; namespace SignedInteger { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function String(): AtomKind; namespace String { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function ByteString(): AtomKind; namespace ByteString { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function Symbol(): AtomKind; namespace Symbol { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } } declare namespace AtomKind { const __from_preserve__: typeof toAtomKind; } declare function fromAtomKind<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: AtomKind): _.Value<_embedded>; declare function asNamedAlternative<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): NamedAlternative<_embedded>; declare function toNamedAlternative<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | NamedAlternative<_embedded>; declare function fromNamedAlternative<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: NamedAlternative<_embedded>): _.Value<_embedded>; declare function asNamedSimplePattern<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): NamedSimplePattern<_embedded>; declare function toNamedSimplePattern<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | NamedSimplePattern<_embedded>; type NamedSimplePattern<_embedded extends _.Embeddable = _.GenericEmbedded> = (({ "_variant": "named"; "value": Binding<_embedded>; } | { "_variant": "anonymous"; "value": SimplePattern<_embedded>; }) & _.Preservable<_embedded> & _.PreserveWritable<_embedded> & { __as_preserve__(): _.Value<_embedded>; }); declare namespace NamedSimplePattern { function named<_embedded extends _.Embeddable = _.GenericEmbedded>(value: Binding<_embedded>): NamedSimplePattern<_embedded>; namespace named { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function anonymous<_embedded extends _.Embeddable = _.GenericEmbedded>(value: SimplePattern<_embedded>): NamedSimplePattern<_embedded>; namespace anonymous { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } } declare namespace NamedSimplePattern { const __from_preserve__: typeof toNamedSimplePattern; } declare function fromNamedSimplePattern<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: NamedSimplePattern<_embedded>): _.Value<_embedded>; declare function asNamedPattern<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): NamedPattern<_embedded>; declare function toNamedPattern<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | NamedPattern<_embedded>; type NamedPattern<_embedded extends _.Embeddable = _.GenericEmbedded> = (({ "_variant": "named"; "value": Binding<_embedded>; } | { "_variant": "anonymous"; "value": Pattern<_embedded>; }) & _.Preservable<_embedded> & _.PreserveWritable<_embedded> & { __as_preserve__(): _.Value<_embedded>; }); declare namespace NamedPattern { function named<_embedded extends _.Embeddable = _.GenericEmbedded>(value: Binding<_embedded>): NamedPattern<_embedded>; namespace named { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } function anonymous<_embedded extends _.Embeddable = _.GenericEmbedded>(value: Pattern<_embedded>): NamedPattern<_embedded>; namespace anonymous { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: {}; definitionName: symbol; variant: symbol; }; } } declare namespace NamedPattern { const __from_preserve__: typeof toNamedPattern; } declare function fromNamedPattern<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: NamedPattern<_embedded>): _.Value<_embedded>; declare function asBinding<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): Binding<_embedded>; declare function toBinding<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | Binding<_embedded>; declare function fromBinding<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: Binding<_embedded>): _.Value<_embedded>; declare function asRef<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): Ref; declare function toRef<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | Ref; declare function fromRef<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: Ref): _.Value<_embedded>; declare function asModulePath<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): ModulePath; declare function toModulePath<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | ModulePath; declare function fromModulePath<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: ModulePath): _.Value<_embedded>; declare const _i_schema_$1: typeof $1; declare const _i_schema_$Boolean: typeof $Boolean; declare const _i_schema_$ByteString: typeof $ByteString; declare const _i_schema_$Double: typeof $Double; declare const _i_schema_$SignedInteger: typeof $SignedInteger; declare const _i_schema_$String: typeof $String; declare const _i_schema_$Symbol: typeof $Symbol; declare const _i_schema_$and: typeof $and; declare const _i_schema_$atom: typeof $atom; declare const _i_schema_$bundle: typeof $bundle; declare const _i_schema_$definitions: typeof $definitions; declare const _i_schema_$dict: typeof $dict; declare const _i_schema_$dictof: typeof $dictof; declare const _i_schema_$embeddedType: typeof $embeddedType; declare const _i_schema_$lit: typeof $lit; declare const _i_schema_$named: typeof $named; declare const _i_schema_$or: typeof $or; declare const _i_schema_$schema: typeof $schema; declare const _i_schema_$seqof: typeof $seqof; declare const _i_schema_$setof: typeof $setof; declare const _i_schema_$tuple: typeof $tuple; declare const _i_schema_$tuplePrefix: typeof $tuplePrefix; declare const _i_schema_$version: typeof $version; declare const _i_schema_AtomKind: typeof AtomKind; declare const _i_schema_Binding: typeof Binding; declare const _i_schema_Bundle: typeof Bundle; declare const _i_schema_CompoundPattern: typeof CompoundPattern; declare const _i_schema_Definitions: typeof Definitions; declare const _i_schema_DictionaryEntries: typeof DictionaryEntries; declare const _i_schema_EmbeddedTypeName: typeof EmbeddedTypeName; declare const _i_schema_ModulePath: typeof ModulePath; declare const _i_schema_Modules: typeof Modules; declare const _i_schema_NamedAlternative: typeof NamedAlternative; declare const _i_schema_NamedPattern: typeof NamedPattern; declare const _i_schema_NamedSimplePattern: typeof NamedSimplePattern; declare const _i_schema_Pattern: typeof Pattern; declare const _i_schema_Ref: typeof Ref; declare const _i_schema_Schema: typeof Schema; declare const _i_schema_SimplePattern: typeof SimplePattern; declare const _i_schema_Version: typeof Version; declare const _i_schema___lit6: typeof __lit6; declare const _i_schema_asAtomKind: typeof asAtomKind; declare const _i_schema_asBinding: typeof asBinding; declare const _i_schema_asBundle: typeof asBundle; declare const _i_schema_asCompoundPattern: typeof asCompoundPattern; declare const _i_schema_asDefinitions: typeof asDefinitions; declare const _i_schema_asDictionaryEntries: typeof asDictionaryEntries; declare const _i_schema_asEmbeddedTypeName: typeof asEmbeddedTypeName; declare const _i_schema_asModulePath: typeof asModulePath; declare const _i_schema_asModules: typeof asModules; declare const _i_schema_asNamedAlternative: typeof asNamedAlternative; declare const _i_schema_asNamedPattern: typeof asNamedPattern; declare const _i_schema_asNamedSimplePattern: typeof asNamedSimplePattern; declare const _i_schema_asPattern: typeof asPattern; declare const _i_schema_asRef: typeof asRef; declare const _i_schema_asSchema: typeof asSchema; declare const _i_schema_asSimplePattern: typeof asSimplePattern; declare const _i_schema_asVersion: typeof asVersion; declare const _i_schema_fromAtomKind: typeof fromAtomKind; declare const _i_schema_fromBinding: typeof fromBinding; declare const _i_schema_fromBundle: typeof fromBundle; declare const _i_schema_fromCompoundPattern: typeof fromCompoundPattern; declare const _i_schema_fromDefinitions: typeof fromDefinitions; declare const _i_schema_fromDictionaryEntries: typeof fromDictionaryEntries; declare const _i_schema_fromEmbeddedTypeName: typeof fromEmbeddedTypeName; declare const _i_schema_fromModulePath: typeof fromModulePath; declare const _i_schema_fromModules: typeof fromModules; declare const _i_schema_fromNamedAlternative: typeof fromNamedAlternative; declare const _i_schema_fromNamedPattern: typeof fromNamedPattern; declare const _i_schema_fromNamedSimplePattern: typeof fromNamedSimplePattern; declare const _i_schema_fromPattern: typeof fromPattern; declare const _i_schema_fromRef: typeof fromRef; declare const _i_schema_fromSchema: typeof fromSchema; declare const _i_schema_fromSimplePattern: typeof fromSimplePattern; declare const _i_schema_fromVersion: typeof fromVersion; declare const _i_schema_toAtomKind: typeof toAtomKind; declare const _i_schema_toBinding: typeof toBinding; declare const _i_schema_toBundle: typeof toBundle; declare const _i_schema_toCompoundPattern: typeof toCompoundPattern; declare const _i_schema_toDefinitions: typeof toDefinitions; declare const _i_schema_toDictionaryEntries: typeof toDictionaryEntries; declare const _i_schema_toEmbeddedTypeName: typeof toEmbeddedTypeName; declare const _i_schema_toModulePath: typeof toModulePath; declare const _i_schema_toModules: typeof toModules; declare const _i_schema_toNamedAlternative: typeof toNamedAlternative; declare const _i_schema_toNamedPattern: typeof toNamedPattern; declare const _i_schema_toNamedSimplePattern: typeof toNamedSimplePattern; declare const _i_schema_toPattern: typeof toPattern; declare const _i_schema_toRef: typeof toRef; declare const _i_schema_toSchema: typeof toSchema; declare const _i_schema_toSimplePattern: typeof toSimplePattern; declare const _i_schema_toVersion: typeof toVersion; declare namespace _i_schema { export { _i_schema_$1 as $1, _i_schema_$Boolean as $Boolean, _i_schema_$ByteString as $ByteString, _i_schema_$Double as $Double, _i_schema_$SignedInteger as $SignedInteger, _i_schema_$String as $String, _i_schema_$Symbol as $Symbol, _i_schema_$and as $and, $any$1 as $any, _i_schema_$atom as $atom, _i_schema_$bundle as $bundle, _i_schema_$definitions as $definitions, _i_schema_$dict as $dict, _i_schema_$dictof as $dictof, $embedded$1 as $embedded, _i_schema_$embeddedType as $embeddedType, _i_schema_$lit as $lit, _i_schema_$named as $named, _i_schema_$or as $or, $rec$1 as $rec, $ref$1 as $ref, _i_schema_$schema as $schema, _i_schema_$seqof as $seqof, _i_schema_$setof as $setof, _i_schema_$tuple as $tuple, _i_schema_$tuplePrefix as $tuplePrefix, _i_schema_$version as $version, _i_schema_AtomKind as AtomKind, _i_schema_Binding as Binding, _i_schema_Bundle as Bundle, _i_schema_CompoundPattern as CompoundPattern, Definition$1 as Definition, _i_schema_Definitions as Definitions, _i_schema_DictionaryEntries as DictionaryEntries, _i_schema_EmbeddedTypeName as EmbeddedTypeName, _i_schema_ModulePath as ModulePath, _i_schema_Modules as Modules, _i_schema_NamedAlternative as NamedAlternative, _i_schema_NamedPattern as NamedPattern, _i_schema_NamedSimplePattern as NamedSimplePattern, _i_schema_Pattern as Pattern, _i_schema_Ref as Ref, _i_schema_Schema as Schema, _i_schema_SimplePattern as SimplePattern, _i_schema_Version as Version, _i_schema___lit6 as __lit6, _imports$1 as _imports, _schema$1 as _schema, _i_schema_asAtomKind as asAtomKind, _i_schema_asBinding as asBinding, _i_schema_asBundle as asBundle, _i_schema_asCompoundPattern as asCompoundPattern, asDefinition$1 as asDefinition, _i_schema_asDefinitions as asDefinitions, _i_schema_asDictionaryEntries as asDictionaryEntries, _i_schema_asEmbeddedTypeName as asEmbeddedTypeName, _i_schema_asModulePath as asModulePath, _i_schema_asModules as asModules, _i_schema_asNamedAlternative as asNamedAlternative, _i_schema_asNamedPattern as asNamedPattern, _i_schema_asNamedSimplePattern as asNamedSimplePattern, _i_schema_asPattern as asPattern, _i_schema_asRef as asRef, _i_schema_asSchema as asSchema, _i_schema_asSimplePattern as asSimplePattern, _i_schema_asVersion as asVersion, _i_schema_fromAtomKind as fromAtomKind, _i_schema_fromBinding as fromBinding, _i_schema_fromBundle as fromBundle, _i_schema_fromCompoundPattern as fromCompoundPattern, fromDefinition$1 as fromDefinition, _i_schema_fromDefinitions as fromDefinitions, _i_schema_fromDictionaryEntries as fromDictionaryEntries, _i_schema_fromEmbeddedTypeName as fromEmbeddedTypeName, _i_schema_fromModulePath as fromModulePath, _i_schema_fromModules as fromModules, _i_schema_fromNamedAlternative as fromNamedAlternative, _i_schema_fromNamedPattern as fromNamedPattern, _i_schema_fromNamedSimplePattern as fromNamedSimplePattern, _i_schema_fromPattern as fromPattern, _i_schema_fromRef as fromRef, _i_schema_fromSchema as fromSchema, _i_schema_fromSimplePattern as fromSimplePattern, _i_schema_fromVersion as fromVersion, _i_schema_toAtomKind as toAtomKind, _i_schema_toBinding as toBinding, _i_schema_toBundle as toBundle, _i_schema_toCompoundPattern as toCompoundPattern, toDefinition$1 as toDefinition, _i_schema_toDefinitions as toDefinitions, _i_schema_toDictionaryEntries as toDictionaryEntries, _i_schema_toEmbeddedTypeName as toEmbeddedTypeName, _i_schema_toModulePath as toModulePath, _i_schema_toModules as toModules, _i_schema_toNamedAlternative as toNamedAlternative, _i_schema_toNamedPattern as toNamedPattern, _i_schema_toNamedSimplePattern as toNamedSimplePattern, _i_schema_toPattern as toPattern, _i_schema_toRef as toRef, _i_schema_toSchema as toSchema, _i_schema_toSimplePattern as toSimplePattern, _i_schema_toVersion as toVersion }; } type Input = Value; type InputEmbedded = GenericEmbedded; declare function qidLast(s: string): string; declare function isValidToken(s: string): boolean; declare function isValidQid(s: string): boolean; declare function isValidJsId(s: string): boolean; declare function jsId(v: string, kf?: () => string): string; declare function jsToken(s: string, kf?: () => string): string; declare const ANDSYM: unique symbol; declare const DOT: unique symbol; declare const DOTDOTDOT: unique symbol; declare const EQUALS: unique symbol; declare const INCLUDE: unique symbol; declare const ORSYM: unique symbol; type SchemaEnvEntry = { schemaModulePath: ModulePath; typescriptModulePath: string; typescriptModuleExpr: string | null; schema: Schema | null; }; type Environment = Array; declare function envLookup(env: Environment, soughtModule: ModulePath): SchemaEnvEntry | null; declare function modsymFor(e: SchemaEnvEntry): string; declare function formatModulePath(p: ModulePath): string; declare function formatRef(r: Ref): string; declare function unnamePattern(p: NamedPattern): Pattern; declare function unnameSimplePattern(p: NamedSimplePattern): SimplePattern; declare function promoteNamedSimplePattern(p: NamedSimplePattern): NamedPattern; declare function nameFor(p: NamedSimplePattern | NamedPattern): string | undefined; declare function anonymousSimplePattern(p: SimplePattern): NamedPattern; declare function namelike(x: Input): string | undefined; declare function isSymbolPattern(p: SimplePattern): boolean; declare const meta_$1: typeof $1; declare const meta_$Boolean: typeof $Boolean; declare const meta_$ByteString: typeof $ByteString; declare const meta_$Double: typeof $Double; declare const meta_$SignedInteger: typeof $SignedInteger; declare const meta_$String: typeof $String; declare const meta_$Symbol: typeof $Symbol; declare const meta_$and: typeof $and; declare const meta_$atom: typeof $atom; declare const meta_$bundle: typeof $bundle; declare const meta_$definitions: typeof $definitions; declare const meta_$dict: typeof $dict; declare const meta_$dictof: typeof $dictof; declare const meta_$embeddedType: typeof $embeddedType; declare const meta_$lit: typeof $lit; declare const meta_$named: typeof $named; declare const meta_$or: typeof $or; declare const meta_$schema: typeof $schema; declare const meta_$seqof: typeof $seqof; declare const meta_$setof: typeof $setof; declare const meta_$tuple: typeof $tuple; declare const meta_$tuplePrefix: typeof $tuplePrefix; declare const meta_$version: typeof $version; declare const meta_ANDSYM: typeof ANDSYM; declare const meta_AtomKind: typeof AtomKind; declare const meta_Binding: typeof Binding; declare const meta_Bundle: typeof Bundle; declare const meta_CompoundPattern: typeof CompoundPattern; declare const meta_DOT: typeof DOT; declare const meta_DOTDOTDOT: typeof DOTDOTDOT; declare const meta_Definitions: typeof Definitions; declare const meta_DictionaryEntries: typeof DictionaryEntries; declare const meta_EQUALS: typeof EQUALS; declare const meta_EmbeddedTypeName: typeof EmbeddedTypeName; type meta_Environment = Environment; declare const meta_INCLUDE: typeof INCLUDE; type meta_Input = Input; type meta_InputEmbedded = InputEmbedded; declare const meta_ModulePath: typeof ModulePath; declare const meta_Modules: typeof Modules; declare const meta_NamedAlternative: typeof NamedAlternative; declare const meta_NamedPattern: typeof NamedPattern; declare const meta_NamedSimplePattern: typeof NamedSimplePattern; declare const meta_ORSYM: typeof ORSYM; declare const meta_Pattern: typeof Pattern; declare const meta_Ref: typeof Ref; declare const meta_Schema: typeof Schema; type meta_SchemaEnvEntry = SchemaEnvEntry; declare const meta_SimplePattern: typeof SimplePattern; declare const meta_Version: typeof Version; declare const meta___lit6: typeof __lit6; declare const meta_anonymousSimplePattern: typeof anonymousSimplePattern; declare const meta_asAtomKind: typeof asAtomKind; declare const meta_asBinding: typeof asBinding; declare const meta_asBundle: typeof asBundle; declare const meta_asCompoundPattern: typeof asCompoundPattern; declare const meta_asDefinitions: typeof asDefinitions; declare const meta_asDictionaryEntries: typeof asDictionaryEntries; declare const meta_asEmbeddedTypeName: typeof asEmbeddedTypeName; declare const meta_asModulePath: typeof asModulePath; declare const meta_asModules: typeof asModules; declare const meta_asNamedAlternative: typeof asNamedAlternative; declare const meta_asNamedPattern: typeof asNamedPattern; declare const meta_asNamedSimplePattern: typeof asNamedSimplePattern; declare const meta_asPattern: typeof asPattern; declare const meta_asRef: typeof asRef; declare const meta_asSchema: typeof asSchema; declare const meta_asSimplePattern: typeof asSimplePattern; declare const meta_asVersion: typeof asVersion; declare const meta_envLookup: typeof envLookup; declare const meta_formatModulePath: typeof formatModulePath; declare const meta_formatRef: typeof formatRef; declare const meta_fromAtomKind: typeof fromAtomKind; declare const meta_fromBinding: typeof fromBinding; declare const meta_fromBundle: typeof fromBundle; declare const meta_fromCompoundPattern: typeof fromCompoundPattern; declare const meta_fromDefinitions: typeof fromDefinitions; declare const meta_fromDictionaryEntries: typeof fromDictionaryEntries; declare const meta_fromEmbeddedTypeName: typeof fromEmbeddedTypeName; declare const meta_fromModulePath: typeof fromModulePath; declare const meta_fromModules: typeof fromModules; declare const meta_fromNamedAlternative: typeof fromNamedAlternative; declare const meta_fromNamedPattern: typeof fromNamedPattern; declare const meta_fromNamedSimplePattern: typeof fromNamedSimplePattern; declare const meta_fromPattern: typeof fromPattern; declare const meta_fromRef: typeof fromRef; declare const meta_fromSchema: typeof fromSchema; declare const meta_fromSimplePattern: typeof fromSimplePattern; declare const meta_fromVersion: typeof fromVersion; declare const meta_isSymbolPattern: typeof isSymbolPattern; declare const meta_isValidJsId: typeof isValidJsId; declare const meta_isValidQid: typeof isValidQid; declare const meta_isValidToken: typeof isValidToken; declare const meta_jsId: typeof jsId; declare const meta_jsToken: typeof jsToken; declare const meta_modsymFor: typeof modsymFor; declare const meta_nameFor: typeof nameFor; declare const meta_namelike: typeof namelike; declare const meta_promoteNamedSimplePattern: typeof promoteNamedSimplePattern; declare const meta_qidLast: typeof qidLast; declare const meta_toAtomKind: typeof toAtomKind; declare const meta_toBinding: typeof toBinding; declare const meta_toBundle: typeof toBundle; declare const meta_toCompoundPattern: typeof toCompoundPattern; declare const meta_toDefinitions: typeof toDefinitions; declare const meta_toDictionaryEntries: typeof toDictionaryEntries; declare const meta_toEmbeddedTypeName: typeof toEmbeddedTypeName; declare const meta_toModulePath: typeof toModulePath; declare const meta_toModules: typeof toModules; declare const meta_toNamedAlternative: typeof toNamedAlternative; declare const meta_toNamedPattern: typeof toNamedPattern; declare const meta_toNamedSimplePattern: typeof toNamedSimplePattern; declare const meta_toPattern: typeof toPattern; declare const meta_toRef: typeof toRef; declare const meta_toSchema: typeof toSchema; declare const meta_toSimplePattern: typeof toSimplePattern; declare const meta_toVersion: typeof toVersion; declare const meta_unnamePattern: typeof unnamePattern; declare const meta_unnameSimplePattern: typeof unnameSimplePattern; declare namespace meta { export { meta_$1 as $1, meta_$Boolean as $Boolean, meta_$ByteString as $ByteString, meta_$Double as $Double, meta_$SignedInteger as $SignedInteger, meta_$String as $String, meta_$Symbol as $Symbol, meta_$and as $and, $any$1 as $any, meta_$atom as $atom, meta_$bundle as $bundle, meta_$definitions as $definitions, meta_$dict as $dict, meta_$dictof as $dictof, $embedded$1 as $embedded, meta_$embeddedType as $embeddedType, meta_$lit as $lit, meta_$named as $named, meta_$or as $or, $rec$1 as $rec, $ref$1 as $ref, meta_$schema as $schema, meta_$seqof as $seqof, meta_$setof as $setof, meta_$tuple as $tuple, meta_$tuplePrefix as $tuplePrefix, meta_$version as $version, meta_ANDSYM as ANDSYM, meta_AtomKind as AtomKind, meta_Binding as Binding, meta_Bundle as Bundle, meta_CompoundPattern as CompoundPattern, meta_DOT as DOT, meta_DOTDOTDOT as DOTDOTDOT, Definition$1 as Definition, meta_Definitions as Definitions, meta_DictionaryEntries as DictionaryEntries, meta_EQUALS as EQUALS, meta_EmbeddedTypeName as EmbeddedTypeName, type meta_Environment as Environment, meta_INCLUDE as INCLUDE, type meta_Input as Input, type meta_InputEmbedded as InputEmbedded, meta_ModulePath as ModulePath, meta_Modules as Modules, meta_NamedAlternative as NamedAlternative, meta_NamedPattern as NamedPattern, meta_NamedSimplePattern as NamedSimplePattern, meta_ORSYM as ORSYM, meta_Pattern as Pattern, meta_Ref as Ref, meta_Schema as Schema, type meta_SchemaEnvEntry as SchemaEnvEntry, meta_SimplePattern as SimplePattern, meta_Version as Version, meta___lit6 as __lit6, _imports$1 as _imports, _schema$1 as _schema, meta_anonymousSimplePattern as anonymousSimplePattern, meta_asAtomKind as asAtomKind, meta_asBinding as asBinding, meta_asBundle as asBundle, meta_asCompoundPattern as asCompoundPattern, asDefinition$1 as asDefinition, meta_asDefinitions as asDefinitions, meta_asDictionaryEntries as asDictionaryEntries, meta_asEmbeddedTypeName as asEmbeddedTypeName, meta_asModulePath as asModulePath, meta_asModules as asModules, meta_asNamedAlternative as asNamedAlternative, meta_asNamedPattern as asNamedPattern, meta_asNamedSimplePattern as asNamedSimplePattern, meta_asPattern as asPattern, meta_asRef as asRef, meta_asSchema as asSchema, meta_asSimplePattern as asSimplePattern, meta_asVersion as asVersion, meta_envLookup as envLookup, meta_formatModulePath as formatModulePath, meta_formatRef as formatRef, meta_fromAtomKind as fromAtomKind, meta_fromBinding as fromBinding, meta_fromBundle as fromBundle, meta_fromCompoundPattern as fromCompoundPattern, fromDefinition$1 as fromDefinition, meta_fromDefinitions as fromDefinitions, meta_fromDictionaryEntries as fromDictionaryEntries, meta_fromEmbeddedTypeName as fromEmbeddedTypeName, meta_fromModulePath as fromModulePath, meta_fromModules as fromModules, meta_fromNamedAlternative as fromNamedAlternative, meta_fromNamedPattern as fromNamedPattern, meta_fromNamedSimplePattern as fromNamedSimplePattern, meta_fromPattern as fromPattern, meta_fromRef as fromRef, meta_fromSchema as fromSchema, meta_fromSimplePattern as fromSimplePattern, meta_fromVersion as fromVersion, meta_isSymbolPattern as isSymbolPattern, meta_isValidJsId as isValidJsId, meta_isValidQid as isValidQid, meta_isValidToken as isValidToken, meta_jsId as jsId, meta_jsToken as jsToken, meta_modsymFor as modsymFor, meta_nameFor as nameFor, meta_namelike as namelike, meta_promoteNamedSimplePattern as promoteNamedSimplePattern, meta_qidLast as qidLast, meta_toAtomKind as toAtomKind, meta_toBinding as toBinding, meta_toBundle as toBundle, meta_toCompoundPattern as toCompoundPattern, toDefinition$1 as toDefinition, meta_toDefinitions as toDefinitions, meta_toDictionaryEntries as toDictionaryEntries, meta_toEmbeddedTypeName as toEmbeddedTypeName, meta_toModulePath as toModulePath, meta_toModules as toModules, meta_toNamedAlternative as toNamedAlternative, meta_toNamedPattern as toNamedPattern, meta_toNamedSimplePattern as toNamedSimplePattern, meta_toPattern as toPattern, meta_toRef as toRef, meta_toSchema as toSchema, meta_toSimplePattern as toSimplePattern, meta_toVersion as toVersion, meta_unnamePattern as unnamePattern, meta_unnameSimplePattern as unnameSimplePattern }; } declare function checkSchema(schema: Schema): ({ ok: true; schema: Schema; } | { ok: false; problems: Array; }); declare class SchemaSyntaxError extends Error { readonly pos: Position | null; constructor(message: string, pos: Position | null); } declare function recordPosition(v: X, pos: Position | null): X; declare function refPosition(v: object): Position | null; type SchemaReaderOptions = { name?: string | Position; readInclude?(includePath: string): string; }; declare function readSchema(source: string, options?: SchemaReaderOptions): Schema; declare function parseSchema(toplevelTokens: Array, options: SchemaReaderOptions): Schema; type SimpleType = FieldType | RecordType; type FieldType = { kind: 'unit'; } | { kind: 'array'; type: FieldType; } | { kind: 'set'; type: FieldType; } | { kind: 'dictionary'; key: FieldType; value: FieldType; } | RefType; type RefType = { kind: 'ref'; typeName: string; ref: Ref | null; }; type RecordType = { kind: 'record'; fields: FieldMap; }; type VariantMap = Map; type FieldMap = Map; type Type = { kind: 'union'; variants: VariantMap; } | SimpleType; declare namespace Type { const union: (variants: VariantMap) => Type; const unit: () => FieldType; const ref: (typeName: string, ref: Ref | null) => RefType; const array: (type: FieldType) => FieldType; const set: (type: FieldType) => FieldType; const dictionary: (key: FieldType, value: FieldType) => FieldType; const record: (fields: FieldMap) => RecordType; } declare const ANY_TYPE: FieldType; declare function isSymbolType(ty: FieldType): ty is { kind: 'ref'; typeName: 'symbol'; ref: null; }; declare const type_ANY_TYPE: typeof ANY_TYPE; type type_FieldMap = FieldMap; type type_FieldType = FieldType; type type_RecordType = RecordType; type type_RefType = RefType; type type_SimpleType = SimpleType; declare const type_Type: typeof Type; type type_VariantMap = VariantMap; declare const type_isSymbolType: typeof isSymbolType; declare namespace type { export { type_ANY_TYPE as ANY_TYPE, type type_FieldMap as FieldMap, type type_FieldType as FieldType, type type_RecordType as RecordType, type type_RefType as RefType, type type_SimpleType as SimpleType, type_Type as Type, type type_VariantMap as VariantMap, type_isSymbolType as isSymbolType }; } interface CompilerOptions { preservesModule?: string; defaultEmbeddedType?: Ref; warn?(message: string, pos: Position | null): void; } declare function compile(env: Environment, modulePath: ModulePath, schema: Schema, options?: CompilerOptions): string; type Imports = { [modulePath: string]: any; }; interface SchemaDefinition { schema: Value; imports: Imports; definitionName: symbol; variant?: symbol; } declare const $any: symbol; declare const $array: symbol; declare const $embedded: symbol; declare const $map: symbol; declare const $rec: symbol; declare const $ref: symbol; declare const $set: symbol; declare const $union: symbol; declare const $unit: symbol; declare function _schema(): _.Value<_.GenericEmbedded>; declare const _imports: { schema: typeof _i_schema; }; type Variant = ({ "label": symbol; "type": Simple; } & _.Preservable & _.PreserveWritable & { __as_preserve__<_embedded extends _.Embeddable = _.GenericEmbedded>(): _.Value<_embedded>; }); declare function Variant({ label, type }: { label: symbol; type: Simple; }): Variant; declare namespace Variant { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: { schema: typeof _i_schema; }; definitionName: symbol; }; var __from_preserve__: typeof toVariant; } type Record = ({ "fields": Array; } & _.Preservable & _.PreserveWritable & { __as_preserve__<_embedded extends _.Embeddable = _.GenericEmbedded>(): _.Value<_embedded>; }); declare function Record(fields: Array): Record; declare namespace Record { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: { schema: typeof _i_schema; }; definitionName: symbol; }; var __from_preserve__: typeof toRecord; } type NamedField = ({ "name": symbol; "type": Field; } & _.Preservable & _.PreserveWritable & { __as_preserve__<_embedded extends _.Embeddable = _.GenericEmbedded>(): _.Value<_embedded>; }); declare function NamedField({ name, type }: { name: symbol; type: Field; }): NamedField; declare namespace NamedField { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: { schema: typeof _i_schema; }; definitionName: symbol; }; var __from_preserve__: typeof toNamedField; } declare function asDefinition<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): Definition; declare function toDefinition<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | Definition; type Definition = (({ "_variant": "union"; "variants": Array; } | { "_variant": "Simple"; "value": Simple; }) & _.Preservable & _.PreserveWritable & { __as_preserve__<_embedded extends _.Embeddable = _.GenericEmbedded>(): _.Value<_embedded>; }); declare namespace Definition { function union(variants: Array): Definition; namespace union { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: { schema: typeof _i_schema; }; definitionName: symbol; variant: symbol; }; } function Simple(value: Simple): Definition; namespace Simple { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: { schema: typeof _i_schema; }; definitionName: symbol; variant: symbol; }; } } declare namespace Definition { const __from_preserve__: typeof toDefinition; } declare function fromDefinition<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: Definition): _.Value<_embedded>; declare function asVariant<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): Variant; declare function toVariant<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | Variant; declare function fromVariant<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: Variant): _.Value<_embedded>; declare function asSimple<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): Simple; declare function toSimple<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | Simple; type Simple = (({ "_variant": "Field"; "value": Field; } | { "_variant": "Record"; "value": Record; }) & _.Preservable & _.PreserveWritable & { __as_preserve__<_embedded extends _.Embeddable = _.GenericEmbedded>(): _.Value<_embedded>; }); declare namespace Simple { function Field(value: Field): Simple; namespace Field { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: { schema: typeof _i_schema; }; definitionName: symbol; variant: symbol; }; } function Record(value: Record): Simple; namespace Record { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: { schema: typeof _i_schema; }; definitionName: symbol; variant: symbol; }; } } declare namespace Simple { const __from_preserve__: typeof toSimple; } declare function fromSimple<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: Simple): _.Value<_embedded>; declare function asRecord<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): Record; declare function toRecord<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | Record; declare function fromRecord<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: Record): _.Value<_embedded>; declare function asNamedField<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): NamedField; declare function toNamedField<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | NamedField; declare function fromNamedField<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: NamedField): _.Value<_embedded>; declare function asField<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): Field; declare function toField<_embedded extends _.Embeddable = _.GenericEmbedded>(v: _.Value<_embedded>): undefined | Field; type Field = (({ "_variant": "unit"; } | { "_variant": "any"; } | { "_variant": "embedded"; } | { "_variant": "array"; "element": Field; } | { "_variant": "set"; "element": Field; } | { "_variant": "map"; "key": Field; "value": Field; } | { "_variant": "ref"; "name": Ref; } | { "_variant": "AtomKind"; "value": AtomKind; }) & _.Preservable & _.PreserveWritable & { __as_preserve__<_embedded extends _.Embeddable = _.GenericEmbedded>(): _.Value<_embedded>; }); declare namespace Field { function unit(): Field; namespace unit { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: { schema: typeof _i_schema; }; definitionName: symbol; variant: symbol; }; } function any(): Field; namespace any { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: { schema: typeof _i_schema; }; definitionName: symbol; variant: symbol; }; } function embedded(): Field; namespace embedded { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: { schema: typeof _i_schema; }; definitionName: symbol; variant: symbol; }; } function array(element: Field): Field; namespace array { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: { schema: typeof _i_schema; }; definitionName: symbol; variant: symbol; }; } function set(element: Field): Field; namespace set { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: { schema: typeof _i_schema; }; definitionName: symbol; variant: symbol; }; } function map({ key, value }: { key: Field; value: Field; }): Field; namespace map { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: { schema: typeof _i_schema; }; definitionName: symbol; variant: symbol; }; } function ref(name: Ref): Field; namespace ref { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: { schema: typeof _i_schema; }; definitionName: symbol; variant: symbol; }; } function AtomKind(value: AtomKind): Field; namespace AtomKind { var schema: () => { schema: _.Value<_.GenericEmbedded>; imports: { schema: typeof _i_schema; }; definitionName: symbol; variant: symbol; }; } } declare namespace Field { const __from_preserve__: typeof toField; } declare function fromField<_embedded extends _.Embeddable = _.GenericEmbedded>(_v: Field): _.Value<_embedded>; declare function definitionType(p: Definition$1): Definition; declare function patternType(p: Pattern): Simple; declare function fieldType(p: SimplePattern): Field; declare function productType(ps: NamedPattern[]): Simple; declare const host_$any: typeof $any; declare const host_$array: typeof $array; declare const host_$embedded: typeof $embedded; declare const host_$map: typeof $map; declare const host_$rec: typeof $rec; declare const host_$ref: typeof $ref; declare const host_$set: typeof $set; declare const host_$union: typeof $union; declare const host_$unit: typeof $unit; declare const host_Definition: typeof Definition; declare const host_Field: typeof Field; declare const host_NamedField: typeof NamedField; declare const host_Record: typeof Record; declare const host_Simple: typeof Simple; declare const host_Variant: typeof Variant; declare const host__imports: typeof _imports; declare const host__schema: typeof _schema; declare const host_asDefinition: typeof asDefinition; declare const host_asField: typeof asField; declare const host_asNamedField: typeof asNamedField; declare const host_asRecord: typeof asRecord; declare const host_asSimple: typeof asSimple; declare const host_asVariant: typeof asVariant; declare const host_definitionType: typeof definitionType; declare const host_fieldType: typeof fieldType; declare const host_fromDefinition: typeof fromDefinition; declare const host_fromField: typeof fromField; declare const host_fromNamedField: typeof fromNamedField; declare const host_fromRecord: typeof fromRecord; declare const host_fromSimple: typeof fromSimple; declare const host_fromVariant: typeof fromVariant; declare const host_patternType: typeof patternType; declare const host_productType: typeof productType; declare const host_toDefinition: typeof toDefinition; declare const host_toField: typeof toField; declare const host_toNamedField: typeof toNamedField; declare const host_toRecord: typeof toRecord; declare const host_toSimple: typeof toSimple; declare const host_toVariant: typeof toVariant; declare namespace host { export { host_$any as $any, host_$array as $array, host_$embedded as $embedded, host_$map as $map, host_$rec as $rec, host_$ref as $ref, host_$set as $set, host_$union as $union, host_$unit as $unit, host_Definition as Definition, host_Field as Field, host_NamedField as NamedField, host_Record as Record, host_Simple as Simple, host_Variant as Variant, host__imports as _imports, host__schema as _schema, host_asDefinition as asDefinition, host_asField as asField, host_asNamedField as asNamedField, host_asRecord as asRecord, host_asSimple as asSimple, host_asVariant as asVariant, host_definitionType as definitionType, host_fieldType as fieldType, host_fromDefinition as fromDefinition, host_fromField as fromField, host_fromNamedField as fromNamedField, host_fromRecord as fromRecord, host_fromSimple as fromSimple, host_fromVariant as fromVariant, host_patternType as patternType, host_productType as productType, host_toDefinition as toDefinition, host_toField as toField, host_toNamedField as toNamedField, host_toRecord as toRecord, host_toSimple as toSimple, host_toVariant as toVariant }; } declare const UNIT: true; type Parsed = Value | Parsed[] | DictOf | Bindings; type TopParsed = Value | Parsed[] | DictOf | TopBindings; type Top = Preservable & PreserveWritable & { __as_preserve__(): Value; }; type DictOf = EncodableDictionary, Parsed>; type BindingName = string; type TopBindings = Bindings & Top; type SingleConstructor = ((input: any) => Parsed) & { schema(): SchemaDefinition; }; type MultipleConstructors = { [key: string]: SingleConstructor; }; type DefinitionConstructors = SingleConstructor | MultipleConstructors; type Bindings = { [key: BindingName]: Parsed; }; declare namespace Bindings { function empty(): Bindings; function single(k: BindingName, v: Parsed): Bindings; function merge(...vs: Bindings[]): Bindings; } type DynField = { type: 'simple'; value: Parsed; } | { type: 'compound'; values: Bindings; }; declare namespace DynField { function unwrap(f: DynField): Parsed; function unwrap_compound(f: DynField): Bindings; function simple(value: Parsed): DynField; function maybeSimple(value: Parsed | null): DynField; function compound(values: Bindings): DynField; function promote(f: DynField, key?: symbol): Bindings; } type Unparseable = TopParsed; type Unparser = (v: Parsed) => Value; type UnparserCompound = (v: Bindings) => Value; declare class SchemaInterpreter { env: Modules; mergeEmbeddeds: (a: V, b: V) => V | undefined; activeModule: ModulePath; unparserCache: { [key: string]: [Unparser]; }; constructor(env?: Modules, mergeEmbeddeds?: (a: V, b: V) => V | undefined); _withModule(modulePath: ModulePath, f: () => R): R; _findModule(modulePath: ModulePath): { resolved: ModulePath; schema: Schema; }; _lookup(modulePath: ModulePath, name: symbol, f: (d: Definition$1, schema: Schema) => R): R; makeTop(modulePath: ModulePath, name: symbol, fields: Bindings): TopBindings; buildConstructor(modulePath: ModulePath, name: symbol, schema: Schema, ty: Simple, variant?: symbol): SingleConstructor; definitionConstructor(modulePath: ModulePath, name: symbol): DefinitionConstructors; parse(modulePath: ModulePath, name: symbol, input: Value): Unparseable; tryParse(modulePath: ModulePath, name: symbol, input: Value): Unparseable | undefined; parseDefinition(d: Definition$1, input: Value): Parsed | undefined; parseNamedAlternative(p: NamedAlternative, input: Value): Bindings | undefined; parseNamedPattern(p: NamedPattern, input: Value): Bindings | undefined; parseNamedSimplePattern(p: NamedSimplePattern, input: Value): DynField | undefined; parseSimplePattern(p: SimplePattern, input: Value): Parsed | null | undefined; parseCompoundPattern(p: CompoundPattern, input: Value): Bindings | undefined; parsePattern(p: Pattern, input: Value): DynField | undefined; unparse(modulePath: ModulePath, name: symbol, v: Unparseable): Value; unparser(modulePath: ModulePath, name: symbol): Unparser; _unparser(modulePath: ModulePath, name: symbol): [Unparser]; unparserDefinition(p: Definition$1): Unparser; unparserNamedAlternative(p: NamedAlternative): [string, UnparserCompound]; unparserNamedPattern(p: NamedPattern): Unparser; unparserPattern(p: Pattern): Unparser; unparserSimplePattern(p: SimplePattern): Unparser; unparserCompoundPattern(p: CompoundPattern): UnparserCompound; unparserNamedSimplePattern(p: NamedSimplePattern): Unparser; moduleFor(modulePath: ModulePath): { [key: string]: any; } | undefined; moduleTree(tree?: { [key: string]: any; }): { [key: string]: any; }; } type interpreter_BindingName = BindingName; declare const interpreter_Bindings: typeof Bindings; type interpreter_DefinitionConstructors = DefinitionConstructors; type interpreter_DictOf = DictOf; declare const interpreter_DynField: typeof DynField; type interpreter_MultipleConstructors = MultipleConstructors; type interpreter_Parsed = Parsed; type interpreter_SchemaInterpreter = SchemaInterpreter; declare const interpreter_SchemaInterpreter: typeof SchemaInterpreter; type interpreter_SingleConstructor = SingleConstructor; type interpreter_Top = Top; type interpreter_TopBindings = TopBindings; type interpreter_TopParsed = TopParsed; declare const interpreter_UNIT: typeof UNIT; type interpreter_Unparseable = Unparseable; type interpreter_Unparser = Unparser; type interpreter_UnparserCompound = UnparserCompound; declare namespace interpreter { export { type interpreter_BindingName as BindingName, interpreter_Bindings as Bindings, type interpreter_DefinitionConstructors as DefinitionConstructors, type interpreter_DictOf as DictOf, interpreter_DynField as DynField, type interpreter_MultipleConstructors as MultipleConstructors, type interpreter_Parsed as Parsed, interpreter_SchemaInterpreter as SchemaInterpreter, type interpreter_SingleConstructor as SingleConstructor, type interpreter_Top as Top, type interpreter_TopBindings as TopBindings, type interpreter_TopParsed as TopParsed, interpreter_UNIT as UNIT, type interpreter_Unparseable as Unparseable, type interpreter_Unparser as Unparser, type interpreter_UnparserCompound as UnparserCompound }; } type RefResolver = (ref: Ref) => FieldType; declare function typeForDefinition(resolver: RefResolver, d: Definition$1): Type; declare function typeForIntersection(resolver: RefResolver, ps: NamedPattern[]): SimpleType; declare function typeFor(resolver: RefResolver, p: Pattern): SimpleType; declare function simpleType(resolver: RefResolver, p: SimplePattern): FieldType; type gentype_RefResolver = RefResolver; declare const gentype_simpleType: typeof simpleType; declare const gentype_typeFor: typeof typeFor; declare const gentype_typeForDefinition: typeof typeForDefinition; declare const gentype_typeForIntersection: typeof typeForIntersection; declare namespace gentype { export { type gentype_RefResolver as RefResolver, gentype_simpleType as simpleType, gentype_typeFor as typeFor, gentype_typeForDefinition as typeForDefinition, gentype_typeForIntersection as typeForIntersection }; } export { gentype as GenType, host as Host, type Imports, interpreter as Interpreter, meta as Meta, type SchemaDefinition, SchemaInterpreter, type SchemaReaderOptions, SchemaSyntaxError, type as Type, checkSchema, compile, parseSchema, readSchema, recordPosition, refPosition };