Skip to content

Commit

Permalink
fix: update Prismic terms to use the latest language style (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloashmore authored May 16, 2023
1 parent 3cd9ea5 commit 1fce99c
Show file tree
Hide file tree
Showing 73 changed files with 300 additions and 262 deletions.
8 changes: 4 additions & 4 deletions src/buildQueryURL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export interface Ordering {
*/
export interface Route {
/**
* The Custom Type of the document.
* The custom type of the document.
*/
type: string;

Expand Down Expand Up @@ -184,8 +184,8 @@ export interface QueryParams {

/**
* The `brokenRoute` option allows you to define the route populated in the
* `url` property for broken Link or Content Relationship fields. A broken
* link is a Link or Content Relationship field whose linked document has been
* `url` property for broken link or content relationship fields. A broken
* link is a link or content relationship field whose linked document has been
* unpublished or deleted.
*
* {@link https://prismic.io/docs/route-resolver}
Expand All @@ -205,7 +205,7 @@ type BuildQueryURLParams = {
ref: string;

/**
* Ref used to populate Integration Fields with the latest content.
* Ref used to populate integration fields with the latest content.
*
* {@link https://prismic.io/docs/integration-fields}
*/
Expand Down
52 changes: 26 additions & 26 deletions src/createClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export type ClientConfig = {
ref?: RefStringOrThunk;

/**
* A list of Route Resolver objects that define how a document's `url` field
* A list of Route Resolver objects that define how a document's `url` property
* is resolved.
*
* {@link https://prismic.io/docs/route-resolver}
Expand All @@ -243,8 +243,8 @@ export type ClientConfig = {

/**
* The `brokenRoute` option allows you to define the route populated in the
* `url` property for broken Link or Content Relationship fields. A broken
* link is a Link or Content Relationship field whose linked document has been
* `url` property for broken link or content relationship fields. A broken
* link is a link or content relationship field whose linked document has been
* unpublished or deleted.
*
* {@link https://prismic.io/docs/route-resolver}
Expand Down Expand Up @@ -424,8 +424,8 @@ export class Client<TDocuments extends PrismicDocument = PrismicDocument> {

/**
* The `brokenRoute` option allows you to define the route populated in the
* `url` property for broken Link or Content Relationship fields. A broken
* link is a Link or Content Relationship field whose linked document has been
* `url` property for broken link or content relationship fields. A broken
* link is a link or content relationship field whose linked document has been
* unpublished or deleted.
*
* {@link https://prismic.io/docs/route-resolver}
Expand Down Expand Up @@ -735,7 +735,7 @@ export class Client<TDocuments extends PrismicDocument = PrismicDocument> {
* A document's UID is different from its ID. An ID is automatically generated
* for all documents and is made available on its `id` property. A UID is
* provided in the Prismic editor and is unique among all documents of its
* Custom Type.
* custom type.
* @example
*
* ```ts
Expand Down Expand Up @@ -765,7 +765,7 @@ export class Client<TDocuments extends PrismicDocument = PrismicDocument> {
* A document's UID is different from its ID. An ID is automatically generated
* for all documents and is made available on its `id` property. A UID is
* provided in the Prismic editor and is unique among all documents of its
* Custom Type.
* custom type.
* @example
*
* ```ts
Expand Down Expand Up @@ -801,7 +801,7 @@ export class Client<TDocuments extends PrismicDocument = PrismicDocument> {
* A document's UID is different from its ID. An ID is automatically generated
* for all documents and is made available on its `id` property. A UID is
* provided in the Prismic editor and is unique among all documents of its
* Custom Type.
* custom type.
* @example
*
* ```ts
Expand All @@ -828,21 +828,21 @@ export class Client<TDocuments extends PrismicDocument = PrismicDocument> {

/**
* Queries a document from the Prismic repository with a specific UID and
* Custom Type.
* custom type.
*
* @remarks
* A document's UID is different from its ID. An ID is automatically generated
* for all documents and is made available on its `id` property. A UID is
* provided in the Prismic editor and is unique among all documents of its
* Custom Type.
* custom type.
* @example
*
* ```ts
* const document = await client.getByUID("blog_post", "my-first-post");
* ```
*
* @typeParam TDocument - Type of the Prismic document returned.
* @param documentType - The API ID of the document's Custom Type.
* @param documentType - The API ID of the document's custom type.
* @param uid - UID of the document.
* @param params - Parameters to filter, sort, and paginate the results.
*
Expand Down Expand Up @@ -873,7 +873,7 @@ export class Client<TDocuments extends PrismicDocument = PrismicDocument> {
* A document's UID is different from its ID. An ID is automatically generated
* for all documents and is made available on its `id` property. A UID is
* provided in the Prismic editor and is unique among all documents of its
* Custom Type.
* custom type.
* @example
*
* ```ts
Expand All @@ -884,7 +884,7 @@ export class Client<TDocuments extends PrismicDocument = PrismicDocument> {
* ```
*
* @typeParam TDocument - Type of the Prismic document returned.
* @param documentType - The API ID of the document's Custom Type.
* @param documentType - The API ID of the document's custom type.
* @param uids - A list of document UIDs.
* @param params - Parameters to filter, sort, and paginate the results.
*
Expand All @@ -909,7 +909,7 @@ export class Client<TDocuments extends PrismicDocument = PrismicDocument> {

/**
* Queries all documents from the Prismic repository with specific UIDs and
* Custom Type.
* custom type.
*
* This method may make multiple network requests to query all matching
* content.
Expand All @@ -918,7 +918,7 @@ export class Client<TDocuments extends PrismicDocument = PrismicDocument> {
* A document's UID is different from its ID. An ID is automatically generated
* for all documents and is made available on its `id` property. A UID is
* provided in the Prismic editor and is unique among all documents of its
* Custom Type.
* custom type.
* @example
*
* ```ts
Expand All @@ -929,7 +929,7 @@ export class Client<TDocuments extends PrismicDocument = PrismicDocument> {
* ```
*
* @typeParam TDocument - Type of Prismic documents returned.
* @param documentType - The API ID of the document's Custom Type.
* @param documentType - The API ID of the document's custom type.
* @param uids - A list of document UIDs.
* @param params - Parameters to filter, sort, and paginate the results.
*
Expand All @@ -955,12 +955,12 @@ export class Client<TDocuments extends PrismicDocument = PrismicDocument> {

/**
* Queries a singleton document from the Prismic repository for a specific
* Custom Type.
* custom type.
*
* @remarks
* A singleton document is one that is configured in Prismic to only allow one
* instance. For example, a repository may be configured to contain just one
* Settings document. This is in contrast to a repeatable Custom Type which
* Settings document. This is in contrast to a repeatable custom type which
* allows multiple instances of itself.
* @example
*
Expand All @@ -969,10 +969,10 @@ export class Client<TDocuments extends PrismicDocument = PrismicDocument> {
* ```
*
* @typeParam TDocument - Type of the Prismic document returned.
* @param documentType - The API ID of the singleton Custom Type.
* @param documentType - The API ID of the singleton custom type.
* @param params - Parameters to filter, sort, and paginate the results.
*
* @returns The singleton document for the Custom Type, if a matching document
* @returns The singleton document for the custom type, if a matching document
* exists.
*/
async getSingle<
Expand All @@ -988,10 +988,10 @@ export class Client<TDocuments extends PrismicDocument = PrismicDocument> {
}

/**
* Queries documents from the Prismic repository for a specific Custom Type.
* Queries documents from the Prismic repository for a specific custom type.
*
* Use `getAllByType` instead if you need to query all documents for a
* specific Custom Type.
* specific custom type.
*
* @example
*
Expand All @@ -1000,10 +1000,10 @@ export class Client<TDocuments extends PrismicDocument = PrismicDocument> {
* ```
*
* @typeParam TDocument - Type of Prismic documents returned.
* @param documentType - The API ID of the Custom Type.
* @param documentType - The API ID of the custom type.
* @param params - Parameters to filter, sort, and paginate the results.
*
* @returns A paginated response containing documents of the Custom Type.
* @returns A paginated response containing documents of the custom type.
*/
async getByType<
TDocument extends TDocuments,
Expand Down Expand Up @@ -1031,10 +1031,10 @@ export class Client<TDocuments extends PrismicDocument = PrismicDocument> {
* ```
*
* @typeParam TDocument - Type of Prismic documents returned.
* @param documentType - The API ID of the Custom Type.
* @param documentType - The API ID of the custom type.
* @param params - Parameters to filter, sort, and paginate the results.
*
* @returns A list of all documents of the Custom Type.
* @returns A list of all documents of the custom type.
*/
async getAllByType<
TDocument extends TDocuments,
Expand Down
2 changes: 1 addition & 1 deletion src/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export const filter = {
* The `geopoint.near` filter checks that the value in the path is within
* the radius of the given coordinates.
*
* This filter will only work for a GeoPoint field.
* This filter will only work for a geopoint field.
*
* {@link https://prismic.io/docs/rest-api-technical-reference#geopointnear}
*/
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/asDate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ type AsDateReturnType<
> = Field extends DateField<"filled"> | TimestampField<"filled"> ? Date : null;

/**
* Transforms a Date or Timestamp field into a JavaScript Date object
* Transforms a date or timestamp field into a JavaScript Date object
*
* @param dateOrTimestampField - A Date or Timestamp field from Prismic
* @param dateOrTimestampField - A date or timestamp field from Prismic
*
* @returns A Date object, null if provided date is falsy
* @see Templating date field from Prismic {@link https://prismic.io/docs/template-content-vanilla-javascript#date-and-timestamp}
Expand Down
36 changes: 18 additions & 18 deletions src/helpers/asHTML.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import type { RichTextField } from "../types/value/richText";
import { LinkResolverFunction } from "./asLink";

/**
* Serializes a node from a Rich Text or Title field with a function to HTML.
* Serializes a node from a rich text or title field with a function to HTML.
*
* Unlike a typical `@prismicio/richtext` function serializer, this serializer
* converts the `children` argument to a single string rather than an array of
* strings.
*
* @see Templating Rich Text and title fields from Prismic {@link https://prismic.io/docs/template-content-vanilla-javascript#rich-text-and-title}
* @see Templating rich text and title fields from Prismic {@link https://prismic.io/docs/template-content-vanilla-javascript#rich-text-and-title}
*/
export type HTMLRichTextFunctionSerializer = (
type: Parameters<RichTextFunctionSerializer<string>>[0],
Expand All @@ -39,13 +39,13 @@ export type HTMLRichTextFunctionSerializer = (
) => string | null | undefined;

/**
* Serializes a node from a Rich Text or Title field with a map to HTML
* Serializes a node from a rich text or title field with a map to HTML
*
* Unlike a typical `@prismicio/richtext` map serializer, this serializer
* converts the `children` property to a single string rather than an array of
* strings.
*
* @see Templating Rich Text and title fields from Prismic {@link https://prismic.io/docs/template-content-vanilla-javascript#rich-text-and-title}
* @see Templating rich text and title fields from Prismic {@link https://prismic.io/docs/template-content-vanilla-javascript#rich-text-and-title}
*/
export type HTMLRichTextMapSerializer = {
[P in keyof RichTextMapSerializer<string>]: (payload: {
Expand All @@ -63,7 +63,7 @@ export type HTMLRichTextMapSerializer = {
* A {@link RichTextMapSerializerFunction} type specifically for
* {@link HTMLRichTextMapSerializer}.
*
* @typeParam BlockName - The serializer's Rich Text block type.
* @typeParam BlockName - The serializer's rich text block type.
*/
type HTMLRichTextMapSerializerFunction<
BlockType extends keyof RichTextMapSerializer<string>,
Expand Down Expand Up @@ -106,17 +106,17 @@ type ExtractTextTypeGeneric<T> = T extends RichTextMapSerializerFunction<
: never;

/**
* Serializes a node from a Rich Text or Title field with a map or a function to HTML
* Serializes a node from a rich text or title field with a map or a function to HTML
*
* @see {@link HTMLRichTextMapSerializer} and {@link HTMLRichTextFunctionSerializer}
* @see Templating Rich Text and title fields from Prismic {@link https://prismic.io/docs/template-content-vanilla-javascript#rich-text-and-title}
* @see Templating rich text and title fields from Prismic {@link https://prismic.io/docs/template-content-vanilla-javascript#rich-text-and-title}
*/
export type HTMLRichTextSerializer =
| HTMLRichTextMapSerializer
| HTMLRichTextFunctionSerializer;

/**
* Creates a default HTML Rich Text Serializer with a given Link Resolver providing
* Creates a default HTML rich text Serializer with a given Link Resolver providing
* sensible and safe defaults for every node type
*
* @internal
Expand Down Expand Up @@ -211,7 +211,7 @@ type AsHTMLConfig = {
linkResolver?: LinkResolverFunction | null;

/**
* An optional Rich Text Serializer, unhandled cases will fallback to the default serializer
* An optional rich text Serializer, unhandled cases will fallback to the default serializer
*/
serializer?: HTMLRichTextSerializer | null;
};
Expand All @@ -234,30 +234,30 @@ type AsHTMLReturnType<Field extends RichTextField | null | undefined> =
// TODO: Remove overload when we remove support for deprecated tuple-style configuration.
export const asHTML: {
/**
* Serializes a Rich Text or Title field to an HTML string.
* Serializes a rich text or title field to an HTML string.
*
* @param richTextField - A Rich Text or Title field from Prismic
* @param richTextField - A rich text or title field from Prismic
* @param config - Configuration that determines the output of `asHTML()`
*
* @returns HTML equivalent of the provided Rich Text or Title field
* @see Templating Rich Text and title fields from Prismic {@link https://prismic.io/docs/template-content-vanilla-javascript#rich-text-and-title}
* @returns HTML equivalent of the provided rich text or title field
* @see Templating rich text and title fields from Prismic {@link https://prismic.io/docs/template-content-vanilla-javascript#rich-text-and-title}
*/
<Field extends RichTextField | null | undefined>(
richTextField: Field,
config?: AsHTMLConfig,
): AsHTMLReturnType<Field>;

/**
* Serializes a Rich Text or Title field to an HTML string.
* Serializes a rich text or title field to an HTML string.
*
* @param richTextField - A Rich Text or Title field from Prismic
* @param richTextField - A rich text or title field from Prismic
* @param linkResolver - An optional link resolver function to resolve links,
* without it you're expected to use the `routes` options from the API
* @param serializer - An optional Rich Text Serializer, unhandled cases will fallback
* @param serializer - An optional rich text Serializer, unhandled cases will fallback
* to the default serializer
*
* @returns HTML equivalent of the provided Rich Text or Title field
* @see Templating Rich Text and title fields from Prismic {@link https://prismic.io/docs/template-content-vanilla-javascript#rich-text-and-title}
* @returns HTML equivalent of the provided rich text or title field
* @see Templating rich text and title fields from Prismic {@link https://prismic.io/docs/template-content-vanilla-javascript#rich-text-and-title}
*
* @deprecated Use object-style configuration instead.
*
Expand Down
10 changes: 5 additions & 5 deletions src/helpers/asImagePixelDensitySrcSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ type AsImagePixelDensitySrcSetReturnType<
> = Field extends ImageFieldImage<"filled">
? {
/**
* The Image field's image URL with Imgix URL parameters (if given).
* The image field's image URL with Imgix URL parameters (if given).
*/
src: string;

/**
* A pixel-densitye-based `srcset` attribute value for the Image field's
* A pixel-densitye-based `srcset` attribute value for the image field's
* image with Imgix URL parameters (if given).
*/
srcset: string;
}
: null;

/**
* Creates a pixel-density-based `srcset` from an Image field with optional
* Creates a pixel-density-based `srcset` from an image field with optional
* image transformations (via Imgix URL parameters).
*
* If a `pixelDensities` parameter is not given, the following pixel densities
Expand All @@ -68,8 +68,8 @@ type AsImagePixelDensitySrcSetReturnType<
* @param config - An object of Imgix URL API parameters. The `pixelDensities`
* parameter defines the resulting `srcset` widths.
*
* @returns A `srcset` attribute value for the Image field with Imgix URL
* parameters (if given). If the Image field is empty, `null` is returned.
* @returns A `srcset` attribute value for the image field with Imgix URL
* parameters (if given). If the image field is empty, `null` is returned.
* @see Imgix URL parameters reference: https://docs.imgix.com/apis/rendering
*/
export const asImagePixelDensitySrcSet = <
Expand Down
Loading

0 comments on commit 1fce99c

Please sign in to comment.