import * as t from "./types.js";
import { InjectionValue } from "./utils/type_utils.js";
import { Auth, Cors as CorsWit, Rate } from "./wit.js";
import Policy from "./policy.js";
type Exports = Record<string, t.Func>;
type Cors = Partial<CorsWit>;
interface TypegraphArgs {
    name: string;
    dynamic?: boolean;
    builder: TypegraphBuilder;
    prefix?: string;
    secrets?: Array<string>;
    cors?: Cors;
    rate?: Rate;
}
export interface TypegraphBuilderArgs {
    expose: (exports: Exports, defaultPolicy?: Policy) => void;
    inherit: () => InheritDef;
    rest: (graphql: string) => number;
    auth: (value: Auth | RawAuth) => number;
    ref: (name: string) => t.Typedef;
}
export declare class InheritDef {
    payload: string | undefined;
    set(value: InjectionValue<unknown>): this;
    inject(value: InjectionValue<string>): this;
    fromContext(value: InjectionValue<string>): this;
    fromSecret(value: InjectionValue<string>): this;
    fromParent(value: InjectionValue<string>): this;
}
export type TypegraphBuilder = (g: TypegraphBuilderArgs) => void;
export declare class RawAuth {
    readonly jsonStr: string;
    constructor(jsonStr: string);
}
export declare function typegraph(name: string, builder: TypegraphBuilder): void;
export declare function typegraph(args: TypegraphArgs): void;
export declare function typegraph(args: Omit<TypegraphArgs, "builder">, builder: TypegraphBuilder): void;
export declare function genRef(name: string): t.Typedef;
export {};
