Add support for re-exporting modules

Use `export * from "somewhere.slint"` to avoid having to repeat all the
types of an existing module in order to re-export all of the types.
This commit is contained in:
Simon Hausmann 2022-12-01 17:55:13 +01:00 committed by Simon Hausmann
parent 6c01ad858c
commit 03fe599890
10 changed files with 247 additions and 122 deletions

View file

@ -0,0 +1,12 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
export * from "../../typeloader/incpath/local_helper_type.slint";
// ^error{re-export 'SomeRect' is already exported in this file}
export * from "../../typeloader/incpath/dependency_from_incpath.slint";
export * from "../../typeloader/incpath/dependency_from_incpath.slint";
// ^error{re-export 'AnotherType' is already exported in this file}
export SomeRect := Rectangle {}

View file

@ -10,7 +10,7 @@ import { NotExported } from "../../typeloader/incpath/local_helper_type.slint";
import { Nothing } from "";
// ^error{Unexpected empty import url}
import "invalid_export.slint";
import "../../typeloader/incpath/local_helper_type.slint";
// ^error{Import names are missing. Please specify which types you would like to import}
import "myimage.png";