Skip to content

docs(image): add content warnings to image function jsdocs #2159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/modules/image/providers/lorempicsum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { deprecated } from '../../../internal/deprecated';
/**
* Module to generate links to random images on https://picsum.photos.
*
* The images generated from this module are fetched from an external service outside the control of Faker and could occasionally contain URLs which are broken or point to unexpected, disturbing, or offensive images. The service may also be subject to usage limits.
*
* @deprecated Use `faker.image.urlPicsumPhotos` instead.
*/
export class LoremPicsum {
Expand All @@ -13,6 +15,8 @@ export class LoremPicsum {
/**
* Generates a new picsum photos image url.
*
* These images are fetched from an external service outside the control of Faker and could occasionally contain URLs which point to unexpected, disturbing, or offensive images. Usage limits may contribute to this behavior.
*
* @param width The width of the image. Defaults to `640`.
* @param height The height of the image. Defaults to `480`.
* @param grayscale Whether to return a grayscale image. Default to `false`.
Expand All @@ -38,6 +42,8 @@ export class LoremPicsum {
/**
* Generates a new picsum photos image url.
*
* These images are fetched from an external service outside the control of Faker and could occasionally contain URLs which point to unexpected, disturbing, or offensive images. Usage limits may contribute to this behavior.
*
* @param width The width of the image. Defaults to `640`.
* @param height The height of the image. Defaults to `480`.
* @param grayscale Whether to return a grayscale image. Default to `false`.
Expand All @@ -57,6 +63,8 @@ export class LoremPicsum {
/**
* Generates a new picsum photos image url.
*
* These images are fetched from an external service outside the control of Faker and could occasionally contain URLs which point to unexpected, disturbing, or offensive images. Usage limits may contribute to this behavior.
*
* @param width The width of the image. Defaults to `640`.
* @param height The height of the image. Defaults to `480`.
* @param blur The optional level of blur to apply. Supports `1` - `10`.
Expand All @@ -80,6 +88,8 @@ export class LoremPicsum {
/**
* Generates a new picsum photos image url.
*
* These images are fetched from an external service outside the control of Faker and could occasionally contain URLs which point to unexpected, disturbing, or offensive images. Usage limits may contribute to this behavior.
*
* @param width The width of the image. Defaults to `640`.
* @param height The height of the image. Defaults to `480`.
* @param grayscale Whether to return a grayscale image. Default to `false`.
Expand Down Expand Up @@ -108,6 +118,8 @@ export class LoremPicsum {
/**
* Generates a new picsum photos image url.
*
* These images are fetched from an external service outside the control of Faker and could occasionally contain URLs which point to unexpected, disturbing, or offensive images. Usage limits may contribute to this behavior.
*
* @param width The width of the image. Defaults to `640`.
* @param height The height of the image. Defaults to `480`.
* @param grayscale Whether to return a grayscale image. Default to `false`.
Expand Down
6 changes: 6 additions & 0 deletions src/modules/image/providers/placeholder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { deprecated } from '../../../internal/deprecated';
/**
* Module to generate links to images on `https://via.placeholder.com/`.
*
* The images generated from this module are fetched from an external service outside the control of Faker and could occasionally contain URLs which are broken or point to unexpected, disturbing, or offensive images. The service may also be subject to usage limits.
*
* @deprecated Use `faker.image.urlPlaceholder` instead.
*/
export class Placeholder {
Expand All @@ -24,6 +26,8 @@ export class Placeholder {
/**
* Generates a new placeholder image url.
*
* These images are fetched from an external service outside the control of Faker and could occasionally contain URLs which point to unexpected, disturbing, or offensive images. Usage limits may contribute to this behavior.
*
* @param width The width of the image (in pixels). Defaults to `640`.
* @param height The height of the image (in pixels). Defaults to `width`.
* @param text The text of the image.
Expand Down Expand Up @@ -85,6 +89,8 @@ export class Placeholder {
/**
* Generate a new placeholder image with random colors and text.
*
* These images are fetched from an external service outside the control of Faker and could occasionally contain URLs which point to unexpected, disturbing, or offensive images. Usage limits may contribute to this behavior.
*
* @param width The width of the image (in pixels). Defaults to `640`.
* @param height The height of the image (in pixels). Defaults to `width`.
* @param format The file format of the image. Supports `png` `jpeg` `png` `gif` `webp`.
Expand Down
18 changes: 18 additions & 0 deletions src/modules/image/providers/unsplash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { deprecated } from '../../../internal/deprecated';
/**
* Module to generate links to random images on `https://source.unsplash.com/`.
*
* The images generated from this module are fetched from an external service outside the control of Faker and could occasionally contain URLs which are broken or point to unexpected, disturbing, or offensive images. The service may also be subject to usage limits.
*
* @deprecated Use `faker.image` instead.
*/
export class Unsplash {
Expand All @@ -13,6 +15,8 @@ export class Unsplash {
/**
* Generates a new unsplash image url for a random supported category.
*
* These images are fetched from an external service outside the control of Faker and could occasionally contain URLs which point to unexpected, disturbing, or offensive images. Usage limits may contribute to this behavior.
*
* @param width The width of the image. Defaults to `640`.
* @param height The height of the image. Defaults to `480`.
* @param keyword The image keywords to use.
Expand All @@ -32,6 +36,8 @@ export class Unsplash {
/**
* Generates a new unsplash image url.
*
* These images are fetched from an external service outside the control of Faker and could occasionally contain URLs which point to unexpected, disturbing, or offensive images. Usage limits may contribute to this behavior.
*
* @param width The width of the image. Defaults to `640`.
* @param height The height of the image. Defaults to `480`.
* @param category The category of the image to generate.
Expand Down Expand Up @@ -75,6 +81,8 @@ export class Unsplash {
/**
* Generates a new unsplash image url using the "food" category.
*
* These images are fetched from an external service outside the control of Faker and could occasionally contain URLs which point to unexpected, disturbing, or offensive images. Usage limits may contribute to this behavior.
*
* @param width The width of the image. Defaults to `640`.
* @param height The height of the image. Defaults to `480`.
* @param keyword The image keywords to use.
Expand All @@ -94,6 +102,8 @@ export class Unsplash {
/**
* Generates a new unsplash image url using the "people" category.
*
* These images are fetched from an external service outside the control of Faker and could occasionally contain URLs which point to unexpected, disturbing, or offensive images. Usage limits may contribute to this behavior.
*
* @param width The width of the image. Defaults to `640`.
* @param height The height of the image. Defaults to `480`.
* @param keyword The image keywords to use.
Expand All @@ -113,6 +123,8 @@ export class Unsplash {
/**
* Generates a new unsplash image url using the "nature" category.
*
* These images are fetched from an external service outside the control of Faker and could occasionally contain URLs which point to unexpected, disturbing, or offensive images. Usage limits may contribute to this behavior.
*
* @param width The width of the image. Defaults to `640`.
* @param height The height of the image. Defaults to `480`.
* @param keyword The image keywords to use.
Expand All @@ -132,6 +144,8 @@ export class Unsplash {
/**
* Generates a new unsplash image url using the "technology" category.
*
* These images are fetched from an external service outside the control of Faker and could occasionally contain URLs which point to unexpected, disturbing, or offensive images. Usage limits may contribute to this behavior.
*
* @param width The width of the image. Defaults to `640`.
* @param height The height of the image. Defaults to `480`.
* @param keyword The image keywords to use.
Expand All @@ -156,6 +170,8 @@ export class Unsplash {
/**
* Generates a new unsplash image url using the "objects" category.
*
* These images are fetched from an external service outside the control of Faker and could occasionally contain URLs which point to unexpected, disturbing, or offensive images. Usage limits may contribute to this behavior.
*
* @param width The width of the image. Defaults to `640`.
* @param height The height of the image. Defaults to `480`.
* @param keyword The image keywords to use.
Expand All @@ -180,6 +196,8 @@ export class Unsplash {
/**
* Generates a new unsplash image url using the "buildings" category.
*
* These images are fetched from an external service outside the control of Faker and could occasionally contain URLs which point to unexpected, disturbing, or offensive images. Usage limits may contribute to this behavior.
*
* @param width The width of the image. Defaults to `640`.
* @param height The height of the image. Defaults to `480`.
* @param keyword The image keywords to use.
Expand Down