Add the declarations for #14304 and #16664.
CC: @roed314 @jpflori @saraedum
Component: interfaces
Author: Julian Rueth, David Roe, Jean-Pierre Flori, Jeroen Demeyer
Branch: 6cc4151
Reviewer: Jean-Pierre Flori
Issue created by migration from https://trac.sagemath.org/ticket/19646