declare module 'airwire' { export interface AirwireException { message: string, exception: string, file: string, line: number, trace: Array<{ class: string, file: string, function: string, line: number, type: string, }>, } export interface AirwirePromise extends Promise { then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: AirwireException) => TResult2 | PromiseLike) | undefined | null): AirwirePromise; catch(onrejected?: ((reason: AirwireException) => TResult | PromiseLike) | undefined | null): AirwirePromise; } export type NonFunctionPropertyNames = { [K in keyof T]: T[K] extends Function ? never : K }[keyof T]; export type NonFunctionProperties = Pick>; export type FunctionProperties = Omit>; export type StringKeys = Pick>; export type WiredMethods = StringKeys>>>; export type WiredProperties = StringKeys>>>; export type Magic = T & { [key: string]: any }; export type ComponentResponse = { data: WiredProperties; metadata: { calls?: { [key in keyof WiredMethods]: any; }; exceptions?: { [key in keyof WiredMethods]: AirwireException; }; errors?: { [key in keyof WiredProperties]: string[]; }; readonly: Array>; [key: string]: any; } } type Watchers = { responses: Array<(response: ComponentResponse) => void>, errors: Array<(error: AirwireException) => void>, }; export type TypeNames = keyof TypeMap export type TypeName = T extends TypeNames ? TypeMap[T] : never }