\documentclass{report}
\usepackage{hyperref}
% WARNING: THIS SHOULD BE MODIFIED DEPENDING ON THE LETTER/A4 SIZE
\oddsidemargin 0cm
\evensidemargin 0cm
\marginparsep 0cm
\marginparwidth 0cm
\parindent 0cm
\setlength{\textwidth}{\paperwidth}
\addtolength{\textwidth}{-2in}


% Conditional define to determine if pdf output is used
\newif\ifpdf
\ifx\pdfoutput\undefined
\pdffalse
\else
\pdfoutput=1
\pdftrue
\fi

\ifpdf
  \usepackage[pdftex]{graphicx}
\else
  \usepackage[dvips]{graphicx}
\fi

% Write Document information for pdflatex/pdftex
\ifpdf
\pdfinfo{
 /Author     (Pasdoc)
 /Title      ()
}
\fi


% definitons for warning and note tag
\usepackage[most]{tcolorbox}
\newtcolorbox{tcbwarning}{
 breakable,
 enhanced jigsaw,
 top=0pt,
 bottom=0pt,
 titlerule=0pt,
 bottomtitle=0pt,
 rightrule=0pt,
 toprule=0pt,
 bottomrule=0pt,
 colback=white,
 arc=0pt,
 outer arc=0pt,
 title style={white},
 fonttitle=\color{black}\bfseries,
 left=8pt,
 colframe=red,
 title={Warning:},
}
\newtcolorbox{tcbnote}{
 breakable,
 enhanced jigsaw,
 top=0pt,
 bottom=0pt,
 titlerule=0pt,
 bottomtitle=0pt,
 rightrule=0pt,
 toprule=0pt,
 bottomrule=0pt,
 colback=white,
 arc=0pt,
 outer arc=0pt,
 title style={white},
 fonttitle=\color{black}\bfseries,
 left=8pt,
 colframe=yellow,
 title={Note:},
}

\begin{document}
\label{toc}\tableofcontents
\newpage
% special variable used for calculating some widths.
\newlength{\tmplength}
\chapter{Unit ok{\_}type{\_}helpers}
\label{ok_type_helpers}
\index{ok{\_}type{\_}helpers}
\section{Overview}
\begin{description}
\item[\texttt{\begin{ttfamily}TStringHelper\end{ttfamily} Record}]
\item[\texttt{\begin{ttfamily}TMyEnumHelper\end{ttfamily} Record}]You can extend enums too.
\end{description}
\section{Classes, Interfaces, Objects and Records}
\ifpdf
\subsection*{\large{\textbf{TMyEnumHelper Record helper for TMyEnum}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{TMyEnumHelper Record helper for TMyEnum}
\fi
\label{ok_type_helpers.TMyEnumHelper}
\index{TMyEnumHelper}
\subsubsection*{\large{\textbf{Description}}\normalsize\hspace{1ex}\hfill}
You can extend enums too. \href{https://docwiki.embarcadero.com/RADStudio/Sydney/en/Class_and_Record_Helpers_}{https://docwiki.embarcadero.com/RADStudio/Sydney/en/Class{\_}and{\_}Record{\_}Helpers{\_}}(Delphi) suggests you cannot, but \href{https://www.thoughtco.com/record-helpers-for-sets-1058204}{https://www.thoughtco.com/record-helpers-for-sets-1058204} and actual test with Delphi 12 shows you can:\subsubsection*{\large{\textbf{Methods}}\normalsize\hspace{1ex}\hfill}
\paragraph*{GetNext}\hspace*{\fill}

\label{ok_type_helpers.TMyEnumHelper-GetNext}
\index{GetNext}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\item[\textbf{Declaration}\hfill]
\ifpdf
\begin{flushleft}
\fi
\begin{ttfamily}
public function GetNext: TMyEnum;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\section{Types}
\ifpdf
\subsection*{\large{\textbf{TMyEnum}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{TMyEnum}
\fi
\label{ok_type_helpers-TMyEnum}
\index{TMyEnum}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\item[\textbf{Declaration}\hfill]
\ifpdf
\begin{flushleft}
\fi
\begin{ttfamily}
TMyEnum = (...);\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\par
\item[\textbf{Description}]
 \item[\textbf{Values}]
\begin{description}
\item[\texttt{one}] \label{ok_type_helpers-one}
\index{}
 
\item[\texttt{two}] \label{ok_type_helpers-two}
\index{}
 
\item[\texttt{three}] \label{ok_type_helpers-three}
\index{}
 
\end{description}


\end{list}
\end{document}
