@@ -9,7 +9,7 @@ export interface Source {
99 location ?: string ;
1010}
1111
12- interface Cacheable {
12+ export interface Cacheable {
1313 cacheable ?< TPointer , TOptions > (
1414 fn : ( pointer : TPointer , options ?: TOptions ) => PromiseLike < Source | never > ,
1515 pointer : TPointer ,
@@ -60,25 +60,3 @@ export type UniversalLoader<TOptions extends SingleFileOptions = SingleFileOptio
6060 SchemaPointerSingle | DocumentPointerSingle ,
6161 TOptions
6262> ;
63-
64- export function makeCacheable < TPointer , TOptions extends Cacheable > (
65- fn : ( pointer : TPointer , options ?: TOptions ) => Promise < Source | never > ,
66- pointer : TPointer ,
67- options : TOptions
68- ) : Promise < Source | never > {
69- if ( options ?. cacheable ) {
70- return options . cacheable ( fn , pointer , options ) ;
71- }
72- return fn ( pointer , options ) ;
73- }
74-
75- export function makeCacheableSync < TPointer , TOptions extends Cacheable > (
76- fn : ( pointer : TPointer , options ?: TOptions ) => Source | never ,
77- pointer : TPointer ,
78- options : TOptions
79- ) : Source | never {
80- if ( options ?. cacheableSync ) {
81- return options . cacheableSync ( fn , pointer , options ) ;
82- }
83- return fn ( pointer , options ) ;
84- }
0 commit comments