|
| 1 | +/** |
| 2 | + * The location (URL) of the object it is linked to. Changes done on it are reflected on the object it relates to. |
| 3 | + * Both the Document and Window interface have such a linked Location, accessible via Document.location and Window.location respectively. |
| 4 | + * |
| 5 | + * Copy Location interface so that user's dont have to include dom typings with Tracing integration |
| 6 | + * Based on https://github.com/microsoft/TypeScript/blob/4cf0afe2662980ebcd8d444dbd13d8f47d06fcd5/lib/lib.dom.d.ts#L9691 |
| 7 | + */ |
| 8 | +export interface Location { |
| 9 | + /** |
| 10 | + * Returns a DOMStringList object listing the origins of the ancestor browsing contexts, from the parent browsing context to the top-level browsing context. |
| 11 | + */ |
| 12 | + readonly ancestorOrigins: DOMStringList; |
| 13 | + /** |
| 14 | + * Returns the Location object's URL's fragment (includes leading "#" if non-empty). |
| 15 | + * |
| 16 | + * Can be set, to navigate to the same URL with a changed fragment (ignores leading "#"). |
| 17 | + */ |
| 18 | + hash: string; |
| 19 | + /** |
| 20 | + * Returns the Location object's URL's host and port (if different from the default port for the scheme). |
| 21 | + * |
| 22 | + * Can be set, to navigate to the same URL with a changed host and port. |
| 23 | + */ |
| 24 | + host: string; |
| 25 | + /** |
| 26 | + * Returns the Location object's URL's host. |
| 27 | + * |
| 28 | + * Can be set, to navigate to the same URL with a changed host. |
| 29 | + */ |
| 30 | + hostname: string; |
| 31 | + /** |
| 32 | + * Returns the Location object's URL. |
| 33 | + * |
| 34 | + * Can be set, to navigate to the given URL. |
| 35 | + */ |
| 36 | + href: string; |
| 37 | + // tslint:disable-next-line: completed-docs |
| 38 | + toString(): string; |
| 39 | + /** |
| 40 | + * Returns the Location object's URL's origin. |
| 41 | + */ |
| 42 | + readonly origin: string; |
| 43 | + /** |
| 44 | + * Returns the Location object's URL's path. |
| 45 | + * |
| 46 | + * Can be set, to navigate to the same URL with a changed path. |
| 47 | + */ |
| 48 | + pathname: string; |
| 49 | + /** |
| 50 | + * Returns the Location object's URL's port. |
| 51 | + * |
| 52 | + * Can be set, to navigate to the same URL with a changed port. |
| 53 | + */ |
| 54 | + port: string; |
| 55 | + /** |
| 56 | + * Returns the Location object's URL's scheme. |
| 57 | + * |
| 58 | + * Can be set, to navigate to the same URL with a changed scheme. |
| 59 | + */ |
| 60 | + protocol: string; |
| 61 | + /** |
| 62 | + * Returns the Location object's URL's query (includes leading "?" if non-empty). |
| 63 | + * |
| 64 | + * Can be set, to navigate to the same URL with a changed query (ignores leading "?"). |
| 65 | + */ |
| 66 | + search: string; |
| 67 | + /** |
| 68 | + * Navigates to the given URL. |
| 69 | + */ |
| 70 | + assign(url: string): void; |
| 71 | + /** |
| 72 | + * Reloads the current page. |
| 73 | + */ |
| 74 | + reload(): void; |
| 75 | + /** @deprecated */ |
| 76 | + // tslint:disable-next-line: unified-signatures completed-docs |
| 77 | + reload(forcedReload: boolean): void; |
| 78 | + /** |
| 79 | + * Removes the current page from the session history and navigates to the given URL. |
| 80 | + */ |
| 81 | + replace(url: string): void; |
| 82 | +} |
0 commit comments