core-api: use typescript workaround for using private constructor instead of a runtime one

This commit is contained in:
Patrik Oldsberg
2020-12-23 14:29:13 +01:00
parent 4b896485e4
commit 99205ec625
+1 -7
View File
@@ -44,13 +44,7 @@ export function createRouteRef<
return new AbsoluteRouteRef<Params>(config);
}
const create = Symbol('create-external-route-ref');
export class ExternalRouteRef {
static [create]() {
return new ExternalRouteRef();
}
private constructor() {}
toString() {
@@ -59,5 +53,5 @@ export class ExternalRouteRef {
}
export function createExternalRouteRef(): ExternalRouteRef {
return ExternalRouteRef[create]();
return new ((ExternalRouteRef as unknown) as { new (): ExternalRouteRef })();
}