/** @effect-diagnostics anyUnknownInErrorContext:off */ import type { NodeServices } from "@effect/platform-node/NodeServices"; import * as ConfigError from "effect/Config"; import * as Effect from "effect/Effect"; import * as Layer from "effect/Layer"; import { Scope } from "effect/Scope"; import type * as Stream from "effect/Stream"; import type { HttpClient } from "effect/unstable/http/HttpClient"; import type { HttpServerRequest } from "effect/unstable/http/HttpServerRequest"; import type { Dependencies } from "./Dependencies.ts"; import type { HttpEffect } from "./Http.ts"; import type { InputProps } from "./Input.ts"; import type { Named, Tag } from "./Named.ts"; import type { Provider, ProviderCollectionLike } from "./Provider.ts"; import { type ResourceLike } from "./Resource.ts"; import type { Rpc } from "./Rpc.ts"; import { RuntimeContext, type BaseRuntimeContext } from "./RuntimeContext.ts"; import type { Stack, StackServices } from "./Stack.ts"; import type { Stage } from "./Stage.ts"; export interface PlatformProps { /** * @internal type used to signal when this is an effect-native implementation * @default false */ isExternal?: boolean; } export type Main = void | { fetch?: HttpEffect | Effect.Effect, never, InitServices | PlatformServices>; }; export interface MainRpc { [key: string]: Effect.Effect | Stream.Stream | ((...args: any[]) => Effect.Effect | Stream.Stream); } export type MakeShape = [ Exclude ] extends [never] ? Exclude : Exclude & Exclude; export type PlatformServices = NodeServices | HttpClient | Provider | ProviderCollectionLike | Stack | StackServices | Stage; export interface Platform, Services, MainShape, RuntimeContext extends BaseRuntimeContext, BaseShape = {}> extends Effect.Effect { Type: Resource["Type"]; Provider: Provider; (): { (id: Id): Effect.Effect & Dependencies, never, Resource["Providers"]> & Named & { make(props: InputProps | Effect.Effect, ConfigError.ConfigError, PropsReq>, impl: Effect.Effect): Layer.Layer>; new (_: never): MakeShape & Named & Tag; of(shape: Shape & MainShape): MakeShape; }; }; (): { (id: Id, props: InputProps | Effect.Effect, ConfigError.ConfigError, PropsReq>, impl: Effect.Effect): Effect.Effect, never, Resource["Providers"] | Exclude | Exclude> & Named & { new (_: never): MakeShape & Named & Tag; }; (id: Id): Effect.Effect, never, Resource["Providers"]> & Named & { make(props: InputProps | Effect.Effect, ConfigError.ConfigError, PropsReq>, impl: Effect.Effect): Layer.Layer>; new (_: never): BaseShape & Named & Tag; }; }; (id: string, props: InputProps | Effect.Effect, never, PropsReq>): Effect.Effect>; (id: Id, props: InputProps | Effect.Effect, never, PropsReq>, impl: Effect.Effect): Effect.Effect & Named, never, Resource["Providers"] | PropsReq | Exclude> & Named; } export declare const Platform: ; exports?: string[] | Record; } | undefined>>(type: R["Type"], hooks: { createRuntimeContext: (id: string) => BaseRuntimeContext; /** * Legacy type names this platform's resource was previously registered * under (see `ResourceOptions.aliases`) — threaded to the underlying * `Resource` so state persisted under a pre-rename type keeps * resolving. */ aliases?: string[]; onCreate?: (resource: R, props: any) => Effect.Effect; /** * Transform the user-supplied props before the underlying resource is * declared. Runs in the resource-construction context (Stack, Namespace, * and providers are available), so the hook may compose REAL child * resources (the `StaticSite` pattern) and return derived props that * reference their Outputs. Implementations MUST be a no-op at runtime * (guard on `globalThis.__ALCHEMY_RUNTIME__`) — the hook is evaluated * wherever the props effect is, including inside deployed bundles. */ transformProps?: (id: string, props: any) => Effect.Effect; }, methods?: { [key: string]: any; }) => any; //# sourceMappingURL=Platform.d.ts.map