pl-api
    Preparing search index...

    Function mediaCategory

    • Parameters

      Returns {
          deleteMedia: (attachmentId: string) => Promise<EmptyObject>;
          getMedia: (
              attachmentId: string,
          ) => Promise<
              | {
                  blurhash: string
                  | null;
                  description: string;
                  id: string;
                  meta: {
                      focus?: { x: number; y: number };
                      original?: {
                          aspect: number | null;
                          height: number;
                          size: string | null;
                          width: number;
                      };
                      small?: {
                          aspect: number
                          | null;
                          height: number;
                          size: string | null;
                          width: number;
                      };
                  };
                  mime_type: string
                  | null;
                  preview_url: string;
                  remote_url: string | null;
                  type: "image";
                  url: string;
              }
              | {
                  blurhash: string
                  | null;
                  description: string;
                  id: string;
                  meta: {
                      duration?: number;
                      original?: {
                          aspect: number | null;
                          duration: number | null;
                          frame_rate: string | null;
                          height: number;
                          size: string | null;
                          width: number;
                      };
                      small?: {
                          aspect: number
                          | null;
                          height: number;
                          size: string | null;
                          width: number;
                      };
                  };
                  mime_type: string
                  | null;
                  preview_url: string;
                  remote_url: string | null;
                  type: "video";
                  url: string;
              }
              | {
                  blurhash: string
                  | null;
                  description: string;
                  id: string;
                  meta: {
                      duration?: number;
                      focus?: { x: number; y: number };
                      original?: {
                          aspect: number | null;
                          height: number;
                          size: string | null;
                          width: number;
                      };
                  };
                  mime_type: string
                  | null;
                  preview_url: string;
                  remote_url: string | null;
                  type: "gifv";
                  url: string;
              }
              | {
                  blurhash: string
                  | null;
                  description: string;
                  id: string;
                  meta: {
                      colors?: {
                          accent?: string;
                          background?: string;
                          duration?: number;
                          foreground?: string;
                      };
                      duration?: number;
                      original?: { bitrate?: number; duration?: number };
                  };
                  mime_type: string
                  | null;
                  preview_url: string;
                  remote_url: string | null;
                  type: "audio";
                  url: string;
              }
              | {
                  blurhash: string
                  | null;
                  description: string;
                  id: string;
                  mime_type: string | null;
                  preview_url: string;
                  remote_url: string | null;
                  type: "unknown";
                  url: string;
              },
          >;
          updateMedia: (
              attachmentId: string,
              params: UpdateMediaParams,
          ) => Promise<
              | {
                  blurhash: string
                  | null;
                  description: string;
                  id: string;
                  meta: {
                      focus?: { x: number; y: number };
                      original?: {
                          aspect: number | null;
                          height: number;
                          size: string | null;
                          width: number;
                      };
                      small?: {
                          aspect: number
                          | null;
                          height: number;
                          size: string | null;
                          width: number;
                      };
                  };
                  mime_type: string
                  | null;
                  preview_url: string;
                  remote_url: string | null;
                  type: "image";
                  url: string;
              }
              | {
                  blurhash: string
                  | null;
                  description: string;
                  id: string;
                  meta: {
                      duration?: number;
                      original?: {
                          aspect: number | null;
                          duration: number | null;
                          frame_rate: string | null;
                          height: number;
                          size: string | null;
                          width: number;
                      };
                      small?: {
                          aspect: number
                          | null;
                          height: number;
                          size: string | null;
                          width: number;
                      };
                  };
                  mime_type: string
                  | null;
                  preview_url: string;
                  remote_url: string | null;
                  type: "video";
                  url: string;
              }
              | {
                  blurhash: string
                  | null;
                  description: string;
                  id: string;
                  meta: {
                      duration?: number;
                      focus?: { x: number; y: number };
                      original?: {
                          aspect: number | null;
                          height: number;
                          size: string | null;
                          width: number;
                      };
                  };
                  mime_type: string
                  | null;
                  preview_url: string;
                  remote_url: string | null;
                  type: "gifv";
                  url: string;
              }
              | {
                  blurhash: string
                  | null;
                  description: string;
                  id: string;
                  meta: {
                      colors?: {
                          accent?: string;
                          background?: string;
                          duration?: number;
                          foreground?: string;
                      };
                      duration?: number;
                      original?: { bitrate?: number; duration?: number };
                  };
                  mime_type: string
                  | null;
                  preview_url: string;
                  remote_url: string | null;
                  type: "audio";
                  url: string;
              }
              | {
                  blurhash: string
                  | null;
                  description: string;
                  id: string;
                  mime_type: string | null;
                  preview_url: string;
                  remote_url: string | null;
                  type: "unknown";
                  url: string;
              },
          >;
          uploadMedia: (
              params: UploadMediaParams,
              meta?: RequestMeta,
          ) => Promise<
              | {
                  blurhash: string
                  | null;
                  description: string;
                  id: string;
                  meta: {
                      focus?: { x: number; y: number };
                      original?: {
                          aspect: number | null;
                          height: number;
                          size: string | null;
                          width: number;
                      };
                      small?: {
                          aspect: number
                          | null;
                          height: number;
                          size: string | null;
                          width: number;
                      };
                  };
                  mime_type: string
                  | null;
                  preview_url: string;
                  remote_url: string | null;
                  type: "image";
                  url: string;
              }
              | {
                  blurhash: string
                  | null;
                  description: string;
                  id: string;
                  meta: {
                      duration?: number;
                      original?: {
                          aspect: number | null;
                          duration: number | null;
                          frame_rate: string | null;
                          height: number;
                          size: string | null;
                          width: number;
                      };
                      small?: {
                          aspect: number
                          | null;
                          height: number;
                          size: string | null;
                          width: number;
                      };
                  };
                  mime_type: string
                  | null;
                  preview_url: string;
                  remote_url: string | null;
                  type: "video";
                  url: string;
              }
              | {
                  blurhash: string
                  | null;
                  description: string;
                  id: string;
                  meta: {
                      duration?: number;
                      focus?: { x: number; y: number };
                      original?: {
                          aspect: number | null;
                          height: number;
                          size: string | null;
                          width: number;
                      };
                  };
                  mime_type: string
                  | null;
                  preview_url: string;
                  remote_url: string | null;
                  type: "gifv";
                  url: string;
              }
              | {
                  blurhash: string
                  | null;
                  description: string;
                  id: string;
                  meta: {
                      colors?: {
                          accent?: string;
                          background?: string;
                          duration?: number;
                          foreground?: string;
                      };
                      duration?: number;
                      original?: { bitrate?: number; duration?: number };
                  };
                  mime_type: string
                  | null;
                  preview_url: string;
                  remote_url: string | null;
                  type: "audio";
                  url: string;
              }
              | {
                  blurhash: string
                  | null;
                  description: string;
                  id: string;
                  mime_type: string | null;
                  preview_url: string;
                  remote_url: string | null;
                  type: "unknown";
                  url: string;
              },
          >;
      }

      • deleteMedia: (attachmentId: string) => Promise<EmptyObject>

        Update media attachment Update a MediaAttachment’s parameters, before it is attached to a status and posted.

        Requires featuresFeatures.deleteMedia.

      • getMedia: (
            attachmentId: string,
        ) => Promise<
            | {
                blurhash: string
                | null;
                description: string;
                id: string;
                meta: {
                    focus?: { x: number; y: number };
                    original?: {
                        aspect: number | null;
                        height: number;
                        size: string | null;
                        width: number;
                    };
                    small?: {
                        aspect: number
                        | null;
                        height: number;
                        size: string | null;
                        width: number;
                    };
                };
                mime_type: string
                | null;
                preview_url: string;
                remote_url: string | null;
                type: "image";
                url: string;
            }
            | {
                blurhash: string
                | null;
                description: string;
                id: string;
                meta: {
                    duration?: number;
                    original?: {
                        aspect: number | null;
                        duration: number | null;
                        frame_rate: string | null;
                        height: number;
                        size: string | null;
                        width: number;
                    };
                    small?: {
                        aspect: number
                        | null;
                        height: number;
                        size: string | null;
                        width: number;
                    };
                };
                mime_type: string
                | null;
                preview_url: string;
                remote_url: string | null;
                type: "video";
                url: string;
            }
            | {
                blurhash: string
                | null;
                description: string;
                id: string;
                meta: {
                    duration?: number;
                    focus?: { x: number; y: number };
                    original?: {
                        aspect: number | null;
                        height: number;
                        size: string | null;
                        width: number;
                    };
                };
                mime_type: string
                | null;
                preview_url: string;
                remote_url: string | null;
                type: "gifv";
                url: string;
            }
            | {
                blurhash: string
                | null;
                description: string;
                id: string;
                meta: {
                    colors?: {
                        accent?: string;
                        background?: string;
                        duration?: number;
                        foreground?: string;
                    };
                    duration?: number;
                    original?: { bitrate?: number; duration?: number };
                };
                mime_type: string
                | null;
                preview_url: string;
                remote_url: string | null;
                type: "audio";
                url: string;
            }
            | {
                blurhash: string
                | null;
                description: string;
                id: string;
                mime_type: string | null;
                preview_url: string;
                remote_url: string | null;
                type: "unknown";
                url: string;
            },
        >

        Get media attachment Get a media attachment, before it is attached to a status and posted, but after it is accepted for processing. Use this method to check that the full-sized media has finished processing.

      • updateMedia: (
            attachmentId: string,
            params: UpdateMediaParams,
        ) => Promise<
            | {
                blurhash: string
                | null;
                description: string;
                id: string;
                meta: {
                    focus?: { x: number; y: number };
                    original?: {
                        aspect: number | null;
                        height: number;
                        size: string | null;
                        width: number;
                    };
                    small?: {
                        aspect: number
                        | null;
                        height: number;
                        size: string | null;
                        width: number;
                    };
                };
                mime_type: string
                | null;
                preview_url: string;
                remote_url: string | null;
                type: "image";
                url: string;
            }
            | {
                blurhash: string
                | null;
                description: string;
                id: string;
                meta: {
                    duration?: number;
                    original?: {
                        aspect: number | null;
                        duration: number | null;
                        frame_rate: string | null;
                        height: number;
                        size: string | null;
                        width: number;
                    };
                    small?: {
                        aspect: number
                        | null;
                        height: number;
                        size: string | null;
                        width: number;
                    };
                };
                mime_type: string
                | null;
                preview_url: string;
                remote_url: string | null;
                type: "video";
                url: string;
            }
            | {
                blurhash: string
                | null;
                description: string;
                id: string;
                meta: {
                    duration?: number;
                    focus?: { x: number; y: number };
                    original?: {
                        aspect: number | null;
                        height: number;
                        size: string | null;
                        width: number;
                    };
                };
                mime_type: string
                | null;
                preview_url: string;
                remote_url: string | null;
                type: "gifv";
                url: string;
            }
            | {
                blurhash: string
                | null;
                description: string;
                id: string;
                meta: {
                    colors?: {
                        accent?: string;
                        background?: string;
                        duration?: number;
                        foreground?: string;
                    };
                    duration?: number;
                    original?: { bitrate?: number; duration?: number };
                };
                mime_type: string
                | null;
                preview_url: string;
                remote_url: string | null;
                type: "audio";
                url: string;
            }
            | {
                blurhash: string
                | null;
                description: string;
                id: string;
                mime_type: string | null;
                preview_url: string;
                remote_url: string | null;
                type: "unknown";
                url: string;
            },
        >

        Update media attachment Update a MediaAttachment’s parameters, before it is attached to a status and posted.

      • uploadMedia: (
            params: UploadMediaParams,
            meta?: RequestMeta,
        ) => Promise<
            | {
                blurhash: string
                | null;
                description: string;
                id: string;
                meta: {
                    focus?: { x: number; y: number };
                    original?: {
                        aspect: number | null;
                        height: number;
                        size: string | null;
                        width: number;
                    };
                    small?: {
                        aspect: number
                        | null;
                        height: number;
                        size: string | null;
                        width: number;
                    };
                };
                mime_type: string
                | null;
                preview_url: string;
                remote_url: string | null;
                type: "image";
                url: string;
            }
            | {
                blurhash: string
                | null;
                description: string;
                id: string;
                meta: {
                    duration?: number;
                    original?: {
                        aspect: number | null;
                        duration: number | null;
                        frame_rate: string | null;
                        height: number;
                        size: string | null;
                        width: number;
                    };
                    small?: {
                        aspect: number
                        | null;
                        height: number;
                        size: string | null;
                        width: number;
                    };
                };
                mime_type: string
                | null;
                preview_url: string;
                remote_url: string | null;
                type: "video";
                url: string;
            }
            | {
                blurhash: string
                | null;
                description: string;
                id: string;
                meta: {
                    duration?: number;
                    focus?: { x: number; y: number };
                    original?: {
                        aspect: number | null;
                        height: number;
                        size: string | null;
                        width: number;
                    };
                };
                mime_type: string
                | null;
                preview_url: string;
                remote_url: string | null;
                type: "gifv";
                url: string;
            }
            | {
                blurhash: string
                | null;
                description: string;
                id: string;
                meta: {
                    colors?: {
                        accent?: string;
                        background?: string;
                        duration?: number;
                        foreground?: string;
                    };
                    duration?: number;
                    original?: { bitrate?: number; duration?: number };
                };
                mime_type: string
                | null;
                preview_url: string;
                remote_url: string | null;
                type: "audio";
                url: string;
            }
            | {
                blurhash: string
                | null;
                description: string;
                id: string;
                mime_type: string | null;
                preview_url: string;
                remote_url: string | null;
                type: "unknown";
                url: string;
            },
        >

        Upload media as an attachment Creates a media attachment to be used with a new status. The full sized media will be processed asynchronously in the background for large uploads.