Creating new Areas and changing type and size of area

I want make such a script, that when I have my Blender window I can create in Python new Window in this place, and change type of this Area

And after it I want change proportions of this two areas.

I made some reaserch about this problem before I created this topic but without any good results.
The topic is quite poorly described on the internet. Maybe we could create an interesting thread about changing Areas in Blender 2.9x
Greets and Thanks for any help :slight_smile:

I can change an existing area to other type.

        for area in bpy.context.screen.areas:
            if area.type == 'TEXT_EDITOR':             
                area.ui_type = 'OUTLINER'

If i add this bpy.ops.screen.area_split(direction=‘HORIZONTAL’, factor=0.5) "split is making
not in the right area.
I wish the split was in an area type OUTLINER.
Greets for help :slight_smile: