extensions.js 796 B

123456789101112131415
  1. /*---------------------------------------------------------------------------------------------
  2. * Copyright (c) Microsoft Corporation. All rights reserved.
  3. * Licensed under the MIT License. See License.txt in the project root for license information.
  4. *--------------------------------------------------------------------------------------------*/
  5. import { SyncDescriptor } from './descriptors.js';
  6. const _registry = [];
  7. export function registerSingleton(id, ctorOrDescriptor, supportsDelayedInstantiation) {
  8. if (!(ctorOrDescriptor instanceof SyncDescriptor)) {
  9. ctorOrDescriptor = new SyncDescriptor(ctorOrDescriptor, [], supportsDelayedInstantiation);
  10. }
  11. _registry.push([id, ctorOrDescriptor]);
  12. }
  13. export function getSingletonServiceDescriptors() {
  14. return _registry;
  15. }