import { C as AttributeArgAst, P as AstNode, T as ExpressionAst, b as FieldAttributeAst, et as SourceFile, x as ModelAttributeAst } from "./parse-Bl1gwWGn.mjs"; import { S as readResolvedConstructorCall, _ as keywordPslSpan, a as ModelSymbol, b as readResolvedAttribute, c as ScalarSymbol, d as TopLevelScope, f as TypeAliasSymbol, g as ResolvedTypeConstructorCall, h as ResolvedAttributeArg, i as FieldSymbol, l as SymbolTable, m as ResolvedAttribute, n as BuildSymbolTableOptions, o as NamespaceSymbol, p as buildSymbolTable, r as CompositeTypeSymbol, s as ResolvedNamedTypeBinding, t as BlockSymbol, u as SymbolTableResult, v as nodePslSpan, x as readResolvedAttributes, y as rangeToPslSpan } from "./symbol-table-en_Bich3.mjs"; import { PslAttribute, PslAttribute as PslAttribute$1, PslAttributeArgument, PslAttributeNamedArgument, PslAttributePositionalArgument, PslAttributeTarget, PslCompositeType, PslDefaultFunctionValue, PslDefaultLiteralValue, PslDefaultValue, PslDiagnostic, PslDiagnostic as PslDiagnostic$1, PslDiagnosticCode, PslDiagnosticCode as PslDiagnosticCode$1, PslDocumentAst, PslExtensionBlock, PslExtensionBlockAttribute, PslExtensionBlockAttributeArg, PslExtensionBlockParamBare, PslExtensionBlockParamList, PslExtensionBlockParamOption, PslExtensionBlockParamRef, PslExtensionBlockParamScalarValue, PslExtensionBlockParamValue, PslField, PslFieldAttribute, PslModel, PslModelAttribute, PslNamedTypeDeclaration, PslNamespace, PslPosition, PslSpan, PslSpan as PslSpan$1, PslTypeConstructorCall, PslTypesBlock, flatPslModels, namespacePslExtensionBlocks } from "@prisma-next/framework-components/psl-ast"; import { Result } from "@prisma-next/utils/result"; import { AuthoringPslBlockDescriptor, AuthoringPslBlockDescriptorNamespace } from "@prisma-next/framework-components/authoring"; import { Simplify, UnionToIntersection } from "@prisma-next/utils/types"; import { CodecLookup } from "@prisma-next/framework-components/codec"; //#region src/attribute-helpers.d.ts declare function getPositionalArgument(attribute: PslAttribute$1, index?: number): string | undefined; declare function parseQuotedStringLiteral(value: string): string | undefined; //#endregion //#region src/attribute-spec/types.d.ts type AttributeLevel = 'field' | 'model' | 'block'; interface ArgType { readonly kind: string; readonly label: string; readonly _out?: T; parse(arg: ExpressionAst, ctx: InterpretCtx): Result; } interface InterpretCtx { readonly level: AttributeLevel; readonly sourceId: string; readonly sourceFile: SourceFile; readonly selfModel: ModelSymbol; resolveReferencedModel(): ModelSymbol | undefined; readonly field?: FieldSymbol; } interface OptionalArgType extends ArgType { readonly optional: true; readonly hasDefault: boolean; readonly defaultValue?: T; } type Param = ArgType; interface PositionalParam { readonly key: string; readonly type: Param; } interface AttributeSpec { readonly level: AttributeLevel; readonly name: string; readonly positional: readonly PositionalParam[]; readonly named: Readonly>>; readonly refine?: (parsed: Out, ctx: InterpretCtx) => readonly PslDiagnostic$1[]; } type OutOf

