import "./_dnt.polyfills.js";
import * as t from "./types.js";
import type { InjectionValue } from "./utils/type_utils.js";
import { type Auth, type Cors as CorsWit, type Rate } from "./wit.js";
import type { Artifact, SerializeParams } from "./gen/typegraph_core";
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;
    disableAutoSerialization?: boolean;
}
export declare class ApplyFromArg {
    name: string | null;
    type: number | null;
    constructor(name: string | null, type: number | null);
}
export declare class ApplyFromStatic {
    value: any;
    constructor(value: any);
}
export declare class ApplyFromSecret {
    key: string;
    constructor(key: string);
}
export declare class ApplyFromContext {
    key: string | null;
    type: number | null;
    constructor(key: string | null, type: number | null);
}
export declare class ApplyFromParent {
    typeName: string;
    constructor(typeName: string);
}
declare const InjectionSource: {
    readonly asArg: (name?: string, type?: t.Typedef) => ApplyFromArg;
    readonly set: (value: any) => ApplyFromStatic;
    readonly fromSecret: (key: string) => ApplyFromSecret;
    readonly fromContext: (key: string, type?: t.Typedef) => ApplyFromContext;
    readonly fromParent: (typeName: string) => ApplyFromParent;
};
type InjectionSourceType = typeof InjectionSource;
export interface TypegraphBuilderArgs extends InjectionSourceType {
    expose: (exports: Exports, defaultPolicy?: t.PolicySpec | Array<t.PolicySpec>) => void;
    inherit: () => InheritDef;
    rest: (graphql: string) => number;
    auth: (value: Auth | RawAuth) => number;
    ref: (name: string) => t.Typedef;
    configureRandomInjection: (params: {
        seed: number;
    }) => void;
}
export declare class InheritDef {
    payload: string | undefined;
    /** inject static value */
    set(value: InjectionValue<unknown>): InheritDef;
    /** inject a value (generic) */
    inject(value: InjectionValue<string>): InheritDef;
    /** inject from context */
    fromContext(value: InjectionValue<string>): InheritDef;
    /** inject from secret */
    fromSecret(value: InjectionValue<string>): InheritDef;
    /** inject from parent */
    fromParent(value: InjectionValue<string>): InheritDef;
    /** inject from random */
    fromRandom(): InheritDef;
}
export type TypegraphBuilder = (g: TypegraphBuilderArgs) => void;
export declare class RawAuth {
    readonly jsonStr: string;
    constructor(jsonStr: string);
}
export interface TypegraphOutput {
    serialize: (config: SerializeParams) => TgFinalizationResult;
    name: string;
}
export interface TgFinalizationResult {
    tgJson: string;
    ref_artifacts: Artifact[];
}
export declare function typegraph(name: string, builder: TypegraphBuilder): Promise<TypegraphOutput>;
export declare function typegraph(args: TypegraphArgs): Promise<TypegraphOutput>;
export declare function typegraph(args: Omit<TypegraphArgs, "builder">, builder: TypegraphBuilder): Promise<TypegraphOutput>;
/** generate a type reference (by name) */
export declare function genRef(name: string): t.Typedef;
export {};
