import { type DecoratorContext, type Model, Program, Type, Interface, ModelProperty, ObjectValue, Operation, StringValue, Union } from "@typespec/compiler"; export declare const appendStateValue: (context: DecoratorContext, key: symbol, target: Type, value: T | T[]) => void; export declare const getStateValue: (program: Program, key: symbol, target: Type) => T[]; export declare const setStateScalar: (context: DecoratorContext, key: symbol, target: Type, value: T) => void; export declare const getStateScalar: (program: Program, key: symbol, target: Type) => T | undefined; export interface SampleOptions { title?: string; description?: string; } export interface SampleEntry { sample: object; title?: string; description?: string; } export declare function $sample(context: DecoratorContext, target: ModelProperty, sample: ObjectValue | object, options?: SampleOptions): void; export declare function $abstract(context: DecoratorContext, target: Model): void; export declare function $coerce(context: DecoratorContext, target: Model, scalar: Type, expansion: ObjectValue | object, title?: string, description?: string, example?: string): void; export interface FactoryEntry { /** Factory method name (e.g., "allow", "deny") */ name: string; /** Field assignments — { fieldName: value } */ sets: Record; /** Optional parameters — { paramName: typeString } */ params: Record; } export interface MethodOptions { /** Whether runtimes expose a synthetic native cancellation parameter */ runtimeCancellable?: boolean; /** Whether the operation is atomic (metadata/documentation only) */ atomic?: boolean; /** Whether failures are non-fatal (metadata/documentation only) */ nonFatal?: boolean; } export interface OperationEffectOptions { /** Whether the operation is atomic (metadata/documentation only) */ atomic?: boolean; /** Whether failures are non-fatal (metadata/documentation only) */ nonFatal?: boolean; } export interface OperationEffectEntry extends MethodOptions { /** Whether this operation is optional on generated callable surfaces */ optional?: boolean; /** Whether this operation is synchronous */ sync?: boolean; } export interface MethodEntry extends MethodOptions { /** Method name (e.g., "text") */ name: string; /** Return type as a string (e.g., "string") */ returns: string; /** Human-readable description of what the method does */ description: string; /** Method parameters as an ordered map of name → type string */ params: Record; /** Whether this method is optional (has a default implementation) */ optional: boolean; /** Whether this method is synchronous (not wrapped in async/Promise/Task) */ sync: boolean; } export declare function $factory(context: DecoratorContext, target: Model, name: string, sets: object, params?: object): void; export declare function $runtimeCancellable(context: DecoratorContext, target: Operation): void; export declare function $sync(context: DecoratorContext, target: Operation): void; export declare function $effect(context: DecoratorContext, target: Operation, options: object): void; export declare function $optionalOperation(context: DecoratorContext, target: Operation): void; export declare function $vector(context: DecoratorContext, target: Operation, vector: object): void; export interface KnownAsEntry { /** Provider identifier (e.g., "openai", "anthropic") */ provider: string; /** Wire field name for that provider */ name: string; } export declare function $knownAs(context: DecoratorContext, target: ModelProperty, provider: string, name: string): void; export interface ParseAliasEntry { /** Canonical string-union value emitted during serialization */ canonical: string; /** Alternate input strings accepted during parsing/loading */ aliases: string[]; } export declare function $parseAlias(context: DecoratorContext, target: Union, canonical: string, aliases: ObjectValue | object | string[]): void; export interface DefaultForEntry { /** Provider identifier (e.g., "openai", "anthropic") */ provider: string; /** Default value for that provider */ defaultValue: any; } export declare function $defaultFor(context: DecoratorContext, target: ModelProperty, provider: string, defaultValue: ObjectValue | object | string | number | boolean): void; /** * Declares that a seam `interface` is resolved by behavioral polymorphic * dispatch keyed by the value of the `discriminator` ModelProperty. The * decorator only records the discriminator; the access path from the seam * methods' parameters to that field is resolved deterministically during IR * lowering (see `resolveCallableDispatch`). */ export declare function $dispatch(context: DecoratorContext, target: Interface, discriminator: ModelProperty): void; /** * Declares which field of this model receives an immediate scalar value when the * model appears as an entry of a name-keyed collection. This is deliberately * distinct from the `@coerce` expansion target: a bare scalar reaching the type * directly and a bare scalar reaching it as a named collection entry are * different contexts and may legitimately populate different fields. */ export declare function $entryShorthand(context: DecoratorContext, target: Model, field: string | StringValue): void; /** A serialization direction a field may be withheld from. */ export type SerializationDirection = "load" | "save"; /** * Marks a model as a serialization root. Only records the intent; the emitter * derives the serialized set (transitive property reach + discriminated variant * expansion) from every `@serializable` root during IR lowering. */ export declare function $serializable(context: DecoratorContext, target: Model): void; /** * Withholds a field from the named serialization direction(s). Records the set * of directions the field is excluded from; an empty argument list defaults to * both directions (least-privilege / fail-closed). Repeated applications (e.g. a * direct decorator plus an augment) are merged by set union so a later * application can only ever tighten — never relax — the withheld set. */ export declare function $sensitive(context: DecoratorContext, target: ModelProperty, ...directions: (SerializationDirection | StringValue)[]): void;