fabricatio_typst.models.generic

base classes for all research components.

Classes

WithRef

Class that provides a reference to another object.

Introspect

Class that provides a method to introspect the object.

Module Contents

class fabricatio_typst.models.generic.WithRef[T](/, **data: Any)

Bases: fabricatio_core.models.generic.Base, abc.ABC

Class that provides a reference to another object.

This class manages a reference to another object, allowing for easy access and updates.

property referenced: T

Get the referenced object.

Returns:

The referenced object.

Return type:

T

Raises:

ValueError – If the reference is not set.

update_ref[S: WithRef](reference: T) S
update_ref(reference: WithRef[T]) S
update_ref(reference: None = None) S

Update the reference of the object.

Parameters:

reference (Union[T, WithRef[T], None]) – The new reference to set.

Returns:

The current instance with the updated reference.

Return type:

S

class fabricatio_typst.models.generic.Introspect

Bases: abc.ABC

Class that provides a method to introspect the object.

This class includes a method to perform internal introspection of the object.

abstractmethod introspect() str

Internal introspection of the object.

Returns:

The internal introspection of the object.

Return type:

str