/**
 * 单例
 * @returns Instance
 */
export function Singleton<T>() {
    class Single {
        protected constructor() { }
        private static _instance: Single = null;

        public static get Instance(): T {
            if (Single._instance == null) {
                Single._instance = new this();
            }
            return Single._instance as T;
        }
    }
    return Single;
}