import { type Children } from "@alloy-js/core";
import type { ParameterDescriptor } from "../parameter-descriptor.js";
export interface TryStatementProps {
children: Children;
}
/**
* A try statement.
*
* @example
* ```tsx
*
* // risky operation
*
*
* console.error(error);
*
* ```
* renders to
* ```ts
* try {
* // risky operation
* } catch (error) {
* console.error(error);
* }
* ```
*/
export declare function TryStatement(props: TryStatementProps): Children;
export interface CatchClauseProps {
parameter?: ParameterDescriptor | string;
children: Children;
}
/**
* A catch clause of a try statement.
*
* @example
* ```tsx
*
* console.error(error);
*
* ```
* renders to
* ```ts
* catch (error: unknown) {
* console.error(error);
* }
* ```
*
* @remarks
* The parameter can be omitted for a catch-all clause, or provided as a string
* or {@link ParameterDescriptor}. When using a descriptor, a refkey can be provided
* to reference the parameter within the catch block. Note that TypeScript only allows
* `any` or `unknown` as catch parameter types.
*/
export declare function CatchClause(props: CatchClauseProps): Children;
export interface FinallyClauseProps {
children: Children;
}
/**
* A finally clause of a try statement.
*
* @example
* ```tsx
*
* // risky operation
*
*
* // cleanup
*
* ```
* renders to
* ```ts
* try {
* // risky operation
* } finally {
* // cleanup
* }
* ```
*/
export declare function FinallyClause(props: FinallyClauseProps): Children;
//# sourceMappingURL=TryStatement.d.ts.map