Type Alias SourceType

SourceType:
    | "vector"
    | "json"
    | "raster"
    | "raster-dem"
    | "grid"
    | "markers"
    | "overlay"

Check the source type of the layer. If "overlay" then an old engine was used