= P extends ArgType ? T : never; type NamedOut>> = Simplify<{ [K in keyof N as N[K] extends OptionalArgType ? never : K]: OutOf; } & { [K in keyof N as N[K] extends OptionalArgType ? K : never]?: OutOf; }>; type PosEntryObject = E['type'] extends OptionalArgType ? { [K in E['key']]?: OutOf; } : { [K in E['key']]: OutOf; }; type PosOut = Simplify; }[number]>>; type AttributeOut>> = Simplify & NamedOut>; type InferAttr = S extends AttributeSpec ? Out : never; //#endregion //#region src/attribute-spec/combinators/bool.d.ts declare function bool(): ArgType; //#endregion //#region src/attribute-spec/combinators/diagnostic.d.ts declare function leafDiagnostic(ctx: InterpretCtx, node: AstNode, message: string): PslDiagnostic$1; //#endregion //#region src/attribute-spec/combinators/entity-ref.d.ts declare function entityRef(): ArgType; //#endregion //#region src/attribute-spec/combinators/field-ref.d.ts type FieldRefScope = 'self' | 'referenced'; interface FieldRefArgType extends ArgType { readonly scope: FieldRefScope; } declare function fieldRef(scope: FieldRefScope): FieldRefArgType; //#endregion //#region src/attribute-spec/combinators/func-call.d.ts interface FuncCallSig { readonly positional?: readonly PositionalParam[]; readonly named?: Readonly>>; } interface TypedFuncCall { readonly fn: string; readonly span: PslSpan$1; readonly args: Readonly>; } declare function funcCall(name: string, sig: FuncCallSig): ArgType; //#endregion //#region src/attribute-spec/combinators/identifier.d.ts declare function identifier(name: N): ArgType; //#endregion //#region src/attribute-spec/combinators/int.d.ts declare function int(opts?: { min?: number; max?: number; }): ArgType; //#endregion //#region src/attribute-spec/combinators/list.d.ts interface ListOptions { readonly nonEmpty?: boolean; readonly unique?: boolean; } declare function list(of: ArgType, opts?: ListOptions): ArgType; //#endregion //#region src/attribute-spec/combinators/num.d.ts declare function num(): ArgType; declare function num(value: number): ArgType; //#endregion //#region src/attribute-spec/combinators/one-of.d.ts declare function oneOf, ...ArgType[]]>(...alts: Alts): ArgType>; //#endregion //#region src/attribute-spec/combinators/record.d.ts declare function record(of: ArgType): ArgType>; //#endregion //#region src/attribute-spec/combinators/str.d.ts declare function str(): ArgType; //#endregion //#region src/attribute-spec/field-attribute.d.ts interface FieldAttributeConfig>> { readonly positional?: Pos; readonly named?: Named; readonly refine?: (parsed: AttributeOut, ctx: InterpretCtx) => readonly PslDiagnostic$1[]; } declare function fieldAttribute> = Record>(name: string, config: FieldAttributeConfig): AttributeSpec>; //#endregion //#region src/attribute-spec/interpret.d.ts interface ArgBindingSpec { readonly name: string; readonly positional: readonly PositionalParam[]; readonly named: Readonly>>; } declare function interpretArgs(args: Iterable, spec: ArgBindingSpec, ctx: InterpretCtx, span: PslSpan$1): Result, readonly PslDiagnostic$1[]>; declare function interpretAttribute(attrNode: FieldAttributeAst | ModelAttributeAst, spec: AttributeSpec, ctx: InterpretCtx): Result; //#endregion //#region src/attribute-spec/model-attribute.d.ts interface ModelAttributeConfig>> { readonly positional?: Pos; readonly named?: Named; readonly refine?: (parsed: AttributeOut, ctx: InterpretCtx) => readonly PslDiagnostic$1[]; } declare function modelAttribute> = Record>(name: string, config: ModelAttributeConfig): AttributeSpec>; //#endregion //#region src/attribute-spec/optional.d.ts declare function optional(type: ArgType, ...rest: [defaultValue: T] | []): OptionalArgType; //#endregion //#region src/extension-block.d.ts declare function findBlockDescriptor(descriptors: AuthoringPslBlockDescriptorNamespace | undefined, keyword: string): AuthoringPslBlockDescriptor | undefined; declare function validateExtensionBlockFromSymbol(input: { readonly block: BlockSymbol; readonly descriptor: AuthoringPslBlockDescriptor; readonly symbolTable: SymbolTable; readonly sourceFile: SourceFile; readonly sourceId: string; readonly codecLookup: CodecLookup; }): readonly PslDiagnostic$1[]; //#endregion export { type ArgBindingSpec, type ArgType, type AttributeLevel, type AttributeOut, type AttributeSpec, type BlockSymbol, type BuildSymbolTableOptions, type CompositeTypeSymbol, type FieldRefArgType, type FieldRefScope, type FieldSymbol, type FuncCallSig, type InferAttr, type InterpretCtx, type ListOptions, type ModelSymbol, type NamedOut, type NamespaceSymbol, type OptionalArgType, type OutOf, type Param, type PosOut, type PositionalParam, type PslAttribute, type PslAttributeArgument, type PslAttributeNamedArgument, type PslAttributePositionalArgument, type PslAttributeTarget, type PslCompositeType, type PslDefaultFunctionValue, type PslDefaultLiteralValue, type PslDefaultValue, type PslDiagnostic, type PslDiagnosticCode, type PslDocumentAst, type PslExtensionBlock, type PslExtensionBlockAttribute, type PslExtensionBlockAttributeArg, type PslExtensionBlockParamBare, type PslExtensionBlockParamList, type PslExtensionBlockParamOption, type PslExtensionBlockParamRef, type PslExtensionBlockParamScalarValue, type PslExtensionBlockParamValue, type PslField, type PslFieldAttribute, type PslModel, type PslModelAttribute, type PslNamedTypeDeclaration, type PslNamespace, type PslPosition, type PslSpan, type PslTypeConstructorCall, type PslTypesBlock, type ResolvedAttribute, type ResolvedAttributeArg, type ResolvedNamedTypeBinding, type ResolvedTypeConstructorCall, type ScalarSymbol, type SymbolTable, type SymbolTableResult, type TopLevelScope, type TypeAliasSymbol, type TypedFuncCall, bool, buildSymbolTable, entityRef, fieldAttribute, fieldRef, findBlockDescriptor, flatPslModels, funcCall, getPositionalArgument, identifier, int, interpretArgs, interpretAttribute, keywordPslSpan, leafDiagnostic, list, modelAttribute, namespacePslExtensionBlocks, nodePslSpan, num, oneOf, optional, parseQuotedStringLiteral, rangeToPslSpan, readResolvedAttribute, readResolvedAttributes, readResolvedConstructorCall, record, str, validateExtensionBlockFromSymbol }; //# sourceMappingURL=index.d.mts.map