@angular-wave/angular.ts 0.7.7 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/animations/raf-scheduler.d.ts +2 -2
- package/@types/animations/shared.d.ts +0 -1
- package/@types/core/compile/attributes.d.ts +3 -3
- package/@types/core/compile/compile.d.ts +1 -1
- package/@types/core/di/injector.d.ts +0 -1
- package/@types/core/di/internal-injector.d.ts +1 -0
- package/@types/core/di/ng-module.d.ts +5 -0
- package/@types/core/filter/filter.d.ts +11 -13
- package/@types/core/parse/parse.d.ts +6 -7
- package/@types/core/sanitize/sanitize-uri.d.ts +3 -6
- package/@types/core/scope/scope.d.ts +1 -1
- package/@types/directive/attrs/attrs.d.ts +7 -1
- package/@types/directive/bind/bind.d.ts +2 -1
- package/@types/directive/events/events.d.ts +9 -3
- package/@types/directive/http/http.d.ts +6 -2
- package/@types/directive/include/include.d.ts +2 -2
- package/@types/directive/input/input.d.ts +2 -12
- package/@types/directive/messages/messages.d.ts +9 -48
- package/@types/directive/model/model.d.ts +3 -3
- package/@types/directive/options/options.d.ts +13 -20
- package/@types/directive/switch/switch.d.ts +1 -0
- package/@types/directive/transclude/transclude.d.ts +10 -6
- package/@types/index.d.ts +1 -1
- package/@types/interface.d.ts +56 -18
- package/@types/{public.d.ts → ng.d.ts} +2 -2
- package/@types/router/directives/view-directive.d.ts +2 -19
- package/@types/router/{common → glob}/glob.d.ts +5 -1
- package/@types/router/globals.d.ts +2 -3
- package/@types/router/path/path-utils.d.ts +8 -11
- package/@types/router/state/interface.d.ts +1 -1
- package/@types/router/state/state-object.d.ts +1 -1
- package/@types/router/state/state-registry.d.ts +1 -2
- package/@types/router/state/state-service.d.ts +8 -7
- package/@types/router/state-filters.d.ts +24 -2
- package/@types/router/transition/transition.d.ts +12 -15
- package/@types/router/url/url-matcher.d.ts +3 -3
- package/@types/router/url/url-rule.d.ts +1 -0
- package/@types/router/url/url-rules.d.ts +26 -6
- package/@types/router/url/url-service.d.ts +30 -42
- package/@types/services/anchor-scroll.d.ts +1 -1
- package/@types/{core → services/exception}/exception-handler.d.ts +4 -4
- package/@types/{core/error-handler.d.ts → services/exception/interface.d.ts} +1 -1
- package/@types/services/http/http.d.ts +48 -3
- package/@types/services/http/interface.d.ts +2 -2
- package/@types/services/http-backend/http-backend.d.ts +49 -44
- package/@types/services/location/interface.d.ts +63 -0
- package/@types/services/location/location.d.ts +330 -0
- package/@types/{core → services}/sce/sce.d.ts +1 -1
- package/@types/services/template-cache/interface.d.ts +8 -2
- package/@types/services/template-cache/template-cache.d.ts +1 -1
- package/@types/services/template-request.d.ts +1 -1
- package/@types/shared/cache.d.ts +0 -2
- package/@types/shared/common.d.ts +0 -2
- package/@types/shared/dom.d.ts +6 -0
- package/@types/shared/interface.d.ts +0 -4
- package/@types/{router/common → shared}/queue.d.ts +2 -2
- package/@types/shared/test-utils.d.ts +1 -0
- package/@types/shared/url-utils/interface.d.ts +46 -0
- package/@types/shared/url-utils/url-utils.d.ts +64 -0
- package/@types/shared/utils.d.ts +44 -6
- package/Makefile +8 -4
- package/dist/angular-ts.esm.js +1889 -2199
- package/dist/angular-ts.umd.js +1889 -2199
- package/dist/angular-ts.umd.min.js +1 -1
- package/docs/assets/scss/index.scss +23 -0
- package/docs/content/_index.md +9 -8
- package/docs/content/docs/_index.md +1 -1
- package/docs/content/docs/directive/app.md +1 -1
- package/docs/content/docs/directive/bind.md +10 -8
- package/docs/content/docs/directive/blur.md +1 -1
- package/docs/content/docs/directive/channel.md +2 -2
- package/docs/content/docs/directive/class-even.md +1 -1
- package/docs/content/docs/directive/class-odd.md +1 -1
- package/docs/content/docs/directive/class.md +1 -1
- package/docs/content/docs/directive/click.md +1 -1
- package/docs/content/docs/directive/copy.md +1 -1
- package/docs/content/docs/directive/cut.md +1 -1
- package/docs/content/docs/directive/dblclick.md +1 -1
- package/docs/content/docs/directive/focus.md +1 -1
- package/docs/content/docs/directive/get.md +203 -0
- package/docs/content/docs/directive/keydown.md +1 -1
- package/docs/content/docs/directive/keyup.md +1 -1
- package/docs/content/docs/directive/load.md +1 -1
- package/docs/content/docs/directive/mousedown.md +1 -1
- package/docs/content/docs/directive/mouseenter.md +1 -1
- package/docs/content/docs/directive/mouseleave.md +1 -1
- package/docs/content/docs/directive/mousemove.md +1 -1
- package/docs/content/docs/directive/mouseout.md +1 -1
- package/docs/content/docs/directive/mouseover.md +1 -1
- package/docs/content/docs/directive/mouseup.md +1 -1
- package/docs/content/docs/directive/non-bindable.md +28 -0
- package/docs/content/docs/provider/locationProvider.md +26 -0
- package/docs/content/docs/provider/templateCacheProvider.md +66 -1
- package/docs/content/docs/service/location.md +57 -0
- package/docs/content/docs/service/templateCache.md +2 -2
- package/docs/content/docs/service/url.md +5 -0
- package/docs/layouts/partials/hooks/head-end.html +1 -1
- package/docs/layouts/shortcodes/showcss.html +2 -0
- package/docs/layouts/shortcodes/version.html +1 -0
- package/docs/static/examples/counter/counter-test.html +0 -4
- package/docs/static/examples/eventbus/eventbus-test.html +0 -4
- package/docs/static/examples/ng-bind/ng-bind.html +2 -2
- package/docs/static/examples/ng-non-bindable/ng-non-bindable-test.html +13 -0
- package/docs/static/examples/ng-non-bindable/ng-non-bindable.html +3 -0
- package/docs/static/examples/ng-non-bindable/ng-non-bindable.test.js +11 -0
- package/docs/static/typedoc/assets/hierarchy.js +1 -1
- package/docs/static/typedoc/assets/highlight.css +6 -6
- package/docs/static/typedoc/assets/navigation.js +1 -1
- package/docs/static/typedoc/assets/search.js +1 -1
- package/docs/static/typedoc/classes/Location.html +55 -0
- package/docs/static/typedoc/classes/LocationProvider.html +20 -0
- package/docs/static/typedoc/classes/NgModule.html +32 -0
- package/docs/static/typedoc/classes/TemplateCacheProvider.html +1 -1
- package/docs/static/typedoc/hierarchy.html +1 -1
- package/docs/static/typedoc/index.html +1 -1
- package/docs/static/typedoc/interfaces/DefaultPorts.html +5 -0
- package/docs/static/typedoc/interfaces/Directive.html +5 -4
- package/docs/static/typedoc/interfaces/Html5Mode.html +23 -0
- package/docs/static/typedoc/interfaces/HttpProviderDefaults.html +1 -1
- package/docs/static/typedoc/interfaces/HttpResponse.html +2 -3
- package/docs/static/typedoc/interfaces/Provider.html +16 -10
- package/docs/static/typedoc/interfaces/RequestConfig.html +1 -1
- package/docs/static/typedoc/interfaces/RequestShortcutConfig.html +1 -1
- package/docs/static/typedoc/interfaces/TemplateCache.html +7 -0
- package/docs/static/typedoc/interfaces/UrlParts.html +9 -0
- package/docs/static/typedoc/types/AnnotatedDirectiveFactory.html +1 -0
- package/docs/static/typedoc/types/AnnotatedFactory.html +1 -1
- package/docs/static/typedoc/types/DirectiveFactory.html +1 -2
- package/docs/static/typedoc/types/DirectiveFactoryFn.html +1 -0
- package/docs/static/typedoc/types/Expression.html +1 -1
- package/docs/static/typedoc/types/HttpResponseStatus.html +1 -0
- package/docs/static/typedoc/types/{TemplateCache.html → SwapModeType.html} +1 -1
- package/docs/static/typedoc/types/UrlChangeListener.html +5 -0
- package/docs/static/typedoc/variables/SwapMode.html +11 -0
- package/docs/static/version.js +13 -0
- package/docs/test-results/.last-run.json +4 -0
- package/docs/test-results/static-examples-counter-counter-counter-example/error-context.md +50 -0
- package/legacy.d.ts +0 -10
- package/package.json +1 -3
- package/src/{loader.js → angular.js} +5 -10
- package/src/angular.spec.js +189 -21
- package/src/animations/animate-children-directive.js +2 -2
- package/src/animations/animate-css.js +17 -18
- package/src/animations/animate.spec.js +1 -1
- package/src/animations/raf-scheduler.js +1 -1
- package/src/animations/shared.js +2 -12
- package/src/binding.spec.js +1 -1
- package/src/core/compile/attributes.js +1 -1
- package/src/core/compile/compile.js +7 -10
- package/src/core/compile/compile.spec.js +1 -1
- package/src/core/controller/controller.spec.js +1 -1
- package/src/core/controller/controller.test.js +1 -0
- package/src/core/di/injector.js +11 -25
- package/src/core/di/injector.spec.js +2 -2
- package/src/core/di/injector.test.js +2 -2
- package/src/core/di/internal-injector.js +7 -7
- package/src/core/di/ng-module.js +12 -27
- package/src/core/filter/filter.js +28 -28
- package/src/core/filter/filter.spec.js +1 -1
- package/src/core/filter/filter.test.js +1 -0
- package/src/core/interpolate/interpolate.js +4 -6
- package/src/core/interpolate/interpolate.spec.js +1 -1
- package/src/core/interpolate/interpolate.test.js +1 -0
- package/src/core/parse/ast/ast.spec.js +1 -1
- package/src/core/parse/ast/ast.test.js +1 -1
- package/src/core/parse/interpreter.js +32 -38
- package/src/core/parse/lexer/lexer.spec.js +1 -1
- package/src/core/parse/parse.js +150 -146
- package/src/core/parse/parse.spec.js +17 -16
- package/src/core/prop.spec.js +1 -1
- package/src/core/root-element.spec.js +1 -1
- package/src/core/sanitize/sanitize-uri.js +3 -3
- package/src/core/scope/scope.js +12 -13
- package/src/core/scope/scope.spec.js +3 -4
- package/src/directive/aria/aria.spec.js +1 -1
- package/src/directive/aria/aria.test.js +1 -0
- package/src/directive/attrs/attrs.js +7 -4
- package/src/directive/attrs/attrs.spec.js +1 -1
- package/src/directive/attrs/attrs.test.js +1 -0
- package/src/directive/attrs/boolean.spec.js +1 -1
- package/src/directive/attrs/boolean.test.js +1 -0
- package/src/directive/attrs/element-style.spec.js +1 -1
- package/src/directive/attrs/element-style.test.js +1 -0
- package/src/directive/attrs/src.spec.js +1 -1
- package/src/directive/attrs/src.test.js +1 -0
- package/src/directive/bind/bind-html.spec.js +1 -1
- package/src/directive/bind/bind.js +1 -0
- package/src/directive/bind/bind.spec.js +1 -1
- package/src/directive/bind/bind.test.js +1 -0
- package/src/directive/channel/channel.spec.js +1 -1
- package/src/directive/channel/channel.test.js +1 -0
- package/src/directive/class/class.spec.js +1 -1
- package/src/directive/class/class.test.js +1 -0
- package/src/directive/cloak/cloak.spec.js +1 -1
- package/src/directive/cloak/cloak.test.js +1 -0
- package/src/directive/controller/controller.spec.js +1 -1
- package/src/directive/controller/controller.test.js +1 -0
- package/src/directive/events/click.spec.js +1 -1
- package/src/directive/events/event.spec.js +1 -1
- package/src/directive/events/events.js +6 -2
- package/src/directive/events/events.test.js +1 -0
- package/src/directive/form/form.js +8 -5
- package/src/directive/form/form.spec.js +1 -1
- package/src/directive/form/form.test.js +1 -0
- package/src/directive/http/delete.spec.js +3 -1
- package/src/directive/http/form-test.html +18 -0
- package/src/directive/http/get.spec.js +281 -4
- package/src/directive/http/http.js +112 -15
- package/src/directive/http/http.test.js +2 -2
- package/src/directive/http/post.spec.js +506 -9
- package/src/directive/http/put.spec.js +3 -1
- package/src/directive/if/if.spec.js +1 -1
- package/src/directive/include/include.js +7 -7
- package/src/directive/include/include.spec.js +1 -1
- package/src/directive/init/init.spec.js +1 -1
- package/src/directive/init/init.test.js +1 -0
- package/src/directive/input/input.js +19 -43
- package/src/directive/input/input.spec.js +1 -2
- package/src/directive/input/input.test.js +1 -0
- package/src/directive/messages/messages.js +4 -0
- package/src/directive/messages/messages.spec.js +1 -1
- package/src/directive/messages/messages.test.js +1 -0
- package/src/directive/model/model.js +14 -14
- package/src/directive/model/model.spec.js +1 -1
- package/src/directive/model/model.test.js +1 -0
- package/src/directive/model-options/model-option.test.js +1 -0
- package/src/directive/model-options/model-options.js +1 -1
- package/src/directive/model-options/model-options.spec.js +1 -1
- package/src/directive/non-bindable/non-bindable.spec.js +1 -1
- package/src/directive/non-bindable/non-bindable.test.js +1 -0
- package/src/directive/observe/observe.spec.js +1 -1
- package/src/directive/observe/observe.test.js +1 -0
- package/src/directive/on/on.spec.js +1 -1
- package/src/directive/on/on.test.js +1 -0
- package/src/directive/options/options.js +454 -464
- package/src/directive/options/options.spec.js +1 -1
- package/src/directive/options/options.test.js +1 -0
- package/src/directive/ref/href.spec.js +1 -1
- package/src/directive/ref/href.test.js +2 -0
- package/src/directive/ref/ref.spec.js +1 -1
- package/src/directive/repeat/repeat.spec.js +2 -3
- package/src/directive/repeat/repeat.test.js +1 -0
- package/src/directive/script/script.spec.js +1 -1
- package/src/directive/script/script.test.js +1 -0
- package/src/directive/select/select.js +1 -1
- package/src/directive/select/select.spec.js +1 -1
- package/src/directive/select/select.test.js +1 -0
- package/src/directive/setter/setter.js +12 -14
- package/src/directive/setter/setter.spec.js +40 -17
- package/src/directive/setter/setter.test.js +1 -0
- package/src/directive/show-hide/show-hide.spec.js +1 -1
- package/src/directive/show-hide/show-hide.test.js +1 -0
- package/src/directive/style/style.spec.js +1 -1
- package/src/directive/style/style.test.js +1 -0
- package/src/directive/switch/switch.js +1 -0
- package/src/directive/switch/switch.spec.js +1 -1
- package/src/directive/switch/switch.test.js +1 -0
- package/src/directive/transclude/transclude.js +87 -89
- package/src/directive/validators/validators.js +82 -84
- package/src/directive/validators/validators.spec.js +5 -4
- package/src/directive/validators/validators.test.js +1 -0
- package/src/filters/filter.spec.js +1 -1
- package/src/filters/filters.spec.js +1 -1
- package/src/filters/limit-to.js +2 -3
- package/src/filters/limit-to.spec.js +1 -1
- package/src/filters/order-by.spec.js +1 -1
- package/src/index.js +1 -1
- package/src/injection-tokens.js +6 -2
- package/src/interface.ts +70 -19
- package/src/loader.md +0 -155
- package/src/{public.js → ng.js} +16 -23
- package/src/{public.spec.js → ng.spec.js} +1 -1
- package/src/router/directives/state-directives.spec.js +9 -8
- package/src/router/directives/view-directive.js +11 -9
- package/src/router/directives/view-directive.spec.js +8 -9
- package/src/router/{common/common.html → glob/glob.html} +2 -3
- package/src/router/{common → glob}/glob.js +5 -0
- package/src/router/{common/common.test.js → glob/glob.test.js} +2 -1
- package/src/router/globals.js +1 -2
- package/src/router/path/path-utils.js +5 -0
- package/src/router/router-test-hashbang.html +45 -0
- package/src/router/services.spec.js +5 -6
- package/src/router/state/interface.ts +1 -1
- package/src/router/state/state-builder.js +3 -3
- package/src/router/state/state-builder.spec.js +1 -1
- package/src/router/state/state-object.js +1 -1
- package/src/router/state/state-registry.js +2 -3
- package/src/router/state/state-service.js +13 -10
- package/src/router/state/state.spec.js +23 -22
- package/src/router/state/state.test.js +1 -0
- package/src/router/state/views.js +1 -1
- package/src/router/state-filter.spec.js +1 -1
- package/src/router/state-filters.js +15 -11
- package/src/router/template-factory.js +5 -4
- package/src/router/template-factory.spec.js +1 -1
- package/src/router/transition/hook-registry.js +1 -1
- package/src/router/transition/transition-service.js +6 -5
- package/src/router/transition/transition.js +4 -4
- package/src/router/url/url-matcher.js +3 -3
- package/src/router/url/url-rule.js +1 -0
- package/src/router/url/url-rules.js +8 -5
- package/src/router/url/url-service.js +82 -85
- package/src/router/url/url-service.spec.js +55 -39
- package/src/router/url/url.test.js +1 -0
- package/src/router/view/view.js +4 -5
- package/src/router/view/view.spec.js +10 -12
- package/src/router/view/view.test.js +1 -0
- package/src/router/view-hook.spec.js +1 -1
- package/src/router/view-scroll.spec.js +1 -1
- package/src/services/anchor-scroll.html +2 -9
- package/src/services/anchor-scroll.js +6 -5
- package/src/{core → services/exception}/exception-handler.js +2 -2
- package/src/{core/error-handler.ts → services/exception/interface.ts} +1 -1
- package/src/services/http/http.js +11 -17
- package/src/services/http/http.spec.js +2 -7
- package/src/services/http/interface.ts +2 -2
- package/src/services/http/template-request.spec.js +1 -1
- package/src/services/http-backend/http-backend.js +53 -89
- package/src/services/http-backend/http-backend.spec.js +2 -6
- package/src/services/http-backend/http-backend.test.js +1 -0
- package/src/services/location/interface.ts +70 -0
- package/src/{core → services}/location/location.html +4 -1
- package/src/services/location/location.js +999 -0
- package/src/{core → services}/location/location.spec.js +911 -532
- package/src/{core → services}/location/location.test.js +2 -2
- package/src/services/log/log.spec.js +1 -1
- package/src/services/log/log.test.js +1 -0
- package/src/services/pubsub/pubsub.spec.js +1 -1
- package/src/{core → services}/sce/sce.html +1 -1
- package/src/{core → services}/sce/sce.js +14 -10
- package/src/{core → services}/sce/sce.md +2 -2
- package/src/{core → services}/sce/sce.spec.js +3 -4
- package/src/{core → services}/sce/sce.test.js +1 -1
- package/src/services/template-cache/interface.ts +8 -2
- package/src/services/template-cache/template-cache.js +3 -1
- package/src/services/template-cache/template-cache.spec.js +73 -1
- package/src/services/template-cache/template-cache.test.js +1 -0
- package/src/services/template-request.js +2 -1
- package/src/shared/cache.js +0 -2
- package/src/shared/common.js +0 -5
- package/src/shared/common.spec.js +1 -1
- package/src/shared/dom.js +10 -0
- package/src/shared/interface.ts +0 -4
- package/src/{router/common → shared}/queue.js +7 -7
- package/src/shared/shared.html +1 -0
- package/src/shared/shared.test.js +1 -0
- package/src/shared/test-utils.js +1 -0
- package/src/shared/url-utils/interface.ts +54 -0
- package/src/{core → shared}/url-utils/url-utils.html +4 -1
- package/src/{core → shared}/url-utils/url-utils.js +26 -47
- package/src/{core → shared}/url-utils/url-utils.spec.js +10 -17
- package/src/{core → shared}/url-utils/url-utils.test.js +1 -1
- package/src/shared/utils.js +60 -9
- package/src/shared/utils.spec.js +35 -1
- package/src/src.html +1 -2
- package/typedoc.json +0 -1
- package/utils/express.js +36 -2
- package/utils/version.cjs +23 -0
- package/@types/core/location/location.d.ts +0 -317
- package/@types/core/task-tracker-factory.d.ts +0 -76
- package/@types/core/url-utils/url-utils.d.ts +0 -56
- package/@types/router/state-provider.d.ts +0 -123
- package/@types/services/browser.d.ts +0 -101
- package/docs/static/typedoc/types/SwapInsertPosition.html +0 -2
- package/jsdoc.json +0 -22
- package/src/core/location/location.js +0 -984
- package/src/core/location/location.md +0 -114
- package/src/core/task-tracker-factory.js +0 -145
- package/src/core/url-utils/url-utils.md +0 -46
- package/src/directive/non-bindable/non-bindable.md +0 -17
- package/src/loader.spec.js +0 -169
- package/src/router/state-provider.js +0 -146
- package/src/services/browser.js +0 -212
- /package/@types/{loader.d.ts → angular.d.ts} +0 -0
- /package/src/router/{common → glob}/glob.spec.js +0 -0
- /package/src/{router/common → shared}/queue.spec.js +0 -0
|
@@ -1,53 +1,58 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @param {import('../browser.js').Browser} $browser
|
|
3
2
|
* @returns
|
|
4
3
|
*/
|
|
5
|
-
export function createHttpBackend(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
4
|
+
export function createHttpBackend(): (
|
|
5
|
+
method: string,
|
|
6
|
+
url?: string,
|
|
7
|
+
post?: any,
|
|
8
|
+
callback?: (
|
|
9
|
+
arg0: number,
|
|
10
|
+
arg1: any,
|
|
11
|
+
arg2: string | null,
|
|
12
|
+
arg3: string,
|
|
13
|
+
arg4: string,
|
|
14
|
+
) => void,
|
|
15
|
+
headers?: {
|
|
16
|
+
[x: string]: string;
|
|
17
|
+
},
|
|
18
|
+
timeout?: number | Promise<any>,
|
|
19
|
+
withCredentials?: boolean,
|
|
20
|
+
responseType?: XMLHttpRequestResponseType,
|
|
21
|
+
eventHandlers?: {
|
|
22
|
+
[x: string]: EventListener;
|
|
23
|
+
},
|
|
24
|
+
uploadEventHandlers?: {
|
|
25
|
+
[x: string]: EventListener;
|
|
26
|
+
},
|
|
18
27
|
) => void;
|
|
19
28
|
/**
|
|
20
|
-
* HTTP backend used by the
|
|
29
|
+
* HTTP backend used by the `$http` that delegates to
|
|
21
30
|
* XMLHttpRequest object and deals with browser incompatibilities.
|
|
22
|
-
*
|
|
23
|
-
* You should never need to use this service directly, instead use the higher-level abstractions:
|
|
24
|
-
* {@link ng.$http $http}.
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* HTTP backend used by the {@link ng.$http service} that delegates to
|
|
29
|
-
* XMLHttpRequest object and deals with browser incompatibilities.
|
|
30
|
-
*
|
|
31
|
-
* You should never need to use this service directly, instead use the higher-level abstractions:
|
|
32
|
-
* {@link ng.$http $http}.
|
|
33
|
-
*
|
|
31
|
+
* You should never need to use this service directly.
|
|
34
32
|
*/
|
|
35
33
|
export class HttpBackendProvider {
|
|
36
|
-
$get: (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
34
|
+
$get: () => (
|
|
35
|
+
method: string,
|
|
36
|
+
url?: string,
|
|
37
|
+
post?: any,
|
|
38
|
+
callback?: (
|
|
39
|
+
arg0: number,
|
|
40
|
+
arg1: any,
|
|
41
|
+
arg2: string | null,
|
|
42
|
+
arg3: string,
|
|
43
|
+
arg4: string,
|
|
44
|
+
) => void,
|
|
45
|
+
headers?: {
|
|
46
|
+
[x: string]: string;
|
|
47
|
+
},
|
|
48
|
+
timeout?: number | Promise<any>,
|
|
49
|
+
withCredentials?: boolean,
|
|
50
|
+
responseType?: XMLHttpRequestResponseType,
|
|
51
|
+
eventHandlers?: {
|
|
52
|
+
[x: string]: EventListener;
|
|
53
|
+
},
|
|
54
|
+
uploadEventHandlers?: {
|
|
55
|
+
[x: string]: EventListener;
|
|
56
|
+
},
|
|
57
|
+
) => void;
|
|
53
58
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A callback function that gets called when the browser URL or state changes.
|
|
3
|
+
*
|
|
4
|
+
* @param url - The new URL after the change (with trailing `#` removed).
|
|
5
|
+
* @param state - The new history state associated with the URL (`history.state`).
|
|
6
|
+
* @returns void
|
|
7
|
+
*/
|
|
8
|
+
export type UrlChangeListener = (url: string, state: History["state"]) => void;
|
|
9
|
+
/**
|
|
10
|
+
* Represents the configuration options for HTML5 mode.
|
|
11
|
+
*/
|
|
12
|
+
export interface Html5Mode {
|
|
13
|
+
/**
|
|
14
|
+
* If true, will rely on `history.pushState` to change URLs where supported.
|
|
15
|
+
* Falls back to hash-prefixed paths in browsers that do not support `pushState`.
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
enabled: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* When html5Mode is enabled, specifies whether or not a `<base>` tag is required to be present.
|
|
21
|
+
* If both `enabled` and `requireBase` are true, and a `<base>` tag is not present,
|
|
22
|
+
* an error will be thrown when `$location` is injected.
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
requireBase: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* When html5Mode is enabled, enables or disables URL rewriting for relative links.
|
|
28
|
+
* If set to a string, URL rewriting will only apply to links with an attribute that matches the given string.
|
|
29
|
+
* For example, if set to `'internal-link'`, URL rewriting will only occur for `<a internal-link>` links.
|
|
30
|
+
* Attribute name normalization does not apply here.
|
|
31
|
+
* @default true
|
|
32
|
+
*/
|
|
33
|
+
rewriteLinks: boolean | string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Represents default port numbers for various protocols.
|
|
37
|
+
*/
|
|
38
|
+
export interface DefaultPorts {
|
|
39
|
+
http: number;
|
|
40
|
+
https: number;
|
|
41
|
+
ftp: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Represents the individual components of a URL.
|
|
45
|
+
*/
|
|
46
|
+
export interface UrlParts {
|
|
47
|
+
/**
|
|
48
|
+
* The URL path (e.g. `/dashboard`, `/users/123`).
|
|
49
|
+
*/
|
|
50
|
+
path: string;
|
|
51
|
+
/**
|
|
52
|
+
* The parsed query string as an object.
|
|
53
|
+
* Mirrors AngularJS’s `$location.setSearch()` format.
|
|
54
|
+
*/
|
|
55
|
+
search: Record<
|
|
56
|
+
string,
|
|
57
|
+
string | number | boolean | (string | number | boolean)[]
|
|
58
|
+
>;
|
|
59
|
+
/**
|
|
60
|
+
* The fragment identifier (everything after `#`, not including the `#` itself).
|
|
61
|
+
*/
|
|
62
|
+
hash: string;
|
|
63
|
+
}
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ///////////////////////////
|
|
3
|
+
* PRIVATE HELPERS
|
|
4
|
+
* ///////////////////////////
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @ignore
|
|
8
|
+
* Encodes a URL path by encoding each path segment individually using `encodeUriSegment`,
|
|
9
|
+
* while preserving forward slashes (`/`) as segment separators.
|
|
10
|
+
*
|
|
11
|
+
* This function first decodes any existing percent-encodings (such as `%20` or `%2F`)
|
|
12
|
+
* in each segment to prevent double encoding, except for encoded forward slashes (`%2F`),
|
|
13
|
+
* which are replaced with literal slashes before decoding to keep path boundaries intact.
|
|
14
|
+
*
|
|
15
|
+
* After decoding, each segment is re-encoded with `encodeUriSegment` according to RFC 3986,
|
|
16
|
+
* encoding only characters that must be encoded in a path segment.
|
|
17
|
+
*
|
|
18
|
+
* The encoded segments are then rejoined with `/` to form the encoded path.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} path - The URL path string to encode. May contain multiple segments separated by `/`.
|
|
21
|
+
* @returns {string} The encoded path, where each segment is encoded, but forward slashes are preserved.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* encodePath("user profile/images/pic 1.jpg")
|
|
25
|
+
* // returns "user%20profile/images/pic%201.jpg"
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* encodePath("folder1%2Fsub/folder2")
|
|
29
|
+
* // returns "folder1%2Fsub/folder2"
|
|
30
|
+
*/
|
|
31
|
+
export function encodePath(path: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* @ignore
|
|
34
|
+
* Decodes each segment of a URL path.
|
|
35
|
+
*
|
|
36
|
+
* Splits the input path by "/", decodes each segment using decodeURIComponent,
|
|
37
|
+
* and if html5Mode is enabled, re-encodes any forward slashes inside segments
|
|
38
|
+
* as "%2F" to avoid confusion with path separators.
|
|
39
|
+
*
|
|
40
|
+
* @param {string} path - The URL path to decode.
|
|
41
|
+
* @param {boolean} html5Mode - If true, encodes forward slashes in segments as "%2F".
|
|
42
|
+
* @returns {string} The decoded path with segments optionally encoding slashes.
|
|
43
|
+
*/
|
|
44
|
+
export function decodePath(path: string, html5Mode: boolean): string;
|
|
45
|
+
/**
|
|
46
|
+
* @ignore
|
|
47
|
+
* Normalizes a URL path by encoding the path segments, query parameters, and hash fragment.
|
|
48
|
+
*
|
|
49
|
+
* - Path segments are encoded using `encodePath`, which encodes each segment individually.
|
|
50
|
+
* - Query parameters (`searchValue`) are converted to a query string using `toKeyValue`.
|
|
51
|
+
* - Hash fragment (`hashValue`) is encoded using `encodeUriSegment` and prefixed with `#`.
|
|
52
|
+
*
|
|
53
|
+
* This function returns a fully constructed URL path with optional query and hash components.
|
|
54
|
+
*
|
|
55
|
+
* @param {string} pathValue - The base URL path (e.g., "folder/item name").
|
|
56
|
+
* @param {Object.<string, any> | string | null} searchValue - An object or string representing query parameters.
|
|
57
|
+
* - If an object, it can contain strings, numbers, booleans, or arrays of values.
|
|
58
|
+
* - If a string, it is assumed to be a raw query string.
|
|
59
|
+
* - If null or undefined, no query string is added.
|
|
60
|
+
* @param {string | null} hashValue - The URL fragment (everything after `#`). If null or undefined, no hash is added.
|
|
61
|
+
*
|
|
62
|
+
* @returns {string} The normalized URL path including encoded path, optional query string, and optional hash.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* normalizePath("products/list", { category: "books", page: 2 }, "section1")
|
|
66
|
+
* // returns "products/list?category=books&page=2#section1"
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* normalizePath("user profile/images", null, null)
|
|
70
|
+
* // returns "user%20profile/images"
|
|
71
|
+
*/
|
|
72
|
+
export function normalizePath(
|
|
73
|
+
pathValue: string,
|
|
74
|
+
searchValue:
|
|
75
|
+
| {
|
|
76
|
+
[x: string]: any;
|
|
77
|
+
}
|
|
78
|
+
| string
|
|
79
|
+
| null,
|
|
80
|
+
hashValue: string | null,
|
|
81
|
+
): string;
|
|
82
|
+
/**
|
|
83
|
+
* @ignore
|
|
84
|
+
* Parses the application URL and updates the location object with path, search, and hash.
|
|
85
|
+
*
|
|
86
|
+
* @param {string} url - The URL string to parse.
|
|
87
|
+
* @param {boolean} html5Mode - Whether HTML5 mode is enabled (affects decoding).
|
|
88
|
+
* @throws Will throw an error if the URL starts with invalid slashes.
|
|
89
|
+
*/
|
|
90
|
+
export function parseAppUrl(url: string, html5Mode: boolean): void;
|
|
91
|
+
/**
|
|
92
|
+
* @ignore
|
|
93
|
+
* Returns the substring of `url` after the `base` string if `url` starts with `base`.
|
|
94
|
+
* Returns `undefined` if `url` does not start with `base`.
|
|
95
|
+
* @param {string} base
|
|
96
|
+
* @param {string} url
|
|
97
|
+
* @returns {string} returns text from `url` after `base` or `undefined` if it does not begin with
|
|
98
|
+
* the expected string.
|
|
99
|
+
*/
|
|
100
|
+
export function stripBaseUrl(base: string, url: string): string;
|
|
101
|
+
/**
|
|
102
|
+
* @ignore
|
|
103
|
+
* Removes the hash fragment (including the '#') from the given URL string.
|
|
104
|
+
*
|
|
105
|
+
* @param {string} url - The URL string to process.
|
|
106
|
+
* @returns {string} The URL without the hash fragment.
|
|
107
|
+
*/
|
|
108
|
+
export function stripHash(url: string): string;
|
|
109
|
+
/**
|
|
110
|
+
* @ignore
|
|
111
|
+
* Removes the file name (and any hash) from a URL, returning the base directory path.
|
|
112
|
+
*
|
|
113
|
+
* For example:
|
|
114
|
+
* - Input: "https://example.com/path/to/file.js"
|
|
115
|
+
* Output: "https://example.com/path/to/"
|
|
116
|
+
*
|
|
117
|
+
* - Input: "https://example.com/path/to/file.js#section"
|
|
118
|
+
* Output: "https://example.com/path/to/"
|
|
119
|
+
*
|
|
120
|
+
* @param {string} url - The URL from which to strip the file name and hash.
|
|
121
|
+
* @returns {string} The base path of the URL, ending with a slash.
|
|
122
|
+
*/
|
|
123
|
+
export function stripFile(url: string): string;
|
|
124
|
+
/**
|
|
125
|
+
* @ignore
|
|
126
|
+
* Extracts the base server URL (scheme, host, and optional port) from a full URL.
|
|
127
|
+
*
|
|
128
|
+
* If no path is present, returns the full URL.
|
|
129
|
+
*
|
|
130
|
+
* For example:
|
|
131
|
+
* - Input: "https://example.com/path/to/file"
|
|
132
|
+
* Output: "https://example.com"
|
|
133
|
+
*
|
|
134
|
+
* - Input: "http://localhost:3000/api/data"
|
|
135
|
+
* Output: "http://localhost:3000"
|
|
136
|
+
*
|
|
137
|
+
* @param {string} url - The full URL to extract the server base from.
|
|
138
|
+
* @returns {string} The server base, including scheme and host (and port if present).
|
|
139
|
+
*/
|
|
140
|
+
export function serverBase(url: string): string;
|
|
141
|
+
/**
|
|
142
|
+
* @ignore
|
|
143
|
+
* Determine if two URLs are equal despite potential differences in encoding,
|
|
144
|
+
* trailing slashes, or empty hash fragments, such as between $location.absUrl() and $browser.url().
|
|
145
|
+
*
|
|
146
|
+
* @param {string} a - First URL to compare.
|
|
147
|
+
* @param {string} b - Second URL to compare.
|
|
148
|
+
* @returns {boolean} True if URLs are equivalent after normalization.
|
|
149
|
+
*/
|
|
150
|
+
export function urlsEqual(a: string, b: string): boolean;
|
|
151
|
+
export class Location {
|
|
152
|
+
/**
|
|
153
|
+
* @param {string} appBase application base URL
|
|
154
|
+
* @param {string} appBaseNoFile application base URL stripped of any filename
|
|
155
|
+
* @param {boolean} [html5] Defaults to true
|
|
156
|
+
* @param {string} [prefix] URL path prefix for html5 mode or hash prefix for hashbang mode
|
|
157
|
+
*/
|
|
158
|
+
constructor(
|
|
159
|
+
appBase: string,
|
|
160
|
+
appBaseNoFile: string,
|
|
161
|
+
html5?: boolean,
|
|
162
|
+
prefix?: string,
|
|
163
|
+
);
|
|
164
|
+
/** @type {string} */
|
|
165
|
+
appBase: string;
|
|
166
|
+
/** @type {string} */
|
|
167
|
+
appBaseNoFile: string;
|
|
168
|
+
/** @type {boolean} */
|
|
169
|
+
html5: boolean;
|
|
170
|
+
/** @type {string | undefined} */
|
|
171
|
+
basePrefix: string | undefined;
|
|
172
|
+
/** @type {string | undefined} */
|
|
173
|
+
hashPrefix: string | undefined;
|
|
174
|
+
/**
|
|
175
|
+
* An absolute URL is the full URL, including protocol (http/https ), the optional subdomain (e.g. www ), domain (example.com), and path (which includes the directory and slug)
|
|
176
|
+
* with all segments encoded according to rules specified in [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt).
|
|
177
|
+
* @type {string}
|
|
178
|
+
*/
|
|
179
|
+
absUrl: string;
|
|
180
|
+
/**
|
|
181
|
+
* @ignore
|
|
182
|
+
* Current url
|
|
183
|
+
* @type {string}
|
|
184
|
+
*/
|
|
185
|
+
$$url: string;
|
|
186
|
+
/**
|
|
187
|
+
* @ignore
|
|
188
|
+
* Callback to update browser url
|
|
189
|
+
* @type {Function}
|
|
190
|
+
*/
|
|
191
|
+
$$updateBrowser: Function;
|
|
192
|
+
/**
|
|
193
|
+
* Change path, search and hash, when called with parameter and return `$location`.
|
|
194
|
+
*
|
|
195
|
+
* @param {string} url New URL without base prefix (e.g. `/path?a=b#hash`)
|
|
196
|
+
* @return {Location} url
|
|
197
|
+
*/
|
|
198
|
+
setUrl(url: string): Location;
|
|
199
|
+
/**
|
|
200
|
+
* Return URL (e.g. `/path?a=b#hash`) when called without any parameter.
|
|
201
|
+
*
|
|
202
|
+
* @return {string} url
|
|
203
|
+
*/
|
|
204
|
+
getUrl(): string;
|
|
205
|
+
/**
|
|
206
|
+
* Change path parameter and return `$location`.
|
|
207
|
+
*
|
|
208
|
+
* @param {(string|number)} path New path
|
|
209
|
+
* @return {Location}
|
|
210
|
+
*/
|
|
211
|
+
setPath(path: string | number): Location;
|
|
212
|
+
/**
|
|
213
|
+
*
|
|
214
|
+
* Return path of current URL
|
|
215
|
+
*
|
|
216
|
+
* @return {string}
|
|
217
|
+
*/
|
|
218
|
+
getPath(): string;
|
|
219
|
+
/**
|
|
220
|
+
* Changes the hash fragment when called with a parameter and returns `$location`.
|
|
221
|
+
* @param {(string|number)} hash New hash fragment
|
|
222
|
+
* @return {Location} hash
|
|
223
|
+
*/
|
|
224
|
+
setHash(hash: string | number): Location;
|
|
225
|
+
/**
|
|
226
|
+
* Returns the hash fragment when called without any parameters.
|
|
227
|
+
* @return {string} hash
|
|
228
|
+
*/
|
|
229
|
+
getHash(): string;
|
|
230
|
+
/**
|
|
231
|
+
* Sets the search part (as object) of current URL
|
|
232
|
+
*
|
|
233
|
+
* @param {string|Object} search New search params - string or hash object.
|
|
234
|
+
* @param {(string|number|Array<string>|boolean)=} paramValue If search is a string or number, then paramValue will override only a single search property.
|
|
235
|
+
* @returns {Object} Search object or Location object
|
|
236
|
+
*/
|
|
237
|
+
setSearch(
|
|
238
|
+
search: string | any,
|
|
239
|
+
paramValue?: (string | number | Array<string> | boolean) | undefined,
|
|
240
|
+
...args: any[]
|
|
241
|
+
): any;
|
|
242
|
+
/**
|
|
243
|
+
* Returns the search part (as object) of current URL
|
|
244
|
+
*
|
|
245
|
+
* @returns {Object} Search object or Location object
|
|
246
|
+
*/
|
|
247
|
+
getSearch(): any;
|
|
248
|
+
/**
|
|
249
|
+
* @private
|
|
250
|
+
* Compose url and update `url` and `absUrl` property
|
|
251
|
+
*/
|
|
252
|
+
private $$compose;
|
|
253
|
+
/**
|
|
254
|
+
* Change the history state object when called with one parameter and return `$location`.
|
|
255
|
+
* The state object is later passed to `pushState` or `replaceState`.
|
|
256
|
+
* See {@link https://developer.mozilla.org/en-US/docs/Web/API/History/pushState#state|History.state}
|
|
257
|
+
*
|
|
258
|
+
* NOTE: This method is supported only in HTML5 mode and only in browsers supporting
|
|
259
|
+
* the HTML5 History API (i.e. methods `pushState` and `replaceState`). If you need to support
|
|
260
|
+
* older browsers (like IE9 or Android < 4.0), don't use this method.
|
|
261
|
+
* @param {any} state
|
|
262
|
+
* @returns {Location}
|
|
263
|
+
*/
|
|
264
|
+
setState(state: any): Location;
|
|
265
|
+
$$state: any;
|
|
266
|
+
/**
|
|
267
|
+
* Return the history state object
|
|
268
|
+
* @returns {any}
|
|
269
|
+
*/
|
|
270
|
+
getState(): any;
|
|
271
|
+
/**
|
|
272
|
+
* @param {string} url
|
|
273
|
+
* @param {string} relHref
|
|
274
|
+
* @returns {boolean}
|
|
275
|
+
*/
|
|
276
|
+
parseLinkUrl(url: string, relHref: string): boolean;
|
|
277
|
+
/**
|
|
278
|
+
* Parse given HTML5 (regular) URL string into properties
|
|
279
|
+
* @param {string} url HTML5 URL
|
|
280
|
+
*/
|
|
281
|
+
parse(url: string): void;
|
|
282
|
+
}
|
|
283
|
+
export class LocationProvider {
|
|
284
|
+
/** @type {string} */
|
|
285
|
+
hashPrefixConf: string;
|
|
286
|
+
/** @type {import("./interface.ts").Html5Mode} */
|
|
287
|
+
html5ModeConf: import("./interface.ts").Html5Mode;
|
|
288
|
+
/** @type {Array<import("./interface.ts").UrlChangeListener>} */
|
|
289
|
+
urlChangeListeners: Array<import("./interface.ts").UrlChangeListener>;
|
|
290
|
+
urlChangeInit: boolean;
|
|
291
|
+
/** @type {History['state']} */
|
|
292
|
+
cachedState: History["state"];
|
|
293
|
+
/** @type {History['state']} */
|
|
294
|
+
lastHistoryState: History["state"];
|
|
295
|
+
/** @type {string} */
|
|
296
|
+
lastBrowserUrl: string;
|
|
297
|
+
/**
|
|
298
|
+
* Updates the browser's current URL and history state.
|
|
299
|
+
*
|
|
300
|
+
* @param {string|undefined} url - The target URL to navigate to.
|
|
301
|
+
* @param {*} [state=null] - Optional history state object to associate with the new URL.
|
|
302
|
+
* @returns {LocationProvider}
|
|
303
|
+
*/
|
|
304
|
+
setUrl(url: string | undefined, state?: any): LocationProvider;
|
|
305
|
+
/**
|
|
306
|
+
* Returns the current URL with any empty hash (`#`) removed.
|
|
307
|
+
* @return {string}
|
|
308
|
+
*/
|
|
309
|
+
getBrowserUrl(): string;
|
|
310
|
+
/**
|
|
311
|
+
* Returns the cached state.
|
|
312
|
+
* @returns {History['state']} The cached state.
|
|
313
|
+
*/
|
|
314
|
+
state(): History["state"];
|
|
315
|
+
/**
|
|
316
|
+
* Caches the current state.
|
|
317
|
+
*
|
|
318
|
+
* @private
|
|
319
|
+
*/
|
|
320
|
+
private cacheState;
|
|
321
|
+
lastCachedState: any;
|
|
322
|
+
$get: (
|
|
323
|
+
| string
|
|
324
|
+
| ((
|
|
325
|
+
$rootScope: import("../../core/scope/scope.js").Scope,
|
|
326
|
+
$rootElement: Element,
|
|
327
|
+
) => Location)
|
|
328
|
+
)[];
|
|
329
|
+
#private;
|
|
330
|
+
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A cache for mapping template
|
|
2
|
+
* A cache interface for mapping template urls to their XHR responses.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export interface TemplateCache {
|
|
5
|
+
get(key: string): any | undefined;
|
|
6
|
+
set(key: string, value: any): this;
|
|
7
|
+
has(key: string): boolean;
|
|
8
|
+
delete(key: string): boolean;
|
|
9
|
+
clear(): void;
|
|
10
|
+
}
|
|
@@ -43,7 +43,7 @@ export class TemplateRequestProvider {
|
|
|
43
43
|
$get: (
|
|
44
44
|
| string
|
|
45
45
|
| ((
|
|
46
|
-
$exceptionHandler: import("
|
|
46
|
+
$exceptionHandler: import("./exception/exception-handler.js").ErrorHandler,
|
|
47
47
|
$templateCache: import("../services/template-cache/interface.ts").TemplateCache,
|
|
48
48
|
$http: any,
|
|
49
49
|
$sce: any,
|
package/@types/shared/cache.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Expando cache for adding properties to DOM nodes with JavaScript.
|
|
3
3
|
* This used to be an Object in JQLite decorator, but swapped out for a Map
|
|
4
|
-
* for performance reasons and convenience methods. A proxy is available for
|
|
5
|
-
* additional logic handling.
|
|
6
4
|
*
|
|
7
5
|
* @type {Map<number, import('../interface.ts').ExpandoStore>}
|
|
8
6
|
*/
|
|
@@ -182,8 +182,6 @@ export function copy(src: any, dest: any): any;
|
|
|
182
182
|
* The same array is returned
|
|
183
183
|
*/
|
|
184
184
|
export const removeFrom: any;
|
|
185
|
-
/** pushes a values to an array and returns the value */
|
|
186
|
-
export const pushTo: any;
|
|
187
185
|
export function allTrueR(memo: any, elem: any): any;
|
|
188
186
|
export function anyTrueR(memo: any, elem: any): any;
|
|
189
187
|
export function unnestR(memo: any, elem: any): any;
|
package/@types/shared/dom.d.ts
CHANGED
|
@@ -240,6 +240,12 @@ export function domInsert(
|
|
|
240
240
|
parentElement: any,
|
|
241
241
|
afterElement: any,
|
|
242
242
|
): void;
|
|
243
|
+
/**
|
|
244
|
+
* Returns the base href of the document.
|
|
245
|
+
*
|
|
246
|
+
* @returns {string} The base href.
|
|
247
|
+
*/
|
|
248
|
+
export function getBaseHref(): string;
|
|
243
249
|
/**
|
|
244
250
|
* A list of boolean attributes in HTML.
|
|
245
251
|
* @type {string[]}
|
|
@@ -16,9 +16,9 @@ export class Queue<T> {
|
|
|
16
16
|
_evictListeners: Array<(item: T) => void>;
|
|
17
17
|
/**
|
|
18
18
|
* Register a listener that will be called with the evicted item.
|
|
19
|
-
* @
|
|
19
|
+
* @param {(item: T) => void} listener
|
|
20
20
|
*/
|
|
21
|
-
onEvict
|
|
21
|
+
onEvict(listener: (item: T) => void): void;
|
|
22
22
|
/**
|
|
23
23
|
* Adds an item to the end of the queue, evicting the head if over limit.
|
|
24
24
|
* @param {T} item
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
export function browserTrigger(element: HTMLElement, options: any): void;
|
|
7
7
|
/**
|
|
8
8
|
* Delays execution for a specified number of milliseconds.
|
|
9
|
+
* TODO remove
|
|
9
10
|
*
|
|
10
11
|
* @param {number} [t=0] - The number of milliseconds to wait. Defaults to 0.
|
|
11
12
|
* @returns {Promise<void>} A promise that resolves after the delay.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A normalized representation of a parsed URL.
|
|
3
|
+
*/
|
|
4
|
+
export interface ParsedUrl {
|
|
5
|
+
/**
|
|
6
|
+
* The full URL string, including protocol, host, path, query, and hash.
|
|
7
|
+
* Example: "https://example.com:8080/path?query=1#section"
|
|
8
|
+
*/
|
|
9
|
+
href: string;
|
|
10
|
+
/**
|
|
11
|
+
* The protocol scheme of the URL, without the trailing colon.
|
|
12
|
+
* Example: "http" or "https"
|
|
13
|
+
*/
|
|
14
|
+
protocol: string;
|
|
15
|
+
/**
|
|
16
|
+
* The host part of the URL, including hostname and port (if specified).
|
|
17
|
+
* Example: "example.com:8080"
|
|
18
|
+
*/
|
|
19
|
+
host: string;
|
|
20
|
+
/**
|
|
21
|
+
* The query string portion of the URL, without the leading "?".
|
|
22
|
+
* Example: "query=1&sort=asc"
|
|
23
|
+
*/
|
|
24
|
+
search: string;
|
|
25
|
+
/**
|
|
26
|
+
* The fragment identifier (hash) of the URL, without the leading "#".
|
|
27
|
+
* Example: "section2"
|
|
28
|
+
*/
|
|
29
|
+
hash: string;
|
|
30
|
+
/**
|
|
31
|
+
* The domain or IP address (including IPv6 in brackets) of the URL.
|
|
32
|
+
* Example: "example.com" or "[::1]"
|
|
33
|
+
*/
|
|
34
|
+
hostname: string;
|
|
35
|
+
/**
|
|
36
|
+
* The port number of the URL as a string, or an empty string if not specified.
|
|
37
|
+
* Example: "8080" or ""
|
|
38
|
+
*/
|
|
39
|
+
port: string;
|
|
40
|
+
/**
|
|
41
|
+
* The path of the URL, always beginning with a leading slash.
|
|
42
|
+
* Example: "/path/to/resource"
|
|
43
|
+
*/
|
|
44
|
+
pathname: string;
|
|
45
|
+
}
|
|
46
|
+
export type ResolvableUrl = string | ParsedUrl;
|