import type { EmitContext, Model, Namespace, Program } from "@typespec/compiler"; import { type EmittedResolverFile } from "./emit-graphql-resolver.js"; import { type EmittedStringModule } from "./emit-string-module.js"; import { type ResolvableByManifestEntry } from "./joins.js"; import { type OpenSearchEmitterOptions } from "./lib.js"; import { type ResolvedProjection, type TopLevelProjection } from "./projection.js"; import { type ResolvedRestOperation } from "./rest-operations.js"; export declare function $onEmit(context: EmitContext): Promise; declare function collectProjectionModels(program: Program, namespace: Namespace): Model[]; declare function isCandidateModel(model: Model): boolean; declare function isTemplateDeclaration(model: Model): boolean; declare function serializeProjections(program: Program, resolved: TopLevelProjection[]): { projections: { fields: { aggregations?: ("terms" | "range" | "cardinality" | "missing" | "sum" | "avg" | "min" | "max" | "date_histogram")[] | undefined; optional: boolean; keyword: boolean; nested: boolean; analyzer: string | undefined; boost: number | undefined; projectedName?: string | undefined; name: string; }[]; dependencies?: import("./joins.js").JoinDependencyManifestEntry[] | undefined; indexSettings?: Record | undefined; name: string; sourceModel: string; indexName: string; }[]; }; /** * REST manifest entries (issue #134). Reuses the graphql-resolvers.json * contract so the same CDK construct wires both resolver kinds; REST entries * carry `typeName` / `httpMethod` / `resourcePath` / `dataSource` instead of * `projection` / `indexName` / `queryFieldName` (`indexName` is optional in * the manifest shape — REST entries have no backing OS index). */ declare function generateRestManifestEntries(restOperations: ResolvedRestOperation[], dataSourceName?: string, resourcePathPrefix?: string, sdlFileName?: string): RestManifestEntry[]; /** * Validates `rest.resourcePathPrefix` (issue #140). Must start with `/` and * must not end with `/`. Returns the validated string, or `undefined` when * no prefix is configured (preserves current behavior). */ declare function validateResourcePathPrefix(prefix?: string): string | undefined; interface RestManifestEntry { typeName: string; fieldName: string; dataSource: string; httpMethod: string; resourcePath: string; mode: "monolithic"; resolverFile: string; sdlFile: string; resolvableBy?: ResolvableByManifestEntry; } interface NestedTypeManifestEntry { projection: string; sdlFile: string; sdlModule: string; } /** * Nested-type manifest entries (issue #164). A nested-only projection has no * Query field, resolver, or index, so it has nothing to say in `resolvers[]` * — but its SDL fragment defines a type that top-level fragments reference by * name. Without it in the manifest, a schema assembled from * `resolvers[].sdlFile` alone dangles on that reference. */ declare function generateNestedTypeEntries(nestedOnly: ResolvedProjection[]): NestedTypeManifestEntry[]; declare function generateGraphQLManifest(projections: TopLevelProjection[], resolverFiles: EmittedResolverFile[], queryFieldDirectives?: string[][], restEntries?: RestManifestEntry[], nestedTypes?: NestedTypeManifestEntry[]): string; /** * Issue #173 — hard-fail compile when the emitted resolver code cannot deploy, * so the over-cap case can never pass compile silently and only fail later at * AppSync `CreateFunction`. Two conditions: any generated AppSync function file * (the resolver-level after-mapping and every pipeline function) over the * 32,768-byte per-function code limit, and a pipeline needing more functions * than AppSync allows on one resolver. Both mean the recursive split ran out of * room and the projection must shed filter/aggregation surface. */ declare function assertResolverFilesFit(program: Program, projectionName: string, resolverFile: EmittedResolverFile): void; /** * Issue #157 — `@searchProjection` states an intent for top-level emission. * Without `@indexName` that intent is discarded, and the result is * byte-identical to an undecorated model, so the demotion is invisible in the * build output. Warn per demoted projection: regenerating a downstream package * then enumerates exactly which Query fields it lost. */ declare function reportDemotedProjections(program: Program, nestedOnly: ResolvedProjection[]): void; export declare const __test: { collectProjectionModels: typeof collectProjectionModels; reportDemotedProjections: typeof reportDemotedProjections; assertResolverFilesFit: typeof assertResolverFilesFit; isCandidateModel: typeof isCandidateModel; isTemplateDeclaration: typeof isTemplateDeclaration; serializeProjections: typeof serializeProjections; generatePackageJson: typeof generatePackageJson; generateTsConfig: typeof generateTsConfig; generateGraphQLManifest: typeof generateGraphQLManifest; generateRestManifestEntries: typeof generateRestManifestEntries; generateNestedTypeEntries: typeof generateNestedTypeEntries; generateGraphQLEntryPoint: typeof generateGraphQLEntryPoint; validateResourcePathPrefix: typeof validateResourcePathPrefix; }; declare function generateTsConfig(projections: ResolvedProjection[], stringModules?: EmittedStringModule[]): string; declare function generateGraphQLEntryPoint(): string; /** * `artifactFileNames` is the list emission recorded as it wrote each * consumer-facing artifact, so a subpath exists for exactly the files the * package ships — whatever shape the resolver emit chose (issue #184). * `stringModules` is the same list for the string-export modules (issue * #1068); each exports as an extensionless subpath resolving to the compiled * `.js` next to the emitted `.ts`. */ declare function generatePackageJson(packageName: string, packageVersion: string, artifactFileNames: string[], restOnly?: boolean, stringModules?: EmittedStringModule[]): string; export {}; //# sourceMappingURL=emitter.d.ts.map