import { Context, Effect } from 'effect';
declare const ResourceNotAvailable_base: new = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
readonly _tag: "ResourceNotAvailable";
} & Readonly;
/** Typed error raised when a command accesses a managed resource that is not currently acquired. */
export declare class ResourceNotAvailable extends ResourceNotAvailable_base<{
readonly resource: string;
}> {
}
declare const ManagedResourceTypeId: unique symbol;
type ManagedResourceTypeId = typeof ManagedResourceTypeId;
declare const ManagedResourceBrand: unique symbol;
/** Branded identity type for a managed resource, used in the Effect R channel. */
export interface ManagedResourceService {
readonly [ManagedResourceBrand]: Key;
}
/**
* A model-driven resource with acquire/release lifecycle. Access the resource
* value in commands via `.get`, which fails with `ResourceNotAvailable` when
* the resource is not currently active. The service identity appears in the
* Effect R channel, providing compile-time enforcement that the resource is
* registered.
*/
export interface ManagedResource {
readonly [ManagedResourceTypeId]: ManagedResourceTypeId;
readonly key: string;
readonly get: Effect.Effect;
/** @internal */
readonly _tag: Context.Service;
}
/** Creates a managed resource identity with a `.get` accessor for use in commands. */
export declare const tag: () => (key: Key) => ManagedResource>;
/** Type-level utility to extract the value type from a ManagedResource. */
export type Value = T extends ManagedResource ? V : never;
/** Type-level utility to extract the service identity type from a ManagedResource. */
export type ServiceOf = T extends ManagedResource ? S : never;
export {};
//# sourceMappingURL=index.d.ts.map