From f0f7aab46fa08d0ad35bc1208701fc7741a546b0 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Wed, 21 Aug 2019 14:54:44 -0700 Subject: [PATCH] [angular-ui-bootstrap] Export module name (#37813) * [angular-ui-bootstrap] Make compatible with npm - starting with 1.0.0 it exports the module name * Add test that type is possible to reference --- types/angular-ui-bootstrap/index.d.ts | 29 +++---------------- .../test/angular-ui-bootstrap-module-tests.ts | 8 +++++ .../{ => test}/angular-ui-bootstrap-tests.ts | 0 types/angular-ui-bootstrap/tsconfig.json | 6 ++-- 4 files changed, 16 insertions(+), 27 deletions(-) create mode 100644 types/angular-ui-bootstrap/test/angular-ui-bootstrap-module-tests.ts rename types/angular-ui-bootstrap/{ => test}/angular-ui-bootstrap-tests.ts (100%) diff --git a/types/angular-ui-bootstrap/index.d.ts b/types/angular-ui-bootstrap/index.d.ts index db08aae252..6932a0bc8d 100644 --- a/types/angular-ui-bootstrap/index.d.ts +++ b/types/angular-ui-bootstrap/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for Angular UI Bootstrap 0.13.3 +// Type definitions for Angular UI Bootstrap 1.0.0 // Project: https://github.com/angular-ui/bootstrap // Definitions by: Brian Surowiec , // Ryan Southgate // Alfie Johnson +// Igor Oleinikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -10,30 +11,8 @@ import * as angular from 'angular'; -export type IAccordionConfig = angular.ui.bootstrap.IAccordionConfig; -export type IButtonConfig = angular.ui.bootstrap.IButtonConfig; -export type IDatepickerConfig = angular.ui.bootstrap.IDatepickerConfig; -export type IDatepickerPopupConfig = angular.ui.bootstrap.IDatepickerPopupConfig; -export type IDropdownConfig = angular.ui.bootstrap.IDropdownConfig; -export type IModalProvider = angular.ui.bootstrap.IModalProvider; -export type IModalService = angular.ui.bootstrap.IModalService; -export type IModalServiceInstance = angular.ui.bootstrap.IModalServiceInstance; -export type IModalInstanceService = angular.ui.bootstrap.IModalInstanceService; -export type IModalScope = angular.ui.bootstrap.IModalScope; -export type IModalSettings = angular.ui.bootstrap.IModalSettings; -export type IModalStackService = angular.ui.bootstrap.IModalStackService; -export type IModalStackedMapKeyValuePair = angular.ui.bootstrap.IModalStackedMapKeyValuePair; -export type IPaginationConfig = angular.ui.bootstrap.IPaginationConfig; -export type IPagerConfig = angular.ui.bootstrap.IPagerConfig; -export type IPositionCoordinates = angular.ui.bootstrap.IPositionCoordinates; -export type IPositionService = angular.ui.bootstrap.IPositionService; -export type IProgressConfig = angular.ui.bootstrap.IProgressConfig; -export type IRatingConfig = angular.ui.bootstrap.IRatingConfig; -export type ITimepickerConfig = angular.ui.bootstrap.ITimepickerConfig; -export type ITooltipOptions = angular.ui.bootstrap.ITooltipOptions; -export type ITooltipProvider = angular.ui.bootstrap.ITooltipProvider; -export type ITransitionService = angular.ui.bootstrap.ITransitionService; -export type ITransitionServiceOptions = angular.ui.bootstrap.ITransitionServiceOptions; +declare const moduleName: 'ui.bootstrap'; +export = moduleName; declare module 'angular' { export namespace ui.bootstrap { diff --git a/types/angular-ui-bootstrap/test/angular-ui-bootstrap-module-tests.ts b/types/angular-ui-bootstrap/test/angular-ui-bootstrap-module-tests.ts new file mode 100644 index 0000000000..7c9a646784 --- /dev/null +++ b/types/angular-ui-bootstrap/test/angular-ui-bootstrap-module-tests.ts @@ -0,0 +1,8 @@ +import angular from 'angular'; +import uiBootstrap from 'angular-ui-bootstrap'; + +angular.module('app', [uiBootstrap]); + +// type defined in the angular namespace +declare const $uibModal: angular.ui.bootstrap.IModalService; +$uibModal.open({ templateUrl: 'template.hmtl' }); diff --git a/types/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts b/types/angular-ui-bootstrap/test/angular-ui-bootstrap-tests.ts similarity index 100% rename from types/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts rename to types/angular-ui-bootstrap/test/angular-ui-bootstrap-tests.ts diff --git a/types/angular-ui-bootstrap/tsconfig.json b/types/angular-ui-bootstrap/tsconfig.json index 62765ca465..74c14d92fe 100644 --- a/types/angular-ui-bootstrap/tsconfig.json +++ b/types/angular-ui-bootstrap/tsconfig.json @@ -15,10 +15,12 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "allowSyntheticDefaultImports": true }, "files": [ "index.d.ts", - "angular-ui-bootstrap-tests.ts" + "test/angular-ui-bootstrap-tests.ts", + "test/angular-ui-bootstrap-module-tests.ts" ] } \ No newline at end of file