import { type Model, type Program } from "@typespec/compiler"; import { type AggregationEntry } from "./aggregations.js"; import { toGraphQLType } from "./graphql-types.js"; import type { ResolvedProjection } from "./projection.js"; export interface EmittedGraphQLFile { fileName: string; content: string; } export interface GraphQLOptions { defaultPageSize: number; maxPageSize: number; /** * Directives applied to every emitted response-path type (Doc, Connection, * Edge, PageInfo, Aggregations, bucket types, nested struct types). Each * string is rendered verbatim after the type name (e.g. * `["@aws_cognito_user_pools", "@aws_iam"]`). Per-model * `@graphqlDirectives(...)` overrides this list per-model. Issue #121. */ directives?: string[]; /** * When false, emit the minimal SDL needed to reference this projection * from a parent: the response object type and any virtual struct types * it contains. Skips Connection/Edge/PageInfo, Filter / SearchFilter, * Sort and Aggregations — none of those are reachable without a Query * field returning the projection. Used for `is SearchProjection` * models that lack `@searchProjection` (issue #123). Default: true. */ topLevel?: boolean; } /** * Resolves the directive list to apply to a type emitted from `model`. When * the model declares `@graphqlDirectives(...)`, that list is used verbatim * (full replacement of `defaults`); empty array opts the model out entirely. * Falls back to `defaults` when no override is declared. */ export declare function resolveDirectives(program: Program, model: Model, defaults: string[] | undefined): string[]; export declare function emitGraphQLSdl(program: Program, projection: ResolvedProjection, options: GraphQLOptions): EmittedGraphQLFile; declare function renderObjectType(program: Program, projection: ResolvedProjection, directives?: readonly string[]): string; declare function renderFilterInput(projection: ResolvedProjection): string | undefined; export declare function sortFieldTypeName(projectionName: string): string; export declare function sortInputTypeName(projectionName: string): string; declare function renderConnectionTypes(typeName: string, includeAggregations: boolean, directives?: readonly string[]): string; declare function renderAggregationTypes(typeName: string, entries: AggregationEntry[], directives?: readonly string[]): string; export declare function toGraphQLQueryFieldName(projectionModelName: string): string; export declare const __test: { renderObjectType: typeof renderObjectType; renderFilterInput: typeof renderFilterInput; renderConnectionTypes: typeof renderConnectionTypes; renderAggregationTypes: typeof renderAggregationTypes; resolveDirectives: typeof resolveDirectives; toGraphQLType: typeof toGraphQLType; toGraphQLQueryFieldName: typeof toGraphQLQueryFieldName; }; export {}; //# sourceMappingURL=emit-graphql-sdl.d.ts.map