From 4ab6a42082e768b4eafb2b0692220595b8f4feba Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Fri, 12 Jun 2020 10:02:10 -0700 Subject: [PATCH] Restore syntax highlights in declaration blocks --- docs/api-reference.md | 96 +++++++++++++++++++++---------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/docs/api-reference.md b/docs/api-reference.md index 7ec86f753..df38ba01e 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -79,22 +79,22 @@ See [the Getting Started guide](getting-started.md) for more information. ### `createBrowserHistory` -
+```tsx
 declare createBrowserHistory({ window?: Window }): BrowserHistory;
 
-interface BrowserHistory<S extends State = State> {
-  readonly action: Action;
-  readonly location: Location<S>;
-  createHref(to: To): string;
-  push(to: To, state?: S): void;
-  replace(to: To, state?: S): void;
-  go(n: number): void;
-  back(): void;
-  forward(): void;
-  listen(listener: Listener<S>): () => void;
-  block(blocker: Blocker<S>): () => void;
+interface BrowserHistory {
+  readonly action: Action;
+  readonly location: Location;
+  createHref(to: To): string;
+  push(to: To, state?: S): void;
+  replace(to: To, state?: S): void;
+  go(n: number): void;
+  back(): void;
+  forward(): void;
+  listen(listener: Listener): () => void;
+  block(blocker: Blocker): () => void;
 }
-
+``` A browser history object keeps track of the browsing history of an application using the browser's built-in history stack. It is designed to run in modern web browsers that support the HTML5 history interface including `pushState`, `replaceState`, and the `popstate` event. @@ -131,22 +131,22 @@ interface PartialPath { ### `createHashHistory` -
+```ts
 declare createHashHistory({ window?: Window }): HashHistory;
 
-interface HashHistory<S extends State = State> {
-  readonly action: Action;
-  readonly location: Location<S>;
-  createHref(to: To): string;
-  push(to: To, state?: S): void;
-  replace(to: To, state?: S): void;
-  go(n: number): void;
-  back(): void;
-  forward(): void;
-  listen(listener: Listener<S>): () => void;
-  block(blocker: Blocker<S>): () => void;
+interface HashHistory {
+  readonly action: Action;
+  readonly location: Location;
+  createHref(to: To): string;
+  push(to: To, state?: S): void;
+  replace(to: To, state?: S): void;
+  go(n: number): void;
+  back(): void;
+  forward(): void;
+  listen(listener: Listener): () => void;
+  block(blocker: Blocker): () => void;
 }
-
+``` A hash history object keeps track of the browsing history of an application using the browser's built-in history stack. It is designed to be run in modern web browsers that support the HTML5 history interface including `pushState`, `replaceState`, and the `popstate` event. @@ -166,7 +166,7 @@ See [the Getting Started guide](getting-started.md) for more information. ### `createMemoryHistory` -
+```ts
 declare createMemoryHistory({
   initialEntries?: InitialEntry[],
   initialIndex?: number
@@ -174,20 +174,20 @@ declare createMemoryHistory({
 
 type InitialEntry = string | PartialLocation;
 
-interface MemoryHistory<S extends State = State> {
-  readonly index: number;
-  readonly action: Action;
-  readonly location: Location<S>;
-  createHref(to: To): string;
-  push(to: To, state?: S): void;
-  replace(to: To, state?: S): void;
-  go(n: number): void;
-  back(): void;
-  forward(): void;
-  listen(listener: Listener<S>): () => void;
-  block(blocker: Blocker<S>): () => void;
+interface MemoryHistory {
+  readonly index: number;
+  readonly action: Action;
+  readonly location: Location;
+  createHref(to: To): string;
+  push(to: To, state?: S): void;
+  replace(to: To, state?: S): void;
+  go(n: number): void;
+  back(): void;
+  forward(): void;
+  listen(listener: Listener): () => void;
+  block(blocker: Blocker): () => void;
 }
-
+``` A memory history object keeps track of the browsing history of an application using an internal array. This makes it ideal in situations where you need complete control over the history stack, like React Native and tests. @@ -340,15 +340,15 @@ See [the Navigation guide](navigation.md) for more information. ### Location -
-interface Location<S extends State = State> {
-  pathname: string;
-  search: string;
-  hash: string;
-  state: S;
-  key: string;
+```ts
+interface Location {
+  pathname: string;
+  search: string;
+  hash: string;
+  state: S;
+  key: string;
 }
-
+``` A `location` is a particular entry in the history stack, usually analogous to a "page" or "screen" in your app. As the user clicks on links and moves around the app, the current location changes.