-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
import { FilledLinkToDocumentField } from "@prismicio/types"; | ||
import type { FilledLinkToDocumentField } from "@prismicio/types"; | ||
|
||
/** | ||
* Resolves a link to a Prismic document to a URL | ||
* | ||
* @param linkToDocumentField - A document link field to resolve | ||
* | ||
* @returns Resolved URL | ||
* | ||
* @typeParam ReturnType - Return type of your link resolver function, useful if you prefer to return a complex object | ||
* | ||
* @see Prismic link resolver documentation: {@link https://prismic.io/docs/technologies/link-resolver-javascript} | ||
*/ | ||
export type LinkResolverFunction<ReturnType = string> = ( | ||
doc: Omit<FilledLinkToDocumentField, "url"> | ||
linkToDocumentField: Omit<FilledLinkToDocumentField, "url"> | ||
) => ReturnType; |