1
- import { StyleManager , TemplateManager } from '@garfish/loader' ;
1
+ import type { TemplateManager } from '@garfish/loader' ;
2
2
import {
3
3
Text ,
4
4
Node ,
@@ -89,7 +89,9 @@ export class App {
89
89
public customLoader ?: CustomerLoader ;
90
90
public childGarfishConfig : interfaces . ChildGarfishConfig = { } ;
91
91
public asyncProviderTimeout : number ;
92
- private asyncProvider ?: interfaces . Provider | ( ( ...args : any [ ] ) => interfaces . Provider ) ;
92
+ private asyncProvider ?:
93
+ | interfaces . Provider
94
+ | ( ( ...args : any [ ] ) => interfaces . Provider ) ;
93
95
private resolveAsyncProvider : ( ) => void | undefined ;
94
96
// private
95
97
private active = false ;
@@ -215,7 +217,9 @@ export class App {
215
217
216
218
if ( asyncProviderTimeout ) {
217
219
// just inject 'registerProvider' function for async provider registration
218
- customExports . registerProvider = ( provider : typeof this . asyncProvider ) => {
220
+ customExports . registerProvider = (
221
+ provider : typeof this . asyncProvider ,
222
+ ) => {
219
223
this . asyncProvider = provider ;
220
224
// resolve it immediately
221
225
this . resolveAsyncProvider ?.( ) ;
@@ -224,7 +228,7 @@ export class App {
224
228
}
225
229
226
230
awaitAsyncProviderRegistration ( ) {
227
- return new Promise < typeof this . asyncProvider > ( resolve => {
231
+ return new Promise < typeof this . asyncProvider > ( ( resolve ) => {
228
232
if ( this . asyncProvider ) {
229
233
resolve ( this . asyncProvider ) ;
230
234
return ;
@@ -697,7 +701,10 @@ export class App {
697
701
style : ( node ) => {
698
702
const text = node . children [ 0 ] as Text ;
699
703
if ( text ) {
700
- const styleManager = new StyleManager ( text . content , baseUrl ) ;
704
+ const styleManager = new this . context . loader . StyleManager (
705
+ text . content ,
706
+ baseUrl ,
707
+ ) ;
701
708
styleManager . setScope ( {
702
709
appName : this . name ,
703
710
rootElId : this . appContainer . id ,
0 commit comments