import { $$deepDepSkip } from "../constants.ts"; import type { DataFromStep, ExecutionDetails, ExecutionEntryFlags, GrafastResultsList } from "../interfaces.ts"; import { Step } from "../step.ts"; import type { __ItemStep } from "./__item.ts"; export declare const TRAP_ERROR: ExecutionEntryFlags; export declare const TRAP_INHIBITED: ExecutionEntryFlags; export declare const TRAP_ERROR_OR_INHIBITED: ExecutionEntryFlags; declare const TRAP_VALUES: readonly ["NULL", "EMPTY_LIST", "PASS_THROUGH"]; /** @defaultValue `'PASS_THROUGH'` */ export type TrapValue = (typeof TRAP_VALUES)[number]; /** `false` means pass-through; all others are literal */ export type ResolvedTrapValue = false | null | undefined | readonly never[]; export interface FlagStepOptions { acceptFlags?: ExecutionEntryFlags; onReject?: Error | null; dataOnly?: boolean; if?: Step; valueForInhibited?: TrapValue; valueForError?: TrapValue; } export declare class __FlagStep extends Step> { static $$export: { moduleName: string; exportName: string; }; isSyncAndSafe: boolean; private ifDep; private forbiddenFlags; private onRejectReturnValue; private valueForInhibited; private valueForError; private canBeInlined; constructor(step: TStep, options: FlagStepOptions); toStringMeta(): string | null; [$$deepDepSkip](): Step; listItem?: ($item: __ItemStep) => Step; _listItem($item: __ItemStep): Step; deduplicate(_peers: readonly Step[]): readonly Step[]; execute(_details: ExecutionDetails<[data: DataFromStep, cond?: boolean]>): GrafastResultsList>; finalize(): void; private fancyExecute; private passThroughExecute; } /** * Example use case: get user by id, but id is null: no need to fetch the user * since we know they won't exist. */ export declare function inhibitOnNull($step: TStep, options?: { if?: FlagStepOptions["if"]; }): Step ? Exclude : any>; /** * Example use case: expecting a node ID that represents a User, but get one * that represents a Post instead: throw error to tell user they've sent invalid * data. */ export declare function assertNotNull($step: TStep, message: string, options?: { if?: FlagStepOptions["if"]; }): __FlagStep; export declare function trap($step: TStep, acceptFlags: ExecutionEntryFlags, options?: { valueForInhibited?: FlagStepOptions["valueForInhibited"]; valueForError?: FlagStepOptions["valueForError"]; if?: FlagStepOptions["if"]; }): __FlagStep; export {}; //# sourceMappingURL=__flag.d.ts.map