@angular-wave/angular.ts 0.0.35 → 0.0.37
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/.eslintrc.cjs +1 -1
- package/Makefile +4 -0
- package/dist/angular-ts.esm.js +1 -1
- package/dist/angular-ts.umd.js +1 -1
- package/index.html +3 -102
- package/package.json +2 -2
- package/playwright.config.ts +4 -3
- package/public/public/my_other_directive.html +1 -0
- package/{test → src}/angular.spec.js +6 -6
- package/src/animations/animate-css-driver.js +1 -1
- package/src/animations/animate-queue.js +1 -1
- package/src/animations/animation.js +1 -1
- package/src/animations/shared.js +1 -1
- package/{test → src}/binding.spec.js +3 -3
- package/src/core/{animate-runner.js → animate/animate-runner.js} +1 -1
- package/src/core/animate/animate.html +18 -0
- package/src/core/{animate.js → animate/animate.js} +4 -5
- package/{test/core → src/core/animate}/animate.spec.js +1 -1
- package/src/core/cache/cache-factor.html +18 -0
- package/{test/core → src/core/cache}/cache-factor.spec.js +2 -2
- package/src/core/cache/cache-factor.test.js +11 -0
- package/src/core/compile/compile.html +18 -0
- package/src/core/{compile.js → compile/compile.js} +25 -21
- package/{test/core → src/core/compile}/compile.spec.js +65 -68
- package/src/core/compile/compile.test.js +12 -0
- package/src/core/controller/controller.html +21 -0
- package/src/core/{controller.js → controller/controller.js} +1 -1
- package/{test/core/controller-provider.spec.js → src/core/controller/controller.spec.js} +2 -2
- package/src/core/controller/controller.test.js +11 -0
- package/{test → src}/core/cookie-reader.spec.js +2 -2
- package/{test → src}/core/document.spec.js +3 -3
- package/src/core/filter/filter.html +18 -0
- package/src/core/{filter.js → filter/filter.js} +5 -5
- package/{test/core → src/core/filter}/filter.spec.js +2 -2
- package/src/core/filter/filter.test.js +11 -0
- package/src/core/interpolate/interpolate.html +21 -0
- package/src/core/{interpolate.js → interpolate/interpolate.js} +1 -1
- package/{test/core → src/core/interpolate}/interpolate.spec.js +2 -2
- package/src/core/interpolate/interpolate.test.js +11 -0
- package/src/core/{interval-factory.js → interval/interval-factory.js} +2 -1
- package/src/core/interval/interval.html +18 -0
- package/src/core/{interval.js → interval/interval.js} +3 -2
- package/{test/core → src/core/interval}/interval.spec.js +6 -10
- package/src/core/interval/interval.test.js +12 -0
- package/src/core/{location.js → location/location.js} +4 -3
- package/{test/core → src/core/location}/location.spec.js +3 -3
- package/{test → src}/core/on.spec.js +3 -3
- package/src/core/parser/parse.js +2 -3
- package/{test/core → src/core/parser}/parse.spec.js +4 -4
- package/{test → src}/core/prop.spec.js +4 -4
- package/{test/core → src/core/pubsub}/pubsub.spec.js +1 -1
- package/src/core/{q.js → q/q.js} +1 -1
- package/{test/core → src/core/q}/q.spec.js +3 -3
- package/{test → src}/core/root-element.spec.js +3 -3
- package/src/core/{sanitize-uri.js → sanitize/sanitize-uri.js} +2 -2
- package/{test/core → src/core/sanitize}/sanitize-uri.spec.js +1 -1
- package/src/core/{sce.js → sce/sce.js} +3 -3
- package/{test/core → src/core/sce}/sce.spec.js +3 -3
- package/src/core/{root-scope.js → scope/scope.js} +33 -35
- package/{test/core → src/core/scope}/scope.spec.js +5 -5
- package/src/core/{timeout.js → timeout/timeout.js} +2 -2
- package/{test/core → src/core/timeout}/timeout.spec.js +2 -2
- package/src/core/{urlUtils.js → url-utils/url-utils.js} +1 -1
- package/{test/core → src/core/url-utils}/url-utils.spec.js +1 -1
- package/src/directive/attrs/attrs.html +18 -0
- package/src/directive/{attrs.js → attrs/attrs.js} +3 -3
- package/{test/directive/scrset.spec.js → src/directive/attrs/attrs.spec.js} +3 -3
- package/{test/directive → src/directive/attrs}/boolean.spec.js +3 -3
- package/{test/directive → src/directive/attrs}/element-style.spec.js +3 -3
- package/src/directive/attrs/src.html +18 -0
- package/{test/directive → src/directive/attrs}/src.spec.js +3 -3
- package/src/directive/attrs/src.test.js +11 -0
- package/src/directive/bind/bind.html +18 -0
- package/src/directive/{bind.js → bind/bind.js} +1 -1
- package/{test/directive → src/directive/bind}/bind.spec.js +3 -3
- package/src/directive/bind/bind.test.js +11 -0
- package/{test/sanitize → src/directive/bind}/bing-html.spec.js +3 -3
- package/src/directive/change/change.html +18 -0
- package/{test/directive → src/directive/change}/change.spec.js +3 -3
- package/src/directive/change/change.test.js +11 -0
- package/src/directive/class/class.html +18 -0
- package/src/directive/{class.js → class/class.js} +3 -3
- package/{test/directive → src/directive/class}/class.spec.js +5 -5
- package/src/directive/class/class.test.js +11 -0
- package/src/directive/cloak/cloak.html +18 -0
- package/{test/directive → src/directive/cloak}/cloak.spec.js +3 -3
- package/src/directive/cloak/cloak.test.js +11 -0
- package/src/directive/controller/controller.html +21 -0
- package/{test/directive → src/directive/controller}/controller.spec.js +5 -5
- package/src/directive/controller/controller.test.js +11 -0
- package/{test/directive → src/directive/events}/click.spec.js +3 -3
- package/{test/directive → src/directive/events}/event.spec.js +4 -4
- package/src/directive/events/events.html +18 -0
- package/src/directive/{events.js → events/events.js} +2 -2
- package/src/directive/events/events.test.js +11 -0
- package/src/directive/form/form.html +18 -0
- package/src/directive/{form.js → form/form.js} +2 -2
- package/{test/directive → src/directive/form}/form.spec.js +5 -5
- package/src/directive/form/form.test.js +11 -0
- package/src/directive/if/if.html +18 -0
- package/src/directive/{if.js → if/if.js} +2 -1
- package/src/directive/if/if.md +77 -0
- package/{test/directive → src/directive/if}/if.spec.js +16 -16
- package/src/directive/if/if.test.js +12 -0
- package/src/directive/include/include.html +18 -0
- package/src/directive/{include.js → include/include.js} +2 -2
- package/{test/directive → src/directive/include}/include.spec.js +52 -71
- package/src/directive/include/include.test.js +12 -0
- package/src/directive/init/init.html +18 -0
- package/{test/directive → src/directive/init}/init.spec.js +4 -4
- package/src/directive/init/init.test.js +11 -0
- package/src/directive/input/input.html +18 -0
- package/src/directive/{input.js → input/input.js} +2 -2
- package/{test/directive → src/directive/input}/input.spec.js +5 -9
- package/src/directive/input/input.test.js +11 -0
- package/src/directive/list/list.html +18 -0
- package/src/directive/{list.js → list/list.js} +1 -1
- package/{test/directive → src/directive/list}/list.spec.js +3 -3
- package/src/directive/list/list.test.js +11 -0
- package/src/directive/model/model.html +18 -0
- package/src/directive/{model.js → model/model.js} +10 -6
- package/{test/directive → src/directive/model}/model.spec.js +8 -8
- package/src/directive/model/model.test.js +11 -0
- package/src/directive/model-options/model-option.test.js +11 -0
- package/src/directive/model-options/model-options.html +21 -0
- package/src/directive/{model-options.js → model-options/model-options.js} +1 -1
- package/{test/directive → src/directive/model-options}/model-options.spec.js +7 -7
- package/src/directive/non-bindable/non-bindable.html +21 -0
- package/{test/directive → src/directive/non-bindable}/non-bindable.spec.js +3 -3
- package/src/directive/non-bindable/non-bindable.test.js +11 -0
- package/src/directive/options/options.html +21 -0
- package/src/directive/{options.js → options/options.js} +8 -6
- package/{test/directive → src/directive/options}/options.spec.js +5 -5
- package/src/directive/options/options.test.js +11 -0
- package/src/directive/ref/href.html +18 -0
- package/{test/directive → src/directive/ref}/href.spec.js +4 -4
- package/src/directive/ref/href.test.js +17 -0
- package/src/directive/ref/ref.html +18 -0
- package/src/directive/{ref.js → ref/ref.js} +1 -1
- package/{test/directive → src/directive/ref}/ref.spec.js +2 -2
- package/src/directive/repeat/repeat.html +18 -0
- package/src/directive/{repeat.js → repeat/repeat.js} +13 -13
- package/{test/directive → src/directive/repeat}/repeat.spec.js +8 -9
- package/src/directive/repeat/repeat.test.js +11 -0
- package/src/directive/script/script.html +18 -0
- package/{test/directive → src/directive/script}/script.spec.js +3 -3
- package/src/directive/script/script.test.js +11 -0
- package/src/directive/select/select.html +18 -0
- package/src/directive/{select.js → select/select.js} +2 -2
- package/{test/directive → src/directive/select}/select.spec.js +5 -5
- package/src/directive/select/select.test.js +11 -0
- package/src/directive/show-hide/show-hide.html +21 -0
- package/{test/directive → src/directive/show-hide}/show-hide.spec.js +3 -3
- package/src/directive/show-hide/show-hide.test.js +11 -0
- package/src/directive/style/style.html +18 -0
- package/{test/directive → src/directive/style}/style.spec.js +3 -3
- package/src/directive/style/style.test.js +11 -0
- package/src/directive/switch/switch.html +18 -0
- package/src/directive/{switch.js → switch/switch.js} +3 -3
- package/{test/directive → src/directive/switch}/switch.spec.js +3 -3
- package/src/directive/switch/switch.test.js +11 -0
- package/src/directive/{transclude.js → transclude/transclude.js} +2 -2
- package/src/directive/validators/validators.html +21 -0
- package/src/directive/{validators.js → validators/validators.js} +3 -3
- package/{test/directive → src/directive/validators}/validators.spec.js +3 -3
- package/src/directive/validators/validators.test.js +11 -0
- package/src/exts/aria/aria.html +21 -0
- package/src/exts/{aria.js → aria/aria.js} +1 -1
- package/{test → src/exts}/aria/aria.spec.js +3 -3
- package/src/exts/aria/aria.test.js +11 -0
- package/src/exts/messages/messages.html +21 -0
- package/src/exts/{messages.js → messages/messages.js} +1 -1
- package/{test → src/exts}/messages/messages.spec.js +5 -5
- package/src/exts/messages/messages.test.js +11 -0
- package/{test/filter → src/filters}/filter.spec.js +10 -5
- package/{test/filter → src/filters}/filters.spec.js +3 -3
- package/{test/filter → src/filters}/limit-to.spec.js +3 -3
- package/{test/filter → src/filters}/order-by.spec.js +2 -2
- package/src/injector.js +1 -2
- package/{test → src}/injector.spec.js +4 -4
- package/src/loader.js +2 -2
- package/{test → src}/loader.spec.js +2 -2
- package/src/public.js +48 -45
- package/{test → src}/public.spec.js +2 -2
- package/src/router/common/glob.html +18 -0
- package/{test/router → src/router/common}/glob.spec.js +1 -1
- package/src/router/common/glob.test.js +11 -0
- package/src/router/directives/view-directive.js +1 -1
- package/{test → src}/router/services.spec.js +2 -2
- package/src/router/state/state-service.js +1 -1
- package/{test/router/ng-state-builder.spec.js → src/router/state-builder.spec.js} +1 -1
- package/{test → src}/router/state-directives.spec.js +3 -3
- package/{test → src}/router/state-filter.spec.js +2 -2
- package/{test → src}/router/state.spec.js +5 -5
- package/{test → src}/router/template-factory.spec.js +3 -3
- package/src/router/transition/transition-hook.js +1 -1
- package/{test → src}/router/url-service.spec.js +4 -4
- package/{test → src}/router/view-directive.spec.js +3 -3
- package/{test → src}/router/view-hook.spec.js +3 -3
- package/{test → src}/router/view-scroll.spec.js +3 -3
- package/{test → src}/router/view.spec.js +12 -12
- package/src/services/browser.js +2 -2
- package/src/services/cache-factory.js +5 -11
- package/src/services/document.js +1 -1
- package/src/services/{http.js → http/http.js} +5 -6
- package/{test/core → src/services/http}/http.spec.js +3 -3
- package/{test/core → src/services/http}/template-request.spec.js +2 -2
- package/src/services/{http-backend.js → http-backend/http-backend.js} +2 -2
- package/{test/core → src/services/http-backend}/http-backend.spec.js +3 -3
- package/src/services/template-request.js +1 -1
- package/{test → src}/shared/common.spec.js +4 -4
- package/{test → src}/shared/hof.spec.js +1 -1
- package/src/shared/jqlite/jqlite.html +18 -0
- package/src/{jqLite.js → shared/jqlite/jqlite.js} +2 -2
- package/{test → src/shared/jqlite}/jqlite.spec.js +7 -7
- package/src/shared/jqlite/jqlite.test.js +11 -0
- package/{test → src/shared}/min-err.spec.js +2 -2
- package/{test → src}/shared/strings.spec.js +1 -1
- package/{test → src/shared}/test-utils.js +1 -1
- package/src/shared/utils.js +3 -18
- package/{test → src}/shared/utils.spec.js +1 -1
- package/tsconfig.json +1 -1
- package/types/animations/animate-cache.d.ts +12 -0
- package/types/animations/animate-children-directive.d.ts +84 -0
- package/types/animations/animate-swap.d.ts +103 -0
- package/types/animations/animation.d.ts +14 -0
- package/types/animations/module.d.ts +750 -0
- package/types/animations/raf-scheduler.d.ts +5 -0
- package/types/animations/shared.d.ts +65 -0
- package/types/constants.d.ts +18 -0
- package/types/core/animate-css.d.ts +25 -0
- package/types/core/cache.d.ts +25 -0
- package/types/core/compile.d.ts +206 -0
- package/types/core/controller.d.ts +42 -0
- package/types/core/exception-handler.d.ts +46 -0
- package/types/core/filter.d.ts +9 -0
- package/types/core/interpolate.d.ts +83 -0
- package/types/core/interval-factory.d.ts +21 -0
- package/types/core/interval.d.ts +4 -0
- package/types/core/location.d.ts +234 -0
- package/types/core/pubsub.d.ts +164 -0
- package/types/core/q.d.ts +33 -0
- package/types/core/root-scope.d.ts +754 -0
- package/types/core/sanitize-uri.d.ts +57 -0
- package/types/core/sce.d.ts +432 -0
- package/types/core/task-tracker-factory.d.ts +50 -0
- package/types/core/timeout.d.ts +31 -0
- package/types/core/urlUtils.d.ts +98 -0
- package/types/directive/attrs.d.ts +176 -0
- package/types/directive/bind.d.ts +21 -0
- package/types/directive/change.d.ts +4 -0
- package/types/directive/class.d.ts +125 -0
- package/types/directive/cloak.d.ts +4 -0
- package/types/directive/controller.d.ts +6 -0
- package/types/directive/events.d.ts +12 -0
- package/types/directive/form.d.ts +230 -0
- package/types/directive/if.d.ts +17 -0
- package/types/directive/include.d.ts +33 -0
- package/types/directive/init.d.ts +4 -0
- package/types/directive/input.d.ts +192 -0
- package/types/directive/list.d.ts +4 -0
- package/types/directive/model.d.ts +672 -0
- package/types/directive/non-bindable.d.ts +5 -0
- package/types/directive/options.d.ts +16 -0
- package/types/directive/ref.d.ts +11 -0
- package/types/directive/repeat.d.ts +23 -0
- package/types/directive/script.d.ts +23 -0
- package/types/directive/show-hide.d.ts +234 -0
- package/types/directive/style.d.ts +4 -0
- package/types/directive/switch.d.ts +23 -0
- package/types/directive/transclude.d.ts +15 -0
- package/types/directive/validators.d.ts +173 -0
- package/types/exts/aria.d.ts +1 -0
- package/types/exts/messages.d.ts +1 -0
- package/types/filters/filter.d.ts +4 -0
- package/types/filters/filters.d.ts +38 -0
- package/types/filters/limit-to.d.ts +4 -0
- package/types/filters/order-by.d.ts +11 -0
- package/types/jqLite.d.ts +57 -0
- package/types/router/common/coreservices.d.ts +4 -0
- package/types/router/common/glob.d.ts +60 -0
- package/types/router/common/queue.d.ts +15 -0
- package/types/router/common/trace.d.ts +72 -0
- package/types/router/directives/view-directive.d.ts +160 -0
- package/types/router/globals.d.ts +30 -0
- package/types/router/hooks/core-resolvables.d.ts +2 -0
- package/types/router/hooks/ignored-transition.d.ts +1 -0
- package/types/router/hooks/invalid-transition.d.ts +1 -0
- package/types/router/hooks/lazy-load.d.ts +42 -0
- package/types/router/hooks/on-enter-exit-retain.d.ts +3 -0
- package/types/router/hooks/redirect-to.d.ts +4 -0
- package/types/router/hooks/resolve.d.ts +4 -0
- package/types/router/hooks/update-globals.d.ts +1 -0
- package/types/router/hooks/url.d.ts +5 -0
- package/types/router/hooks/views.d.ts +5 -0
- package/types/router/index.d.ts +1 -17
- package/types/router/injectables.d.ts +1 -0
- package/types/router/params/param-factory.d.ts +8 -0
- package/types/router/params/param-type.d.ts +65 -0
- package/types/router/params/param-types.d.ts +36 -0
- package/types/router/params/param.d.ts +41 -0
- package/types/router/params/state-params.d.ts +12 -0
- package/types/router/path/path-node.d.ts +45 -0
- package/types/router/path/path-utils.d.ts +83 -0
- package/types/router/resolve/resolvable.d.ts +50 -0
- package/types/router/resolve/resolve-context.d.ts +102 -0
- package/types/router/services.d.ts +12 -13
- package/types/router/state/state-builder.d.ts +89 -0
- package/types/router/state/state-matcher.d.ts +7 -0
- package/types/router/state/state-object.d.ts +72 -0
- package/types/router/state/state-queue-manager.d.ts +19 -0
- package/types/router/state/state-registry.d.ts +118 -0
- package/types/router/state/state-service.d.ts +419 -0
- package/types/router/state/target-state.d.ts +102 -0
- package/types/router/state/views.d.ts +50 -0
- package/types/router/state-filters.d.ts +15 -0
- package/types/router/state-provider.d.ts +123 -0
- package/types/router/template-factory.d.ts +124 -0
- package/types/router/transition/hook-builder.d.ts +40 -0
- package/types/router/transition/hook-registry.d.ts +102 -0
- package/types/router/transition/interface.d.ts +11 -0
- package/types/router/transition/reject-factory.d.ts +42 -0
- package/types/router/transition/transition-event-type.d.ts +24 -0
- package/types/router/transition/transition-hook.d.ts +86 -0
- package/types/router/transition/transition-service.d.ts +115 -0
- package/types/router/transition/transition.d.ts +390 -0
- package/types/router/url/url-config.d.ts +100 -0
- package/types/router/url/url-matcher.d.ts +175 -0
- package/types/router/url/url-rule.d.ts +146 -0
- package/types/router/url/url-rules.d.ts +229 -0
- package/types/router/url/url-service.d.ts +278 -0
- package/types/router/view/view.d.ts +137 -0
- package/types/router/view-scroll.d.ts +5 -0
- package/types/services/anchor-scroll.d.ts +11 -0
- package/types/services/browser.d.ts +150 -0
- package/types/services/cache-factory.d.ts +143 -0
- package/types/services/cookie-reader.d.ts +17 -0
- package/types/services/document.d.ts +38 -0
- package/types/services/http-backend.d.ts +78 -0
- package/types/services/http.d.ts +157 -0
- package/types/services/log.d.ts +63 -0
- package/types/services/template-request.d.ts +69 -0
- package/types/shared/common.d.ts +216 -0
- package/types/shared/hof.d.ts +131 -0
- package/types/shared/predicates.d.ts +15 -0
- package/types/shared/strings.d.ts +55 -0
- package/types/shared/utils.d.ts +630 -0
- package/types-back/README.md +2 -0
- package/{types → types-back}/index.d.ts +17 -12
- package/types-back/router/index.d.ts +17 -0
- package/types-back/router/services.d.ts +15 -0
- package/e2e/unit.spec.ts +0 -16
- package/public/my_other_directive.html +0 -1
- package/src/directive/if.md +0 -80
- package/test/build-test.html +0 -14
- package/test/mock-test.html +0 -13
- package/test/module-test.html +0 -58
- /package/{test → public}/jasmine/jasmine-5.1.2/boot0.js +0 -0
- /package/{test → public}/jasmine/jasmine-5.1.2/boot1.js +0 -0
- /package/{test → public}/jasmine/jasmine-5.1.2/jasmine-html.js +0 -0
- /package/{test → public}/jasmine/jasmine-5.1.2/jasmine.css +0 -0
- /package/{test → public}/jasmine/jasmine-5.1.2/jasmine.js +0 -0
- /package/{test → public}/jasmine/jasmine-5.1.2/jasmine_favicon.png +0 -0
- /package/{test → public}/jasmine/jasmine-browser.json +0 -0
- /package/{test → public}/jasmine/jasmine.json +0 -0
- /package/public/{README.md → public/README.md} +0 -0
- /package/public/{circle.html → public/circle.html} +0 -0
- /package/public/{my_child_directive.html → public/my_child_directive.html} +0 -0
- /package/public/{my_directive.html → public/my_directive.html} +0 -0
- /package/public/{test.html → public/test.html} +0 -0
- /package/src/core/{animate-css.js → animate/animate-css.js} +0 -0
- /package/src/core/{cache.js → cache/cache.js} +0 -0
- /package/src/core/{compile.md → compile/compile.md} +0 -0
- /package/src/core/{filter.md → filter/filter.md} +0 -0
- /package/src/core/{interval.md → interval/interval.md} +0 -0
- /package/src/core/{pubsub.js → pubsub/pubsub.js} +0 -0
- /package/src/directive/{bind.md → bind/bind.md} +0 -0
- /package/src/directive/{change.js → change/change.js} +0 -0
- /package/src/directive/{change.md → change/change.md} +0 -0
- /package/src/directive/{cloak.js → cloak/cloak.js} +0 -0
- /package/src/directive/{cloak.md → cloak/cloak.md} +0 -0
- /package/src/directive/{controller.js → controller/controller.js} +0 -0
- /package/src/directive/{controller.md → controller/controller.md} +0 -0
- /package/src/directive/{events.md → events/events.md} +0 -0
- /package/src/directive/{include.md → include/include.md} +0 -0
- /package/src/directive/{init.js → init/init.js} +0 -0
- /package/src/directive/{init.md → init/init.md} +0 -0
- /package/src/directive/{list.md → list/list.md} +0 -0
- /package/src/directive/{non-bindable.js → non-bindable/non-bindable.js} +0 -0
- /package/src/directive/{non-bindable.md → non-bindable/non-bindable.md} +0 -0
- /package/src/directive/{repeat.md → repeat/repeat.md} +0 -0
- /package/src/directive/{script.js → script/script.js} +0 -0
- /package/src/directive/{show-hide.js → show-hide/show-hide.js} +0 -0
- /package/src/directive/{style.js → style/style.js} +0 -0
- /package/src/directive/{style.md → style/style.md} +0 -0
- /package/src/directive/{switch.md → switch/switch.md} +0 -0
- /package/src/exts/{messages.md → messages/messages.md} +0 -0
- /package/{test/module-test.js → src/services/http/http.html} +0 -0
- /package/src/{constants.js → shared/constants.js} +0 -0
- /package/{types → types-back}/angular.d.ts +0 -0
- /package/{types → types-back}/global.d.ts +0 -0
- /package/{types → types-back}/jqlite.d.ts +0 -0
- /package/{types → types-back}/router/core/common/common.d.ts +0 -0
- /package/{types → types-back}/router/core/common/coreservices.d.ts +0 -0
- /package/{types → types-back}/router/core/common/glob.d.ts +0 -0
- /package/{types → types-back}/router/core/common/hof.d.ts +0 -0
- /package/{types → types-back}/router/core/common/index.d.ts +0 -0
- /package/{types → types-back}/router/core/common/predicates.d.ts +0 -0
- /package/{types → types-back}/router/core/common/queue.d.ts +0 -0
- /package/{types → types-back}/router/core/common/safeConsole.d.ts +0 -0
- /package/{types → types-back}/router/core/common/strings.d.ts +0 -0
- /package/{types → types-back}/router/core/common/trace.d.ts +0 -0
- /package/{types → types-back}/router/core/globals.d.ts +0 -0
- /package/{types → types-back}/router/core/hooks/coreResolvables.d.ts +0 -0
- /package/{types → types-back}/router/core/hooks/ignoredTransition.d.ts +0 -0
- /package/{types → types-back}/router/core/hooks/invalidTransition.d.ts +0 -0
- /package/{types → types-back}/router/core/hooks/lazyLoad.d.ts +0 -0
- /package/{types → types-back}/router/core/hooks/onEnterExitRetain.d.ts +0 -0
- /package/{types → types-back}/router/core/hooks/redirectTo.d.ts +0 -0
- /package/{types → types-back}/router/core/hooks/resolve.d.ts +0 -0
- /package/{types → types-back}/router/core/hooks/updateGlobals.d.ts +0 -0
- /package/{types → types-back}/router/core/hooks/url.d.ts +0 -0
- /package/{types → types-back}/router/core/hooks/views.d.ts +0 -0
- /package/{types → types-back}/router/core/index.d.ts +0 -0
- /package/{types → types-back}/router/core/interface.d.ts +0 -0
- /package/{types → types-back}/router/core/params/index.d.ts +0 -0
- /package/{types → types-back}/router/core/params/interface.d.ts +0 -0
- /package/{types → types-back}/router/core/params/param.d.ts +0 -0
- /package/{types → types-back}/router/core/params/paramType.d.ts +0 -0
- /package/{types → types-back}/router/core/params/paramTypes.d.ts +0 -0
- /package/{types → types-back}/router/core/params/stateParams.d.ts +0 -0
- /package/{types → types-back}/router/core/path/index.d.ts +0 -0
- /package/{types → types-back}/router/core/path/pathNode.d.ts +0 -0
- /package/{types → types-back}/router/core/path/pathUtils.d.ts +0 -0
- /package/{types → types-back}/router/core/resolve/index.d.ts +0 -0
- /package/{types → types-back}/router/core/resolve/interface.d.ts +0 -0
- /package/{types → types-back}/router/core/resolve/resolvable.d.ts +0 -0
- /package/{types → types-back}/router/core/resolve/resolveContext.d.ts +0 -0
- /package/{types → types-back}/router/core/router.d.ts +0 -0
- /package/{types → types-back}/router/core/state/index.d.ts +0 -0
- /package/{types → types-back}/router/core/state/interface.d.ts +0 -0
- /package/{types → types-back}/router/core/state/stateBuilder.d.ts +0 -0
- /package/{types → types-back}/router/core/state/stateMatcher.d.ts +0 -0
- /package/{types → types-back}/router/core/state/stateObject.d.ts +0 -0
- /package/{types → types-back}/router/core/state/stateQueueManager.d.ts +0 -0
- /package/{types → types-back}/router/core/state/stateRegistry.d.ts +0 -0
- /package/{types → types-back}/router/core/state/stateService.d.ts +0 -0
- /package/{types → types-back}/router/core/state/targetState.d.ts +0 -0
- /package/{types → types-back}/router/core/transition/hookBuilder.d.ts +0 -0
- /package/{types → types-back}/router/core/transition/hookRegistry.d.ts +0 -0
- /package/{types → types-back}/router/core/transition/index.d.ts +0 -0
- /package/{types → types-back}/router/core/transition/interface.d.ts +0 -0
- /package/{types → types-back}/router/core/transition/rejectFactory.d.ts +0 -0
- /package/{types → types-back}/router/core/transition/transition.d.ts +0 -0
- /package/{types → types-back}/router/core/transition/transitionEventType.d.ts +0 -0
- /package/{types → types-back}/router/core/transition/transitionHook.d.ts +0 -0
- /package/{types → types-back}/router/core/transition/transitionService.d.ts +0 -0
- /package/{types → types-back}/router/core/url/index.d.ts +0 -0
- /package/{types → types-back}/router/core/url/interface.d.ts +0 -0
- /package/{types → types-back}/router/core/url/urlConfig.d.ts +0 -0
- /package/{types → types-back}/router/core/url/urlMatcher.d.ts +0 -0
- /package/{types → types-back}/router/core/url/urlMatcherFactory.d.ts +0 -0
- /package/{types → types-back}/router/core/url/urlRouter.d.ts +0 -0
- /package/{types → types-back}/router/core/url/urlRule.d.ts +0 -0
- /package/{types → types-back}/router/core/url/urlRules.d.ts +0 -0
- /package/{types → types-back}/router/core/url/urlService.d.ts +0 -0
- /package/{types → types-back}/router/core/view/index.d.ts +0 -0
- /package/{types → types-back}/router/core/view/interface.d.ts +0 -0
- /package/{types → types-back}/router/core/view/view.d.ts +0 -0
- /package/{types → types-back}/router/directives/viewDirective.d.ts +0 -0
- /package/{types → types-back}/router/interface.d.ts +0 -0
- /package/{types → types-back}/router/legacy/resolveService.d.ts +0 -0
- /package/{types → types-back}/router/legacy/stateEvents.d.ts +0 -0
- /package/{types → types-back}/router/stateFilters.d.ts +0 -0
- /package/{types → types-back}/router/stateProvider.d.ts +0 -0
- /package/{types → types-back}/router/statebuilders/onEnterExitRetain.d.ts +0 -0
- /package/{types → types-back}/router/statebuilders/views.d.ts +0 -0
- /package/{types → types-back}/router/templateFactory.d.ts +0 -0
- /package/{types → types-back}/router/viewScroll.d.ts +0 -0
- /package/{test/server → utils}/express.js +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @description
|
|
4
|
+
* Private service to sanitize uris for links and images. Used by $compile.
|
|
5
|
+
*/
|
|
6
|
+
export function SanitizeUriProvider(): void;
|
|
7
|
+
export class SanitizeUriProvider {
|
|
8
|
+
/**
|
|
9
|
+
* @description
|
|
10
|
+
* Retrieves or overrides the default regular expression that is used for determining trusted safe
|
|
11
|
+
* urls during a[href] sanitization.
|
|
12
|
+
*
|
|
13
|
+
* The sanitization is a security measure aimed at prevent XSS attacks via HTML anchor links.
|
|
14
|
+
*
|
|
15
|
+
* Any url due to be assigned to an `a[href]` attribute via interpolation is marked as requiring
|
|
16
|
+
* the $sce.URL security context. When interpolation occurs a call is made to `$sce.trustAsUrl(url)`
|
|
17
|
+
* which in turn may call `$$sanitizeUri(url, isMedia)` to sanitize the potentially malicious URL.
|
|
18
|
+
*
|
|
19
|
+
* If the URL matches the `aHrefSanitizationTrustedUrlList` regular expression, it is returned unchanged.
|
|
20
|
+
*
|
|
21
|
+
* If there is no match the URL is returned prefixed with `'unsafe:'` to ensure that when it is written
|
|
22
|
+
* to the DOM it is inactive and potentially malicious code will not be executed.
|
|
23
|
+
*
|
|
24
|
+
* @param {RegExp=} regexp New regexp to trust urls with.
|
|
25
|
+
* @returns {RegExp|ng.ICompileProvider} Current RegExp if called without value or self for
|
|
26
|
+
* chaining otherwise.
|
|
27
|
+
*/
|
|
28
|
+
aHrefSanitizationTrustedUrlList: (
|
|
29
|
+
regexp?: RegExp | undefined,
|
|
30
|
+
) => RegExp | ng.ICompileProvider;
|
|
31
|
+
/**
|
|
32
|
+
* @description
|
|
33
|
+
* Retrieves or overrides the default regular expression that is used for determining trusted safe
|
|
34
|
+
* urls during img[src] sanitization.
|
|
35
|
+
*
|
|
36
|
+
* The sanitization is a security measure aimed at prevent XSS attacks via HTML image src links.
|
|
37
|
+
*
|
|
38
|
+
* Any URL due to be assigned to an `img[src]` attribute via interpolation is marked as requiring
|
|
39
|
+
* the $sce.MEDIA_URL security context. When interpolation occurs a call is made to
|
|
40
|
+
* `$sce.trustAsMediaUrl(url)` which in turn may call `$$sanitizeUri(url, isMedia)` to sanitize
|
|
41
|
+
* the potentially malicious URL.
|
|
42
|
+
*
|
|
43
|
+
* If the URL matches the `imgSrcSanitizationTrustedUrlList` regular expression, it is returned
|
|
44
|
+
* unchanged.
|
|
45
|
+
*
|
|
46
|
+
* If there is no match the URL is returned prefixed with `'unsafe:'` to ensure that when it is written
|
|
47
|
+
* to the DOM it is inactive and potentially malicious code will not be executed.
|
|
48
|
+
*
|
|
49
|
+
* @param {RegExp=} regexp New regexp to trust urls with.
|
|
50
|
+
* @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for
|
|
51
|
+
* chaining otherwise.
|
|
52
|
+
*/
|
|
53
|
+
imgSrcSanitizationTrustedUrlList: (
|
|
54
|
+
regexp?: RegExp | undefined,
|
|
55
|
+
) => RegExp | ng.$compileProvider;
|
|
56
|
+
$get: () => (uri: any, isMediaUrl: any) => any;
|
|
57
|
+
}
|
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
export function escapeForRegexp(s: any): any;
|
|
2
|
+
export function adjustMatcher(matcher: any): any;
|
|
3
|
+
/**
|
|
4
|
+
* @ngdoc service
|
|
5
|
+
* @name $sceDelegate
|
|
6
|
+
* @kind function
|
|
7
|
+
*
|
|
8
|
+
* @description
|
|
9
|
+
*
|
|
10
|
+
* `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict
|
|
11
|
+
* Contextual Escaping (SCE)} services to AngularJS.
|
|
12
|
+
*
|
|
13
|
+
* For an overview of this service and the functionnality it provides in AngularJS, see the main
|
|
14
|
+
* page for {@link ng.$sce SCE}. The current page is targeted for developers who need to alter how
|
|
15
|
+
* SCE works in their application, which shouldn't be needed in most cases.
|
|
16
|
+
*
|
|
17
|
+
* <div class="alert alert-danger">
|
|
18
|
+
* AngularJS strongly relies on contextual escaping for the security of bindings: disabling or
|
|
19
|
+
* modifying this might cause cross site scripting (XSS) vulnerabilities. For libraries owners,
|
|
20
|
+
* changes to this service will also influence users, so be extra careful and document your changes.
|
|
21
|
+
* </div>
|
|
22
|
+
*
|
|
23
|
+
* Typically, you would configure or override the {@link ng.$sceDelegate $sceDelegate} instead of
|
|
24
|
+
* the `$sce` service to customize the way Strict Contextual Escaping works in AngularJS. This is
|
|
25
|
+
* because, while the `$sce` provides numerous shorthand methods, etc., you really only need to
|
|
26
|
+
* override 3 core functions (`trustAs`, `getTrusted` and `valueOf`) to replace the way things
|
|
27
|
+
* work because `$sce` delegates to `$sceDelegate` for these operations.
|
|
28
|
+
*
|
|
29
|
+
* Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} to configure this service.
|
|
30
|
+
*
|
|
31
|
+
* The default instance of `$sceDelegate` should work out of the box with little pain. While you
|
|
32
|
+
* can override it completely to change the behavior of `$sce`, the common case would
|
|
33
|
+
* involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting
|
|
34
|
+
* your own trusted and banned resource lists for trusting URLs used for loading AngularJS resources
|
|
35
|
+
* such as templates. Refer {@link ng.$sceDelegateProvider#trustedResourceUrlList
|
|
36
|
+
* $sceDelegateProvider.trustedResourceUrlList} and {@link
|
|
37
|
+
* ng.$sceDelegateProvider#bannedResourceUrlList $sceDelegateProvider.bannedResourceUrlList}
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* @ngdoc provider
|
|
41
|
+
* @name $sceDelegateProvider
|
|
42
|
+
*
|
|
43
|
+
*
|
|
44
|
+
* @description
|
|
45
|
+
*
|
|
46
|
+
* The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate
|
|
47
|
+
* $sceDelegate service}, used as a delegate for {@link ng.$sce Strict Contextual Escaping (SCE)}.
|
|
48
|
+
*
|
|
49
|
+
* The `$sceDelegateProvider` allows one to get/set the `trustedResourceUrlList` and
|
|
50
|
+
* `bannedResourceUrlList` used to ensure that the URLs used for sourcing AngularJS templates and
|
|
51
|
+
* other script-running URLs are safe (all places that use the `$sce.RESOURCE_URL` context). See
|
|
52
|
+
* {@link ng.$sceDelegateProvider#trustedResourceUrlList
|
|
53
|
+
* $sceDelegateProvider.trustedResourceUrlList} and
|
|
54
|
+
* {@link ng.$sceDelegateProvider#bannedResourceUrlList $sceDelegateProvider.bannedResourceUrlList},
|
|
55
|
+
*
|
|
56
|
+
* For the general details about this service in AngularJS, read the main page for {@link ng.$sce
|
|
57
|
+
* Strict Contextual Escaping (SCE)}.
|
|
58
|
+
*
|
|
59
|
+
* **Example**: Consider the following case. <a name="example"></a>
|
|
60
|
+
*
|
|
61
|
+
* - your app is hosted at url `http://myapp.example.com/`
|
|
62
|
+
* - but some of your templates are hosted on other domains you control such as
|
|
63
|
+
* `http://srv01.assets.example.com/`, `http://srv02.assets.example.com/`, etc.
|
|
64
|
+
* - and you have an open redirect at `http://myapp.example.com/clickThru?...`.
|
|
65
|
+
*
|
|
66
|
+
* Here is what a secure configuration for this scenario might look like:
|
|
67
|
+
*
|
|
68
|
+
* ```
|
|
69
|
+
* angular.module('myApp', []).config(function($sceDelegateProvider) {
|
|
70
|
+
* $sceDelegateProvider.trustedResourceUrlList([
|
|
71
|
+
* // Allow same origin resource loads.
|
|
72
|
+
* 'self',
|
|
73
|
+
* // Allow loading from our assets domain. Notice the difference between * and **.
|
|
74
|
+
* 'http://srv*.assets.example.com/**'
|
|
75
|
+
* ]);
|
|
76
|
+
*
|
|
77
|
+
* // The banned resource URL list overrides the trusted resource URL list so the open redirect
|
|
78
|
+
* // here is blocked.
|
|
79
|
+
* $sceDelegateProvider.bannedResourceUrlList([
|
|
80
|
+
* 'http://myapp.example.com/clickThru**'
|
|
81
|
+
* ]);
|
|
82
|
+
* });
|
|
83
|
+
* ```
|
|
84
|
+
* Note that an empty trusted resource URL list will block every resource URL from being loaded, and will require
|
|
85
|
+
* you to manually mark each one as trusted with `$sce.trustAsResourceUrl`. However, templates
|
|
86
|
+
* requested by {@link ng.$templateRequest $templateRequest} that are present in
|
|
87
|
+
* {@link ng.$templateCache $templateCache} will not go through this check. If you have a mechanism
|
|
88
|
+
* to populate your templates in that cache at config time, then it is a good idea to remove 'self'
|
|
89
|
+
* from the trusted resource URL lsit. This helps to mitigate the security impact of certain types
|
|
90
|
+
* of issues, like for instance attacker-controlled `ng-includes`.
|
|
91
|
+
*/
|
|
92
|
+
export function $SceDelegateProvider(): void;
|
|
93
|
+
export class $SceDelegateProvider {
|
|
94
|
+
SCE_CONTEXTS: {
|
|
95
|
+
HTML: string;
|
|
96
|
+
CSS: string;
|
|
97
|
+
MEDIA_URL: string;
|
|
98
|
+
URL: string;
|
|
99
|
+
RESOURCE_URL: string;
|
|
100
|
+
JS: string;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* @ngdoc method
|
|
104
|
+
* @name $sceDelegateProvider#trustedResourceUrlList
|
|
105
|
+
* @kind function
|
|
106
|
+
*
|
|
107
|
+
* @param {Array=} trustedResourceUrlList When provided, replaces the trustedResourceUrlList with
|
|
108
|
+
* the value provided. This must be an array or null. A snapshot of this array is used so
|
|
109
|
+
* further changes to the array are ignored.
|
|
110
|
+
* Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items
|
|
111
|
+
* allowed in this array.
|
|
112
|
+
*
|
|
113
|
+
* @return {Array} The currently set trusted resource URL array.
|
|
114
|
+
*
|
|
115
|
+
* @description
|
|
116
|
+
* Sets/Gets the list trusted of resource URLs.
|
|
117
|
+
*
|
|
118
|
+
* The **default value** when no `trustedResourceUrlList` has been explicitly set is `['self']`
|
|
119
|
+
* allowing only same origin resource requests.
|
|
120
|
+
*
|
|
121
|
+
* <div class="alert alert-warning">
|
|
122
|
+
* **Note:** the default `trustedResourceUrlList` of 'self' is not recommended if your app shares
|
|
123
|
+
* its origin with other apps! It is a good idea to limit it to only your application's directory.
|
|
124
|
+
* </div>
|
|
125
|
+
*/
|
|
126
|
+
trustedResourceUrlList: (value: any, ...args: any[]) => any[];
|
|
127
|
+
/**
|
|
128
|
+
* @ngdoc method
|
|
129
|
+
* @name $sceDelegateProvider#bannedResourceUrlList
|
|
130
|
+
* @kind function
|
|
131
|
+
*
|
|
132
|
+
* @param {Array=} bannedResourceUrlList When provided, replaces the `bannedResourceUrlList` with
|
|
133
|
+
* the value provided. This must be an array or null. A snapshot of this array is used so
|
|
134
|
+
* further changes to the array are ignored.</p><p>
|
|
135
|
+
* Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items
|
|
136
|
+
* allowed in this array.</p><p>
|
|
137
|
+
* The typical usage for the `bannedResourceUrlList` is to **block
|
|
138
|
+
* [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as
|
|
139
|
+
* these would otherwise be trusted but actually return content from the redirected domain.
|
|
140
|
+
* </p><p>
|
|
141
|
+
* Finally, **the banned resource URL list overrides the trusted resource URL list** and has
|
|
142
|
+
* the final say.
|
|
143
|
+
*
|
|
144
|
+
* @return {Array} The currently set `bannedResourceUrlList` array.
|
|
145
|
+
*
|
|
146
|
+
* @description
|
|
147
|
+
* Sets/Gets the `bannedResourceUrlList` of trusted resource URLs.
|
|
148
|
+
*
|
|
149
|
+
* The **default value** when no trusted resource URL list has been explicitly set is the empty
|
|
150
|
+
* array (i.e. there is no `bannedResourceUrlList`.)
|
|
151
|
+
*/
|
|
152
|
+
bannedResourceUrlList: (value: any, ...args: any[]) => any[];
|
|
153
|
+
$get: (
|
|
154
|
+
| string
|
|
155
|
+
| ((
|
|
156
|
+
$injector: any,
|
|
157
|
+
$$sanitizeUri: any,
|
|
158
|
+
) => {
|
|
159
|
+
trustAs: (type: string, trustedValue: any) => any;
|
|
160
|
+
getTrusted: (type: string, maybeTrusted: any) => any;
|
|
161
|
+
valueOf: (maybeTrusted: any) => any;
|
|
162
|
+
})
|
|
163
|
+
)[];
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* @ngdoc provider
|
|
167
|
+
* @name $sceProvider
|
|
168
|
+
*
|
|
169
|
+
*
|
|
170
|
+
* @description
|
|
171
|
+
*
|
|
172
|
+
* The $sceProvider provider allows developers to configure the {@link ng.$sce $sce} service.
|
|
173
|
+
* - enable/disable Strict Contextual Escaping (SCE) in a module
|
|
174
|
+
* - override the default implementation with a custom delegate
|
|
175
|
+
*
|
|
176
|
+
* Read more about {@link ng.$sce Strict Contextual Escaping (SCE)}.
|
|
177
|
+
*/
|
|
178
|
+
/**
|
|
179
|
+
* @ngdoc service
|
|
180
|
+
* @name $sce
|
|
181
|
+
* @kind function
|
|
182
|
+
*
|
|
183
|
+
* @description
|
|
184
|
+
*
|
|
185
|
+
* `$sce` is a service that provides Strict Contextual Escaping services to AngularJS.
|
|
186
|
+
*
|
|
187
|
+
* ## Strict Contextual Escaping
|
|
188
|
+
*
|
|
189
|
+
* Strict Contextual Escaping (SCE) is a mode in which AngularJS constrains bindings to only render
|
|
190
|
+
* trusted values. Its goal is to assist in writing code in a way that (a) is secure by default, and
|
|
191
|
+
* (b) makes auditing for security vulnerabilities such as XSS, clickjacking, etc. a lot easier.
|
|
192
|
+
*
|
|
193
|
+
* ### Overview
|
|
194
|
+
*
|
|
195
|
+
* To systematically block XSS security bugs, AngularJS treats all values as untrusted by default in
|
|
196
|
+
* HTML or sensitive URL bindings. When binding untrusted values, AngularJS will automatically
|
|
197
|
+
* run security checks on them (sanitizations, trusted URL resource, depending on context), or throw
|
|
198
|
+
* when it cannot guarantee the security of the result. That behavior depends strongly on contexts:
|
|
199
|
+
* HTML can be sanitized, but template URLs cannot, for instance.
|
|
200
|
+
*
|
|
201
|
+
* To illustrate this, consider the `ng-bind-html` directive. It renders its value directly as HTML:
|
|
202
|
+
* we call that the *context*. When given an untrusted input, AngularJS will attempt to sanitize it
|
|
203
|
+
* before rendering if a sanitizer is available, and throw otherwise. To bypass sanitization and
|
|
204
|
+
* render the input as-is, you will need to mark it as trusted for that context before attempting
|
|
205
|
+
* to bind it.
|
|
206
|
+
*
|
|
207
|
+
* As of version 1.2, AngularJS ships with SCE enabled by default.
|
|
208
|
+
*
|
|
209
|
+
* ### In practice
|
|
210
|
+
*
|
|
211
|
+
* Here's an example of a binding in a privileged context:
|
|
212
|
+
*
|
|
213
|
+
* ```
|
|
214
|
+
* <input ng-model="userHtml" aria-label="User input">
|
|
215
|
+
* <div ng-bind-html="userHtml"></div>
|
|
216
|
+
* ```
|
|
217
|
+
*
|
|
218
|
+
* Notice that `ng-bind-html` is bound to `userHtml` controlled by the user. With SCE
|
|
219
|
+
* disabled, this application allows the user to render arbitrary HTML into the DIV, which would
|
|
220
|
+
* be an XSS security bug. In a more realistic example, one may be rendering user comments, blog
|
|
221
|
+
* articles, etc. via bindings. (HTML is just one example of a context where rendering user
|
|
222
|
+
* controlled input creates security vulnerabilities.)
|
|
223
|
+
*
|
|
224
|
+
* For the case of HTML, you might use a library, either on the client side, or on the server side,
|
|
225
|
+
* to sanitize unsafe HTML before binding to the value and rendering it in the document.
|
|
226
|
+
*
|
|
227
|
+
* How would you ensure that every place that used these types of bindings was bound to a value that
|
|
228
|
+
* was sanitized by your library (or returned as safe for rendering by your server?) How can you
|
|
229
|
+
* ensure that you didn't accidentally delete the line that sanitized the value, or renamed some
|
|
230
|
+
* properties/fields and forgot to update the binding to the sanitized value?
|
|
231
|
+
*
|
|
232
|
+
* To be secure by default, AngularJS makes sure bindings go through that sanitization, or
|
|
233
|
+
* any similar validation process, unless there's a good reason to trust the given value in this
|
|
234
|
+
* context. That trust is formalized with a function call. This means that as a developer, you
|
|
235
|
+
* can assume all untrusted bindings are safe. Then, to audit your code for binding security issues,
|
|
236
|
+
* you just need to ensure the values you mark as trusted indeed are safe - because they were
|
|
237
|
+
* received from your server, sanitized by your library, etc. You can organize your codebase to
|
|
238
|
+
* help with this - perhaps allowing only the files in a specific directory to do this.
|
|
239
|
+
* Ensuring that the internal API exposed by that code doesn't markup arbitrary values as safe then
|
|
240
|
+
* becomes a more manageable task.
|
|
241
|
+
*
|
|
242
|
+
* In the case of AngularJS' SCE service, one uses {@link ng.$sce#trustAs $sce.trustAs}
|
|
243
|
+
* (and shorthand methods such as {@link ng.$sce#trustAsHtml $sce.trustAsHtml}, etc.) to
|
|
244
|
+
* build the trusted versions of your values.
|
|
245
|
+
*
|
|
246
|
+
* ### How does it work?
|
|
247
|
+
*
|
|
248
|
+
* In privileged contexts, directives and code will bind to the result of {@link ng.$sce#getTrusted
|
|
249
|
+
* $sce.getTrusted(context, value)} rather than to the value directly. Think of this function as
|
|
250
|
+
* a way to enforce the required security context in your data sink. Directives use {@link
|
|
251
|
+
* ng.$sce#parseAs $sce.parseAs} rather than `$parse` to watch attribute bindings, which performs
|
|
252
|
+
* the {@link ng.$sce#getTrusted $sce.getTrusted} behind the scenes on non-constant literals. Also,
|
|
253
|
+
* when binding without directives, AngularJS will understand the context of your bindings
|
|
254
|
+
* automatically.
|
|
255
|
+
*
|
|
256
|
+
* As an example, {@link ng.directive:ngBindHtml ngBindHtml} uses {@link
|
|
257
|
+
* ng.$sce#parseAsHtml $sce.parseAsHtml(binding expression)}. Here's the actual code (slightly
|
|
258
|
+
* simplified):
|
|
259
|
+
*
|
|
260
|
+
* ```
|
|
261
|
+
* let ngBindHtmlDirective = ['$sce', function($sce) {
|
|
262
|
+
* return function(scope, element, attr) {
|
|
263
|
+
* scope.$watch($sce.parseAsHtml(attr.ngBindHtml), function(value) {
|
|
264
|
+
* element.html(value || '');
|
|
265
|
+
* });
|
|
266
|
+
* };
|
|
267
|
+
* }];
|
|
268
|
+
* ```
|
|
269
|
+
*
|
|
270
|
+
* ### Impact on loading templates
|
|
271
|
+
*
|
|
272
|
+
* This applies both to the {@link ng.directive:ngInclude `ng-include`} directive as well as
|
|
273
|
+
* `templateUrl`'s specified by {@link guide/directive directives}.
|
|
274
|
+
*
|
|
275
|
+
* By default, AngularJS only loads templates from the same domain and protocol as the application
|
|
276
|
+
* document. This is done by calling {@link ng.$sce#getTrustedResourceUrl
|
|
277
|
+
* $sce.getTrustedResourceUrl} on the template URL. To load templates from other domains and/or
|
|
278
|
+
* protocols, you may either add them to the {@link ng.$sceDelegateProvider#trustedResourceUrlList
|
|
279
|
+
* trustedResourceUrlList} or {@link ng.$sce#trustAsResourceUrl wrap them} into trusted values.
|
|
280
|
+
*
|
|
281
|
+
* *Please note*:
|
|
282
|
+
* The browser's
|
|
283
|
+
* [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)
|
|
284
|
+
* and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/)
|
|
285
|
+
* policy apply in addition to this and may further restrict whether the template is successfully
|
|
286
|
+
* loaded. This means that without the right CORS policy, loading templates from a different domain
|
|
287
|
+
* won't work on all browsers. Also, loading templates from `file://` URL does not work on some
|
|
288
|
+
* browsers.
|
|
289
|
+
*
|
|
290
|
+
* ### This feels like too much overhead
|
|
291
|
+
*
|
|
292
|
+
* It's important to remember that SCE only applies to interpolation expressions.
|
|
293
|
+
*
|
|
294
|
+
* If your expressions are constant literals, they're automatically trusted and you don't need to
|
|
295
|
+
* call `$sce.trustAs` on them (e.g.
|
|
296
|
+
* `<div ng-bind-html="'<b>implicitly trusted</b>'"></div>`) just works (remember to include the
|
|
297
|
+
* `ngSanitize` module). The `$sceDelegate` will also use the `$sanitize` service if it is available
|
|
298
|
+
* when binding untrusted values to `$sce.HTML` context.
|
|
299
|
+
* AngularJS provides an implementation in `angular-sanitize.js`, and if you
|
|
300
|
+
* wish to use it, you will also need to depend on the {@link ngSanitize `ngSanitize`} module in
|
|
301
|
+
* your application.
|
|
302
|
+
*
|
|
303
|
+
* The included {@link ng.$sceDelegate $sceDelegate} comes with sane defaults to allow you to load
|
|
304
|
+
* templates in `ng-include` from your application's domain without having to even know about SCE.
|
|
305
|
+
* It blocks loading templates from other domains or loading templates over http from an https
|
|
306
|
+
* served document. You can change these by setting your own custom {@link
|
|
307
|
+
* ng.$sceDelegateProvider#trustedResourceUrlList trusted resource URL list} and {@link
|
|
308
|
+
* ng.$sceDelegateProvider#bannedResourceUrlList banned resource URL list} for matching such URLs.
|
|
309
|
+
*
|
|
310
|
+
* This significantly reduces the overhead. It is far easier to pay the small overhead and have an
|
|
311
|
+
* application that's secure and can be audited to verify that with much more ease than bolting
|
|
312
|
+
* security onto an application later.
|
|
313
|
+
*
|
|
314
|
+
* <a name="contexts"></a>
|
|
315
|
+
* ### What trusted context types are supported?
|
|
316
|
+
*
|
|
317
|
+
* | Context | Notes |
|
|
318
|
+
* |---------------------|----------------|
|
|
319
|
+
* | `$sce.HTML` | For HTML that's safe to source into the application. The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. If an unsafe value is encountered and the {@link ngSanitize $sanitize} module is present this will sanitize the value instead of throwing an error. |
|
|
320
|
+
* | `$sce.CSS` | For CSS that's safe to source into the application. Currently unused. Feel free to use it in your own directives. |
|
|
321
|
+
* | `$sce.MEDIA_URL` | For URLs that are safe to render as media. Is automatically converted from string by sanitizing when needed. |
|
|
322
|
+
* | `$sce.URL` | For URLs that are safe to follow as links. Is automatically converted from string by sanitizing when needed. Note that `$sce.URL` makes a stronger statement about the URL than `$sce.MEDIA_URL` does and therefore contexts requiring values trusted for `$sce.URL` can be used anywhere that values trusted for `$sce.MEDIA_URL` are required.|
|
|
323
|
+
* | `$sce.RESOURCE_URL` | For URLs that are not only safe to follow as links, but whose contents are also safe to include in your application. Examples include `ng-include`, `src` / `ngSrc` bindings for tags other than `IMG` (e.g. `IFRAME`, `OBJECT`, etc.) <br><br>Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` or `$sce.MEDIA_URL` do and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` or `$sce.MEDIA_URL` are required. <br><br> The {@link $sceDelegateProvider#trustedResourceUrlList $sceDelegateProvider#trustedResourceUrlList()} and {@link $sceDelegateProvider#bannedResourceUrlList $sceDelegateProvider#bannedResourceUrlList()} can be used to restrict trusted origins for `RESOURCE_URL` |
|
|
324
|
+
* | `$sce.JS` | For JavaScript that is safe to execute in your application's context. Currently unused. Feel free to use it in your own directives. |
|
|
325
|
+
*
|
|
326
|
+
*
|
|
327
|
+
* <div class="alert alert-warning">
|
|
328
|
+
* Be aware that, before AngularJS 1.7.0, `a[href]` and `img[src]` used to sanitize their
|
|
329
|
+
* interpolated values directly rather than rely upon {@link ng.$sce#getTrusted `$sce.getTrusted`}.
|
|
330
|
+
*
|
|
331
|
+
* **As of 1.7.0, this is no longer the case.**
|
|
332
|
+
*
|
|
333
|
+
* Now such interpolations are marked as requiring `$sce.URL` (for `a[href]`) or `$sce.MEDIA_URL`
|
|
334
|
+
* (for `img[src]`), so that the sanitization happens (via `$sce.getTrusted...`) when the `$interpolate`
|
|
335
|
+
* service evaluates the expressions.
|
|
336
|
+
* </div>
|
|
337
|
+
*
|
|
338
|
+
* There are no CSS or JS context bindings in AngularJS currently, so their corresponding `$sce.trustAs`
|
|
339
|
+
* functions aren't useful yet. This might evolve.
|
|
340
|
+
*
|
|
341
|
+
* ### Format of items in {@link ng.$sceDelegateProvider#trustedResourceUrlList trustedResourceUrlList}/{@link ng.$sceDelegateProvider#bannedResourceUrlList bannedResourceUrlList} <a name="resourceUrlPatternItem"></a>
|
|
342
|
+
*
|
|
343
|
+
* Each element in these arrays must be one of the following:
|
|
344
|
+
*
|
|
345
|
+
* - **'self'**
|
|
346
|
+
* - The special **string**, `'self'`, can be used to match against all URLs of the **same
|
|
347
|
+
* domain** as the application document using the **same protocol**.
|
|
348
|
+
* - **String** (except the special value `'self'`)
|
|
349
|
+
* - The string is matched against the full *normalized / absolute URL* of the resource
|
|
350
|
+
* being tested (substring matches are not good enough.)
|
|
351
|
+
* - There are exactly **two wildcard sequences** - `*` and `**`. All other characters
|
|
352
|
+
* match themselves.
|
|
353
|
+
* - `*`: matches zero or more occurrences of any character other than one of the following 6
|
|
354
|
+
* characters: '`:`', '`/`', '`.`', '`?`', '`&`' and '`;`'. It's a useful wildcard for use
|
|
355
|
+
* for matching resource URL lists.
|
|
356
|
+
* - `**`: matches zero or more occurrences of *any* character. As such, it's not
|
|
357
|
+
* appropriate for use in a scheme, domain, etc. as it would match too much. (e.g.
|
|
358
|
+
* http://**.example.com/ would match http://evil.com/?ignore=.example.com/ and that might
|
|
359
|
+
* not have been the intention.) Its usage at the very end of the path is ok. (e.g.
|
|
360
|
+
* http://foo.example.com/templates/**).
|
|
361
|
+
* - **RegExp** (*see caveat below*)
|
|
362
|
+
* - *Caveat*: While regular expressions are powerful and offer great flexibility, their syntax
|
|
363
|
+
* (and all the inevitable escaping) makes them *harder to maintain*. It's easy to
|
|
364
|
+
* accidentally introduce a bug when one updates a complex expression (imho, all regexes should
|
|
365
|
+
* have good test coverage). For instance, the use of `.` in the regex is correct only in a
|
|
366
|
+
* small number of cases. A `.` character in the regex used when matching the scheme or a
|
|
367
|
+
* subdomain could be matched against a `:` or literal `.` that was likely not intended. It
|
|
368
|
+
* is highly recommended to use the string patterns and only fall back to regular expressions
|
|
369
|
+
* as a last resort.
|
|
370
|
+
* - The regular expression must be an instance of RegExp (i.e. not a string.) It is
|
|
371
|
+
* matched against the **entire** *normalized / absolute URL* of the resource being tested
|
|
372
|
+
* (even when the RegExp did not have the `^` and `$` codes.) In addition, any flags
|
|
373
|
+
* present on the RegExp (such as multiline, global, ignoreCase) are ignored.
|
|
374
|
+
* - If you are generating your JavaScript from some other templating engine (not
|
|
375
|
+
* recommended, e.g. in issue [#4006](https://github.com/angular/angular.js/issues/4006)),
|
|
376
|
+
* remember to escape your regular expression (and be aware that you might need more than
|
|
377
|
+
* one level of escaping depending on your templating engine and the way you interpolated
|
|
378
|
+
* the value.) Do make use of your platform's escaping mechanism as it might be good
|
|
379
|
+
* enough before coding your own. E.g. Ruby has
|
|
380
|
+
* [Regexp.escape(str)](http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-c-escape)
|
|
381
|
+
* and Python has [re.escape](http://docs.python.org/library/re.html#re.escape).
|
|
382
|
+
* Javascript lacks a similar built in function for escaping. Take a look at Google
|
|
383
|
+
* Closure library's [goog.string.regExpEscape(s)](
|
|
384
|
+
* http://docs.closure-library.googlecode.com/git/closure_goog_string_string.js.source.html#line962).
|
|
385
|
+
*
|
|
386
|
+
* Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} for an example.
|
|
387
|
+
*
|
|
388
|
+
*
|
|
389
|
+
* ## Can I disable SCE completely?
|
|
390
|
+
*
|
|
391
|
+
* Yes, you can. However, this is strongly discouraged. SCE gives you a lot of security benefits
|
|
392
|
+
* for little coding overhead. It will be much harder to take an SCE disabled application and
|
|
393
|
+
* either secure it on your own or enable SCE at a later stage. It might make sense to disable SCE
|
|
394
|
+
* for cases where you have a lot of existing code that was written before SCE was introduced and
|
|
395
|
+
* you're migrating them a module at a time. Also do note that this is an app-wide setting, so if
|
|
396
|
+
* you are writing a library, you will cause security bugs applications using it.
|
|
397
|
+
*
|
|
398
|
+
* That said, here's how you can completely disable SCE:
|
|
399
|
+
*
|
|
400
|
+
* ```
|
|
401
|
+
* angular.module('myAppWithSceDisabledmyApp', []).config(function($sceProvider) {
|
|
402
|
+
* // Completely disable SCE. For demonstration purposes only!
|
|
403
|
+
* // Do not use in new projects or libraries.
|
|
404
|
+
* $sceProvider.enabled(false);
|
|
405
|
+
* });
|
|
406
|
+
* ```
|
|
407
|
+
*
|
|
408
|
+
*/
|
|
409
|
+
export function $SceProvider(): void;
|
|
410
|
+
export class $SceProvider {
|
|
411
|
+
/**
|
|
412
|
+
* @ngdoc method
|
|
413
|
+
* @name $sceProvider#enabled
|
|
414
|
+
* @kind function
|
|
415
|
+
*
|
|
416
|
+
* @param {boolean=} value If provided, then enables/disables SCE application-wide.
|
|
417
|
+
* @return {boolean} True if SCE is enabled, false otherwise.
|
|
418
|
+
*
|
|
419
|
+
* @description
|
|
420
|
+
* Enables/disables SCE and returns the current value.
|
|
421
|
+
*/
|
|
422
|
+
enabled: (value?: boolean | undefined, ...args: any[]) => boolean;
|
|
423
|
+
$get: (string | (($parse: any, $sceDelegate: any) => any))[];
|
|
424
|
+
}
|
|
425
|
+
export namespace SCE_CONTEXTS {
|
|
426
|
+
let HTML: string;
|
|
427
|
+
let CSS: string;
|
|
428
|
+
let MEDIA_URL: string;
|
|
429
|
+
let URL: string;
|
|
430
|
+
let RESOURCE_URL: string;
|
|
431
|
+
let JS: string;
|
|
432
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ! This is a private undocumented service !
|
|
3
|
+
*
|
|
4
|
+
* @name $$taskTrackerFactory
|
|
5
|
+
* @description
|
|
6
|
+
* A function to create `TaskTracker` instances.
|
|
7
|
+
*
|
|
8
|
+
* A `TaskTracker` can keep track of pending tasks (grouped by type) and can notify interested
|
|
9
|
+
* parties when all pending tasks (or tasks of a specific type) have been completed.
|
|
10
|
+
*
|
|
11
|
+
* @param {$log} log - A logger instance (such as `$log`). Used to log error during callback
|
|
12
|
+
* execution.
|
|
13
|
+
*
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
export function $$TaskTrackerFactoryProvider(): void;
|
|
17
|
+
export class $$TaskTrackerFactoryProvider {
|
|
18
|
+
$get: () => any;
|
|
19
|
+
}
|
|
20
|
+
export function TaskTracker(log: any): void;
|
|
21
|
+
export class TaskTracker {
|
|
22
|
+
constructor(log: any);
|
|
23
|
+
ALL_TASKS_TYPE: string;
|
|
24
|
+
DEFAULT_TASK_TYPE: string;
|
|
25
|
+
/**
|
|
26
|
+
* Execute the specified function and decrement the appropriate `taskCounts` counter.
|
|
27
|
+
* If the counter reaches 0, all corresponding `taskCallbacks` are executed.
|
|
28
|
+
*
|
|
29
|
+
* @param {Function} fn - The function to execute.
|
|
30
|
+
* @param {string=} [taskType=DEFAULT_TASK_TYPE] - The type of task that is being completed.
|
|
31
|
+
*/
|
|
32
|
+
completeTask: (fn: any, taskType: any) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Increase the task count for the specified task type (or the default task type if non is
|
|
35
|
+
* specified).
|
|
36
|
+
*
|
|
37
|
+
* @param {string=} [taskType=DEFAULT_TASK_TYPE] - The type of task whose count will be increased.
|
|
38
|
+
*/
|
|
39
|
+
incTaskCount: (taskType: any) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Execute the specified callback when all pending tasks have been completed.
|
|
42
|
+
*
|
|
43
|
+
* If there are no pending tasks, the callback is executed immediately. You can optionally limit
|
|
44
|
+
* the tasks that will be waited for to a specific type, by passing a `taskType`.
|
|
45
|
+
*
|
|
46
|
+
* @param {function} callback - The function to call when there are no pending tasks.
|
|
47
|
+
* @param {string=} [taskType=ALL_TASKS_TYPE] - The type of tasks that will be waited for.
|
|
48
|
+
*/
|
|
49
|
+
notifyWhenNoPendingTasks: (callback: any, taskType: any) => void;
|
|
50
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function $timeout(
|
|
2
|
+
$rootScope: any,
|
|
3
|
+
$browser: any,
|
|
4
|
+
$q: any,
|
|
5
|
+
$$q: any,
|
|
6
|
+
$exceptionHandler: any,
|
|
7
|
+
): {
|
|
8
|
+
(
|
|
9
|
+
fn?: (() => any) | undefined,
|
|
10
|
+
delay?: number | undefined,
|
|
11
|
+
invokeApply?: boolean | undefined,
|
|
12
|
+
...args: any[]
|
|
13
|
+
): Promise<any>;
|
|
14
|
+
/**
|
|
15
|
+
* @ngdoc method
|
|
16
|
+
* @name $timeout#cancel
|
|
17
|
+
*
|
|
18
|
+
* @description
|
|
19
|
+
* Cancels a task associated with the `promise`. As a result of this, the promise will be
|
|
20
|
+
* resolved with a rejection.
|
|
21
|
+
*
|
|
22
|
+
* @param {Promise=} promise Promise returned by the `$timeout` function.
|
|
23
|
+
* @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully
|
|
24
|
+
* canceled.
|
|
25
|
+
*/
|
|
26
|
+
cancel(promise?: Promise<any> | undefined): boolean;
|
|
27
|
+
};
|
|
28
|
+
export function $TimeoutProvider(): void;
|
|
29
|
+
export class $TimeoutProvider {
|
|
30
|
+
$get: (string | typeof $timeout)[];
|
|
31
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Implementation Notes for non-IE browsers
|
|
4
|
+
* ----------------------------------------
|
|
5
|
+
* Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM,
|
|
6
|
+
* results both in the normalizing and parsing of the URL. Normalizing means that a relative
|
|
7
|
+
* URL will be resolved into an absolute URL in the context of the application document.
|
|
8
|
+
* Parsing means that the anchor node's host, hostname, protocol, port, pathname and related
|
|
9
|
+
* properties are all populated to reflect the normalized URL. This approach has wide
|
|
10
|
+
* compatibility - Safari 1+, Mozilla 1+ etc. See
|
|
11
|
+
* http://www.aptana.com/reference/html/api/HTMLAnchorElement.html
|
|
12
|
+
*
|
|
13
|
+
* Implementation Notes for IE
|
|
14
|
+
* ---------------------------
|
|
15
|
+
* IE <= 10 normalizes the URL when assigned to the anchor node similar to the other
|
|
16
|
+
* browsers. However, the parsed components will not be set if the URL assigned did not specify
|
|
17
|
+
* them. (e.g. if you assign a.href = "foo", then a.protocol, a.host, etc. will be empty.) We
|
|
18
|
+
* work around that by performing the parsing in a 2nd step by taking a previously normalized
|
|
19
|
+
* URL (e.g. by assigning to a.href) and assigning it a.href again. This correctly populates the
|
|
20
|
+
* properties such as protocol, hostname, port, etc.
|
|
21
|
+
*
|
|
22
|
+
* References:
|
|
23
|
+
* http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement
|
|
24
|
+
* http://www.aptana.com/reference/html/api/HTMLAnchorElement.html
|
|
25
|
+
* http://url.spec.whatwg.org/#urlutils
|
|
26
|
+
* https://github.com/angular/angular.js/pull/2902
|
|
27
|
+
* http://james.padolsey.com/javascript/parsing-urls-with-the-dom/
|
|
28
|
+
*
|
|
29
|
+
* @kind function
|
|
30
|
+
* @param {string|object} url The URL to be parsed. If `url` is not a string, it will be returned
|
|
31
|
+
* unchanged.
|
|
32
|
+
* @description Normalizes and parses a URL.
|
|
33
|
+
* @returns {object} Returns the normalized URL as a dictionary.
|
|
34
|
+
*
|
|
35
|
+
* | member name | Description |
|
|
36
|
+
* |---------------|------------------------------------------------------------------------|
|
|
37
|
+
* | href | A normalized version of the provided URL if it was not an absolute URL |
|
|
38
|
+
* | protocol | The protocol without the trailing colon |
|
|
39
|
+
* | host | The host and port (if the port is non-default) of the normalizedUrl |
|
|
40
|
+
* | search | The search params, minus the question mark |
|
|
41
|
+
* | hash | The hash string, minus the hash symbol |
|
|
42
|
+
* | hostname | The hostname |
|
|
43
|
+
* | port | The port, without ":" |
|
|
44
|
+
* | pathname | The pathname, beginning with "/" |
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
export function urlResolve(url: string | object): object;
|
|
48
|
+
/**
|
|
49
|
+
* Parse a request URL and determine whether this is a same-origin request as the application
|
|
50
|
+
* document.
|
|
51
|
+
*
|
|
52
|
+
* @param {string|object} requestUrl The url of the request as a string that will be resolved
|
|
53
|
+
* or a parsed URL object.
|
|
54
|
+
* @returns {boolean} Whether the request is for the same origin as the application document.
|
|
55
|
+
*/
|
|
56
|
+
export function urlIsSameOrigin(requestUrl: string | object): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Parse a request URL and determine whether it is same-origin as the current document base URL.
|
|
59
|
+
*
|
|
60
|
+
* Note: The base URL is usually the same as the document location (`location.href`) but can
|
|
61
|
+
* be overriden by using the `<base>` tag.
|
|
62
|
+
*
|
|
63
|
+
* @param {string|object} requestUrl The url of the request as a string that will be resolved
|
|
64
|
+
* or a parsed URL object.
|
|
65
|
+
* @returns {boolean} Whether the URL is same-origin as the document base URL.
|
|
66
|
+
*/
|
|
67
|
+
export function urlIsSameOriginAsBaseUrl(requestUrl: string | object): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Create a function that can check a URL's origin against a list of allowed/trusted origins.
|
|
70
|
+
* The current location's origin is implicitly trusted.
|
|
71
|
+
*
|
|
72
|
+
* @param {string[]} trustedOriginUrls - A list of URLs (strings), whose origins are trusted.
|
|
73
|
+
*
|
|
74
|
+
* @returns {Function} - A function that receives a URL (string or parsed URL object) and returns
|
|
75
|
+
* whether it is of an allowed origin.
|
|
76
|
+
*/
|
|
77
|
+
export function urlIsAllowedOriginFactory(
|
|
78
|
+
trustedOriginUrls: string[],
|
|
79
|
+
): Function;
|
|
80
|
+
/**
|
|
81
|
+
* Determine if two URLs share the same origin.
|
|
82
|
+
*
|
|
83
|
+
* @param {string|Object} url1 - First URL to compare as a string or a normalized URL in the form of
|
|
84
|
+
* a dictionary object returned by `urlResolve()`.
|
|
85
|
+
* @param {string|object} url2 - Second URL to compare as a string or a normalized URL in the form
|
|
86
|
+
* of a dictionary object returned by `urlResolve()`.
|
|
87
|
+
*
|
|
88
|
+
* @returns {boolean} - True if both URLs have the same origin, and false otherwise.
|
|
89
|
+
*/
|
|
90
|
+
export function urlsAreSameOrigin(
|
|
91
|
+
url1: string | any,
|
|
92
|
+
url2: string | object,
|
|
93
|
+
): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Returns the current document base URL.
|
|
96
|
+
* @returns {string}
|
|
97
|
+
*/
|
|
98
|
+
export function getBaseUrl(): string;
|