import { t as TypeParameters } from "./type-parameters-BzCDG9lT.mjs";
import { Children, Namekey, Refkey } from "@alloy-js/core";
import { CallSignatureProps, CommonDeclarationProps, TypeParameterDescriptor } from "@alloy-js/typescript";
//#region src/typescript/components/class-declaration.d.ts
/**
* Props for the ClassDeclaration component, which represents a TypeScript class declaration
*/
interface ClassDeclarationProps extends CommonDeclarationProps {
/**
* An indication of whether this class is abstract
*/
abstract?: boolean;
/**
* An optional class that this class extends. This will be rendered as an `extends` clause in the class declaration
*/
extends?: Children;
/**
* Optional interfaces that this class implements. This will be rendered as an `implements` clause in the class declaration
*/
implements?: Children[];
/**
* The generic type parameters of the class.
*/
typeParameters?: TypeParameterDescriptor[] | string[];
}
/**
* Create a TypeScript class declaration.
*
* @example
* ```tsx
* const myPetRefkey = refkey();
* const Animal = refkey();
* const staticMember = refkey();
* const instanceMember = refkey();
*
*
*
* "hello"
*
*
*
*
* this.name = name;
*
*
*
*
* new {Animal}();
*
*
* {staticMember}; // Animal.something
* // myPet.name
* {memberRefkey(myPetRefkey, instanceMember)}
* ```
*/
declare function ClassDeclaration(props: ClassDeclarationProps): Children;
declare namespace ClassDeclaration {
var TypeParameters: typeof TypeParameters;
}
/**
* Generates a TypeScript class member declaration for the given reflection class.
*/
interface ClassMemberProps {
name: string | Namekey;
refkey?: Refkey;
public?: boolean;
private?: boolean;
protected?: boolean;
jsPrivate?: boolean;
static?: boolean;
abstract?: boolean;
children?: Children;
doc?: Children;
nullish?: boolean;
override?: boolean;
}
/**
* Generates a TypeScript class member declaration for the given reflection class.
*
* @param props - The properties of the class member, including its name, visibility, and other modifiers.
* @returns A JSX element representing the class member declaration, which can be used within a ClassDeclaration component.
*/
declare function ClassMember(props: ClassMemberProps): Children;
/**
* Props for a class field, which is a specific type of class member that represents a property of the class.
*/
interface ClassFieldProps extends ClassMemberProps {
name: string;
type?: Children;
optional?: boolean;
children?: Children;
isPrivateMember?: boolean;
}
/**
* Generates a TypeScript class field declaration for the given reflection class.
*
* @param props - The properties of the class field, including its name, type, optionality, and other modifiers.
* @returns A JSX element representing the class field declaration, which can be used within a ClassDeclaration component.
*/
declare function ClassField(props: ClassFieldProps): Children;
/**
* Props for a class field, which is a specific type of class member that represents a property of the class.
*/
interface ClassPropertyProps extends ClassMemberProps {
name: string;
type?: Children;
children?: Children;
}
/**
* Generates a TypeScript class property setter declaration for the given reflection class.
*
* @param props - The properties of the class property, including its name, type, and other modifiers.
* @returns A JSX element representing the class property setter declaration, which can be used within a ClassDeclaration component.
*/
declare function ClassPropertySet(props: ClassPropertyProps): Children;
/**
* Generates a TypeScript class property getter declaration for the given reflection class.
*
* @param props - The properties of the class property, including its name, type, and other modifiers.
* @returns A JSX element representing the class property getter declaration, which can be used within a ClassDeclaration component.
*/
declare function ClassPropertyGet(props: ClassPropertyProps): Children;
/**
* Props for a class method, which is a specific type of class member that represents a function defined within the class.
*/
interface ClassMethodProps extends ClassMemberProps, CallSignatureProps {
async?: boolean;
children?: Children;
}
/**
* Generates a TypeScript class method declaration for the given reflection class.
*
* @param props - The properties of the class method, including its name, visibility, and other modifiers.
* @returns A JSX element representing the class method declaration, which can be used within a ClassDeclaration component.
*/
declare function ClassMethod(props: ClassMethodProps): Children;
//#endregion
export { ClassMember as a, ClassMethodProps as c, ClassPropertySet as d, ClassFieldProps as i, ClassPropertyGet as l, ClassDeclarationProps as n, ClassMemberProps as o, ClassField as r, ClassMethod as s, ClassDeclaration as t, ClassPropertyProps as u };
//# sourceMappingURL=class-declaration-CL5quGqz.d.mts.map