export interface EnumInfo { readonly identity: string; /** Source member names used by type checking and member access. */ readonly members: ReadonlySet; /** * Runtime wire value for each source member name. D102 ruling 1: a string, * or a safe integer where the protocol pins a numeric version. The kinds are * distinct values — `"2"` and `2` are two wire values, not one. */ readonly wireValues: ReadonlyMap; } /** * D55 rule 120: a generic record declaration, in the form every later stage * needs it — the identity its instantiations are keyed under, the parameter * names and their bounds, and the field table with the `parameter` types still * standing in it. This is the shape that crosses a module interface, so a * dependent can write `Box` without the declaring module ever * having anticipated that argument. */ export interface GenericTypeInfo { readonly identity: string; readonly name: string; readonly parameterNames: readonly string[]; readonly parameterBounds: readonly (TypeParameterBound | null)[]; readonly fields: ReadonlyMap; readonly readonlyFields?: ReadonlySet; } export type ExtensionTypeDisplay = { readonly kind: "named"; readonly name: string; } | { readonly kind: "constructor"; readonly prefix: string; readonly name: string; } | { readonly kind: "properties"; readonly name: string; readonly result: string; readonly hiddenOptionalProperties?: ReadonlyMap; }; /** * A target-owned type family. Core traverses its nested types and owns stable * identity, while the active language extension owns semantic compatibility * between roles in the family (for example a framework constructor satisfying * a framework contract). */ export interface ExtensionValueType { readonly kind: "extension"; readonly extensionId: string; readonly family: string; readonly role: string; readonly nominal?: string; readonly properties: ReadonlyMap; readonly requiredProperties: ReadonlySet; readonly arguments: readonly ValueType[]; readonly metadata?: Readonly>; readonly display: ExtensionTypeDisplay; } /** * D55 rule 121: a generic record applied to arguments — `Box`. The * arguments ride on the application rather than inside the `parameter` kind, * which keeps that kind's De Bruijn contract literal; this is D41 item 61's own * precedent for bounds, applied to the other piece of discriminating * information. The canonical instantiation identity is a pure function of * `declaration` and `arguments` (`genericApplicationIdentity`), so every stage * that rebuilds an application — the analyzer, a module interface, generic * `def` substitution — computes the same string without agreeing on anything * else. `fieldsOf` is untouched: the identity keys an already-substituted field * table, so no call site of it ever substitutes. */ export interface GenericApplication { /** The declaration's identity once nominals are resolved; its source name before that. */ readonly declaration: string; /** The declaration's display name (`Box`), so substitution can rebuild the display text. */ readonly name: string; readonly arguments: readonly ValueType[]; } export type ValueType = /** * `restricted` is the recursion placeholder and `boundary` is the `unknown` * a program wrote down — the type of data nobody has checked yet. Neither * may be absorbed by a merge; see `mergeTypes`. */ { readonly kind: "unknown"; readonly restricted?: boolean; readonly boundary?: true; } /** * `textConvertible` marks the compiler-owned text-conversion domain (charter * section 14). It is not spellable in source: only the built-in `str` * declares it, so a bare `str` stays a first-class value while assignability * still admits exactly the conversion whitelist at every call site. */ | { readonly kind: "any"; readonly textConvertible?: true; } | { readonly kind: "null"; } | { readonly kind: "string"; } | { readonly kind: "number"; } | { readonly kind: "bool"; } | { readonly kind: "optional"; readonly inner: ValueType; } | { readonly kind: "list"; readonly element: ValueType; readonly readonlyView?: true; } | { readonly kind: "set"; readonly element: ValueType; readonly readonlyView?: true; } | { readonly kind: "map"; readonly key: ValueType; readonly value: ValueType; readonly readonlyView?: true; } | { readonly kind: "record"; readonly value: ValueType; readonly readonlyView?: true; } | { readonly kind: "promise"; readonly value: ValueType; } | { readonly kind: "object"; readonly fields: ReadonlyMap; readonly readonlyFields?: ReadonlySet; readonly optionalFields?: ReadonlySet; readonly readonlyView?: true; /** * D51 (audit 12): a standard capability handle a target declares * structurally rather than as a named type — a socket, an event stream, a * terminal. `using` supplies the contract for capability handles (charter * section 16), and only a compiler extension can set this flag, so a user * record with a `close()` is still never auto-detected as ownable. */ readonly capabilityHandle?: true; } | { readonly kind: "parameter"; readonly name: string; readonly index: number; } | { readonly kind: "named"; readonly name: string; readonly identity?: string; readonly readonlyView?: true; readonly application?: GenericApplication; } /** * D55 rule 120 layer two: a class instantiation carries its arguments on the * same `application` a generic record does, and its `identity` is the same * pure function of declaration and arguments. `Stack` and * `Stack` are therefore two identities that no subclass chain joins, * which is the whole of the invariance ruling (D77 rule 194 item 1). */ | { readonly kind: "class"; readonly name: string; readonly identity?: string; readonly application?: GenericApplication; } | { readonly kind: "enum"; readonly name: string; readonly identity: string; } | { readonly kind: "enumMember"; readonly name: string; readonly identity: string; readonly member: string; } | { readonly kind: "enumObject"; readonly name: string; readonly identity: string; readonly members: ReadonlySet; } | { readonly kind: "typeObject"; readonly name: string; readonly value?: ValueType; } | { readonly kind: "runtimeType"; readonly value: ValueType; } | { readonly kind: "classConstructor"; readonly name: string; readonly identity?: string; } | ExtensionValueType | { readonly kind: "function"; readonly typeParameterNames?: readonly string[]; readonly typeParameterBounds?: readonly (TypeParameterBound | null)[]; readonly parameters: readonly ValueType[]; readonly parameterNames?: readonly string[]; readonly requiredParameters: number; readonly rest?: ValueType; readonly result: ValueType; } | { readonly kind: "action"; readonly typeParameterNames?: readonly string[]; readonly typeParameterBounds?: readonly (TypeParameterBound | null)[]; readonly parameters: readonly ValueType[]; readonly parameterNames?: readonly string[]; readonly requiredParameters: number; readonly rest?: ValueType; readonly result: ValueType; } | { readonly kind: "intrinsic"; readonly name: string; readonly typeParameterNames?: readonly string[]; readonly typeParameterBounds?: readonly (TypeParameterBound | null)[]; readonly parameters: readonly ValueType[]; readonly parameterNames?: readonly string[]; readonly requiredParameters: number; readonly rest?: ValueType; readonly result: ValueType; } | { readonly kind: "union"; readonly members: readonly ValueType[]; }; /** Canonical identities for Core's cross-runtime binary storage types. */ export declare const VELAR_BYTES_TYPE_IDENTITY = "velar/binary#type:Bytes"; export declare const VELAR_UINT8_BUFFER_TYPE_IDENTITY = "velar/binary#type:UInt8Buffer"; export declare const VELAR_UINT16_BUFFER_TYPE_IDENTITY = "velar/binary#type:UInt16Buffer"; export declare const VELAR_UINT32_BUFFER_TYPE_IDENTITY = "velar/binary#type:UInt32Buffer"; export declare const VELAR_FLOAT32_BUFFER_TYPE_IDENTITY = "velar/binary#type:Float32Buffer"; export type BinaryStorageKind = "bytes" | "uint8" | "uint16" | "uint32" | "float32"; /** * Binary storage stays nominal even though its JavaScript representation is a * typed array. This keeps Buffer's accidental surface out of source while * giving the analyzer and emitter one exact fast-path discriminator. */ export declare function binaryStorageKind(type: ValueType): BinaryStorageKind | null; export declare const unknownType: ValueType; /** * The `unknown` a program wrote in an annotation, and the type every boundary * that hands back unchecked data should carry. It differs from the inference * seed above in exactly one rule — a merge may not absorb it — so `unknown` * arriving from outside stays unassignable until the value is validated, * instead of being retyped as whatever the other branch produced. */ export declare const boundaryUnknownType: ValueType; export declare const invalidType: ValueType; export declare const anyType: ValueType; /** The declared parameter domain of the built-in `str`; see `isTextConvertibleType`. */ export declare const textConvertibleType: ValueType; export declare const nullType: ValueType; export declare const stringType: ValueType; export declare const numberType: ValueType; export declare const boolType: ValueType; /** * D41 item 61: the complete, closed bound vocabulary. A bound is a name the * compiler owns; users cannot define one, and there is no syntax for combining * two — D51 rule 110: not because the three form a containment chain (they do * not: a Web text-shaped value satisfies Text and is refused by Data), but * because no real function demands two at once. The grant table in * `types/bounds.ts` is the whole definition; nothing computes a relation * between two bounds. */ export declare const typeParameterBoundNames: readonly ["Comparable", "Text", "Data"]; export type TypeParameterBound = (typeof typeParameterBoundNames)[number]; export interface TypeEnvironment { fieldsOf(identity: string): ReadonlyMap | null; readonlyFieldsOf?(identity: string): ReadonlySet | null; isSubclassOf(actual: string, expected: string): boolean; isPrimitiveType(name: string): boolean; isPrimitiveSubtype(actual: string, expected: string): boolean; isExtensionTypeAssignable?(actual: ExtensionValueType, expected: ExtensionValueType, assign: (actual: ValueType, expected: ValueType) => boolean): boolean | undefined; /** Target-owned total text forms used by f-strings and the built-in `str`. */ extensionTextForm?(type: ValueType): boolean | undefined; /** Expands declared type aliases; the text-conversion domain checks the expanded shape. */ expandTypeAliases?(type: ValueType): ValueType; /** * D102 ruling 1: the declared wire value of each member of an enum, looked up * by identity first and local name second, the way every other enum question * reaches `this.enums`. Assignability needs it because the enum -> `string` * exit (D42 item 65) is a claim about the runtime representation, and a * member pinned to an integer does not have one. */ enumWireValuesOf?(identity: string, name: string): ReadonlyMap | null; /** * D41 item 61 risk 2: the declared bound of a type parameter in scope. The * bound deliberately lives outside the `parameter` type kind (whose identity * encodes only its De Bruijn index), so the environment answers it from the * declaration frame the annotation was resolved in. */ boundOf?(type: Extract): TypeParameterBound | null; /** Decides whether a solved type argument satisfies a declared bound. */ satisfiesBound?(type: ValueType, bound: TypeParameterBound): boolean; } /** * The canonical identity of one instantiation. D55 rule 121 puts the arguments * in the identity string rather than adding a field `typeIdentity` would have * to learn, so `Box` and `Box` are two identities and * `typeIdentity`'s `named` branch is unchanged. Arguments are keyed by their * own identities, which is what makes `Box` and `Box` one type when * `Id` is an alias of `string`. */ export declare function genericApplicationIdentity(declaration: string, arguments_: readonly ValueType[]): string; /** * Rebuilds a type with `map` applied to each type it directly contains. The * nested positions are exactly the ones `substituteTypeParameters` walks, kept * in one place so a traversal added by a caller cannot miss one of them. */ export declare function mapNestedTypes(type: ValueType, map: (nested: ValueType) => ValueType): ValueType; export declare function optionalOf(type: ValueType): ValueType; export declare function nonOptional(type: ValueType): ValueType; export declare function unionOf(types: readonly ValueType[]): ValueType; export declare function resolvedAsyncType(type: ValueType): ValueType; export declare function sameType(left: ValueType, right: ValueType): boolean; export declare function sameTypeIgnoringCallableParameterNames(left: ValueType, right: ValueType): boolean; export declare function runtimeTypeValue(type: ValueType): ValueType | null; export declare function semanticTypeIdentity(type: ValueType): string; export declare const analysisTypeIdentity: typeof semanticTypeIdentity; export declare function isInvalidType(type: ValueType): boolean; export type CallableType = Extract; export declare function typeContainsRuntimeTypeCheck(type: ValueType): boolean; export declare function typeContainsAnyOutput(type: ValueType): boolean; //# sourceMappingURL=model.d.ts.map