File tree 3 files changed +380
-61
lines changed
3 files changed +380
-61
lines changed Original file line number Diff line number Diff line change @@ -357,8 +357,24 @@ export function loaderFor(cardOrField: CardDef | FieldDef) {
357
357
return loader ;
358
358
}
359
359
360
- export async function apiFor ( cardOrField : CardDef | FieldDef ) {
361
- let loader = loaderFor ( cardOrField ) ;
360
+ export async function apiFor (
361
+ cardOrFieldType : typeof CardDef | typeof FieldDef | typeof BaseDef ,
362
+ ) : Promise < typeof CardAPI > ;
363
+ export async function apiFor (
364
+ cardOrField : CardDef | FieldDef | BaseDef ,
365
+ ) : Promise < typeof CardAPI > ;
366
+ export async function apiFor (
367
+ cardOrFieldOrClass :
368
+ | CardDef
369
+ | FieldDef
370
+ | BaseDef
371
+ | typeof CardDef
372
+ | typeof FieldDef
373
+ | typeof BaseDef ,
374
+ ) {
375
+ let loader =
376
+ Loader . getLoaderFor ( cardOrFieldOrClass ) ??
377
+ loaderFor ( cardOrFieldOrClass as CardDef | FieldDef | BaseDef ) ;
362
378
let api = await loader . import < typeof CardAPI > (
363
379
'https://cardstack.com/base/card-api' ,
364
380
) ;
You can’t perform that action at this time.
0 commit comments