import type BLRequest from 'backendless-request' import type { ServiceConfigItemTypes } from './common/constants' import type { ServiceClassType } from './v1/constants' import type { ConfigItemSource } from './v1/types' import type { createExtension } from './v2/create-extension' import type { FlowrunnerCrypto } from './v2/crypto' import type { ExtendedZod } from './v2/params' import type { getExtension } from './v2/registry' // The single `Flowrunner` runtime installed on the global scope by ../namespace.ts. Shared by v1 and v2: // - `Request` — HTTP client used by service code (`Flowrunner.Request.get(...)`). // - `z` / `createExtension` / `getExtension` — the v2 authoring surface (services do `const z = Flowrunner.z`). // - `ServerCode` — the v1-only registration seam, set for the duration of a v1 require (see v1/namespace.ts). export interface FlowrunnerRuntime { Request: typeof BLRequest z: ExtendedZod crypto: FlowrunnerCrypto createExtension: typeof createExtension getExtension: typeof getExtension ServerCode: FlowrunnerServerCode | null } export interface FlowrunnerServerCode { addService(ServiceClass: ServiceClassType, sourceConfigItems?: ConfigItemSource[]): void ConfigItems: { TYPES: typeof ServiceConfigItemTypes } } declare global { var Flowrunner: FlowrunnerRuntime }