This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function make_wrapper<T extends { [k: string]: any }>(root: T) { | |
type VHWithoutLastElement<T extends [...args: any]> = T extends [...args: infer P, last: any] ? P : never; | |
type VHLastElement<T extends [...args: any]> = T extends [...args: any, last: infer LastType] ? LastType : never; | |
type VHCallbackExtractValue<T extends any> = T extends ((err: any, value: infer ValueType) => void) ? (ValueType extends unknown ? void : ValueType) : never; | |
type VHPromisifier<T extends (...args: any) => any> = T extends (...args: infer P) => any ? ((...args: VHWithoutLastElement<P>) => Promise<VHCallbackExtractValue<VHLastElement<P>>>) : never; | |
return <fn_t extends keyof T>(fn: fn_t): VHPromisifier<T[fn_t]> => { | |
return promisify(root[fn]).bind(root); | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* tslint:disable */ | |
export function NoObserver<T>(target: T): T { | |
if (target === null || typeof target === 'undefined') { | |
return target; | |
} | |
(target as any)._isVue = true; | |
return target; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Module, VuexModule, Mutation, Action } from 'vuex-module-decorators' | |
type ModulePreserveState = Module | |
export { Module, ModulePreserveState, VuexModule, Mutation, Action } |