UNPKG

servido

Version:

Versatile services for React ⚗️

18 lines (17 loc) 1.04 kB
import { Class } from "./service-types"; /** Determines whether a value is a service class. It can literally be any value, including a function (which would be interpreted as a class * in production builds, since they can be constructed like new function() without ES6 features). The `Service` class has the `serviceClassProperty` * defined, which this function uses to determine if the `obj` is an extension of `Service`. */ export declare function isServiceClass<T, A extends any[]>(obj: any): obj is Class<T, A>; /** Used in `isServiceClass`, and is intended to be set to a truthy value in the `Service` constructor. */ export declare const serviceClassProperty = "__service__"; export declare function isPromise(v: any): v is Promise<any>; export declare function resolveModuleThunk<T>(moduleThunk: ModuleThunk<T>): T; export declare type ModuleThunk<T> = T | DefaultModule<T> | SingleExportModule<T>; interface SingleExportModule<T> { [key: string]: T; } interface DefaultModule<T> { default: T; } export {};